0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: group_delete_ctrl.php
<?php if(isset($_POST['Delete'])) { $groupname = $_POST['txtgroup']; $groupid=$_POST['txtgroupid']; $p_id=@$_SESSION['project_id']; $u_id=@$_SESSION['user_id']; $active_flag=0; $sql="select * from accgroup where user_id='$u_id' and project_id ='$p_id' and groupname ='$groupname'"; $sql=mysql_query($sql); while($row=mysql_fetch_array($sql)) { $table_id = $row['group_id']; } // checking wheter it is active $sql="select * from custemaccount_cashentry where user_id='$u_id' and project_id ='$p_id' and groupname='$groupname'"; $sql1=mysql_query($sql); $row=mysql_fetch_array($sql1); if($row!= NULL) { $active_flag=1; } $sql="select * from account where user_id='$u_id' and project_id ='$p_id' and group_name='$groupname'"; $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 { //Checking default accounts. Not allow to edit or delete $result=Common::defaultaccount_check($groupname,$acc_head,$acc_head_count); if($result=="True") { $message="Sorry. This is default account head. You cannot use it."; $error_flag=1; } if($error_flag==0) { $sql="delete from accgroup where group_id ='$table_id'"; mysql_query($sql); $message="Delete successfully.."; } } $url=$server_ip."/USER/search_group.php?message=$message"; echo "<script>window.location='$url'</script>"; /*include "search_group.php"; exit();*/ }?>