| 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 : |
<?
ob_start();
session_start();
if($_SESSION["adminlogin"]=="")
{
header('location:index.php');
exit();
}
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล
require_once('../connect/connect.php');
require_once('../connect/function.php');
//=========== กรณีลบรายการสินค้า
if($_GET["Action"]=="Delete")
{
//=========== ลบข้อมูล
$sql_del= "delete from stock where StockID='".$_GET["StockID"]."'";
$dbquery_del = mysql_query($sql_del);
echo"<script language='JavaScript'>";
echo"alert('ลบข้อมูลเรียบร้อยแล้ว');";
echo"window.location='stock.php';";
echo"</script>";
}
?>
<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="68%" 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>
<form name="frm" method="post" action="<?=$_SERVER['PHP_SELF'];?>" enctype="multipart/form-data">
<table width="68%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="58%"> </td>
<td width="42%"><div align="right"><img src="../image/edit_icon.gif" width="15" height="15">
<a href="addstock.php">เพิ่มสต๊อกใหม</a>่ </div></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table cellspacing=1 cellpadding=3 width="68%" bgcolor=#CCCCCC border=0 align="center" height="10">
<tbody>
<tr bgcolor=#e5e5e5>
<td bgcolor="#FFFFFF"><div align="center">ลำัดัับ</div></td>
<td bgcolor="#FFFFFF"><div align="center">รหัสวัตถุดิบ</div></td>
<td bgcolor="#FFFFFF">ชื่อวัตถุดิบ</td>
<td bgcolor="#FFFFFF"><div align="center">เบอร์</div></td>
<td bgcolor="#FFFFFF"><div align="center">สี</div></td>
<td bgcolor="#FFFFFF"><div align="center">จำนวนสต๊อก</div></td>
<td bgcolor="#FFFFFF"><div align="center">แก้ไข</div></td>
<td bgcolor="#FFFFFF"><div align="center">ลบ</div></td>
</tr>
<?
$i=0;
//=========== ทำการ query เพื่อเลือกรายการสินค้า
$sql_stock = "select * from stock where 1 $condition order by StockID asc";
$dbquery_stock = mysql_query($sql_stock);
$num_rows_stock = mysql_num_rows($dbquery_stock);
while ($result= mysql_fetch_array($dbquery_stock))
{
$i++;
?>
<tr bgcolor=#e5e5e5>
<td width="32" bgcolor="#FFFFFF"> <div align="center">
<?=$i;?>
</div></td>
<td width="75" bgcolor="#FFFFFF"><div align="center">
<?=$result["StockCode"];?>
</div></td>
<td width="199" bgcolor="#FFFFFF">
<?=$result["StockName"];?>
</td>
<td width="95" bgcolor="#FFFFFF"> <div align="center">
<?=$result["Number"];?>
</div></td>
<td width="84" bgcolor="#FFFFFF"><div align="center">
<?=$result["Color"];?>
</div></td>
<td width="83" bgcolor="#FFFFFF"><div align="center">
<?=$result["Stock"];?>
</div></td>
<script language="JavaScript">
function Conf<?=$result["StockID"]; ?>(object) {
if (confirm("ยืนยันการลบ [ <?=$result["StockName"]; ?> ] ") ==true) {
return true;
}
return false;
}
</script>
<td width="29" bgcolor="#FFFFFF"><div align="center"><a href="editstock.php?StockID=<?=$result["StockID"];?>"><img src="../image/edit_icon.gif" width="15" height="15" border="0"></a></div></td>
<td width="21" bgcolor="#FFFFFF"><div align="center"><a href="<?=$_SERVER['PHP_SELF'];?>?Action=Delete&StockID=<?=$result["StockID"];?>&file1=<?=$result["PictureSmall"];?>&file2=<?=$result["PictureBig"];?>" onClick="return Conf<?=$result["StockID"]; ?>(this)"><img src="../image/delete.gif" width="16" height="16" border="0"></a></div></td>
</tr>
<?
}
?>
</tbody>
</table>
<table cellspacing=0 cellpadding=4 width="68%" 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"></div></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
</form>