| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/onesolution.com.hk/support/ |
Upload File : |
<?php require("checkuser.php"); ?>
<?
if ($logged_in == 1) {
} else {
//echo 'Not logged in. <a href="login.php">Login</a>';
header('Location: logon.php');
}
?>
<?php require("configure.php"); ?>
<?
$searchdate = $_POST['searchdate'];
if ($searchdate == "")
{
// get year, eg 2006
$year = date('Y');
// get month, eg 04
$month = date('n');
// get day, eg 3
$day = date('j');
$searchdate = date('Ymd');
}
else
{
$year = substr($searchdate,0,4);
$month = substr($searchdate,4,2);
$day = substr($searchdate,6,2);
}
// get number of days in month, eg 28
$daysInMonth = date("t",mktime(0,0,0,$month,1,$year));
// get first day of the month, eg 4
$firstDay = date("w", mktime(0,0,0,$month,1,$year));
// calculate total spaces needed in array
$tempDays = $firstDay + $daysInMonth;
// calculate total rows needed
$weeksInMonth = ceil($tempDays/7);
for($j=0;$j<$weeksInMonth;$j++)
{
for($i=0;$i<7;$i++)
{
$counter++;
$week[$j][$i] = $counter;
}
}
?>
<?
$counter=0;
for($j=0;$j<$weeksInMonth;$j++) {
for($i=0;$i<7;$i++) {
$counter++;
$week[$j][$i] = $counter;
// offset the days
$week[$j][$i] -= $firstDay;
if (($week[$j][$i] < 1) || ($week[$j][$i] > $daysInMonth)) {
$week[$j][$i] = "";
}
}
}
?>
<?php
function fillArray() {
// create a 2-d array
// for($j=0;$j<$this->weeksInMonth;$j++) {
// for($i=0;$i<7;$i++) {
// $counter++;
// $this->week[$j][$i] = $counter;
// // offset the days
// $this->week[$j][$i] -= $this->firstDay;
// if (($this->week[$j][$i] < 1) || ($this->week[$j][$i] > $this->daysInMonth)) {
// $this->week[$j][$i] = "";
// }
// }
// }
}
?>
<html>
<head>
<title>One solution Limited - Project List</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<script type="text/javascript" src="calendarDateInput.js">
</script>
<table><tr><td valign='top'>
<form action="" method="post">
<script>DateInput('searchdate', true, 'YYYYMMDD', '<?=$searchdate?>')</script>
<input type="submit" value="Submit">
</form>
<table width="840" border="0" cellpadding='1' cellspacing='1' bgcolor='#666666'>
<tr>
<th colspan='7' class='content' bgcolor='#FFFFFF'><?= date('M', mktime(0,0,0,$month,1,$year)).' '.$year; ?></th>
</tr>
<tr>
<th class='content' bgcolor='#FFFFFF' background="images/gsprite_mod_sky_051408.gif"><font color="#FF0000">Sun</font></th>
<th class='content' bgcolor='#FFFFFF' background="images/gsprite_mod_sky_051408.gif">Mon</th>
<th class='content' bgcolor='#FFFFFF' background="images/gsprite_mod_sky_051408.gif">Tue</th>
<th class='content' bgcolor='#FFFFFF' background="images/gsprite_mod_sky_051408.gif">Wed</th>
<th class='content' bgcolor='#FFFFFF' background="images/gsprite_mod_sky_051408.gif">Thur</th>
<th class='content' bgcolor='#FFFFFF' background="images/gsprite_mod_sky_051408.gif">Fri</th>
<th class='content' bgcolor='#FFFFFF' background="images/gsprite_mod_sky_051408.gif">Sat</th>
</tr>
<?php
//mysql_query("SET NAMES 'UTF8'");
//mysql_query("SET CHARACTER SET UTF8");
//mysql_query("SET CHARACTER_SET_RESULTS=UTF8'");
foreach ($week as $key => $val)
{
echo "<tr>";
for ($i=0;$i<7;$i++)
{
echo "<td width='120' height='100' valign='top' class='content' ";
if (($year.substr('0'.$month, strlen('0'.$month)-2).substr('0'.$week[$key][$i], strlen('0'.$week[$key][$i])-2)) == (date("Ymd")))
{
echo "bgcolor='#FFFFCC'>";
}
else
{
echo "bgcolor='#FFFFFF'>";
}
echo $week[$key][$i];
if ($week[$key][$i] <> "")
{
event($year.substr('0'.$month, strlen('0'.$month)-2).substr('0'.$week[$key][$i], strlen('0'.$week[$key][$i])-2));
}
echo "</td>";
}
echo "</tr>";
}?>
</table>
</td><td valign='top'>
<?
if ($searchdate <> "")
{
?>
<table width="300" border="0" cellpadding="1" cellspacing="1" bgcolor="#666666">
<?
$datefr = $year.substr('0'.$month, strlen('0'.$month)-2)."01";
$dateto = date("Ymd", strtotime(date("Ymd", strtotime($datefr." +1 month"))." -1 days"));
$sql = "select taskname, staffname, projectname ";
$sql .= "from PM_TASK_HDR a, SYS_STAFF b, PM_PROJECT_HDR c ";
$sql .= "where a.staffid = b.staffid ";
$sql .= "and a.projectid = c.projectid ";
$sql .= "and ((datefr between '$datefr' and '$dateto') ";
$sql .= "or (dateto between '$datefr' and '$dateto')) ";
$sql .= "order by staffname, taskname";
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<tr><td valign='top' class='content' bgcolor='#FFFFFF'>".$row{'staffname'}."</td>";
echo "<td valign='top' class='content' bgcolor='#FFFFFF'>".$row{'projectname'}."</td><td class='content' bgcolor='#FFFFFF'>".$row{'taskname'}."</td>";
}
?>
</table>
<?
}
?>
</td></tr>
</table>
</body>
</html>
<?
function event($d)
{
$sql = "select a.projectid, b.staffid, taskname, staffname, projectname ";
$sql .= "from PM_TASK_HDR a, SYS_STAFF b, PM_PROJECT_HDR c ";
$sql .= "where a.staffid = b.staffid ";
$sql .= "and a.projectid = c.projectid ";
$sql .= "and '". $d ."' between datefr and dateto ";
$sql .= "order by b.staffid desc";
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<br><li><a href='tasklist.php?projectid=".$row{'projectid'}."'>". "<font color='#".md5(strrev($row{'staffname'}))."'>(".$row{'staffname'}.")</font> ".$row{'projectname'}."->".$row{'taskname'}."</a>";
}
}
?>