0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: project_delete.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"> <!-- .style2 { color: #660000; font-weight: bold; } .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); } .style7 { color: #990000; font-weight: bold; } #apDiv2 { position:absolute; width:65px; height:37px; z-index:1; left: 724px; top: 246px; background-image: url(../images/back_button_up.jpg); } --> </style> </head> <body> <p> <!--<div id="headerbg"> <div id="headerblank">--> <!--<div id="headerbg"> <div id="headerblank">--> <?php include("include/first_userheader.php"); $id=$_GET['project_id']; if(isset($_POST['Delete'])) { //$u_name=@$_SESSION['username']; $u_id=@$_SESSION['user_id']; $p_id=$_POST['txtpid']; $active_flag=0; $Projectcode= $_POST['txtproject_code']; $sql="select * from addproject where user_id='$u_id' and project_id ='$p_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { $project_proposels =$row['projectproposel']; } //$sql="select * from addproject where project_id ='$p_id'"; // $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 Project. You cannot delete this details."; } else { $DelFilePath = ROOT_DIR . $project_proposels ; if (file_exists($DelFilePath)) { unlink ($DelFilePath); } $sql="delete from addproject where user_id='$u_id' and project_id='$p_id'"; mysql_query($sql); $sql="delete from account where user_id='$u_id' and project_id='$p_id'"; mysql_query($sql); $sql="delete from accgroup where user_id='$u_id' and project_id='$p_id'"; mysql_query($sql); $message="Delete successfully.."; } $url="http://".$server_ip."/CPFMS/USER/search_project.php?message=$message"; echo "<script>window.location='$url'</script>"; }?> </div> </div> </p> <div align="center" class="projectboldtxt">Delete project Details </p> </div> <form action="project_delete.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <div id="apDiv1"><a href="search_project.php"><img src="../images/back_button_up.jpg" alt="" width="61" height="35" /></a></div> <table width="457" align="center"> <tr> <td width="106"><div align="right" class="projectboldtxt style4"> <div align="left" class="projectboldtxt">Project id</div> </div></td> <td width="339"><label> <input type="text" name="txtpid" id="txtpid" value="<?php echo $_GET['id'];?>" readonly="readonly"/> </label></td> </tr> <tr> <td width="106" class="projectboldtxt">Project code</td> <?php $p_code=@$_SESSION['project_code_s'];?> <td><input type="text" name="txtproject_code" id="txtproject_code" value=" <?php echo $p_code; ?>" readonly="readonly"/></td> </tr> </table> <p> </p> <table width="457" align="center"> <tr> <td width="212" class="projectboldtxt style6"> Do you want to delete the project...?</td> <td width="233"><label> <input type="submit" name="Delete" id="Delete" value="Delete" /> </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>