0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: delete_account.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 Group| 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> </html> <style type="text/css"> <!-- #apDiv3 { position:absolute; width:65px; height:40px; z-index:1; top: 306px; left: 718px; } .style1 { color: #660000; font-weight: bold; } --> </style> <p><?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; //MySql connection ?> <?php include("include/first_userheader.php"); $id=$_GET['id']; if(isset($_POST['Delete'])) { $u_id=@$_SESSION['user_id']; $p_id=@$_SESSION['project_id']; $accname = $_POST['txtaccname']; $acc_id=$_POST['txtaccid']; $active_flag=0; $sql="select * from account where user_id='$u_id' and project_id='$p_id' and account_name ='$accname'"; $sql=mysql_query($sql); while($row=mysql_fetch_array($sql)) { $accdb_id = $row['account_id']; } $sql="select * from payment where user_id='$u_id' and project_id ='$p_id' and account_Name='$accname'"; $sql1=mysql_query($sql); $row=mysql_fetch_array($sql1); if($row != NULL) { $active_flag=1; } $sql="select * from reciept where user_id='$u_id' and project_id ='$p_id' and account_Name='$accname'"; $sql1=mysql_query($sql); $row=mysql_fetch_array($sql1); if($row!= NULL) { $active_flag=1; } $sql="select * from custemaccount_cashentry where user_id='$u_id' and project_id ='$p_id' and accountname='$accname'"; $sql1=mysql_query($sql); $row=mysql_fetch_array($sql1); if($row!= NULL) { $active_flag=1; } $sql="select * from ledger where user_id='$u_id' and project_id ='$p_id' and account_name='$accname'"; $sql1=mysql_query($sql); $row=mysql_fetch_array($sql1); 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 account where user_id='$u_id' and project_id='$p_id' and account_id ='$accdb_id'"; mysql_query($sql); $message="Delete successfully.."; } $url=$server_ip."/USER/search_acc.php?message=$message"; echo "<script>window.location='$url'</script>"; exit(); }?> </div> </div> </p><form action="delete_account.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <div align="center" class="style6 style1">Delete Account Details</div> <p align="center"> </p> <div id="apDiv1"><a href="search_emp.php"></a></div> <table width="415" align="center"> <tr> <td width="106"><div align="right" class="projectboldtxt"> <div align="left" class="projectboldtxt">Account ID</div> </div></td> <td width="339"><label> <input type="text" name="txtaccid" id="txtaccid" value="<?php echo $_GET['id'];?>" readonly="readonly"/> </label></td> </tr> <tr> <td class="projectboldtxt">Account name</td> <td><input type="text" name="txtaccname" id="txtaccname" value="<?php echo $_GET['name'];?>" readonly="readonly"/></td> </tr> </table> <div id="apDiv2"><a href="search_emp.php"></a></div> <p> </p> <table width="435" align="center"> <tr> <td width="279" class="projectboldtxt"> Do you want to delete the Account...?</td> <td width="144"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> <a href="search_acc.php" class="projectboldtxt style2">Back</a></label></td> </tr> </table> <a href="search_emp.php"></a> </div> </div> </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>