UnknownSec Bypass
403
:
/
var
/
www
/
cotutilitydash
/ [
drwxrwxr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
cross_result1.php
<?php include "header.php"?> <?php include "sidemenu.php"?> <div id="page-wrapper"> <div class="col-md-12 graphs"> <div class="xs"> <div class="bs-example4 tab-content" data-example-id="simple-responsive-table"> <h3>Consumption Report </h3> <div class="table-responsive"> <?php $area=$_GET['area']; $equipment=$_GET['equipment']; $subarea1=$_GET['subarea']; $monthname=$_GET['monthname']; $monthyear=$_GET['monyear']; $day=0; $mon=0; $yea=$monthyear; $fromdate=""; $todate=""; if($monthname=="January") { $day=31; $mon=1; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="February") { if($yea%4==0) $day=29; else $day=28; $mon=2; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="March") { $day=31; $mon=3; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="April") { $day=30; $mon=4; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="May") { $day=31; $mon=5; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="June") { $day=30; $mon=6; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="July") { $day=31; $mon=7; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="August") { $day=31; $mon=8; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="September") { $day=30; $mon=9; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="October") { $day=31; $mon=10; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="November") { $day=30; $mon=11; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } else if($monthname=="December") { $day=31; $mon=12; $fromdate=$yea.'-'.$mon.'-'.'01'; $todate=$yea.'-'.$mon.'-'. $day; } ?> <?php $query="SELECT area,equipment,subarea,"; for ($x = 1; $x <= $day; $x++) { $query.= "Sum(CASE WHEN consuptiondate='$yea-$mon-$x' Then totalconsumption else 0 end) as '$x-$mon-$yea'"; //if($x<$day) //{ $query.=","; //} } if(trim($subarea1)=="") { $query.=" (SELECT Max(totalconsumption) from v_consumptiondetails as con1 WHERE con1.area=con.area and con1.equipment=con.equipment and con1.subarea=con.subarea and consuptiondate BETWEEN '".$fromdate."' and '".$todate."' GROUP by con1.area,con1.subarea) as maxcon, (SELECT Min(totalconsumption) from v_consumptiondetails as con1 WHERE con1.area=con.area and con1.equipment=con.equipment and con1.subarea=con.subarea and consuptiondate BETWEEN '".$fromdate."' and '".$todate."' GROUP by con1.area,con1.subarea) as mincon from v_consumptiondetails as con where area='".$area."' and equipment='".$equipment."' and consuptiondate between '".$fromdate."' and '".$todate."' GROUP by area,equipment,subarea"; $result=mysqli_query($conn, $query) or die("Query Failed."); } else { $newStr = explode(",", $subarea1); //$newStr= json_decode($_POST["subarea"], true); $subdata=""; $arrLength = count($newStr); for($i = 0; $i < $arrLength; $i++) { if($i==$arrLength-1) { $subdata= $subdata. "'".$newStr[$i]."'"; } else { $subdata= $subdata."'".$newStr[$i]."'".','; } } $query.=" (SELECT Max(totalconsumption) from v_consumptiondetails as con1 WHERE con1.area=con.area and con1.equipment=con.equipment and con1.subarea=con.subarea and consuptiondate BETWEEN '".$fromdate."' and '".$todate."' GROUP by con1.area,con1.subarea) as maxcon, (SELECT Min(totalconsumption) from v_consumptiondetails as con1 WHERE con1.area=con.area and con1.equipment=con.equipment and con1.subarea=con.subarea and consuptiondate BETWEEN '".$fromdate."' and '".$todate."' GROUP by con1.area,con1.subarea) as mincon from v_consumptiondetails as con where area='".$area."' and equipment='".$equipment."' and subarea in(".$subdata.") and consuptiondate between '".$fromdate."' and '".$todate."' GROUP by area,equipment,subarea"; $result=mysqli_query($conn, $query) or die("Query Failed."); } //echo $query; ?> <table id="studtable" class="table table-striped table-bordered"> <thead> <tr> <th> Area</th> <th> Equipment</th> <th> SubArea</th> <?php for ($i = 1; $i <= $day; $i++) { ?> <th><?php $coldate=$i.'-'.$mon.'-'.$yea; print $coldate?> </th> <?php } ?> <th> Min</th> <th> Max</th> </tr> </thead> <?php while ($row = mysqli_fetch_assoc($result)) { ?> <tr> <td> <?php echo $row['area']; ?> </td> <td> <?php echo $row['equipment']; ?> </td> <td> <?php echo $row['subarea']; ?> </td> <?php for ($k = 1; $k <= $day; $k++) { ?> <td><?php $coldate=$k.'-'.$mon.'-'.$yea; echo $row[$coldate]; ?></td> <?php } ?> <td> <?php echo $row['mincon']; ?> </td> <td> <?php echo $row['maxcon']; ?> </td> </tr> <?php } ?> </table> </div><!-- /.table-responsive --> </div> </div> <head> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/r/dt/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.9,af-2.0.0,b-1.0.3,b-colvis-1.0.3,b-html5-1.0.3,b-print-1.0.3,se-1.0.1/datatables.min.css" /> <script type="text/javascript" src="https://cdn.datatables.net/r/dt/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.9,af-2.0.0,b-1.0.3,b-colvis-1.0.3,b-html5-1.0.3,b-print-1.0.3,se-1.0.1/datatables.min.js"> </script> </head> <script> function getarea(val) { $.ajax({ type: "Post", url: "get_area.php", success: function(res) { var data = JSON.parse(res); var sel = $("#area"); sel.empty(); $("#area").append('<option>Select Area</option>'); for (var i = 0; i < data.length; i++) { if (data[i].tname == val) { sel.append('<option value="' + data[i].tname + '" selected=true>' + data[i] .tname + '</option>'); } else { sel.append('<option value="' + data[i].tname + '">' + data[i].tname + '</option>'); } } // $('#particular').editableSelect(); /// $("#state").html(data); } }); } $(document).ready(function(){ $("#studtable").DataTable({ bLengthChange: true, "iDisplayLength": 10, bInfo: false, responsive: true, "bAutoWidth": false, dom: 'lBfrtip', buttons: [ {extend: 'copy', attr: {id: 'allan'}}, 'csv', 'excel', 'pdf' ] }); }); function checkpermission() { var formname = "manage_subarea.php"; try { var urlgetcode = 'get_permissiondetails.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&formname=' + formname, dataType: 'json', async: true, cache: false, success: function(data) { var btntext= document.getElementById("btnsave").innerHTML; if(btntext=="SAVE") { if(data.add==0) { $(btnsave).prop("disabled", true); alert("You do not have permission to add area please contact to administrator"); return; } else { $(btnsave).prop("disabled", false); } } else if(btntext=="UPDATE") { if(data.edit==0) { $(btnsave).prop("disabled", true); alert("You do not have permission to edit area please contact to administrator"); return; } else { $(btnsave).prop("disabled", false); } } else if(btntext=="DEACTIVE") { if(data.delete==0) { $(btnsave).prop("disabled", true); alert("You do not have permission to deactive area please contact to administrator"); return; } else { $(btnsave).prop("disabled", false); } } else if(btntext=="ACTIVE") { if(data.delete==0) { $(btnsave).prop("disabled", true); alert("You do not have permission to active area please contact to administrator"); return; } else { $(btnsave).prop("disabled", false); } } }, error: function(request) { alert(request.responseText); } }); } catch (Error) { alert(Error); } return; } function clearall() { $('#hdid').val(""); $('#area').val("Select Area"); $('#subarea').val(""); $('#mincon').val(""); $('#maxcon').val(""); document.getElementById("btnsave").innerHTML = "SAVE"; checkpermission(); } function remove(id) { var id = id; try { var urlgetcode = 'get_arealist.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&id=' + id, dataType: 'json', async: true, cache: false, success: function(data) { $('#hdid').val(data.parcode); $('#area').val(data.parname); $('#subarea').val(data.subarea); $('#mincon').val(data.mincon); $('#maxcon').val(data.maxcon); if(data.status==0) { document.getElementById("btnsave").innerHTML = "DEACTIVE"; } else { document.getElementById("btnsave").innerHTML = "ACTIVE"; } checkpermission(); }, error: function(request) { alert(request.responseText); } }); } catch (Error) { alert(Error); } return; } function edit(id) { var id = id; try { var urlgetcode = 'get_arealist.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&id=' + id, dataType: 'json', async: true, cache: false, success: function(data) { $('#hdid').val(data.parcode); $('#area').val(data.parname); $('#subarea').val(data.subarea); $('#mincon').val(data.mincon); $('#maxcon').val(data.maxcon); document.getElementById("btnsave").innerHTML = "UPDATE"; checkpermission(); }, error: function(request) { alert(request.responseText); } }); } catch (Error) { alert(Error); } return; } function curdsubarea() { var flag = true; var inputField1 = document.getElementById("area"); if (inputField1.value == "Select Area") { flag = false; alert("Please select area."); document.getElementById("area").focus(); return false; } var inputField2 = document.getElementById("subarea"); if (inputField2.value == "") { flag = false; alert("Please enter subarea."); document.getElementById("subarea").focus(); return false; } var inputField3 = document.getElementById("mincon"); if (inputField3.value == "") { flag = false; alert("Please enter minimum consumption."); document.getElementById("mincon").focus(); return false; } var inputField4 = document.getElementById("maxcon"); if (inputField4.value == "") { flag = false; alert("Please enter max consumption."); document.getElementById("maxcon").focus(); return false; } var digits = "0123456789."; var temp; for (var i = 0; i < document.getElementById("mincon").value.length; i++) { temp = document.getElementById("mincon").value.substring(i, i + 1); if (digits.indexOf(temp) == -1) { alert("Use only numeric digits."); document.getElementById("mincon").focus(); return false; } } for (var i = 0; i < document.getElementById("maxcon").value.length; i++) { temp = document.getElementById("maxcon").value.substring(i, i + 1); if (digits.indexOf(temp) == -1) { alert("Use only numeric digits."); document.getElementById("maxcon").focus(); return false; } } var area = document.getElementById("area").value; var subarea = document.getElementById("subarea").value; var mincon = document.getElementById("mincon").value; var maxcon = document.getElementById("maxcon").value; var id = document.getElementById("hdid").value; var btnopration = document.getElementById("btnsave").innerHTML; var identifier = 2; try { if (flag == true) { var text = "Do you want to "+btnopration +" the subarea"; if (confirm(text) == false) { flag = false; return false; } var urlgetcode = 'mst_curd_subarea.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&area=' + area+'&subarea=' + subarea + '&id=' + id + '&mincon=' + mincon + '&maxcon=' + maxcon + '&btnopration=' + btnopration + '&identifier=' + identifier, dataType: 'json', async: true, cache: false, success: function(data) { alert(data); window.location.href = "manage_subarea.php"; $('#hdid').val(""); $('#area').val(""); $('#subarea').val(""); $('#mincon').val(""); $('#maxcon').val(""); }, error: function(request) { alert(request.responseText); } }); } } catch (Error) { alert(Error); } return; } </script> <?php include "footer.php"?>
Copyright © 2025 - UnknownSec