0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: delete_item.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 project | 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> <!--<div id="headerbg"> <div id="headerblank">--> <!--<div id="headerbg"> <div id="headerblank">--> <?php include("include/userheader.php"); $id=$_GET['id']; $name=$_GET['name']; if(isset($_POST['Delete'])) { $u_id=@$_SESSION['user_id']; $item_id=$_POST['txtitemid']; $itemname=$_POST['txtitemname']; $active_flag=0; //$Projectcode= $_POST['txtproject_code']; $sql="select * from stockitem where user_id='$u_id' and item_id ='$item_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { $dbid =$row['item_id']; $item_db=$row['item_name']; } $sql="select * from stockentry where item_name='$item_db'"; $sql=mysql_query($sql); $row=mysql_fetch_array($sql); if($row != NULL) { $active_flag=1; } // $sql="select * from employe where project_id ='$p_id'"; // $sql=mysql_query($sql); // $row=mysql_fetch_array($sql); // if($row != NULL) // { // $active_flag=1; // } // $sql="select * from `ledger` where `project_id` ='$p_id'"; // $sql=mysql_query($sql); // $row=mysql_fetch_array($sql); // if($row != NULL) // { // $active_flag=1; // } // // $sql="select * from `payment` where `project_id` ='$p_id'"; // $sql=mysql_query($sql); // $row=mysql_fetch_array($sql); // if($row != NULL) // { // $active_flag=1; // } // $sql="select * from `reciept` where `project_id` ='$p_id'"; // $sql=mysql_query($sql); // $row=mysql_fetch_array($sql); // if($row != NULL) // { // $active_flag=1; // } // $sql="select * from `salaryvoucher` where `project_id` ='$p_id'"; // $sql=mysql_query($sql); // $row=mysql_fetch_array($sql); // if($row != NULL) // { // $active_flag=1; // } // $sql="select * from `accgroup` where `project_id` ='$p_id'"; // $sql=mysql_query($sql); // $row=mysql_fetch_array($sql); // if($row != NULL) // { // $active_flag=1; // } // $sql="select * from `account` where `project_id` ='$p_id'"; // $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 { // $DelFilePath = ROOT_DIR . $project_proposels ; // // if (file_exists($DelFilePath)) // { // unlink ($DelFilePath); // } $sql="delete from stockitem where user_id='$u_id' and item_id='$dbid'"; mysql_query($sql); $message="Delete successfully.."; } $url="http://".$server_ip."/CPFMS/USER/search_stockitem.php?message=$message"; echo "<script>window.location='$url'</script>"; }?> </div> </div> </p> <p> </p> <p> </p> <div align="center" class="projectboldtxt">Delete item Details </p> </div> <form action="delete_item.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">item id</div> </div></td> <td width="339"><label> <input type="text" name="txtitemid" id="txtitemid" 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="246" class="projectboldtxt style6"> Do you want to delete the item details...?</td> <td width="199"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> <a href="search_stockitem.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>