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/add_gen_stock.php
<?
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"]=="Save")
	                   {


					   //=========== บันทึกข้อมูล
								  $sql_up = "insert into gen_stock (StockID,Date,Quantity) Values ('$_GET[StockID]','".date("Y-m-d")."','$_POST[txtQuantity]')";
								  $dbquery_up = mysql_query($sql_up);
											 
					  
							  $sql_up = "update stock set Stock=Stock - ($_POST[txtQuantity])    where StockID='$_GET[StockID]'";
							  $dbquery_up = mysql_query($sql_up);
					  					  
									echo"<script language='JavaScript'>";
									echo"alert('เพิ่มข้อมูลเรียบร้อยแล้ว');";
									echo"window.location='gen_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">
<script language="JavaScript" src="editor.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<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="gen_stock.php">กลับไป</a></div></td>
              </tr>
            </tbody>
          </table></td>
      </tr>
    </tbody>
  </table>
</div>

<script language="JavaScript">
function checkvalue()
{
	//=========== ตรวจสอบค่าว่าง

		
			<?
			if($_GET["StockID"] == "")			
			{
			?>
					alert('กรุณาเลือกวัตถุดิบ');
					document.all.ddlStockID.focus();
					return false;
			<?
			}
			?>

		
		if(document.all.txtQuantity.value =="")
		{
		alert('กรุณากรอกจำนวนที่เบิก');
		document.all.txtQuantity.focus();
		return false;
		}
		
		
		if(parseint(document.all.txtQuantity.value) > parseint(document.all.hidMax.value))
		{
			alert('จำนวนที่เบิกจะต้องน้อยไม่มากกว่า'+parseint(document.all.txtQuantity.value));
			document.all.txtQuantity.focus();
			return false;		
		}
	
}


</script>
<form name="frmNew" method="post" action="<?=$_SERVER['PHP_SELF'];?>?StockID=<?=$_GET["StockID"];?>&Action=Save" enctype="multipart/form-data" onSubmit="return checkvalue();">
  <table cellspacing=1 cellpadding=3 width="51%" bgcolor=#CCCCCC border=0 align="center" height="10">
    <tbody>
      <tr bgcolor=#e5e5e5> 
        <td width="31" bgcolor="#FFFFFF"> <script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script> 
          <table width="100%" border="0" cellspacing="2" cellpadding="2">
            <tr> 
              <td width="25%">&nbsp;</td>
              <td width="75%">&nbsp;</td>
            </tr>
            <tr> 
              <td valign="top">วันที่</td>
              <td> 
                <?=date("Y-m-d");?>
                &nbsp;</td>
            </tr>
            <tr> 
              <td valign="top">รหัสวัตถุดิบ <font color="#FF0000">** </font></td>
              <td><select name="ddlStockID" id="ddlStockID" onChange="MM_jumpMenu('parent',this,0)">
                  <option value="?StockID=">-- เลือกรายการวัตถุดิบสินค้า --</option>
                  <?
	 		 $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++;
				if($result["StockID"] ==$_GET["StockID"])
				{
					$sel = "selected";
				}
				else
				{
					$sel = "";
				}
			?>
                  <option value="?StockID=<?=$result["StockID"];?>" <?=$sel;?>> 
                  <?=$result["StockCode"];?>
                  [ 
                  <?=$result["StockName"];?>
                  เบอร์ : 
                  <?=$result["Number"];?>
                  สี : 
                  <?=$result["Color"];?>
                  ]</option>
                  <?
				  }
				  ?>
                </select> </td>
            </tr>
            <?
			if($_GET["StockID"] != "")			
			{
			$result=select("stock","where 1=1 and StockID='".$_GET["StockID"]."'");
			?>
            <tr> 
              <td valign="top">จำนวนที่เบิกได้</td>
              <td>
                <?=$result["Stock"];?>
                <input name="hidMax" type="hidden" id="hidMax" value="<?=$result["Stock"];?>"></td>
            </tr>
            <?
			}
			?>
            <tr> 
              <td valign="top">จำนวนที่เบิก <font color="#FF0000">** </font></td>
              <td><input name="txtQuantity" type="text" class="txtbox" id="txtQuantity"  value="<?=$_POST["txtQuantity"];?>" size="10" maxlength="10"></td>
            </tr>
            <tr> 
              <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
              <td><input name="Submit" type="submit" class="button" value="บันทึก"> 
                <input name="Cancel" type="button" class="button" id="Cancel" value="ยกเลิก" onClick="window.location='gen_stock.php';"></td>
            </tr>
            <tr> 
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr> 
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
          </table></td>
      </tr>
 
    </tbody>
  </table>
</form>


Youez - 2016 - github.com/yon3zu
LinuXploit