noalyss Version-9
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<div class="pc_calendar" id="user_cal" style="width:100%">
6<?php echo $month_year?>
7<?php
8 $js=sprintf("calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s','notitle':%d})",
9 dossier::id(),'per_div','calendar_zoom_div','list',$notitle);
10 echo HtmlInput::anchor(_('Liste'),''," onclick=\"{$js}\"") ;
12 ?>
13
14<?php if ($zoom == 1 ): ?>
15<table style="width:100%;height:80%">
16 <?php else: ?>
17<table style="width:100%;">
18 <?php endif; ?>
19<tr>
20<?php
21$nFirstDay=$g_user->get_first_week_day();
23for ($i=0;$i<=6;$i++){
24 echo "<th>";
25 $nDay=($nDay>6)?0:$nDay;
26 echo '<span class="d-none d-sm-block ">'.$week[$nDay].'</span>';
27 echo '<span class=" d-block d-sm-none">'.substr($week[$nDay],0,2).'</span>';
28 $nDay++;
29 echo "</th>";
30}
31?>
32</tr>
33<?php
37$today_month=date('m');
38$today_day=date('j');
39while ($ind <= $this->day) {
40 if ($nCol==0)
41 {
42 echo "<tr>";
43 }
44 $class="workday";
45 if ($week==0||$week==6)
46 {
47 $class="weekend";
48 }
49 // compute the date
50 $timestamp_date=mktime(0,0,0,$this->month,$ind,$this->year);
51 $date_calendar=date('w',$timestamp_date);
52 $st="";
53 if ($today_month==$this->month&&$today_day==$ind)
54 {
55 $st=' style="border:2px solid darkblue;background-color:hsl(199, 60%, 95%);" ';
56 }
57 if ( $date_calendar == $week ) {
58 echo '<td class="'.$class.'" '.$st.'>'.'<span class="day">'.$ind."</span>";
59 echo '<span class="d-none d-sm-block ">'.$cell[$ind].'<span>';
60 echo '<span class="d-block d-sm-none">'.$cell[$ind].'<span>';
61 echo '</td>';
62 $ind++;$week++;$nCol++;
63 } else {
64 echo "<td></td>";
65 $week++;$nCol++;
66 }
67 //if ( $ind > $this->day ) exit();
68 if ( $nCol == 7 ) { echo "</tr>";$nCol=0;}
69 if ( $week == 7 ) { $week=0;}
70}
71if ( $nCol != 0 ) { echo "</tr>";}
72?>
73
74</table>
75</div>
tr($p_string, $p_extra='')
Definition: ac_common.php:88
global $g_user
if no group available , then stop
$opd_description style
$input_from id
Definition: balance.inc.php:63
$nDay
Definition: calendar.php:22
for($i=0;$i<=6;$i++) $ind
Definition: calendar.php:34
$nCol
Definition: calendar.php:36
$today_month
Definition: calendar.php:37
if($zoom==1) $nFirstDay
Definition: calendar.php:21
$today_day
Definition: calendar.php:38
$week
Definition: calendar.php:35
$class
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 anchor with a url or a javascript if $p_js is not null then p_url will be javascript:...
$all table