UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
cpanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
add_block.php
<?php include "top.php";?> <script> $(document).ready(function() { var stateid = ""; gettotalstate(stateid); var id = getUrlVars()['id']; var op = getUrlVars()['op']; // Initialize State select2 $("#state").select2(); // Initialize District select2 $("#district").select2(); if (id != "") { $.ajax({ method: 'POST', url: 'get_block.php', data: '&id=' + id, dataType: "JSON", success: function(data) { //var obj = JSON.stringify(data); // var str = $.parseJSON(obj); $('#hdid').val(data.hdid); $('#blockname').val(data.blockname); gettotalstate(data.stcode); getdistrict(data.stcode, data.distcode); if (op == "Update") { $('#pageheading').text("Edit Block"); $('#pageheading1').text("Edit Block Name"); $('#btnopration').text("Update"); document.getElementById("blockname").focus(); } else if (op == "Delete") { $('#pageheading').text("Delete Block"); $('#pageheading1').text("Delete Block Name"); $('#btnopration').text("Delete"); document.getElementById("blockname").setAttribute('disabled', true); document.getElementById("state").setAttribute('disabled', true); document.getElementById("district").setAttribute('disabled', true); } } }); } }); function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } function gettotalstate(val) { $.ajax({ type: "Get", url: "get_total_state.php", success: function(res) { var data = JSON.parse(res); var sel = $("#state"); sel.empty(); $("#state").append('<option>Select State</option>'); for (var i = 0; i < data.length; i++) { if (data[i].stcode == val) { sel.append('<option value="' + data[i].stcode + '" selected=true>' + data[i] .statename + '</option>'); } else { sel.append('<option value="' + data[i].stcode + '">' + data[i].statename + '</option>'); } } /// $("#state").html(data); } }); } function getdistrict(val, disvalue) { $.ajax({ type: "POST", url: "get_district.php", data: 'state_id=' + val, success: function(res) { var data = JSON.parse(res); var sel = $("#district"); sel.empty(); $("#district").append('<option>Select District</option>'); for (var i = 0; i < data.length; i++) { if (data[i].distcode == disvalue) { sel.append('<option value="' + data[i].distcode + '" selected=true>' + data[i] .districtname + '</option>'); } else { sel.append('<option value="' + data[i].distcode + '">' + data[i].districtname + '</option>'); } } // $("#district").html(data); } }); } function selectCountry(val) { $("#search-box").val(val); $("#suggesstion-box").hide(); } function saveblock() { var flag = true; var inputField11 = document.getElementById("state"); if (inputField11.value == "Select State") { flag = false; alert("Please select state name"); document.getElementById("state").focus(); return false; } var inputField12 = document.getElementById("district"); if (inputField12.value == "Select District") { flag = false; alert("Please select district name"); document.getElementById("district").focus(); return false; } var inputField3 = document.getElementById("blockname"); if (inputField3.value == "") { flag = false; alert("Please enter block name"); document.getElementById("blockname").focus(); return false; } var state = document.getElementById("state").value; var district = document.getElementById("district").value; var blockname = document.getElementById("blockname").value; var hdid = document.getElementById("hdid").value; var btnopration = document.getElementById("btnopration").innerHTML; var text = "Do You Want " + btnopration + " Block"; if (confirm(text) == false) { flag = false; return false; } try { if (flag == true) { var urlgetcode = 'manage_block.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&blockname=' + blockname + '&state=' + state + '&district=' + district + '&hdid=' + hdid + '&btnopration=' + btnopration, dataType: 'json', async: true, cache: false, success: function(msg) { if (msg == "1") { alert("Save Successfully"); $('#hdid').val(""); $('#blockname').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_block.php"; } else if (msg == "2") { alert("Already Exist"); $('#hdid').val(""); $('#blockname').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_block.php"; } else if (msg == "3") { alert("Update Successfully"); $('#hdid').val(""); $('#blockname').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_block.php"; } else if (msg == "4") { alert("Delete Successfully"); $('#hdid').val(""); $('#blockname').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_block.php"; } }, error: function(request) { alert(request.responseText); } }); } } catch (Error) { alert(Error); } return; } </script> <div id="page-wrapper" class="gray-bg dashbard-1"> <div class="content-main"> <!--banner--> <div class="banner"> <table width="100%"> <tr> <td width="50%"><b><label name="pageheading" id="pageheading">Add Block</label></b></td> <td width="50%" align="right"><a class="btn btn-default" href="list_block.php">Block List</a></td> </tr> </table> </div> <!--//banner--> <!--grid--> <div class=" profile"> <div class="profile-bottom"> <h3><i class="fa fa-edit"></i><label name="pageheading1" id="pageheading1" class="control-label">Add District Name</label></h3> <div class="col-md-12 form-group1 group-mail"> <input type="hidden" class="form-control1" name="hdid" id="hdid"> <label class="control-label">State Name</label> <select name="state" onChange="getdistrict(this.value,'');" id="state" class="form-control1" style="width: 100%;"> </select> </div> <div class="clearfix"> </div> <div class="form-group"> <div class="col-sm-12 form-group1 group-mail"> <label for="districtname" class="control-label">District Name</label> <select name="district" id="district" class="form-control1" style="width: 100%;"> </select> </div> </div> <div class="clearfix"> </div> <div class="form-group"> <div class="col-sm-12 form-group1 group-mail"> <label class="control-label">Block Name</label> <input type="text" class="form-control1" id="blockname" name="blockname" placeholder="Block Name"> </div> </div> <div class="clearfix"> </div> <div class="col-md-12 form-group"> <button type="submit" id="btnopration" class="btn btn-default" onclick="saveblock();">Save</button> </div> <div class="clearfix"> </div> </div> </div> <!--//grid--> <?php include "footer.php";?>
Copyright © 2025 - UnknownSec