0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: delete_salary.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 salary 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']; $salary_id_restore=$_POST['txtsalaryid']; $active_flag=0; $sql="select * from salaryvoucher where user_id='$u_id' and project_id ='$p_id' and salary_id='$salary_id_restore'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { $salary_db=$row['salary_id']; } $ledgertype="Salary Voucher"; // // $sql="select * from ledger where user_id='$u_id' and project_id ='$p_id' and type_id='$salary_db' and ledger_type='$ledgertype'"; // // $sql=mysql_query($sql); // $row=mysql_fetch_array($sql); // if($row != NULL) // { // $active_flag=1; // } // if($active_flag==1) // { // $message="This is an active details. You cannot delete this details."; // } // else // { $sql="delete from salaryvoucher where user_id='$u_id' and project_id ='$p_id' and salary_id ='$salary_id_restore'"; mysql_query($sql); $sql="delete from ledger where user_id='$u_id' and project_id ='$p_id' and ledger_type='$ledgertype' and type_id ='$salary_id_restore'"; mysql_query($sql); $message="Delete successfully.."; $url=$server_ip."/USER/search_salary.php?message=$message"; echo "<script>window.location='$url'</script>"; } ?> </div> </div> </p> <p> </p> <p> </p> <form action="delete_salary.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <p> </p> <p> </p> <table width="347" align="center"> <tr> <td width="171"><div align="right" class="projectboldtxt"> <div align="left" class="projectboldtxt">salary voucher ID</div> </div></td> <td width="229"><label> <input type="text" name="txtsalaryid" id="txtsalaryid" value="<?php echo $_GET['id'];?>" readonly="readonly"/> </label></td> </tr> </table> <p> </p> <table width="435" align="center"> <tr> <td width="253" class="projectboldtxt"> Do you want to delete the salary details...?</td> <td width="170"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> <a href="search_salary.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> </div> <?php include "include/footer.php"; ?> </p> </body> </html>