UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
epanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
add_farmer.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(); $("#village").select2(); if (id != "") { $.ajax({ method: 'POST', url: 'get_farmer_details.php', data: '&id=' + id, dataType: "JSON", success: function(data) { //var obj = JSON.stringify(data); // var str = $.parseJSON(obj); $('#hdid').val(data.hdid); $('#farmername').val(data.farmername); $('#fathername').val(data.fathername); $('#mobileno1').val(data.mobileno1); $('#mobileno2').val(data.mobileno2); $('#age').val(data.age); $('#gender').val(data.gender); gettotalstate(data.stcode); getdistrict(data.stcode, data.distcode); getmanageblock(data.stcode,data.distcode,data.blockid); gettotalvillage1(data.stcode,data.distcode,data.blockid,data.villageid); if (op == "Update") { $('#pageheading').text("Edit Farmer"); $('#pageheading1').text("Edit Farmer Details"); $('#btnopration').text("Update"); document.getElementById("farmername").focus(); } else if (op == "Delete") { $('#pageheading').text("Delete Farmer"); $('#pageheading1').text("Delete Farmer Details"); $('#btnopration').text("Delete"); document.getElementById("village").setAttribute('disabled', true); document.getElementById("state").setAttribute('disabled', true); document.getElementById("district").setAttribute('disabled', true); document.getElementById("block").setAttribute('disabled', true); document.getElementById("fathername").setAttribute('disabled', true); document.getElementById("mobileno1").setAttribute('disabled', true); document.getElementById("mobileno2").setAttribute('disabled', true); document.getElementById("age").setAttribute('disabled', true); document.getElementById("gender").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 gettotalvillage1(statevalue, disvalue,blockid,villageid) { $.ajax({ type: "POST", url: "get_manage_village.php", data: '&state_id=' + statevalue+'&district_id='+disvalue+'&block_id='+blockid, success: function(res) { var data = JSON.parse(res); var sel = $("#village"); sel.empty(); for (var i = 0; i < data.length; i++) { if (data[i].vid == villageid) { sel.append('<option value="' + data[i].vid + '" selected=true>' + data[i] .villagename + '</option>'); } else { sel.append('<option value="' + data[i].vid + '">' + data[i] .villagename + '</option>'); } } // $("#district").html(data); } }); } function gettotalvillage(statevalue, disvalue,blockid,villageid) { if(villageid=="") statevalue= document.getElementById("state").value; disvalue= document.getElementById("district").value; $.ajax({ type: "POST", url: "get_manage_village.php", data: '&state_id=' + statevalue+'&district_id='+disvalue+'&block_id='+blockid, success: function(res) { var data = JSON.parse(res); var sel = $("#village"); sel.empty(); for (var i = 0; i < data.length; i++) { if (data[i].vid == villageid) { sel.append('<option value="' + data[i].vid + '" selected=true>' + data[i] .villagename + '</option>'); } else { sel.append('<option value="' + data[i].vid + '">' + data[i] .villagename + '</option>'); } } // $("#district").html(data); } }); } function selectCountry(val) { $("#search-box").val(val); $("#suggesstion-box").hide(); } function saveformer() { var flag = true; var inputField1 = document.getElementById("state"); if (inputField1.value == "Select State") { flag = false; alert("Please select state name"); document.getElementById("state").focus(); return false; } var inputField2 = document.getElementById("district"); if (inputField2.value == "Select District") { flag = false; alert("Please select district name"); document.getElementById("district").focus(); return false; } var inputField3 = document.getElementById("block"); if (inputField3.value == "0") { flag = false; alert("Please select block name"); document.getElementById("block").focus(); return false; } var inputField4 = document.getElementById("village"); if (inputField4.value == "0") { flag = false; alert("Please enter village name"); document.getElementById("villagename").focus(); return false; } var inputField5 = document.getElementById("farmername"); if (inputField5.value == "") { flag = false; alert("Please enter farmer name"); document.getElementById("farmername").focus(); return false; } var inputField6 = document.getElementById("fathername"); if (inputField6.value == "") { flag = false; alert("Please enter father name"); document.getElementById("fathername").focus(); return false; } var inputField7 = document.getElementById("mobileno1"); if (inputField7.value == "") { flag = false; alert("Please enter mobileno1"); document.getElementById("mobileno1").focus(); return false; } var inputField8 = document.getElementById("age"); if (inputField8.value == "-") { flag = false; alert("Please select age"); document.getElementById("age").focus(); return false; } var inputField9 = document.getElementById("gender"); if (inputField9.value == "-") { flag = false; alert("Please select gender"); document.getElementById("gender").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("village").value; var farmername = document.getElementById("farmername").value; var fathername = document.getElementById("fathername").value; var mobileno1 = document.getElementById("mobileno1").value; var mobileno2 = document.getElementById("mobileno2").value; var age = document.getElementById("age").value; var gender = document.getElementById("gender").value; var hdid = document.getElementById("hdid").value; var btnopration = document.getElementById("btnopration").innerHTML; var text = "Do you want " + btnopration + " Farmer Details"; if (confirm(text) == false) { flag = false; return false; } try { if (flag == true) { var urlgetcode = 'manage_farmer_details.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&villagename=' + villagename + '&block=' + block + '&state=' + state + '&district=' + district +'&farmername=' + farmername +'&fathername=' + fathername+'&mobileno1=' + mobileno1+'&mobileno2=' + mobileno2+'&age=' + age+'&gender=' + gender + '&hdid=' + hdid + '&btnopration=' + btnopration, dataType: 'json', async: true, cache: false, success: function(msg) { if (msg == "1") { alert("Save Successfully"); $('#hdid').val(""); $('#village').val("Select"); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#farmername').val(""); $('#fathername').val(""); $('#mobileno1').val(""); $('#mobileno2').val(""); $('#age').val(""); $('#gender').val(""); $('#btnopration').text("Save"); window.location.href = "list_farmer.php"; } else if (msg == "2") { alert("Mobile No. Already Exist"); $('#village').val("Select"); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#farmername').val(""); $('#fathername').val(""); $('#mobileno1').val(""); $('#mobileno2').val(""); $('#age').val(""); $('#gender').val(""); $('#btnopration').text("Save"); window.location.href = "list_farmer.php"; } else if (msg == "3") { alert("Update Successfully"); $('#village').val("Select"); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#farmername').val(""); $('#fathername').val(""); $('#mobileno1').val(""); $('#mobileno2').val(""); $('#age').val(""); $('#gender').val(""); $('#btnopration').text("Save"); window.location.href = "list_farmer.php"; } else if (msg == "4") { alert("Delete Successfully"); $('#village').val("Select"); $('#block').val("Select"); $('#state').val("Select"); $('#district').val("Select"); $('#farmername').val(""); $('#fathername').val(""); $('#mobileno1').val(""); $('#mobileno2').val(""); $('#age').val(""); $('#gender').val(""); $('#btnopration').text("Save"); window.location.href = "list_farmer.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 Farmer</label></b></td> <td width="50%" align="right"><a class="btn btn-default" href="list_farmer.php">Farmer List</a></td> </tr> </table> </div> <!--//banner--> <!--grid--> <div class="validation-system"> <div class="validation-form"> <!----> <input type="hidden" class="form-control1" id="hdid" name="hdid"> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">State</label> <select onChange="getdistrict(this.value,'');" name="state" id="state" class="form-control" style="width: 100%;" required> </select> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">District</label> <select name="district" id="district" onChange="getmanageblock('',this.value,'');" class="form-control" style="width: 100%;"> </select> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Block</label> <select name="block" id="block" onChange="gettotalvillage('','',this.value,'');" class="form-control" style="width: 100%;" required> </select> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Village</label> <select name="village" id="village" class="form-control" style="width: 100%;"> </select> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Farmer Name</label> <input type="text" class="form-control1" id="farmername" name="farmername" placeholder="Farmer Name" required=""> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Father's Name</label> <input type="text" class="form-control1" id="fathername" name="fartername" placeholder="Father's Name"> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Mobile No.1</label> <input type="text" class="form-control1" id="mobileno1" name="mobileno1" placeholder="Mobile No.1" required=""> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Mobile No.2</label> <input type="text" class="form-control1" id="mobileno2" name="mobileno2" placeholder="Mobile No.2"> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Age (in Years)</label> <select name="age" id="age" class="form-control1"> <option>-</option> <option>99</option> <option>98</option> <option>97</option> <option>96</option> <option>95</option> <option>94</option> <option>93</option> <option>92</option> <option>91</option> <option>90</option> <option>89</option> <option>88</option> <option>87</option> <option>86</option> <option>85</option> <option>84</option> <option>83</option> <option>82</option> <option>81</option> <option>80</option> <option>79</option> <option>78</option> <option>77</option> <option>76</option> <option>75</option> <option>74</option> <option>73</option> <option>72</option> <option>71</option> <option>70</option> <option>69</option> <option>68</option> <option>67</option> <option>66</option> <option>65</option> <option>64</option> <option>63</option> <option>62</option> <option>61</option> <option>60</option> <option>59</option> <option>58</option> <option>57</option> <option>56</option> <option>55</option> <option>54</option> <option>53</option> <option>52</option> <option>51</option> <option>50</option> <option>49</option> <option>48</option> <option>47</option> <option>46</option> <option>45</option> <option>44</option> <option>43</option> <option>42</option> <option>41</option> <option>40</option> <option>39</option> <option>38</option> <option>37</option> <option>36</option> <option>35</option> <option>34</option> <option>33</option> <option>32</option> <option>31</option> <option>30</option> <option>29</option> <option>28</option> <option>27</option> <option>26</option> <option>25</option> <option>24</option> <option>23</option> <option>22</option> <option>21</option> <option>20</option> </select> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Gender</label> <select name="gender" id="gender" class="form-control1"> <option>-</option> <option>Male</option> <option>Female</option> </select> </div> <div class="clearfix"> </div> </div> <div class="col-md-12 form-group"> <button type="submit" id="btnopration" onclick="saveformer();" class="btn btn-primary">Save</button> </div> <div class="clearfix"> </div> <!----> </div> </div> <!--//grid--> <?php include "footer.php";?>
Copyright © 2025 - UnknownSec