MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /var/www/html/pathumthani_eoffice/application/meetingroom/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/meetingroom/config_accessories.php
<?
//include("chk_permission.php");
session_start();
include("../../config/config.inc.php");
include("../../common/function.php");
include("var.inc.php");

$phpfile = "config_accessories.php";
################ HARD FIX
$user=$_SESSION[session_staffid];
################
?>
<HTML>
<HEAD><TITLE>ระบบจองห้องประชุม</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=windows-874">
<LINK href="../../common/style.css" rel="stylesheet" type="text/css">
<LINK href="../../common/tab_style.css" rel="stylesheet" type="text/css" />
<SCRIPT language="javascript" src="../../common/popcalendar.js"></SCRIPT>
<SCRIPT language="javascript" src="../../common/xmlhttp.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../../common/tabber.js"></SCRIPT>

<SCRIPT type="text/javascript"  >
function   chk_confirm(name01) {
	if (!(confirm("ไม่สามารถกู้คืนได้เมื่อลบรายการ"+ name01 +" \n เลือก OK เพื่อยืนยันการลบ"))){
		return false; 
	}
}	   // END function   chk_confirm_person(name01) { 
</SCRIPT>

<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</HEAD>
<BODY topmargin="0">
<? 			 	
$title_label = "รายการโสตทัศนวัสดุในห้องประชุม";
include "header.php";   ?>


<? 	
$nowaction = "xconfig" ; 
		 	include "menu_bar.php";  
?>
    <table width="100%" height="400" border="0" cellpadding="0" cellspacing="0" bgcolor="#EFEFEF">
      <tr>
        <td align="center" valign="top"><br>
		  <span class="header">อุปกรณ์โสตทัศนวัสดุ</span>
