0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.116.118.214


Current Path : /var/www/html/univadmin/rrit/js/
Upload File :
Current File : /var/www/html/univadmin/rrit/js/mainAdm.js

function getDashboard() {
  $("#app-dashboard").load("../admin/dashboard.html", function () {
    dashboardLeads();
  });
}

function dashboardLeads() {
  $.ajax({
    type: "GET",
    url: "../php/dashboardLeads.php",
    success: function (res) {
      let response = JSON.parse(res);
      if (response.error_code === 0) {
        $("#leads").html(response.Leads.count);
        $("#registered").html(response.Reg.count);
      } else if (response.error_code == -1) {
        alert(response.msg);
        window.location.href = "register.html";
        return;
      } else {
        $("#leads").html(0);
        $("#registered").html(0);
      }
    },
  });
}

function getData() {
  $.ajax({
    type: "GET",
    url: "../php/getLeadDet.php",
    success: function (response) {
      let res = JSON.parse(response);
      $("#app-dashboard").load("../admin/leads.html", function () {
        let leadDet = "";
        leadDet += `<table class="table table-bordered" style = "position: relative;
        border-collapse: collapse; ">
        <thead style="position: sticky,
        top: 0,">
          <tr>
            <th scope="col">Application No.</th>
            <th scope="col">Student Name</th>
            <th scope="col">Mobile No.</th>
            <th scope="col">E-mail ID</th>
            <th scope="col">Specializtion</th>
            <th scope="col">Date</th>
            <th scope="col">Sources</th>
            <th scope="col">Status</th>
            <th scope="col">Remarks</th>
            <th scope="col">Save</th>
          </tr>
        </thead>
        <tbody>`;
        for (var i = 0; i < res.length; i++) {
          leadDet += `<tr>`;
          leadDet += `<td><p href="#" id="myBtn" onclick="appDet('${res[i]["fappno"]}')">${res[i]["fappno"]}</p></td>`;
          leadDet += `<td>${res[i]["fname"]}</td>`;
          leadDet += `<td>${res[i]["fmob"]}</td>`;
          leadDet += `<td>${res[i]["femail"]}</td>`;
          leadDet += `<td>${res[i]["fspecial"]}</td>`;
          leadDet += `<td>${res[i]["fcreateddate"]}</td>`;
          leadDet += `<td>${res[i]["freferstatus"]}</td>`;
          leadDet += `<td>
              <select class="select form-control" id="status">
                <option value="2">Interested</option>
                <option value="3">Not Interested</option>
              </select>
            </td>`;
          leadDet += `<td><input
                    type="text"
                    id='remarks_${i}'
                    class="form-control form-control"
                    value=""
                    required
                    /></td>`;
          leadDet += `<td><button type="button" class="btn btn-outline-success" onclick="saveStdDet('${res[i]["fappno"]}',${i})">Save</button></td>`;
          leadDet += `</tr>`;
        }
        leadDet += `</tbody>
          </table>`;
        $("#leadDet").html(leadDet);
      });
    },
  });
}

function saveStdDet(appno, i) {
  var rem = $("#remarks_" + i).val();
  console.log(appno, rem);
}

function appDet(appn) {
  var appno = appn;
  $.ajax({
    type: "POST",
    url: "../php/appDet.php",
    data: "appno=" + appno,
    success: function (response) {
      let res = JSON.parse(response);
      var det = res.data;
      $("#app-dashboard").load("../admin/appmodel.html", function () {
        if (det.fpaymentstatus == "T") {
          var status = appno + "- Payment Successfully Done";
        } else {
          var status = appno + "- Payment was not Done";
        }
        console.log(status, det);
        $("#stddet").val(status);
        $("#appDet").load("../html_modules/personal.html", function () {
          var spli = det.fstate;
          var state = spli.split("-");
          $("#sname").val(det.fname);
          $("#fmob").val(det.fmob);
          $("#femail").val(det.femail);
          $("#fatname").val(det.ffatname);
          $("#birthdayDate").val(det.fdob);
          $("#category").val(det.fcate);
          $("#nation").val(det.fnation);
          $("#fatno").val(det.ffatmob);
          $("#motname").val(det.fmotname);
          $("#refer").val(det.freferstatus);
          $("#relig").val(det.freligion);
          $("#aadhaarNo").val(det.faadhaarno);
          $("#add1").val(det.fadd1);
          $("#add2").val(det.fadd2);
          $("#add3").val(det.fadd3);
          $("#country").val(det.fcountry);
          $("#state").val(state[0]);
          $("#district").val(det.fdistrict);
          $("#pincode").val(state[1]);
        });
      });
    },
  });
}

