noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
calendar.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4
5/**
6 * @var $p_type type of display inherited , long or short
7 */
8$cn=Dossier::connect();
9$p=new \Periode($cn);
10try {
11 $today_periode=$p->find_periode(date('d.m.Y'));
12 $today_hidden=\HtmlInput::hidden('today', $today_periode);
13} catch (\Exception $e) {
15}
16?>
17<div class="pc_calendar" id="user_cal" style="width:100%">
18<?php echo $month_year?>
19<?php
20 $js=sprintf("calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s','notitle':%d})",
21 dossier::id(),'per_div','calendar_zoom_div','list',$notitle);
22 echo HtmlInput::anchor(_('Liste'),''," onclick=\"{$js}\"") ;
24 echo $today_hidden;
25 ?>
26 <?php if ($today_hidden != '') :?>
27<script>$('today').gDossier="<?=Dossier::id()?>"
28 $('today').type_display="<?=$p_type?>";
29
30</script>
31 <button class="smallbutton" onclick="change_month($('today'))"> <?=_("Aujourd'hui")?></button>
32 <?php endif;?>
33
34
35<?php if ($zoom == 1 ): ?>
36<table style="width:100%;height:70%">
37 <?php else: ?>
38<table style="width:100%;height:70%">
39 <?php endif; ?>
40<tr>
41<?php
42$nFirstDay=$g_user->get_first_week_day();
44for ($i=0;$i<=6;$i++){
45 echo "<th>";
46 $nDay=($nDay>6)?0:$nDay;
47 echo '<span class="d-none d-sm-block ">'.$week[$nDay].'</span>';
48 echo '<span class=" d-block d-sm-none">'.substr($week[$nDay],0,2).'</span>';
49 $nDay++;
50 echo "</th>";
51}
52?>
53</tr>
54<?php
58$today_month=date('m');
59$today_day=date('j');
60$height=($zoom == 1)?"15vh":"3rem";
61while ($ind <= $this->day) {
62 if ($nCol==0)
63 {
64 echo "<tr style='height:{$height} '>";
65 }
66 $class="workday";
67 if ($week==0||$week==6)
68 {
69 $class="weekend";
70 }
71 // compute the date
72 $timestamp_date=mktime(0,0,0,$this->month,$ind,$this->year);
73 $date_calendar=date('w',$timestamp_date);
74 $st="";
75 if ($today_month==$this->month&&$today_day==$ind)
76 {
77 $st=' style="border:2px solid darkblue;background-color:hsl(199, 60%, 95%);" ';
78 }
79 if ( $date_calendar == $week ) {
80 echo '<td class="'.$class.'" '.$st.'>'.'<span class="day">'.$ind."</span>";
81 echo '<span class="d-none d-sm-block ">'.$cell[$ind].'<span>';
82 echo '<span class="d-block d-sm-none">'.$cell[$ind].'<span>';
83 echo '</td>';
84 $ind++;$week++;$nCol++;
85 } else {
86 echo "<td></td>";
87 $week++;$nCol++;
88 }
89 //if ( $ind > $this->day ) exit();
90 if ( $nCol == 7 ) { echo "</tr>";$nCol=0;}
91 if ( $week == 7 ) { $week=0;}
92}
93if ( $nCol != 0 ) { echo "</tr>";}
94?>
95
96</table>
97</div>
tr($p_string, $p_extra='')
Definition ac_common.php:88
global $g_user
if no group available , then stop
$opd_description style
_("actif, passif,charge,...")
$nDay
Definition calendar.php:43
for($i=0;$i<=6;$i++) $ind
Definition calendar.php:55
$height
Definition calendar.php:60
$nCol
Definition calendar.php:57
$today_month
Definition calendar.php:58
$today_hidden
Definition calendar.php:12
$p
Definition calendar.php:9
if($zoom==1) $nFirstDay
Definition calendar.php:42
$today_day
Definition calendar.php:59
$week
Definition calendar.php:56
static button_action_add()
static anchor($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
Return a simple LINK with a url or a javascript if $p_js is not null then p_url will be javascript:vo...
$all table