| Server IP : 61.19.30.66 / Your IP : 216.73.216.80 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/ |
Upload File : |
<?
require_once "config/connectdb.php";
?>
<?
$sql2="SELECT namesc,tumbolsc,amps,dissc,years,termx FROM config";
mysql_query("SET character_set_results=tis620");//ตั้งค่าการดึงข้อมูลออกมาให้เป็น tis620
mysql_query("SET character_set_client=tis620");//ตั้งค่าการส่งข้อมุลลงฐานข้อมูลออกมาให้ เป็น tis620
mysql_query("SET character_set_connection=tis620");//ตั้งค่าการติดต่อฐานข้อมูลให้เป็น ti
$result2 = mysql_query($sql2);
while (list($namesc,$tumbolsc,$amps,$dissc,$years,$termx) = mysql_fetch_row($result2)) {
$xsc_Name = $namesc;
$xsc_tumbolsc = $tumbolsc;
$xsc_disc = $dissc;
$xsc_amps = $amps;
$xsc_years = $years;
$termxx = $termx;
}
?>
<html>
<head>
<title>-:- ADMIN -:-</title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
</head>
<body>
<?php
if ($codeteach == "2")
{
?><script language="javascript">
alert("กรุณากลับไปป้อนข้อมูลใหม่อีกครั้ง \n");
history.back();
</script>
<?php
}
else
{
$host="localhost";
$username="root";
$password="klw3322";
$connect= mysql_connect( $host,$username,$password) or die ("ติดต่อฐานข้อมูล Mysql ไม่ได้ ");
$tb="sell_product";
$sql="select sell_bacode from sell_product where sell_bacode='$_POST[bacode]'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
if($row)
{
echo "มีบาร์โค้ดนี้แล้ว<hr> <a href=addpro.php>add new"; exit;
}
//$num_rows=mysql_num_rows($db_query);
$signup = date("j/n/").(date("Y")+543) ;
}
if($num_rows != 0) /* ตรวจสอบรหัส */
{
echo"<script>window.alert(\"รหัสนี้ซ้ำ\");history.go (-1);</script>";
}
else
{
mysql_query("INSERT INTO $tb (sell_proid,sell_proname,sell_procost,sell_prosell,sell_unit,sell_user,sell_bacode,sell_edit) values('', '$_POST[namepro]','$_POST[cost]','$_POST[sell]','$_POST[unit]','$_POST[registeach]','$_POST[bacode]','$signup ')") or die ("Add ข้อมูลลง Table ไม่ได้ ");
echo "<script>window.alert(\"บันทึกข้อมูลเรียบแล้วครับ\");history.go (-1);</script>";
}
mysql_close();
?>
</body>
</html>