| 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 header("Content-Type:text/html;charset=BIG5"); ?>
<?php require("checkuser.php"); ?>
<?php require("configure.php"); ?>
<?
$jobid = $_GET['jobid'];
$id = $_GET['id'];
//$id = "c9f0f895fb98ab9159f51fd0297e236d";
if ($id == "")
{
if ($logged_in <> 1) {
header('Location: logon.php');
return;
}
$disable = "";
$sql = "select * from SYS_JOB where jobid = $jobid";
}
else
{
$disable = "disabled";
$sql = "select * from SYS_JOB where md5(jobid) = '$id'";
}
$result = mysql_query($sql);
if ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
$jobid = $row{'jobid'};
$staffid = $row{'staffid'};
$custid = $row{'custid'};
$email = $row{'email'};
$jobtimefr = substr($row{'jobtimefr'},3,2).substr($row{'jobtimefr'},6,2);
$jobtimeto = substr($row{'jobtimeto'},3,2).substr($row{'jobtimeto'},6,2);
$jobdate = $row{'jobdate'};
$jobtype = $row{'jobtype'};
$calldate = $row{'calldate'};
$calltime = substr($row{'calltime'},3,2).substr($row{'calltime'},6,2);
$jobdetail = $row{'jobdetail'};
$jobaction = $row{'jobaction'};
$jobstatus = $row{'jobstatus'};
$remarks = $row{'remarks'};
$creationby = $row{'creationby'};
$creationdate = $row{'creationdate'};
$updatedby = $row{'updatedby'};
$updateddate = $row{'updateddate'};
$acceptedby = $row{'acceptedby'};
$filename = $row{'filename'};
}
?>
<html>
<head>
<title>One Solution Limited - Support</title>
<link rel="stylesheet" href="main.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<script language="JavaScript" type="text/javascript" src="richtext.js"></script>
<script type="text/javascript" src="selectcustomer.js"></script>
<script type="text/javascript" src="calendarDateInput.js"></script>
<script type="text/javascript">
function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}
</script>
</head>
<body onLoad="showCustomer('<?=$custid?>')">
<!--********************************************************-->
<script language="JavaScript">
<!--
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
function formCheck(formobj){
// Enter name of mandatory fields
var fieldRequired = Array("email", "jobtimefr", "jobtimeto", "calltime", "jobdetail", "jobaction");
// Enter field description to appear in the dialog box
var fieldDescription = Array("Email", "Service time start", "Service time end", "Call time", "Job symptions", "Action");
// dialog message
var alertMsg = "Please complete the following fields:\n";
var l_Msg = alertMsg.length;
// check email start
var returnval=emailfilter.test(formobj.email.value)
if (returnval==false)
{
//alert("Please enter a valid email address.")
alertMsg += " - Please enter a valid email address.\n";
//formobj.email.select()
}
// check email end
var jobtimefr = formobj.jobtimefr.value
if (jobtimefr.length != 4 || IsNumeric(jobtimefr) == false)
{
alertMsg += " - Please enter expected Service Time Start using the following format (Eg. 0930).\n";
}
var jobtimeto = formobj.jobtimeto.value
if (jobtimeto.length != 4 || IsNumeric(jobtimeto) == false)
{
alertMsg += " - Please enter expected Service Time End using the following format (Eg. 0930).\n";
}
var calltime = formobj.calltime.value
if (calltime.length != 0)
{
if (IsNumeric(calltime) == false)
{
alertMsg += " - Please enter expected Call Time using the following format (Eg. 0930).\n";
}
}
for (var i = 0; i < fieldRequired.length; i++){
var obj = formobj.elements[fieldRequired[i]];
if (obj){
switch(obj.type){
case "select-one":
if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
case "select-multiple":
if (obj.selectedIndex == -1){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
case "text":
case "textarea":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "\n";
}
break;
default:
}
if (obj.type == undefined){
var blnchecked = false;
for (var j = 0; j < obj.length; j++){
if (obj[j].checked){
blnchecked = true;
}
}
if (!blnchecked){
alertMsg += " - " + fieldDescription[i] + "\n";
}
}
}
}
if (alertMsg.length == l_Msg){
return submitForm();
}else{
alert(alertMsg);
return false;
}
}
function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;
}
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
function daysElapsed(date1,date2) {
var difference =
Date.UTC(y2k(date1.getYear()),date1.getMonth(),date1.getDate(),0,0,0)
- Date.UTC(y2k(date2.getYear()),date2.getMonth(),date2.getDate(),0,0,0);
return difference/1000/60/60/24;
}
function submitForm() {
return true;
}
// -->
</script>
<script type="text/javascript">
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Please enter a valid email address.")
e.select()
}
return returnval
}
</script>
<!--********************************************************-->
<table border="0" cellpadding="1" cellspacing="1" width="100%">
<tr><td class='pageheader' align="left" valign="middle" height="100"><img src="images/iconProducts.png"> <b>Job Service</b></td>
<td class='content' align="center" width="150"></td>
</tr>
</table>
<form action="jobupdate.php" name="addform" method="post" enctype="multipart/form-data" onSubmit="return formCheck(this);">
<input type="hidden" name="jobid" value="<?=$jobid?>">
<?
if ($_SESSION['roleid'] <> 2)
{
function getRealIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
return $_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
return $_SERVER['REMOTE_ADDR'];
}
return 0;
}
?>
<input type="hidden" name="acceptedby" value="<?=getRealIpAddr();?>">
<?
}
?>
<table border="0" cellpadding="1" cellspacing="1" width="800">
<tr><td class='content' align="left" valign="middle" width="150"><b>Job No.:</b></td>
<td class='content' width="650"><b><?=$jobid?></b></td></tr>
<tr><td class='content' align="left" valign="middle" width="150">Select a Staff:</td>
<td class='content' width="650">
<select name="staffid" class="content" <?=$disable?>>
<?php
if ($_SESSION['roleid'] == 1)
{
$sql = "SELECT * ";
$sql .= "FROM SYS_STAFF where roleid = 2 and status = 1 order by staffname";
}
else
{
if ($_SESSION['userid'] == "")
{
$sql = "SELECT * ";
$sql .= "FROM SYS_STAFF where roleid = 2 and status = 1 and staffid = '". $staffid ."' order by staffname";
}
else
{
$sql = "SELECT * ";
$sql .= "FROM SYS_STAFF where roleid = 2 and status = 1 and userid = '". $_SESSION['userid'] ."' order by staffname";
}
}
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<option value='".$row{'staffid'}."' ". getSelect($row{'staffid'}, $staffid).">". $row{'staffname'} ."</option>";
}
?>
</select>
</td></tr>
<tr><td class='content' align="left" valign="middle" width="150">Select a Customer:</td>
<td class='content' width="650">
<select name="custid" onChange="showCustomer(this.value)" class="content" <?=$disable?>>
<?php
$sql = "SELECT * ";
$sql .= "FROM CM_CUSTOMER_HDR order by custname";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<option value='".$row{'custid'}."' ". getSelect($row{'custid'}, $custid).">". $row{'custname'} ."</option>";
}
mysql_close($dbh);
?>
</select>
</td></tr>
</table>
<?
$showemail = 0;
?>
<div id="txtHint" class="content">Customer info will be listed here.</div>
<table border="0" cellpadding="1" cellspacing="1" width="800">
<tr><td class="content" width="150">Email:</td>
<td class="content"><input type="text" name="email" value="<?=$email?>" size="30" maxlength="100" class="content" <?=$disable?>>
</td></tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" width="800">
<tr><td class="content" width="150">Service Time:</td>
<td class="content">
Start <input type="text" name="jobtimefr" value="<?=$jobtimefr?>" size="4" maxlength="4" class="content" <?=$disable?>>
End <input type="text" name="jobtimeto" value="<?=$jobtimeto?>" size="4" maxlength="4" class="content" <?=$disable?>>
</td></tr>
<tr><td class="content" width="150">Date:</td>
<td class="content">
<script>DateInput('jobdate', true, 'YYYY-MM-DD', '<?=$jobdate?>', '<?=$disable?>')</script>
</td></tr>
<tr><td colspan="2"><hr></td></tr>
<tr><td class="content" width="150">Job Type:</td>
<td class="content"><input type='radio' name='jobtype' value='1' class="content" <?=getCheck('1', $jobtype)?>>Schedule Visit <input type='radio' name='jobtype' value='2' class="content" <?=getCheck('2', $jobtype)?>>Service Call <input type='radio' name='jobtype' value='3' class="content" <?=getCheck('3', $jobtype)?>>Urgent Call</td></tr>
<tr><td class="content" width="150">Call Date:</td>
<td class="content">
<script>DateInput('calldate', true, 'YYYY-MM-DD', '<?=$calldate?>', '<?=$disable?>')</script>
</td></tr>
<tr><td class="content" width="150">Call Time:</td>
<td class="content">
<input type="text" name="calltime" value="<?=$calltime?>" size="4" maxlength="4" class="content" <?=$disable?>>
</td></tr>
<tr><td class="content" width="150" valign="top">Job Symptions:</td>
<td class="content">
<textarea name="jobdetail" class="content" cols="80" rows="5" maxlength="500" onKeyUp="return ismaxlength(this)" <?=$disable?>><?=$jobdetail?></textarea>
</td></tr>
<tr><td class="content" width="150" valign="top">Action:</td>
<td class="content">
<textarea name="jobaction" class="content" cols="80" rows="5" maxlength="500" onKeyUp="return ismaxlength(this)" <?=$disable?>><?=$jobaction?></textarea>
</td></tr>
<tr><td class="content" width="150" valign="top">Job Status:</td>
<td class="content">
<input type="radio" name="jobstatus" value="1" <?=getCheck('1', $jobstatus)?>>Done
<input type="radio" name="jobstatus" value="2" <?=getCheck('2', $jobstatus)?>>Follow up (Please specify below)
<input type="radio" name="jobstatus" value="3" <?=getCheck('3', $jobstatus)?>>Others (Please specify below)
</td></tr>
<tr><td class="content" width="150" valign="top">Remarks:</td>
<td class="content">
<textarea name="remarks" class="content" cols="80" rows="5" maxlength="500" onKeyUp="return ismaxlength(this)"><?=$remarks?></textarea>
</td></tr>
<tr><td class="content" width="150">File:</td>
<td class="content">
<?
if (strlen($acceptedby) == 0)
{
?>
<input name="filename" type="file" class="content" id="filename">
<?
}
?>
<?
if ($filename <> "")
{
echo "<a href='docs/".$filename."' target='_new'>".$filename."</a>";
}
?>
</td></tr>
<?
if (strlen($acceptedby) == 0)
{
if ($_SESSION['roleid'] <> 2)
{
?>
<tr><td class="content" width="150" valign="top"></td>
<td class="content"><input type="submit" value="Accept" class="content"><input type="reset" value="Reset" class="content">
</td></tr>
<?
}
elseif (($_SESSION['roleid'] == 2) && ($jobstatus == 1))
{
?>
<tr><td class="content" width="150" valign="top"></td>
<td class="content"><input type="submit" value="Submit" class="content"><input type="reset" value="Reset" class="content">
</td></tr>
<?
}
}
else
{
?>
<tr><td class="content" width="150" valign="top"></td>
<td class="content">
<!--<input type="submit" value="Submit" class="content" disabled><input type="reset" value="Reset" class="content" disabled>-->
<!-- <input type="submit" value="Submit" class="content" /><input type="reset" value="Reset" class="content" /> -->
</td></tr>
<?
}
?>
</form>
<?
//echo date("F j, Y, g:i a");
//echo date("Ymdgi");
?>
</body>
</html>
<?
function getSelect($field1, $field2)
{
if ($field1 == $field2)
{
return "selected";
}
else
{
return "";
}
}
?>
<?
function getCheck($field1, $field2)
{
if ($field1 == $field2)
{
return "checked";
}
else
{
return "";
}
}
?>