0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: delete_payment.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"; //MySql connection //require_once BASE_DIR."/Proposels/imagePath.php"; ?> <?php include("include/first_userheader.php"); if(isset($_POST['Delete'])) { $u_id=@$_SESSION['user_id']; $p_id=@$_SESSION['project_id']; $Payment_id=$_POST['txtpaymentid']; $active_flag=0; $sql="select * from payment where user_id='$u_id' and project_id ='$p_id' and payment_id='$Payment_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { $paymenid_db=$row['payment_id']; } $ledgertype="Payment"; $sql="delete from payment where user_id='$u_id' and project_id ='$p_id' and payment_id ='$Payment_id'"; mysql_query($sql); $sql="delete from ledger where user_id='$u_id' and project_id ='$p_id' and ledger_type='$ledgertype' and type_id ='$Payment_id'"; mysql_query($sql); /*// if discount present........................ $sql="select * from payment where user_id='$u_id' and project_id='$p_id' and payment_id ='$Payment_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { //1 $discount=$row['discount']; }//1 $groupname="Discount Received" ; if($discount >0) //$discount == old discount ; means , already a discount is present and a deleteion in ledger is required. { $sql="delete from ledger where user_id='$u_id' and project_id ='$p_id' and ledger_type='$ledgertype' and type_id ='$Payment_id'"; mysql_query($sql); } /////////////////////////////*/ $message="Delete successfully.."; $url=$server_ip."/USER/search_payment.php?message=$message"; echo "<script>window.location='$url'</script>"; exit(); } ?> </p> <p> </p> <form action="delete_payment.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <p> </p> <p> </p> <table width="415" align="center"> <tr> <td width="106"><div align="right" class="projectboldtxt"> <div align="left" class="projectboldtxt">payment ID</div> </div></td> <td width="339"><label> <input type="text" name="txtpaymentid" id="txtpaymentid" 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 payment...?</td> <td width="233"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> <a href="search_payment.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>