0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: delete_advancetakenentry.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 payment details| 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" /> </head> <body> <p><?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; include("include/first_userheader.php"); //MySql connection //require_once BASE_DIR."/Proposels/imagePath.php"; ?> <?php if(isset($_POST['Delete'])) { $u_id=@$_SESSION['user_id']; $p_id=@$_SESSION['project_id']; $advance_id=$_POST['txtid']; $active_flag=0; $sql="select * from advance_taken_entry where user_id='$u_id' and advance_id='$advance_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { $advance_id_db=$row['advance_id']; $advance_or_imprest=$row['advance_impresed']; } $sql="select * from advance_settelment where advance_taken_entry_no ='$advance_id'"; mysql_query($sql); if (mysql_affected_rows()>0) { $active_flag=1; } if($active_flag==1) { $message="Failed : This is an active details. You cannot delete this details."; } else { $sql="delete from advance_taken_entry where user_id='$u_id' and advance_id='$advance_id_db'"; mysql_query($sql); //Ledger delete for imprest if ($advance_or_imprest=="Imprest") { $sql="delete from ledger where user_id='$u_id' and project_id='$p_id' and ledger_type='AI Taken' and type_id='$advance_id_db'"; mysql_query($sql); } $message="Success : Delete successfully.."; } $url=$server_ip."/USER/search_advancetakenentry.php?message=$message"; echo "<script>window.location='$url'</script>"; } ?></p> <p> </p> <form action="delete_advancetakenentry.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <p> </p> <p> </p> <table width="357" align="center"> <tr> <td width="178"><div align="right" class="projectboldtxt"> <div align="left" class="projectboldtxt">Advance / Imprest ID</div> </div></td> <td width="167"><label> <input type="text" name="txtid" id="txtid" value="<?php echo $_GET['id'];?>" readonly="readonly"/> </label></td> </tr> </table> <p> </p> <table width="435" align="center"> <tr> <td width="212" class="projectboldtxt"> Do you want to delete...?</td> <td width="233"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> <a href="search_advancetakenentry.php" class="projectboldtxt style2">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> </div> <?php include "include/footer.php"; ?> </p> </body> </html>