UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
cpanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
add_village.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(); $("#block").select2(); if (id != "") { $.ajax({ method: 'POST', url: 'get_village.php', data: '&id=' + id, dataType: "JSON", success: function(data) { //var obj = JSON.stringify(data); // var str = $.parseJSON(obj); $('#hdid').val(data.hdid); $('#villagename').val(data.villagename); gettotalstate(data.stcode); getdistrict(data.stcode, data.distcode); getmanageblock(data.stcode,data.distcode,data.blockid); if (op == "Update") { $('#pageheading').text("Edit Village"); $('#pageheading1').text("Edit Village Name"); $('#btnopration').text("Update"); document.getElementById("villagename").focus(); } else if (op == "Delete") { $('#pageheading').text("Delete Village"); $('#pageheading1').text("Delete Village Name"); $('#btnopration').text("Delete"); document.getElementById("villagename").setAttribute('disabled', true); document.getElementById("state").setAttribute('disabled', true); document.getElementById("district").setAttribute('disabled', true); document.getElementById("block").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 getmanageblock(statevalue, disvalue,blockid) { if(blockid=="") statevalue= document.getElementById("state").value; $.ajax({ type: "POST", url: "get_manage_block.php", data: '&state_id=' + statevalue+'&district_id='+disvalue, success: function(res) { var data = JSON.parse(res); var sel = $("#block"); sel.empty(); for (var i = 0; i < data.length; i++) { if (data[i].bid == blockid) { sel.append('<option value="' + data[i].bid + '" selected=true>' + data[i] .blockname + '</option>'); } else { sel.append('<option value="' + data[i].bid + '">' + data[i] .blockname + '</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("block"); if (inputField3.value == "") { flag = false; alert("Please select block name"); document.getElementById("block").focus(); return false; } var inputField4 = document.getElementById("villagename"); if (inputField4.value == "") { flag = false; alert("Please enter village name"); document.getElementById("villagename").focus(); return false; } var state = document.getElementById("state").value; var district = document.getElementById("district").value; var block = document.getElementById("block").value; var villagename = document.getElementById("villagename").value; var hdid = document.getElementById("hdid").value; var btnopration = document.getElementById("btnopration").innerHTML; var text = "Do you want " + btnopration + " Village"; if (confirm(text) == false) { flag = false; return false; } try { if (flag == true) { var urlgetcode = 'manage_village.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&villagename=' + villagename + '&block=' + block + '&state=' + state + '&district=' + district + '&hdid=' + hdid + '&btnopration=' + btnopration, dataType: 'json', async: true, cache: false, success: function(msg) { if (msg == "1") { alert("Record save successfully"); $('#hdid').val(""); $('#villagename').val(""); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_village.php"; } else if (msg == "2") { alert("Record already exist"); $('#hdid').val(""); $('#villagename').val(""); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_village.php"; } else if (msg == "3") { alert("Record update successfully"); $('#hdid').val(""); $('#villagename').val(""); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_village.php"; } else if (msg == "4") { alert("Record delete successfully"); $('#hdid').val(""); $('#villagename').val(""); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#btnopration').text("Save"); window.location.href = "list_village.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 Village</label></b></td> <td width="50%" align="right"><a class="btn btn-default" href="list_village.php">Village 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" onChange="getmanageblock('',this.value,'');" 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 for="districtname" class="control-label">Block Name</label> <select name="block" id="block" 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">Village Name</label> <input type="text" class="form-control1" id="villagename" name="villagename" placeholder="Village 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