function getRegData() {
  $.ajax({
    type: "GET",
    url: "../php/getRegDet.php",
    success: function (response) {
      let res = JSON.parse(response);
      $("#app-dashboard").load("../admin/registered.html", function () {
        let leadDet = "";
        leadDet += `<table class="table table-bordered" style = "position: relative;
          border-collapse: collapse; ">
          <thead style="position: sticky,
          top: 0,">
            <tr>
              <th scope="col" >Application No.</th>
              <th scope="col" >Student Name</th>
              <th scope="col" >Mobile No.</th>
              <th scope="col" >E-mail ID</th>
              <th scope="col" >Specializtion</th>
              <th scope="col" >Payment Date</th>
            </tr>
          </thead>
          <tbody>`;
        //   <th scope="col">Save</th>
        for (var i = 0; i < res.length; i++) {
          leadDet += `<tr>`;
          leadDet += `<td>${res[i]["fappno"]}</td>`;
          leadDet += `<td>${res[i]["fname"]}</td>`;
          leadDet += `<td>${res[i]["fmob"]}</td>`;
          leadDet += `<td>${res[i]["femail"]}</td>`;
          leadDet += `<td>${res[i]["fspecial"]}</td>`;
          leadDet += `<td>${res[i]["fpaymentdate"]}</td>`;
          // leadDet += `<td>
          //       <select class="select form-control" id="status">
          //         <option value="2">Interested</option>
          //         <option value="3">Not Interested</option>
          //       </select>
          //     </td>`;
          // leadDet += `<td><input
          //             type="text"
          //             id="remarks"
          //             class="form-control form-control"
          //             value=""
          //             required
          //             /></td>`;
          //   leadDet += `<td><button type="button" class="btn btn-outline-success">Save</button></td>`;
          leadDet += `</tr>`;
        }
        leadDet += `</tbody>
            </table>`;
        $("#leadDet").html(leadDet);
      });
    },
  });
}

{
  /* <th >Status</th>
<th >Remarks</th> */
}
function getReqLeadDet() {
  let course = $("#coursename").val();
  let datefrm = $("#detFrom").val();
  let dateto = $("#detTo").val();
  let status = $("#statusreq").val();
  $.ajax({
    type: "GET",
    url: "../php/getFiltLeadDet.php",
    data:
      "course=" +
      course +
      "&datefrm=" +
      datefrm +
      "&dateto=" +
      dateto +
      "&status=" +
      status,
    success: function (response) {
      let res = JSON.parse(response);

      $("#app-dashboard").load("../admin/leads.html", function () {
        let filterData = "";
        filterData += `<table class="table table-bordered" style = "position: relative;
        border-collapse: collapse; ">
        <thead style="position: sticky,
        top: 0,">
          <tr>
            <th scope="col">Application No.</th>
            <th scope="col">Student Name</th>
            <th scope="col">Mobile No.</th>
            <th scope="col">E-mail ID</th>
            <th scope="col">Specializtion</th>
            <th scope="col">Date</th>
            <th scope="col">Status</th>
            <th scope="col">Remarks</th>
            
          </tr>
        </thead>
        <tbody>`;
        // <th scope="col">Save</th>
        for (var i = 0; i < res.length; i++) {
          filterData += `<tr>`;
          filterData += `<td>${res[i]["fappno"]}</td>`;
          filterData += `<td>${res[i]["fname"]}</td>`;
          filterData += `<td>${res[i]["fmob"]}</td>`;
          filterData += `<td>${res[i]["femail"]}</td>`;
          filterData += `<td>${res[i]["fspecial"]}</td>`;
          filterData += `<td>${res[i]["fcreateddate"]}</td>`;
          filterData += `<td>
              <select class="select form-control" id="status">
                <option value="2">Interested</option>
                <option value="3">Not Interested</option>
              </select>
            </td>`;
          filterData += `<td><input
                    type="text"
                    id="remarks"
                    class="form-control form-control"
                    value=""
                    required
                    /></td>`;
          //   filterData += `<td><button type="button" class="btn btn-outline-success">Save</button></td>`;
          filterData += `</tr>`;
        }
        filterData += `</tbody>
          </table>`;
        $("#leadDet").html(filterData);
      });
    },
  });
}