<?
if ($accid == ""){ ########################################### 
if ($delaccid != ""){
	$sql = " DELETE FROM meeting_accessories  WHERE ( accid ='$delaccid')   ";
	$result = mysql_query($sql) ; 
	if (!($result)) {  
		addlog("ไม่สามารถลบรายการอุปกรณ์โสตทัสนวัสดุ log ได้",$m_id,$logid5,$delaccid);
		echo " Line ". __LINE__ ."<hr> $sql   <br> ".mysql_error() ."<br> "; 
	}else{
		addlog("ลบรายการอุปกรณ์โสตทัสนวัสดุ log ได้",$m_id,$logid5,$delaccid);
		$msg_return = " <img src=../../images/approve.gif >  ลบรายการเสร็จสิ้น";
	}   ######## END if (!($result)) { 	
} ######## END if ($delaccid != ""){

?>		
          <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td>
<?   if ($msg_return != ""){ echo " <center> $msg_return </center> <br> ";   } ?>
			  <a href="config_accessories.php?accid=0" target="_self">เพิ่มอุปกรณ์โสตทัศนวัสดุ</a></td>
            </tr>
          </table>
          <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999"    >
		   <tr align="center" bgcolor="#466A8E" class="headerTB_white" >
            <td width="6%" >ลำดับ</td>
            <td width="5%">&nbsp;</td>
            <td width="56%">รายการ</td>
            <td width="15%">หน่วยนับ</td>
            <td width="18%">ค่าเช่า(บาท)/<br>
             ต่อครั้ง</td>
            </tr>
<?
$sql = "SELECT accid, accname, accname_en,  accdetail, accunit, accprice 
FROM meeting_accessories   ";
$result = mysql_query($sql) ; 
echo mysql_error() ;  
while ($rs= mysql_fetch_assoc($result)){ 
$nonm++; 
if ($bgcolor1 == "DDDDDD"){  $bgcolor1 = "EFEFEF"  ; } else {$bgcolor1 = "DDDDDD" ;}
?>		
          <tr align="center" bgcolor="#<?=$bgcolor1?>">
            <td height="25" ><?=$nonm?></td>		  
            <td align="center">
			<a href='config_accessories.php?accid=<?=$rs[accid]?>' target=_self>
			<img src="../../images/b_edit.png" width="16" height="16" border="0"></a>
			<a href="config_accessories.php?delaccid=<?=$rs[accid]?>&xact=del" onClick="return  chk_confirm('<?=$rs[accname]?>');  " ><img src="../../images/b_drop.png" width="16" height="16" border="0"></a></td>			
            <td align="left"><?
            echo " <a href='config_accessories.php?accid=$rs[accid]' target=_self></a>$rs[accname] "; 
			
?>
&nbsp; </td>
            <td>   &nbsp;<?=$rs[accunit]?> </td>	
            <td>   &nbsp;<?=$rs[accprice]?> </td>	
            </tr>

<?
} ### END while ($rs= mysql_fetch_assoc($result)){   
?>	 		  
        </table>
<?   }else{   ######### else if ($accid == ""){ ###########################################  	
if ($update_acc !=  ""){################# Start คลิก submit มา
$xread="readonly";
$xdis="style='visibility:hidden'";
echo "";
	$accdetail = htmlspecialchars($accdetail) ; 
	if ($accid ==0){ 
		$sql = " INSERT INTO meeting_accessories  ( accname,accname_en,accdetail,accunit,accprice) VALUES 
		( '$accname','$accname_en','$accdetail','$accunit','$accprice') "; 
		$result = mysql_query($sql) ; 
		if ( mysql_insert_id() != ""){  $accid =  mysql_insert_id() ;  }
		addlog("เพิ่มข้อมูลอุปกรณ์ $accname ",$m_id,$logid4,$accid); 
	}else{ 
		$sql = "  UPDATE meeting_accessories SET accname='$accname',accname_en='$accname_en',accdetail='$accdetail',
		accunit='$accunit',accprice='$accprice' WHERE (accid='$accid')   "; 
		$result = mysql_query($sql) ; 
		addlog("แก้ไขข้อมูลอุปกรณ์ $accname ",$m_id,$logid6,$accid); 
	} ######END if ($accid ==0){ 
	
	if (!($result)) {  
		echo " Line ". __LINE__ ."<hr> $sql1  <br> ".mysql_error() ."<br> "; 
	}else{
		$msg_return = " <img src=../../images/approve.gif >  ปรับปรุงเสร็จสิ้น";
	}   ######## END if (!($result)) { 
} ################# END if ($update_acc !=  ""){ คลิก submit มา

$sql = "SELECT accid, accname, accname_en,  accdetail, accunit, accprice 
FROM meeting_accessories WHERE accid = $accid    ";
$result = mysql_query($sql) ; 
$rs=  mysql_fetch_assoc($result) ; 

if (mysql_errno() ){ echo "<br>LINE ".__LINE__. " <hr><pre> $sql </pre><hr> ".mysql_error() ."<br>" ; } 
 ?>

<form name="form1" method="post" action="">
  
  <table width="66%" border="0" align="center" cellpadding="2" cellspacing="0">
    <tr>
      <td bgcolor="#999999" class="headerTB_white">Accessories Setup </td>
    </tr>
    <tr>
      <td bgcolor="#999999"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;  
<?
echo $msg_return ; 
$msg_return = "";
?>			</td>
          </tr>
          <tr>
            <td height="19" align="right">ชื่ออุปกรณ์ : </td>
            <td>               
               <input name="accname" type="text" value="<?=$rs[accname]?>" size="46" 
			   <?=$xread?>>              </td>
          </tr>
          <tr>
            <td align="right">ชื่ออุปกรณ์(อังกฤษ) : </td>
            <td>
               <input  <?=$xread?> name="accname_en" type="text" value="<?=$rs[accname_en]?>" size="46">              </td>
          </tr>
          <tr>
            <td width="27%" align="right">หน่วยนับ : </td>
            <td width="73%">                
               <input  <?=$xread?> name="accunit" type="text" value="<?=$rs[accunit]?>" size="46">                </td>
          </tr>
          <tr>
            <td align="right">ค่าเช่า(บาท/ครั้ง) : </td>
            <td>                
              <input  <?=$xread?> name="accprice" type="text" value="<?=$rs[accprice]?>" size="46">               </td>
          </tr>
          <tr>
            <td align="right">รายละเอียด :</td>
            <td>             
              <textarea <?=$xread?> name="accdetail" cols="45" rows="5"><?=$rs[accdetail]?></textarea>              </td>
          </tr>
          <tr>
            <td colspan="2" align="center">
			<input name="form_accid" type="hidden" id="form_accid" value="<?=$accid?>">
			<input   <?=$xdis?> name="update_acc" type="submit" id="update_acc" value="บันทึก"> 
              &nbsp; 
              <input type="button" name="Submit2" value="กลับหน้าหลัก" onClick="window.location='<?=$phpfile?>'"></td>
          </tr> 
          <tr>
            <td colspan="2">&nbsp;</td>
          </tr>
      </table></td>
    </tr>
  </table>
</form>
<?   }   ######### END if ($accid == ""){ ###########################################   ?>		</td>
      </tr>
 
</table>

 
	
 <? 	
		 	include "footer.php";  
?>
	
	
	
	

	

Anon7 - 2021