UnknownSec Bypass
403
:
/
var
/
www
/
jpsagrisolution
/
cpanel
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
add_employee.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 != 'undefind') { $.ajax({ method: 'POST', url: 'get_employee.php', data: '&id=' + id, dataType: "JSON", success: function(data) { //var obj = JSON.stringify(data); // var str = $.parseJSON(obj); $('#hdid').val(data.hdid); $('#employeename').val(data.employeename); $('#designation').val(data.designation); $('#gender').val(data.gender); $('#maritalstatus').val(data.maritalstatus); $('#dateofbirth').val(data.dateofbirth); $('#dateofjoining').val(data.dateofjoining); $('#mobileno').val(data.mobileno); $('#emailid').val(data.emailid); $('#aadharno').val(data.aadharno); $('#panno').val(data.panno); $('#currentaddress').val(data.currentaddress); $('#parmanentaddress').val(data.parmanentaddress); gettotalstate(data.stcode); getdistrict(data.stcode, data.distcode); $('#username').val(data.username); $('#userpassword').val(data.userpassword); if (op == "Update") { $('#pageheading').text("Edit Employee"); $('#btnopration').text("Update"); document.getElementById("employeename").focus(); } else if (op == "Delete") { $('#pageheading').text("Delete Employee"); $('#btnopration').text("Delete"); document.getElementById("employeename").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 saveemployee() { var flag = true; var inputField1 = document.getElementById("employeename"); if (inputField1.value == "") { flag = false; alert("Please enter employee name"); document.getElementById("employeename").focus(); return false; } var inputField2 = document.getElementById("designation"); if (inputField2.value == "-") { flag = false; alert("Please enter employee name"); document.getElementById("designation").focus(); return false; } var inputField3 = document.getElementById("gender"); if (inputField3.value == "-") { flag = false; alert("Please select gender type"); document.getElementById("gender").focus(); return false; } var inputField4 = document.getElementById("maritalstatus"); if (inputField4.value == "-") { flag = false; alert("Please select marital status"); document.getElementById("maritalstatus").focus(); return false; } var inputField5 = document.getElementById("dateofbirth"); if (inputField5.value == "") { flag = false; alert("Please enter date of birth"); document.getElementById("dateofbirth").focus(); return false; } var inputField6 = document.getElementById("dateofjoining"); if (inputField6.value == "") { flag = false; alert("Please enter date of joining"); document.getElementById("dateofjoining").focus(); return false; } var inputField7 = document.getElementById("mobileno"); if (inputField7.value == "") { flag = false; alert("Please enter mobile no."); document.getElementById("mobileno").focus(); return false; } var inputField8 = document.getElementById("emailid"); if (inputField8.value == "") { flag = false; alert("Please enter email id"); document.getElementById("emailid").focus(); return false; } var inputField9 = document.getElementById("aadharno"); if (inputField9.value == "") { flag = false; alert("Please enter aadhar no."); document.getElementById("aadharno").focus(); return false; } var inputField10 = document.getElementById("panno"); if (inputField10.value == "") { flag = false; alert("Please enter pan card no."); document.getElementById("panno").focus(); return false; } var inputField11 = document.getElementById("currentaddress"); if (inputField11.value == "") { flag = false; alert("Please enter current address"); document.getElementById("currentaddress").focus(); return false; } var inputField12 = document.getElementById("parmanentaddress"); if (inputField12.value == "") { flag = false; alert("Please enter parmanent address"); document.getElementById("parmanentaddress").focus(); return false; } var inputField13 = document.getElementById("state"); if (inputField13.value == "Select") { flag = false; alert("Please select state name"); document.getElementById("state").focus(); return false; } var inputField14 = document.getElementById("district"); if (inputField14.value == "Select District") { flag = false; alert("Please select district name"); document.getElementById("district").focus(); return false; } var inputField15 = document.getElementById("username"); if (inputField15.value == "") { flag = false; alert("Please enter user name"); document.getElementById("username").focus(); return false; } var inputField16 = document.getElementById("userpassword"); if (inputField16.value == "") { flag = false; alert("Please enter user password"); document.getElementById("userpassword").focus(); return false; } var employeename = document.getElementById("employeename").value; var designation = document.getElementById("designation").value; var gender = document.getElementById("gender").value; var maritalstatus = document.getElementById("maritalstatus").value; var dateofbirth = document.getElementById("dateofbirth").value; var dateofjoining = document.getElementById("dateofjoining").value; var mobileno = document.getElementById("mobileno").value; var emailid = document.getElementById("emailid").value; var aadharno = document.getElementById("aadharno").value; var panno = document.getElementById("panno").value; var currentaddress = document.getElementById("currentaddress").value; var parmanentaddress = document.getElementById("parmanentaddress").value; var state = document.getElementById("state").value; var district = document.getElementById("district").value; var username = document.getElementById("username").value; var userpassword = document.getElementById("userpassword").value; var usertype = "user"; var hdid = document.getElementById("hdid").value; var btnopration = document.getElementById("btnopration").innerHTML; var text = "Do You Want " + btnopration + " Employee"; if (confirm(text) == false) { flag = false; return false; } try { if (flag == true) { var urlgetcode = 'manage_employee.php'; $.ajax({ method: 'POST', url: urlgetcode, data: '&employeename=' + employeename + '&designation=' + designation + '&gender=' + gender + '&maritalstatus=' + maritalstatus + '&dateofbirth=' + dateofbirth + '&dateofjoining=' + dateofjoining + '&mobileno=' + mobileno + '&emailid=' + emailid + '&aadharno=' + aadharno + '&panno=' + panno + '¤taddress=' + currentaddress + '&parmanentaddress=' + parmanentaddress + '&state=' + state + '&district=' + district + '&username=' + username + '&userpassword=' + userpassword + '&usertype=' + usertype + '&hdid=' + hdid + '&btnopration=' + btnopration, dataType: 'json', async: true, cache: false, success: function(msg) { if (msg == "1") { alert("Save Successfully"); $('#hdid').val(""); $('#employeename').val(""); $('#designation').val("-"); $('#gender').val("-"); $('#maritalstatus').val("-"); $('#dateofbirth').val(""); $('#dateofjoining').val(""); $('#mobileno').val(""); $('#emailid').val(""); $('#aadharno').val(""); $('#panno').val(""); $('#currentaddress').val(""); $('#parmanentaddress').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#username').val(""); $('#userpassword').val(""); $('#btnopration').text("Save"); window.location.href = "list_employee.php"; } else if (msg == "2") { alert("Employee with same name, post & mobile no. already exist"); $('#hdid').val(""); $('#employeename').val(""); $('#designation').val("-"); $('#gender').val("-"); $('#maritalstatus').val("-"); $('#dateofbirth').val(""); $('#dateofjoining').val(""); $('#mobileno').val(""); $('#emailid').val(""); $('#aadharno').val(""); $('#panno').val(""); $('#currentaddress').val(""); $('#parmanentaddress').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#username').val(""); $('#userpassword').val(""); $('#btnopration').text("Save"); window.location.href = "list_employee.php"; } else if (msg == "3") { alert("Update Successfully"); $('#hdid').val(""); $('#employeename').val(""); $('#designation').val("-"); $('#gender').val("-"); $('#maritalstatus').val("-"); $('#dateofbirth').val(""); $('#dateofjoining').val(""); $('#mobileno').val(""); $('#emailid').val(""); $('#aadharno').val(""); $('#panno').val(""); $('#currentaddress').val(""); $('#parmanentaddress').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#username').val(""); $('#userpassword').val(""); $('#btnopration').text("Save"); window.location.href = "list_employee.php"; } else if (msg == "4") { alert("Delete Successfully"); $('#hdid').val(""); $('#employeename').val(""); $('#designation').val("-"); $('#gender').val("-"); $('#maritalstatus').val("-"); $('#dateofbirth').val(""); $('#dateofjoining').val(""); $('#mobileno').val(""); $('#emailid').val(""); $('#aadharno').val(""); $('#panno').val(""); $('#currentaddress').val(""); $('#parmanentaddress').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#username').val(""); $('#userpassword').val(""); $('#btnopration').text("Save"); window.location.href = "list_employee.php"; } else if (msg == "5") { alert("Employee can not be deleted because it is in use"); $('#hdid').val(""); $('#employeename').val(""); $('#designation').val("-"); $('#gender').val("-"); $('#maritalstatus').val("-"); $('#dateofbirth').val(""); $('#dateofjoining').val(""); $('#mobileno').val(""); $('#emailid').val(""); $('#aadharno').val(""); $('#panno').val(""); $('#currentaddress').val(""); $('#parmanentaddress').val(""); $('#state').val("Select"); $('#district').val("Select"); $('#username').val(""); $('#userpassword').val(""); $('#btnopration').text("Save"); window.location.href = "list_employee.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 Employee</label></b></td> <td width="50%" align="right"><a class="btn btn-default" href="list_employee.php">Employee List</a></td> </tr> </table> </div> <!--//banner--> <!--grid--> <div class="validation-system"> <div class="validation-form"> <!----> <div class="vali-form"> <input type="hidden" class="form-control1" id="hdid" name="hdid"> <div class="col-md-6 form-group1"> <label class="control-label">Emplyee Name</label> <input type="text" class="form-control1" id="employeename" name="employeename" placeholder="Employee Name" required=""> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Designation</label> <input type="text" class="form-control1" id="designation" name="designation" placeholder="Designation"> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <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="col-md-6 form-group1 form-last"> <label class="control-label">Marital Status</label> <select name="maritalstatus" id="maritalstatus" class="form-control1"> <option>-</option> <option>Married</option> <option>Un-Married</option> </select> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Date Of Birth</label> <input type="date" class="form-control1" id="dateofbirth" name="dateofbirth" placeholder="Date Of Birth"> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Date Of Joining</label> <input type="date" class="form-control1" id="dateofjoining" name="dateofjoining" placeholder="Date Of Joining"> </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.</label> <input type="text" class="form-control1" id="mobileno" name="mobileno" placeholder="Mobile No." required> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Email id</label> <input type="text" class="form-control1" id="emailid" name="emailid" placeholder="Email Id" required> </div> <div class="clearfix"> </div> </div> <div class="vali-form vali-form1"> <div class="col-md-6 form-group1"> <label class="control-label">Aadhar No.</label> <input type="text" class="form-control1" id="aadharno" name="aadharno" placeholder="Aadhar No."> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Pan No.</label> <input type="text" class="form-control1" id="panno" name="panno" placeholder="Pan No."> </div> <div class="clearfix"> </div> </div> <div class="col-md-12 form-group1 group-mail"> <label class="control-label">Current Address</label> <textarea name="currentaddress" id="currentaddress" cols="50" rows="4" class="form-control1"></textarea> <div class="clearfix"> </div> </div> <div class="col-md-12 form-group1 group-mail"> <label class="control-label">Parmanent Address</label> <textarea name="parmanentaddress" id="parmanentaddress" cols="50" rows="4" class="form-control1"></textarea> <div class="clearfix"> </div> </div> <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" 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">User Name</label> <input type="text" class="form-control1" id="username" name="username" placeholder="User Name" required> </div> <div class="col-md-6 form-group1 form-last"> <label class="control-label">Password</label> <input type="text" class="form-control1" id="userpassword" name="userpassword" placeholder="Password" required> </div> <div class="clearfix"> </div> </div> <div class="col-md-12 form-group"> <button type="submit" id="btnopration" class="btn btn-primary" onclick="saveemployee();">Save</button> </div> <div class="clearfix"> </div> <!----> </div> </div> <!--//grid--> <?php include "footer.php";?>
Copyright © 2025 - UnknownSec