/
GetHoliday.php
39 lines (32 loc) · 920 Bytes
/
GetHoliday.php
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
<?php
#if(!isset($_SESSION))
# session_start();
require('init_smarty.php');
require ('tmUtils.php');
if($_SERVER['QUERY_STRING'])
{
parse_str($_SERVER['QUERY_STRING']);
if (isset($user))
{
class gFormVar
{
public $holCols;
public $holDetails;
}
$g = new gFormVar();
DBConnect();
$today = date('Y-m-d');
$g->holCols = "Developer, Start Date, EndDate";
$g->holDetails = MakeTable("name, date_format(startdate,\"%d-%m-%Y\"), date_format(enddate,\"%d-%m-%Y\")",
"holiday, users", "holiday.developerid = users.userid and enddate > '$today' and developerid = $user", "startdate desc");
if (count($g->holDetails) == 0) { echo "No Out of Office weeks found<br>"; }
else
{
$tmpl->assign('g',$g);
echo $tmpl->fetch('holtable.tpl');
}
}
}
else
{ echo "User not set<br>"; }
?>