| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/comservices/backend/ |
Upload File : |
<?php require_once('../Connections/comservice.php'); ?>
<?php require_once('../Connections/comservice.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "A";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$b_date = empty($_GET['b_date']) ? "-1" : $_GET['b_date'];
$e_date = empty($_GET['e_date']) ? "-1" : $_GET['e_date'];
/*$s_type = empty($_GET['s_type']) ? "-1" : $_GET['s_type'];
$s_dept = empty($_GET['s_dept']) ? "-1" : $_GET['s_dept'];
$s_place = empty($_GET['s_place']) ? "-1" : $_GET['s_place']; */
mysql_select_db($database_comservice, $comservice);
$sql = "
SELECT r.*
FROM com_inform r
WHERE DATE(r.inform_date) >= %s
AND DATE(r.inform_date) <= %s";
$sql .= " ORDER BY r.inform_date ASC";
$query_LisRe = sprintf($sql,
GetSQLValueString($b_date, "text"),
GetSQLValueString($e_date, "text")
/*GetSQLValueString($s_type, "text"),
$condition,
GetSQLValueString($s_dept, "text") */
);
$colname_recmem = "-1";
if (isset($_SESSION['MM_MEMBERNAME'])) {
$colname_recmem = $_SESSION['MM_MEMBERNAME'];
}
mysql_select_db($database_comservice, $comservice);
$query_recmem = sprintf("SELECT * FROM mis_member WHERE MEMBERNAME = %s", GetSQLValueString($colname_recmem, "text"));
$recmem = mysql_query($query_recmem, $comservice) or die(mysql_error());
$row_recmem = mysql_fetch_assoc($recmem);
$colname_recmem = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_recmem = $_SESSION['MM_Username'];
}
mysql_select_db($database_comservice, $comservice);
$query_recmem = sprintf("SELECT * FROM mis_member WHERE MEMBERCODE = %s", GetSQLValueString($colname_recmem, "text"));
$recmem = mysql_query($query_recmem, $comservice) or die(mysql_error());
$row_recmem = mysql_fetch_assoc($recmem);
$totalRows_recmem = mysql_num_rows($recmem);
mysql_select_db($database_comservice, $comservice);
$query_minform = "SELECT * FROM com_inform";
$minform = mysql_query($query_minform, $comservice) or die(mysql_error());
$row_minform = mysql_fetch_assoc($minform);
$totalRows_minform = mysql_num_rows($minform);
$queryString_minform = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_minform") == false &&
stristr($param, "totalRows_minform") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_minform = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_minform = sprintf("&totalRows_minform=%d%s", $totalRows_minform, $queryString_minform);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ระบบแจ้งซ่อมครุภัณฑ์คอมพิวเตอร์ออนไลน์ คณะวิทยาการจัดการ</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="../css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.6.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.12.custom.min.js" type="text/javascript"></script>
<link href="css/smoothness/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document) .ready(function() {
$("#b_date, #e_date") .datepicker({
dateFormat : "yy-mm-dd"
});
});
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#EEEEEE"><img src="../img/logo.gif" width="70" /><br />
<h3> ระบบแจ้งซ่อมครุภัณฑ์คอมพิวเตอร์ออนไลน์ คณะวิทยาการจัดการ </h3></td>
</tr>
</table>
<table width="95%" border="0" align="center" cellpadding="5" cellspacing="5">
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"><font color="#3366FF"><span class="glyphicon glyphicon-user"></span> ยินดีต้อนรับคุณ : <?php echo $row_recmem['MEMBERNAME']; ?> </font> <? print " Date : " . date("D d F Y " ); ?></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><strong><font color="#FF0000">รวมรายการแจ้งซ่อมทั้งสิ้น <em><?php echo $totalRows_minform ?></em> รายการ </font></strong></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><table width="90%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="11%" align="center" bgcolor="#D6D6D6"><strong>inform_date</strong></td>
<td width="9%" align="center" bgcolor="#D6D6D6"><strong>item_id</strong></td>
<td width="12%" align="center" bgcolor="#D6D6D6"><strong>device_name</strong></td>
<td width="9%" align="center" bgcolor="#D6D6D6"><strong>job_type</strong></td>
<td width="34%" align="center" bgcolor="#D6D6D6"><strong>inform_detail</strong></td>
<td width="13%" align="center" bgcolor="#D6D6D6"><strong>member_name</strong></td>
<td width="12%" align="center" bgcolor="#D6D6D6"><strong>inform_status</strong></td>
</tr>
<?php do { ?>
<tr>
<td><?php echo date ('d-m-Y',strtotime($row_minform['inform_date'])); ?>
</td>
<td><?php echo $row_minform['item_id']; ?></td>
<td><?php echo $row_minform['device_name']; ?></td>
<td><?php echo $row_minform['job_type']; ?></td>
<td><?php echo $row_minform['inform_detail']; ?></td>
<td><?php echo $row_minform['member_name']; ?></td>
<td><?php echo $row_minform['inform_status']; ?></td>
</tr>
<?php } while ($row_minform = mysql_fetch_assoc($minform)); ?>
</table></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="25" colspan="2" align="center" bgcolor="#FFFFFF">
<input type="button" class="btn-primary btn-lg" value="Print" onclick="window.print() " />
</td>
</tr>
<tr>
<td width="26%" height="25" align="center" bgcolor="#FFFFFF"> </td>
<td width="74%" align="center" bgcolor="#FFFFFF">
</td>
</tr>
</table>
<?php
include("../footer.php") ?>
<?php
mysql_free_result($recmem);
mysql_free_result($minform);
?>
</body>
</html>