[go: up one dir, main page]

Menu

[r21]: / calendarTable.php  Maximize  Restore  History

Download this file

92 lines (83 with data), 3.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
include('includes/databaseLogin.php');
include('includes/installedLanguage.php');
echo "<!DOCTYPE html>";
?>
<html>
<head>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<?php
mysql_query("BEGIN");
if(isset($_POST[sCode])){
$tDay = $_POST[day];
$tMonth = $_POST[month];
$tYear = $_POST[year];
$calendar=0;
$appNumber=0;
$getDoctors = mysql_query("SELECT * FROM users WHERE userPrivList='Dottore' ORDER BY userFullName");
while($row = mysql_fetch_array($getDoctors)) {
$calendarTopPos = 150+$calendar*240;
echo "<span class=\"BlockHeader\" style=\"position: absolute; top: " . $calendarTopPos . "px; width: 75%;\"><span>" . _T("Calendar") . " (" . $row[userFullName] . ")</span></span>";
//prima riga della tabella degli appuntamenti
$indDay=0;
$indice=0;
echo "<div id=\"div" . $calendar . "_0_0\" style=\"background-color:#FFFEFA; position: absolute; border: 1px solid black; height: 20px;\"></div>\n";
for($indice=1; $indice<27;$indice += 1){
//Ore
$conta = $indice - 1;
if(($conta%2) == 1){
$hourToSet=8+(($conta-1)/2);
$nameToSet=$hourToSet . ":30";
echo "<div name=\"" . $nameToSet . "\" id=\"div" . $calendar . "_0_" . $indice . "\" align=\"center\" style=\"font-size:0.6em; background-color:#FFFEFA; position: absolute; border: 1px solid black; height: 20px;\"><p valign=\"bottom\">30</p></div>\n";
}else{
$hourToSet = 8+($conta/2);
$nameToSet=$hourToSet . ":00";
echo "<div name=\"" . $nameToSet . "\" id=\"div" . $calendar . "_0_" . $indice . "\" align=\"center\" style=\"font-size:0.8em; font-weight:bold; background-color:#FFFEFA; position: absolute; border: 1px solid black; height: 20px;\">$hourToSet</div>\n";
}
}
//tabella degli appuntamenti
for($indDay=1; $indDay<8;$indDay += 1){
$indice=0;
$dateCursor = date("d/m/y",mktime(0,0,0,$tMonth,$tDay+$indDay-1,$tYear));
$searchDate = date("d/m/Y",mktime(0,0,0,$tMonth,$tDay+$indDay-1,$tYear));
//Casella data per la data corrente
echo "<div name=\"" . $searchDate . "\" id=\"div" . $calendar . "_" . $indDay . "_0\" align=\"center\" style=\"font-size:0.8em; font-weight:bold; background-color:#FFFEFA; position: absolute; border: 1px solid black; height: 20px;\">$dateCursor</div>\n";
//Caselle della tabella per la data corrente
for($indice=1; $indice<27;$indice += 1){
echo "<div class=\"emptyAppBox\" id=\"div" . $calendar . "_" . $indDay . "_" . $indice . "\"></div>\n";
}
$entry = mysql_query("SELECT * FROM calendars WHERE forDoctor='" . $row[userFullName] . "' AND date='$searchDate'");
//Caselle appuntamenti per la data corrente
while($row2 = mysql_fetch_array($entry)) {
switch($row2[location]){
case 0:
$appClass = 'visitAppBox';
break;
case 1:
$appClass = 'homeVisitAppBox';
break;
case 2:
$appClass = 'extCommitmentAppBox';
break;
case 3:
$appClass = 'holidayAppBox';
break;
default:
$appClass = 'visitAppBox';
}
echo "<div class=\"" . $appClass . "\" name=\"" . $row2[entryID] . "_" . $calendar . "_" . $indDay . "_" . $row2[time] . "_" . $row2[timeTo] . "_" . $appNumber . "\" id=\"app" . $appNumber . "\"><span class=\"handle1\"><img src=\"images/handle.png\"></span><span style=\"float: right; vertical-align: center;\"><img src=\"images/handleResize.png\" style=\"vertical-align: center;\"></span></div>\n";
$startTime = $row2[time];
$appNumber=$appNumber+1;
}
}
$calendar=$calendar+1;
}
}else{
//Error
}
mysql_query("COMMIT");
?>
</body>
</html>