403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/comservices/backend//add_devices_detail.php
<?php require_once('../Connections/comservice.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "../index.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "0";
$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;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmaddcase")) {
  $insertSQL = sprintf("INSERT INTO com_devices_detail (item_id, device_name, device_status, count_unit, device_price, device_location, device_installation, where_price, remark, admin_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['item_id'], "text"),
                       GetSQLValueString($_POST['device_name'], "text"),
                       GetSQLValueString($_POST['device_status'], "text"),
                       GetSQLValueString($_POST['count_unit'], "text"),
                       GetSQLValueString($_POST['device_price'], "int"),
                       GetSQLValueString($_POST['device_location'], "text"),
                       GetSQLValueString($_POST['date_installation'], "text"),
                       GetSQLValueString($_POST['where_price'], "text"),
                       GetSQLValueString($_POST['device_detail'], "text"),
                       GetSQLValueString($_POST['admin_id'], "text"));

  mysql_select_db($database_comservice, $comservice);
  $Result1 = mysql_query($insertSQL, $comservice) or die(mysql_error());

  $insertGoTo = "add_devices_detail.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

$colname_recmem = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_recmem = $_SESSION['MM_Username'];
}
mysql_select_db($database_comservice, $comservice);
$query_recmem = sprintf("SELECT * FROM com_member WHERE muser = %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_devices = "SELECT * FROM com_devices";
$devices = mysql_query($query_devices, $comservice) or die(mysql_error());
$row_devices = mysql_fetch_assoc($devices);
$totalRows_devices = mysql_num_rows($devices);

$maxRows_show_alldevice = 10;
$pageNum_show_alldevice = 0;
if (isset($_GET['pageNum_show_alldevice'])) {
  $pageNum_show_alldevice = $_GET['pageNum_show_alldevice'];
}
$startRow_show_alldevice = $pageNum_show_alldevice * $maxRows_show_alldevice;

mysql_select_db($database_comservice, $comservice);
$query_show_alldevice = "SELECT * FROM com_devices_detail ORDER BY id DESC";
$query_limit_show_alldevice = sprintf("%s LIMIT %d, %d", $query_show_alldevice, $startRow_show_alldevice, $maxRows_show_alldevice);
$show_alldevice = mysql_query($query_limit_show_alldevice, $comservice) or die(mysql_error());
$row_show_alldevice = mysql_fetch_assoc($show_alldevice);

if (isset($_GET['totalRows_show_alldevice'])) {
  $totalRows_show_alldevice = $_GET['totalRows_show_alldevice'];
} else {
  $all_show_alldevice = mysql_query($query_show_alldevice);
  $totalRows_show_alldevice = mysql_num_rows($all_show_alldevice);
}
$totalPages_show_alldevice = ceil($totalRows_show_alldevice/$maxRows_show_alldevice)-1;

$queryString_show_alldevice = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_show_alldevice") == false && 
        stristr($param, "totalRows_show_alldevice") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_show_alldevice = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_show_alldevice = sprintf("&totalRows_show_alldevice=%d%s", $totalRows_show_alldevice, $queryString_show_alldevice);
?>
<!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">


    <!-- 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() {
		$("#date_installation") .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">
<h3> ระบบแจ้งซ่อมครุภัณฑ์คอมพิวเตอร์ออนไลน์ </h3></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="5" cellspacing="5">
  <tr>
    <td colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center" bgcolor="#FFFFFF"></td>
  </tr>
  <tr>
    <td colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center" bgcolor="#FFFFFF">
      
      <b>
        
      </b></td>
  </tr>
  <tr>
    <td colspan="2" align="left" bgcolor="#FFFFFF"></td>
  </tr>
  <tr>
    <td width="18%" rowspan="5" align="left" valign="top" bgcolor="#FFFFFF"> 
    
    
    
    <?php include("menuadmin1.php"); ?></td>
     
     
     
    <td align="center" bgcolor="#FFFFFF"> <a href="#" class="list-group-item active">
        <strong>แบบฟอร์มเพิ่มรายการครุภัณฑ์คอมพิวเตอร์  </strong></a></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#FFFFFF">&nbsp;<br />
      <table width="98%" border="1" align="right" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="6" align="right" bgcolor="#FFFFFF">รวม &nbsp; &nbsp; <?php echo $totalRows_show_alldevice ?> &nbsp; รายการ</td>
        </tr>
        <tr>
          <td width="16%" height="35" align="center" bgcolor="#D6D6D6">รหัสครุภัณฑ์</td>
          <td width="10%" height="35" align="center" bgcolor="#D6D6D6">ชื่อครุภัณฑ์</td>
          <td width="5%" height="35" align="center" bgcolor="#D6D6D6">สถานะ</td>
          <td width="65%" height="35" align="center" bgcolor="#D6D6D6">รายละเอียด</td>
          <td height="35" colspan="2" align="center" bgcolor="#D6D6D6">จัดการ</td>
        </tr>
        <?php do { ?>
          <tr>
            <td align="left"><?php echo $row_show_alldevice['item_id']; ?></td>
            <td align="center"><?php echo $row_show_alldevice['device_name']; ?></td>
            <td align="center"><?php echo $row_show_alldevice['device_status']; ?></td>
            <td align="left"><?php echo $row_show_alldevice['remark']; ?></td>
            <td width="4%" align="center"><a href="#" class="btn btn-info btn-xs">edit</a></td>
            <td width="4%" align="center"><a href="#" class="btn btn-danger btn-xs">del</a></td>
          </tr>
          <?php } while ($row_show_alldevice = mysql_fetch_assoc($show_alldevice)); ?>
    </table></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#FFFFFF">
    
    
    
      
        <?php if ($totalRows_show_alldevice > 0) { // Show if recordset not empty ?>
      <a href="<?php printf("%s?pageNum_show_alldevice=%d%s", $currentPage, 0, $queryString_show_alldevice); ?>"><img src="img/First.gif" width="18" height="13" /></a> &nbsp; <a href="<?php printf("%s?pageNum_show_alldevice=%d%s", $currentPage, max(0, $pageNum_show_alldevice - 1), $queryString_show_alldevice); ?>"><img src="img/Previous.gif" width="14" height="13" /></a> &nbsp; <a href="<?php printf("%s?pageNum_show_alldevice=%d%s", $currentPage, min($totalPages_show_alldevice, $pageNum_show_alldevice + 1), $queryString_show_alldevice); ?>"><img src="img/Next.gif" width="14" height="13" /></a>&nbsp; <a href="<?php printf("%s?pageNum_show_alldevice=%d%s", $currentPage, $totalPages_show_alldevice, $queryString_show_alldevice); ?>"><img src="img/Last.gif" width="18" height="13" /></a>
      <?php } // Show if recordset not empty ?>
    
    
    
    </td>
  </tr>
  <tr>
    <td align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td width="82%" align="center" bgcolor="#FFFFFF">
      
      <form action="<?php echo $editFormAction; ?>" onsubmit="return validateForm()" method="POST" enctype="multipart/form-data" name="frmaddcase" id="frmaddcase" >
        <table width="80%" border="0" align="center" cellpadding="10" cellspacing="10">
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4">&nbsp;</td>
          </tr>
          <tr>
            <td width="19%" align="right">รหัสครุภัณฑ์ : &nbsp; </td>
            <td width="30%">
            
            <input name="item_id" type="text" class="form-control" id="item_id" placeholder=" เช่น ธบ.5719-213-00003-001" value="" />
           
            
            
            </td>
            <td colspan="3" valign="top"><font color="#FF0000">* ต้องการข้อมูล </font></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4">&nbsp;</td>
          </tr>
          <tr>
            <td align="right">ประเภทครุภัณฑ์ : &nbsp; </td>
            <td><label for="device_name"></label>
              <label for="device_name"></label>
              <select name="device_name" id="device_name">
                <?php
do {  
?>
                <option value="<?php echo $row_devices['device_name']?>"<?php if (!(strcmp($row_devices['device_name'], $row_devices['device_name']))) {echo "selected=\"selected\"";} ?>><?php echo $row_devices['device_name']?></option>
                <?php
} while ($row_devices = mysql_fetch_assoc($devices));
  $rows = mysql_num_rows($devices);
  if($rows > 0) {
      mysql_data_seek($devices, 0);
	  $row_devices = mysql_fetch_assoc($devices);
  }
?>
            </select></td>
            <td width="15%" align="right">สถานะครุภัณฑ์ : &nbsp; </td>
            <td colspan="2"><select name="device_status" id="device_status">
              <option>กรุณาเลือก</option>
              <option value="ปกติ">ปกติ</option>
              <option value="ชำรุด">ชำรุด</option>
              <option value="เสื่อมคุณภาพ">เสื่อมคุณภาพ</option>
              <option value="สูญหาย">สูญหาย</option>
            </select></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4">&nbsp;</td>
          </tr>
          <tr>
            <td align="right">หน่วยนับ : &nbsp; </td>
            <td>
              <select name="count_unit" id="count_unit">
                <option>กรุณาเลือก</option>
                <option value="เครื่อง">เครื่อง</option>
                <option value="ชิ้น">ชิ้น</option>
                <option value="ตัว">ตัว</option>
              </select>
            </label></td>
            <td align="right">มูลค่า : </td>
            <td width="26%"><label for="device_price"></label>
            <input name="device_price" type="text" class="form-control" id="device_price" /></td>
            <td width="10%" align="center">บาท
            <label for="count_unit"></label></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
          </tr>
          <tr>
            <td align="right">วันที่รับ : &nbsp; </td>
            <td colspan="2"><label for="date_installation"></label>
            <input type="text" name="date_installation" id="date_installation" /></td>
            <td colspan="2">&nbsp;</td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
          </tr>
          <tr>
            <td align="right">แหล่งเงิน : </td>
            <td><label for="where_price"></label>
            <input name="where_price" type="text" id="where_price" size="30"  placeholder="เช่น เงินบำรุงการศึกษา" class="form-control"/></td>
            <td>&nbsp;</td>
            <td colspan="2">&nbsp;</td>
          </tr>
          <tr>
            <td align="right" valign="top">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
            <td colspan="2" valign="top">&nbsp;</td>
          </tr>
          <tr>
            <td align="right" valign="top">ที่ตั้ง :&nbsp; </td>
            <td colspan="2"><label for="device_location"></label>
            <input name="device_location" type="text" id="device_location" size="40"  placeholder="ระบุ อาคาร ชั้น ห้อง" class="form-control"/></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4">&nbsp;</td>
          </tr>
          <tr>
            <td align="right" valign="top">รายละเอียด : &nbsp;</td>
            <td colspan="4"><label for="device_detail"></label>
            <textarea name="device_detail" cols="60" id="device_detail" placeholder="ยี่ห้อ รุ่น Serail Number" class="form-control"></textarea></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4"><input name="admin_id" type="hidden" id="admin_id" value="<?php echo $row_recmem['MEMBERCODE']; ?>" /></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4">&nbsp;</td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4">&nbsp;&nbsp;</td>
          </tr>
          <tr>
            <td colspan="5" align="center">
              
              <button type="submit" class="btn btn-primary ">บันทึกข้อมูล</button>  
              &nbsp;&nbsp;&nbsp; &nbsp;
              
              <button type="reset" class="btn btn-warning">เคลียร์ข้อความ</button>          </td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td colspan="4" align="center">&nbsp;</td>
          </tr>
        </table>
        <input type="hidden" name="MM_insert" value="frmaddcase" />
      </form>
     
      
      
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" bgcolor="#DFDFD9"><span class="glyphicon glyphicon-log-out"></span> <a href="<?php echo $logoutAction ?>">ออกจากระบบ</a></td>
  </tr>
</table>
 
<?php
include("../footer.php")


?>
<?php
mysql_free_result($recmem);

mysql_free_result($devices);

mysql_free_result($show_alldevice);
?>

 




</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit