0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: delete_stockentry.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; //MySql connection require_once BASE_DIR."/Proposels/imagePath.php"; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Delete stockentry | OFMSP</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="../style.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="../images/icon.ico" /> <style type="text/css"> <!-- .style4 { font-family: None } .style6 {color: #853008} #apDiv1 { position:absolute; width:64px; height:37px; z-index:1; left: 717px; top: 258px; background-image: url(../images/back_button_up.jpg); } #apDiv2 { position:absolute; width:65px; height:37px; z-index:1; left: 724px; top: 246px; background-image: url(../images/back_button_up.jpg); } .style8 {font-size: 14px} --> </style> </head> <body> <p> <?php include("include/userheader.php"); $id=$_GET['id']; $name=$_GET['name']; if(isset($_POST['Delete'])) { $active_flag=0; $u_id=@$_SESSION['user_id']; $item_id=$_POST['txtentryid']; $itemname=$_POST['txtitemname']; $sql="select * from stockentry where user_id='$u_id' and stockentry_id='$item_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { $dbid =$row['stockentry_id']; $db_name =$row['item_name']; } /*$sql="select * from stockusage_entry where item_name='$db_name'"; $sql=mysql_query($sql); $row=mysql_fetch_array($sql); if($row != NULL) { $active_flag=1; }*/ if($active_flag==1) { $message="This is an active item.You cannot delete this details."; } else { $sql="delete from stockentry where user_id='$u_id' and stockentry_id='$dbid'"; mysql_query($sql); $message="Delete successfully.."; } $url=$server_ip."/USER/search_stockentry.php?message=$message"; echo "<script>window.location='$url'</script>"; }?> </div> </div> </p> <p> </p> <p> </p> <p> </p> <div align="center" class="projectboldtxt">Delete item Details </p> </div> <form action="delete_stockentry.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <table width="457" align="center"> <tr> <td width="106"><div align="right" class="projectboldtxt style4"> <div align="left" class="projectboldtxt">stockentry id</div> </div></td> <td width="339"><label> <input type="text" name="txtentryid" id="txtentryid" value="<?php echo $_GET['id'];?>" readonly="readonly"/> </label></td> </tr> <tr> <td width="106" class="projectboldtxt">Item name</td> <td><input type="text" name="txtitemname" id="txtitemname" value=" <?php echo $_GET['name']; ; ?>" readonly="readonly"/></td> </tr> </table> <p> </p> <table width="457" align="center"> <tr> <td width="298" class="projectboldtxt style6"> Do you want to delete the stock entry details...?</td> <td width="147"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> <a href="search_stockentry.php" class="projectboldtxt style8">Back</a></label></td> </tr> </table></form> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </div> <?php include "include/footer.php"; ?> </p> </body> </html>