<%@ Page Title="" Language="C#" MasterPageFile="~/module/dashboardPage.master" AutoEventWireup="true" CodeFile="Registration3.aspx.cs" Inherits="module_Registration3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">


    <script type="text/javascript">
        var firstname = "";
        var secondsnm = "";
        var lname = "";
        var fullname = "";  var gender = "";  var studst = "";  var isprovi = "";var title = "";
        var stateid = "0";var cityid = "0";var classids = "";var divsid = "";
        var ddyear1 = "";
        var ddyear2 = "";
        var dtyear1 = "";
        var dtyear2 = "";
        var stryr = "";
        var studentid = "";
        var stsud = "";
        $(document).ready(function () {
            let today2 = new Date().toISOString().substr(0, 10);

            document.querySelector("#dp-5").value = today2;
            let today3 = new Date().toISOString().substr(0, 10);

            document.querySelector("#txtadmdt").value = today3;
            $("#btnsave").show();
            getreceipts();
            //$("#dbirth").datepicker({ dateFormat: "dd-mm-yyyy" }).datepicker("setDate", new Date());
            $("#btnadd").click(function () {
                if ($("#btnadd").val() == "Submit") {
                    SaveData();
                }
                //else if ($("#btnadd").val() == "Update") {
                //    updatedata();
                //}
            });
            $("#dp-5").change(function () {

                if ($(this).val() == "") {
                
                }
                else {
                                               
                    var strDate = ($(this).val());
                    var dateParts = strDate.split("-");
                    var dateparts1 = dateParts[2];
                   
                    var date = new Date( strDate); 
                    var today = new Date();
                    var age = Math.floor((today - date) / (1000 * 60 * 60 * 24 * 365)); 
                    if(age ==0)
                    {
                        agecalculator();
                        // alert();
                    }
                    else
                    {
                        $('#txtage').val(age);}
                }
            });

            $("#dp-6").change(function () {

                if ($(this).val() == "") {
                
                }
                else {
                                               
                    var strDate = ($(this).val());
                    var dateParts = strDate.split("-");
                    var dateparts1 = dateParts[2];
                   
                    var date = new Date( strDate); 
                    var today = new Date();
                    var age = Math.floor((today - date) / (1000 * 60 * 60 * 24 * 365)); 
                    if(age ==0)
                    {
                        agecalculator();
                        // alert();
                    }
                    else
                    {
                        $('#txtage').val(age);}
                }
            });


     
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "Registration3.aspx/PopulateDropDownList5",
                data: "",
                dataType: "json",
                success: function (result) {
                    $('select[id$=ddlcountry]').empty();
                    $('select[id$=ddlcountry]').append("<option value='0'>Select Country</option>");
                    $.each(result.d, function (key, value) {
                        var ddyear1 = value.DeptName;
                        

                        $('select[id$=ddlcountry]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
                        //console.log(value.DeptName);
                    });
                   $('select[id$=ddlcountry]').val('0').change();
                    $('select[id$=ddlcountry] option:eq(101)').attr("selected", true);
                    //  $('select[id$=ddlclassty]').selectpicker('refresh');
                    //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                  
                },
                error: function ajaxError(result) {
                    console.log(result.status + ' : ' + result.statusText);
                }

            });
        
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList6",
                    data: "",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlstate]').empty();
                        $('select[id$=ddlstate]').append("<option value='0'>Select State</option>");
                        $.each(result.d, function (key, value) {
                            var ddyear1 = value.DeptName;
                        

                            $('select[id$=ddlstate]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
                            //console.log(value.DeptName);
                        });
                        if(stateid != "0"){
                          
                        }else{ $('select[id$=ddlstate]').val("0").change();
                            $('select[id$=ddlstate] option:eq(22)').attr("selected", true);
                        }
                       
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
       
            $('select[id$=ddlcountry1]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList6",
                    data: "{cotryid :'"+ $('select[id$=ddlcountry1]').val() +"'}",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlstate1]').empty();
                        $('select[id$=ddlstate1]').append("<option value='0'>Select State</option>");
                        $.each(result.d, function (key, value) {
                            var ddyear1 = value.DeptName;
                        

                            $('select[id$=ddlstate1]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
                          
                            //console.log(value.DeptName);
                        });
                        // $('select[id$=ddlstate1]').val('0').change();
                        if(stateid != "0"){
                            $("select[id$=ddlstate1]").val(stateid).change();
                        }else{  $("select[id$=ddlstate1]").val("0").change();
                        }
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            });
          
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList7",
                    data: "",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlcity]').empty();
                        $('select[id$=ddlcity]').append("<option value='0'>Select City</option>");
                        $.each(result.d, function (key, value) {
                            var ddyear1 = value.DeptName;
                            

                            $('select[id$=ddlcity]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
                            //console.log(value.DeptName);
                        });
                     
                        $('select[id$=ddlcity]').val('0').change();
                     
                        //  $('select[id$=ddlcity] option:eq(22)').attr("selected", true);
                         
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
       
            $('select[id$=ddlstate1]').change(function () {
                
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList7",
                    data: "{statesid :'"+ $('select[id$=ddlstate1]').val() +"'}",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlcity1]').empty();
                        $('select[id$=ddlcity1]').append("<option value='0'>Select City</option>");
                        $.each(result.d, function (key, value) {
                            var ddyear1 = value.DeptName;
                        

                            $('select[id$=ddlcity1]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
                            //console.log(value.DeptName);
                        });
                        // $('select[id$=ddlcity1]').val('0').change();
                        $("select[id$=ddlcity1]").val(cityid).change();
                        //  $('select[id$=ddlcity] option:eq(22)').attr("selected", true);
                         
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            });
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "Registration3.aspx/PopulateDropDownList8",
                data: "",
                dataType: "json",
                success: function (result) {
                    $('select[id$=ddlyears]').empty();
                    //var currentdt = new Date();
                    //var cuurentyr = currentdt.getFullYear();
                    //var prevyr = currentdt.setFullYear(currentdt.getFullYear() - 1);
                    $('select[id$=ddlyears]').append("<option value='0'>Select Year</option>");
                 
                    $.each(result.d, function (key, value) {
                        ddyear1 = value.DeptName;
                        ddyear2 = value.year1;
                        dtyear1 = new Date(ddyear1);
                        dtyear2 = new Date(ddyear2);
                        stryr = dtyear1.getFullYear() + "-" + dtyear2.getFullYear();
                          
                        $('select[id$=ddlyears]').append($("<option data-toggle='tooltip' data-placement='top' title='" + stryr + "'></option>").val(value.DeptId).html(stryr));
                        //console.log(value.DeptName);
                    });
                    // $('select[id$=ddlyears]').val('0').change();
                    //$('select[id$=cat] option:eq(0)').attr("selected", true);
                    //  $('select[id$=ddlclassty]').selectpicker('refresh');
                    //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                },
                error: function ajaxError(result) {
                    console.log(result.status + ' : ' + result.statusText);
                }

            }); 
            let today12 = new Date().toISOString().substr(0, 10);
                     
            document.querySelector("#incomedate").value = today12;
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "Registration3.aspx/PopulateDropDownList8",
                data: "",
                dataType: "json",
                success: function (result) {
                    $('select[id$=ddlyrs]').empty();
                    //var currentdt = new Date();
                    //var cuurentyr = currentdt.getFullYear();
                    //var prevyr = currentdt.setFullYear(currentdt.getFullYear() - 1);
                    $('select[id$=ddlyrs]').append("<option value='0'>Select Year</option>");
                 
                    $.each(result.d, function (key, value) {
                        ddyear1 = value.DeptName;
                        ddyear2 = value.year1; 
                        dtyear1 = new Date(ddyear1);
                        dtyear2 = new Date(ddyear2);
                           
                        stryr = dtyear1.getFullYear() + "-" + dtyear2.getFullYear();
                          
                        $('select[id$=ddlyrs]').append($("<option data-toggle='tooltip' data-placement='top' title='" + stryr + "'></option>").val(value.DeptId).html(stryr));
                        //console.log(value.DeptName);
                    });
                    // $('select[id$=ddlyears]').val('0').change();
                    //$('select[id$=cat] option:eq(0)').attr("selected", true);
                    //  $('select[id$=ddlclassty]').selectpicker('refresh');
                    //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                },
                error: function ajaxError(result) {
                    console.log(result.status + ' : ' + result.statusText);
                }

            });
            $('select[id$=ddlyrs]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList9",
                    data: "",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlsclass]').empty();
                        $('select[id$=ddlsclass]').append("<option value='0'>Select class</option>");
                        $.each(result.d, function (key, value) {
                            var dd = value.DeptName;


                            $('select[id$=ddlsclass]').append($("<option data-toggle='tooltip' data-placement='top' title='" + dd + "'></option>").val(value.DeptId).html(dd));
                            //console.log(value.DeptName);
                        });
                        // $('select[id$=ddlclass]').val('0').change();
                        //$('select[id$=cat] option:eq(0)').attr("selected", true);
                        //  $('select[id$=ddlclassty]').selectpicker('refresh');
                        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            });
            $('select[id$=ddlsclass]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList10",
                    data: "{clids :'" + $('select[id$=ddlsclass]').val() + "'}",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddldivision]').empty();
                        $('select[id$=ddldivision]').append("<option value='0'>Select Division</option>");
                        $.each(result.d, function (key, value) {
                            var dd = value.DeptName;


                            $('select[id$=ddldivision]').append($("<option data-toggle='tooltip' data-placement='top' title='" + dd + "'></option>").val(value.DeptId).html(dd));
                            //console.log(value.DeptName);
                        });
                        $('select[id$=ddldivision]').val('0').change();
                        //$('select[id$=cat] option:eq(0)').attr("selected", true);
                        //  $('select[id$=ddlclassty]').selectpicker('refresh');
                        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
                
            });
            $('select[id$=ddldivision]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList11",
                    data: "{yrsid :'"+ $('select[id$=ddlyrs]').val() +"',clsid : '"+ $('select[id$=ddlsclass]').val() +"',divisids :'" + $('select[id$=ddldivision]').val() + "'}",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlstudent]').empty();
                        $('select[id$=ddlstudent]').append("<option value='0'>Select Student</option>");
                        $.each(result.d, function (key, value) {
                            var dd = value.DeptName;
                            var fullname = value.firstname + " " + value.midname + " " + value.lastname;

                            $('select[id$=ddlstudent]').append($("<option data-toggle='tooltip' data-placement='top' title='" + fullname + "'></option>").val(dd).html(fullname));
                            //console.log(value.DeptName);
                        });
                        $('select[id$=ddlstudent]').val('0').change();
                        //$('select[id$=cat] option:eq(0)').attr("selected", true);
                        //  $('select[id$=ddlclassty]').selectpicker('refresh');
                        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            });
            $('select[id$=ddlyears]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList9",
                    data: "",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlclass]').empty();
                        $('select[id$=ddlclass]').append("<option value='0'>Select class</option>");
                        $.each(result.d, function (key, value) {
                            var dd = value.DeptId;
                            

                            $('select[id$=ddlclass]').append($("<option data-toggle='tooltip' data-placement='top' title='" + value.DeptId + "'></option>").val(value.DeptId).html(value.DeptName));
                            //console.log(value.DeptName);
                        });
                     
                        $('select[id$=ddlclass]').val(classids).change();
                        //$('select[id$=cat] option:eq(0)').attr("selected", true);
                        //  $('select[id$=ddlclassty]').selectpicker('refresh');
                        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            }); 
            $('select[id$=ddlyears1]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList9",
                    data: "",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddlclass1]').empty();
                        $('select[id$=ddlclass1]').append("<option value='0'>Select class</option>");
                        $.each(result.d, function (key, value) {
                            var dd = value.DeptName;


                            $('select[id$=ddlclass1]').append($("<option data-toggle='tooltip' data-placement='top' title='" + dd + "'></option>").val(value.DeptId).html(dd));
                            //console.log(value.DeptName);
                        });
                            
                        $('select[id$=ddlclass1]').val(classids).change();
                        // $('select[id$=ddlclass]').val('0').change();
                        //$('select[id$=cat] option:eq(0)').attr("selected", true);
                        //  $('select[id$=ddlclassty]').selectpicker('refresh');
                        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            });
            $('select[id$=ddlclass]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList10",
                    data: "{clids :'" + $('select[id$=ddlclass]').val() + "'}",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddldivi]').empty();
                        $('select[id$=ddldivi]').append("<option value='0'>Select Division</option>");
                        $.each(result.d, function (key, value) {
                            var dd = value.DeptName;


                            $('select[id$=ddldivi]').append($("<option data-toggle='tooltip' data-placement='top' title='" + dd + "'></option>").val(value.DeptId).html(dd));
                            //console.log(value.DeptName);
                        });
                        $('select[id$=ddldivi]').val(divsid).change();
                        //$('select[id$=cat] option:eq(0)').attr("selected", true);
                        //  $('select[id$=ddlclassty]').selectpicker('refresh');
                        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            }); 
            $('select[id$=ddlclass1]').change(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Registration3.aspx/PopulateDropDownList10",
                    data: "{clids :'" + $('select[id$=ddlclass1]').val() + "'}",
                    dataType: "json",
                    success: function (result) {
                        $('select[id$=ddldivi1]').empty();
                        $('select[id$=ddldivi1]').append("<option value='0'>Select Division</option>");
                        $.each(result.d, function (key, value) {
                            var dd = value.DeptName;


                            $('select[id$=ddldivi1]').append($("<option data-toggle='tooltip' data-placement='top' title='" + dd + "'></option>").val(value.DeptId).html(dd));
                            //console.log(value.DeptName);
                        });
                        $('select[id$=ddldivi1]').val(divsid).change();
                        //$('select[id$=cat] option:eq(0)').attr("selected", true);
                        //  $('select[id$=ddlclassty]').selectpicker('refresh');
                        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                    },
                    error: function ajaxError(result) {
                        console.log(result.status + ' : ' + result.statusText);
                    }

                });
            });
            getdata();
            $("select[id$=ddltitle]").change(function () {
                title = $("select[id$=ddltitle]").val(); fullname = "";$("#txtpname").val("");
            });
            $("#txtfname").bind('blur keyup', function (e) {
                if (e.type === 'blur' || e.keyCode === 13) {

                    fullname = "";
                    fullname = title + "." + $("#txtfname").val(); $("#txtpname").val(fullname);
                }
            });
         
            $("#txtmname").bind('blur keyup', function (e) {
                if (e.type === 'blur' || e.keyCode === 13) {

                    fullname = "";
                    fullname =  $("#txtpname").val() + " "+  $("#txtmname").val(); $("#txtpname").val(fullname);
                }
            });
            $("#txtlname").bind('blur keyup', function (e) {
                if (e.type === 'blur' || e.keyCode === 13) {

                    fullname = "";
                    fullname = $("#txtpname").val() + " "+ $("#txtlname").val(); $("#txtpname").val(fullname);
                }
            });
            //$("#txtlname").blur(function () {
            //    fullname = fullname + " " + $("#txtlname").val(); $("#txtpname").val(fullname);
            //});
          
        
            
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "Registration3.aspx/PopulateDropDownList4",
                data: "",
                dataType: "json",
                success: function (result) {
                    $('select[id$=ddlcateg]').empty();
                    $('select[id$=ddlcateg]').append("<option value='0'>Select Category</option>");
                    $.each(result.d, function (key, value) {
                        var ddyear1 = value.DeptName;
                     

                        $('select[id$=ddlcateg]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
                        //console.log(value.DeptName);
                    });
                    $('select[id$=ddlcateg]').val('0').change();
                    //$('select[id$=cat] option:eq(0)').attr("selected", true);
                    //  $('select[id$=ddlclassty]').selectpicker('refresh');
                    //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                },
                error: function ajaxError(result) {
                    console.log(result.status + ' : ' + result.statusText);
                }

            });
        });
        function getreceipts(){
            $.ajax({
                url: 'Registration3.aspx/GetEmpData',
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                dataType: 'json',
                data: "{}",
                success: function (_data) {
                    _data = JSON.parse(_data.d);
                    var nn = _data;
                    var name = "STUD";
                    // var id = "001";
                    var d = new Date();
                    var n = d.getMonth() + 1;
                    if (n < 10) {
                        n = "0" + n;
                    }
                    else {

                    }
                    var year = new Date().toLocaleDateString('en', { year: '2-digit' });
                    var fill = name + "/" + n + year + "/" + nn;

                    // $('#name').val(fill);


                    $('#pre').html(fill);

                    console.log(JSON.stringify(_data));
                }
                
            });
        }
        function SaveData() {
            if ($("select[id$=ddltitle]").val() == "") {
              
                noty({ text: 'Enter Title', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
                
                return false;
            }
            if ($("#txtfname").val() == "") {
              
                noty({ text: 'Enter First Name', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
               
                return false;
            }
            if ($("#txtmname").val() == "") {
               
                noty({ text: 'Enter Middle Name', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
               
                return false;
            }
            if ($("#txtlname").val() == "") {
               
                noty({ text: 'Enter Last Name', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
               
                return false;
            }
            if ($("#txtpname").val() == "") {
                
                noty({ text: 'Enter P.Name', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
              
                return false;
            }
            if ($("#txtmob1").val() == "") {
               
                noty({ text: 'Enter  Mobile Number', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
               
                return false;
            }
            if ($("select[id$=ddlclass]").val() == "0") {
               
                noty({ text: 'Select Class', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
             
                return false;
            }
            if ($("select[id$=ddldivi]").val() == "0") {
                
                noty({ text: 'Select Divison', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
             
                return false;
            }
            if ($("#ddlquali").val() == "") {
               
                noty({ text: 'Select Highest Qualification', layout: 'topRight', type: 'information' });
                setTimeout(function () { $.noty.closeAll(); }, 3000);
              
                return false;
            }
            //if ($("select[id$=ddlscheme]").val() == "0") {
               
            //    noty({ text: 'Select Scheme', layout: 'topRight', type: 'information' });
            //    setTimeout(function () { $.noty.closeAll(); }, 3000);
            //    setTimeout(function () { $.noty.closeAll(); }, 3000);
            //    return false;
            //}
            //if ($("select[id$=ddlcourse]").val() == "0") {
              
            //    noty({ text: 'Select Course Name', layout: 'topRight', type: 'information' });
            //    setTimeout(function () { $.noty.closeAll(); }, 3000);
            //    setTimeout(function () { $.noty.closeAll(); }, 3000);
            //    return false;
            //}
           

          
            if ($("#rbmale").prop('checked') == true) {
                gender = $("#rbmale").val();
            }
            else if ($("#rbfemale").prop('checked') == true) {
                gender = $("#rbfemale").val();
            }
          
            if ($("#Radio1").prop('checked') == true) { 
                studst = $("#Radio1").val();
            }
            else if ($("#Radio2").prop('checked') == true) {
                studst = $("#Radio2").val();
            }
          
            if ($("#Radio3").prop('checked') == true) {
                isprovi = $("#Radio3").val();
            }
            else  if($("#Radio4").prop('checked') == true) {
                isprovi = $("#Radio4").val();
            }
            var obj = {};
            //Uhid:'" + $("#pre").html()
            obj.uhid = $("#pre").html();
            obj.studtitle = $("select[id$=ddltitle]").val();
            obj.fname = $("#txtfname").val();
            obj.mname = $("#txtmname").val();
            obj.lname = $("#txtlname").val();
            obj.pname = $("#txtpname").val();
            obj.mothernme = $("#motname").val();
            obj.country = $('select[id$=ddlcountry]').val();
            obj.state = $('select[id$=ddlstate]').val();
            obj.city = $('select[id$=ddlcity]').val();
            obj.address = $("#txtaddress").val();
            obj.resiaddrss = $("#txtresiadd").val();
            obj.peraddrss = $("#txtperadd").val();
            obj.pin = $("#txtpin").val();
            obj.castcategory = $('select[id$=ddlcateg]').val();
            obj.castes = $("#txtcaste").val();
            obj.bloodgroup = $('select[id$=ddlbgroup]').val();
            obj.gender = gender;
            obj.dob = $("#dp-5").val(); 
            obj.age = $("#txtage").val();
            obj.mobile1 = $("#txtmob1").val();
            obj.mobile2 = $("#txtmob2").val();
            obj.email = $("#txtemail").val();
            obj.stdyears = $("select[id$=ddlyears]").val();
            obj.classd = $('select[id$=ddlclass]').val();
            obj.division = $('select[id$=ddldivi]').val();
            obj.highquali = $("#ddlquali").val();
            obj.adharcard = $("#txtadhar").val();
            obj.admission = $("#txtadmdt").val();
            obj.bplcard = $("#txtbpl").val();
            obj.scheme = $('select[id$=ddlscheme]').val();
            obj.coursename = $('select[id$=ddlcourse]').val();
            obj.status = studst;
            obj.isprovisional = isprovi;

            $.ajax({
                type: "POST",
                url: "Registration3.aspx/savedata", //It calls our web method.
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify(obj),
                dataType: "json",
                success: function (data) {
                    console.log(JSON.stringify(data));

                    noty({ text: 'Saved Successfully', layout: 'topRight', type: 'information' });
                    setTimeout(function () { $.noty.closeAll(); }, 3000);
                    getreceipts();
                    getdata();
                    Clear();
                },
                error: function (error) {
                    console.log(JSON.stringify(error));
                    //alert("Error in insert");
                    noty({ text: 'Error in insert', layout: 'topRight', type: 'information' });
                    setTimeout(function () { $.noty.closeAll(); }, 3000);
                }
            });
        }
        function Clear(){
           
            $("select[id$=ddltitle]").val("").change();
            $("#txtfname").val("");
            $("#txtmname").val("");
            $("#txtlname").val("");
            $("#txtpname").val("");
            $("#motname").val("");
            $('select[id$=ddlcountry]').val("0").change();
            $('select[id$=ddlstate]').val("0").change();
            $('select[id$=ddlcity]').val("0").change();
            $("#txtaddress").val("");
            $("#txtresiadd").val("");
            $("#txtperadd").val("");
            $("#txtpin").val("");
            $('select[id$=ddlcateg]').val("0").change();
            $('select[id$=ddlbgroup]').val("").change();
            gender = "";
            let today2 = new Date().toISOString().substr(0, 10);

            document.querySelector("#dp-5").value = today2;
            $("#txtage").val("");
            $("#txtmob1").val("");
            $("#txtmob2").val("");
            $("#txtemail").val("");
            $("select[id$=ddlyears]").val("0").change();
            $('select[id$=ddlclass]').val("0").change();
            $('select[id$=ddldivi]').val("0").change();
            $("#ddlquali").val("");
            $("#txtadhar").val("");
            $("#txtvoting").val("");
            $("#txtbpl").val("");
            getreceipts();
            studst = "";
            isprovi = "";
        } 
        function clear1(){
            id1 = "";
            $("select[id$=ddltitle1]").val("").change();
            $("#txtfname1").val("");
            $("#txtmname1").val("");
            $("#txtlname1").val("");
            $("#txtpname1").val("");
            $("#motname1").val("");
            $('select[id$=ddlcountry1]').val("0").change();
            $('select[id$=ddlstate1]').val("0").change();
            $('select[id$=ddlcity1]').val("0").change();
            $("#txtaddress1").val("");
            $("#txtresiadd1").val("");
            $("#txtperadd1").val("");
            $("#txtpin1").val("");
            $('select[id$=ddlcateg1]').val("0").change();
            $('select[id$=ddlbgroup1]').val("0").change();
            let today2 = new Date().toISOString().substr(0, 10);

            document.querySelector("#dp-6").value = today2;
       
            gender = "";
           
            $("#txtage1").val();
            $("#txtmob11").val();
            $("#txtmob21").val();
            $("#txtemail1").val();
            $('select[id$=ddlyears1]').val();
            $('select[id$=ddlclass1]').val();
            $('select[id$=ddldivi1]').val();
            $('#ddlquali').val();
            $("#txtadhar1").val();
        
            studst ="";
      
           
          
         
            isprovi = "";
          
        }
        var staddress = "";
        //function datatable() {
        //    $.ajax({
        //        type: "POST",
        //        url: "Registration3.aspx/GetData",
        //        contentType: "application/JSON; charset=utf-8",

        //        datatype: "JSON",
        //        success: function (data) {
        //            var table = $('#dataemp').DataTable();
        //            data = JSON.parse(data.d);

        //            table.clear();
        //            for (var i = 0,count = 1; i < data.length; i++,count++) {
        //                staddress = data[i].resiaddrss + "," + data[i].cityname + "," + data[i].stname + "," + data[i].pin;
        //                ddyear1 = data[i].fromdate;
        //                ddyear2 = data[i].todate;
        //                dtyear1 = new Date(ddyear1);
        //                dtyear2 = new Date(ddyear2);
        //                stryr = dtyear1.getFullYear() + "-" + dtyear2.getFullYear();
        //                var fullname = data[i].title+"."+ data[i].fname +" "+ data[i].mname+ " "+data[i].lname;
        //                table.row.add([
                            
        //                count, data[i].studid,  fullname,staddress, data[i].feename, data[i].mobile1, data[i].email, data[i].studdob,stryr,data[i].classname,data[i].divname, data[i].adharcard,  data[i].status, data[i].isprovisional,
        //                     "<button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=getscroll('" + data[i].studentids + "') id='btnedit' class='btn btn-success'><i class='bx bx-message-square-edit'></i></button> <button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=deletedata('" + data[i].studentids + "') id='btndelete' class='btn btn-danger'><i class='fadeIn animated bx bx-trash-alt'></i></button>&nbsp; <button  style='height:35px; width: 35px; padding-left:7px;display:none' data-bs-toggle'modal' data-bs-target='#exampleLargeModal5' type='button' class='btn btn-primary' onclick='getstudentdetails(\""+data[i].studid+"\",'" + data[i].studentids + "');'><i class='lni lni-save'></i></button>&nbsp;<button title='cancel' style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=getstudentdetails(\""+ data[i].studid +"\")  id='btnedit' class='btn btn-success' data-bs-toggle='modal' data-bs-target='#exampleLargeModal5'><i class='bx bx-x'></i></button>"

        //                ]).draw(true);

        //            }
        //        }
        //    });
        //}  
     
        function getdata() {

         var table1 = $('#dataemp').DataTable();
          
            table1.destroy();
            var table = $('#dataemp').DataTable({
                "deferRender": true,
                "processing": true,
                orderable: false,
                searchable: false,
                bServerSide: true,
                "responsive":true,
                scrollCollapse: true,
              
                //fixedColumns: {
                //    leftColumns: 0,
                //    right: 1
                //},
                "paging": true,
                "ordering": true,
                "filter": true,
                "pageLength": 10,
                "iDisplayLength": 10,
                "ORDER": [1, "asc"],
                "ajax":
                   {
                       "url": "Registration3.aspx/GetEmpData14",
                       "contentType": "application/json;charset=UTF-8",
                       "type": 'get',
                       'data': function (request) {
                           //request.prefix = uhid,
                           //request.prefix1 = $("#dp-4").val(),
                           // request.prefix2 = mudocids
                           //console.log(request);
                           return request.d;
                       },
                       complete: function (response) {
                           //console.log(JSON.stringify(response));
                       },
                       dataSrc: function (json) {
                           var return_data = json;
                           return json.d.data;
                       }
                   },
                "columns": [
                     { "data": "studid", "name": "StudID", "width": "10%" },
                      { "data": "fullname", "name": "Preference Name", "width": "25%" },
                    //{ "data": "studaddress", "name": "Address", "width": "10%" },
                     //{ "data": "feenm", "name": "Caste Category", "width": "10%" }, 
                     //{ "data": "mobile", "name": "Mobile", "width": "10%" }, 
                     // { "data": "email", "name": "Email", "width": "10%" },
                      //{ "data": "studentdob", "name": "Date of Birth", "width": "10%" },
                     { "data": "stryear", "name": "Admission Year", "width": "7%" },
                     { "data": "admissiondt", "name": "Admission Date", "width": "8%" },
                     { "data": "clsnm", "name": "Class", "width": "8%" },
                     { "data": "divsnm", "name": "Division", "width": "8%" },
                     //{ "data": "aadharcardnos", "name": "Adhar Card No", "width": "10%" },
                     //{ "data": "ststaus", "name": "Status", "width": "10%" },
                     //{ "data": "isprovi", "name": "IsProvisional", "width": "10%" },
                     { 
                         render: function (data, type, row) {
                             //console.log(JSON.stringify(row.id));
                             return createButton('edit',row.studid, row.id);
                         }, "width": "30%" 
                     }
                ],

                "language": {
                    "lengthMenu": "Display _MENU_ records per page",
                    "zeroRecords": "Nothing found - sorry",
                    "info": "Showing page _PAGE_ of _PAGES_",
                    "infoEmpty": "",
                    "infoFiltered": ""
                }
            });

            
        } 
        function createButton(buttonType,studid, rowID) {
            return "<button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=getscroll('" + rowID + "') id='btnedit' class='btn btn-success'><i class='bx bx-message-square-edit'></i></button> <button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=deletedata('" + rowID + "') id='btndelete' class='btn btn-danger'><i class='fadeIn animated bx bx-trash-alt'></i></button>&nbsp; <button  style='height:35px; width: 35px; padding-left:7px;display:none' data-bs-toggle'modal' data-bs-target='#exampleLargeModal5' type='button' class='btn btn-primary' onclick='getstudentdetails(\""+studid+"\",'" + rowID + "');'><i class='lni lni-save'></i></button>&nbsp;<button title='cancel' style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=getstudentdetails(\""+ studid +"\")  id='btnedit' class='btn btn-success' data-bs-toggle='modal' data-bs-target='#exampleLargeModal5'><i class='bx bx-x'></i></button>";
        }
        function getstudentdetails(stuid){
            studentid = stuid;
         
        }
        function cancelstudent(){
            $.ajax({
                url: 'Registration3.aspx/canceladm',
                type: 'post',
                contentType: 'application/json;charset=utf-8',
                dataType: 'json',
                data: "{studentids:'"+ studentid +"',sid:'"+ stsud +"',canceldt :'"+ $("#incomedate").val() +"' }",
                success: function () {
                    noty({ text: 'Admission Cancled', layout: 'topRight', type: 'information' });
                    setTimeout(function () { $.noty.closeAll(); }, 3000);

                                                      
                    getdata();
                    $("#mclose1")[0].click();
                },
                error: function () {
                    alert("Insert Error");
                                                      
                }

            });

        }
        //function searchdata(){
        //    var obj = {};
        //    obj.yrsid = $("select[id$=ddlyrs]").val();
        //    obj.cldid =  $("select[id$=ddlsclass]").val();
        //    obj.divsid =  $("select[id$=ddldivision]").val();
        //    obj.studsid =  $("select[id$=ddlstudent]").val();
        //    $.ajax({
        //        type: "POST",
        //        url: "Registration3.aspx/GetDatasearch",
        //        contentType: "application/JSON; charset=utf-8",
        //        data : JSON.stringify(obj),
        //        datatype: "JSON",
        //        success: function (data) {
        //            var table = $('#dataemp').DataTable();
        //            data = JSON.parse(data.d);

        //            table.clear();
        //            for (var i = 0,count = 1; i < data.length; i++,count++) {
        //                staddress = data[i].resiaddrss + "," + data[i].cityname + "," + data[i].stname + "," + data[i].pin;
        //                var ddyear1 = data[i].fromdate;
        //                var ddyear2 = data[i].todate;
        //                var dtyear1 = new Date(ddyear1);
        //                var dtyear2 = new Date(ddyear2);
        //                var stryr = dtyear1.getFullYear() + "-" + dtyear2.getFullYear();
        //                table.row.add([
                            
        //                count, data[i].studid,  data[i].pname,staddress, data[i].feename, data[i].mobile1, data[i].email, data[i].studdob,stryr,data[i].classname,data[i].divname, data[i].adharcard,  data[i].status, data[i].isprovisional,
        //                     "<button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=getscroll('" + data[i].studentids + "') id='btnedit' class='btn btn-success'><i class='bx bx-message-square-edit'></i></button> <button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=deletedata('" + data[i].studentids + "') id='btndelete' class='btn btn-danger'><i class='fadeIn animated bx bx-trash-alt'></i></button> <button  style='height:35px; width: 35px; padding-left:7px;' type='button' class='btn btn-primary'><i class='lni lni-save'></i></button> <button  style='height:35px; width: 35px; padding-left:7px;' type='button' class='btn btn-dark'><i class='bx bx-x'></i></span></button>"

        //                ]).draw(true);

        //            }
        //        }
        //    });
        //} 
        function searchdata() {

            var table = $('#dataemp').DataTable();
          
            table.destroy();
            var table = $('#dataemp').DataTable({
                "deferRender": true,
                "processing": true,
                orderable: false,
                searchable: true,
                bServerSide: true,
                "responsive":true,
                "paging": true,
                "ordering": true,
                "filter": true,
                "pageLength": 10,
                "iDisplayLength": 10,
                "ORDER": [1, "asc"],
                "ajax":
                   {
                       "url": "Registration3.aspx/GetEmpData15",
                       "contentType": "application/json;charset=UTF-8",
                       "type": 'get',
                       'data': function (request) {
                           request.prefix = $("select[id$=ddlyrs]").val();
                           request.prefix1 =  $("select[id$=ddlsclass]").val();
                           request.prefix2 = $("select[id$=ddldivision]").val();
                          request.prefix3 = $("select[id$=ddlstudent]").val();
                           //console.log(request);
                           return request.d;
                       },
                       complete: function (response) {
                           //console.log(JSON.stringify(response));
                       },
                       dataSrc: function (json) {
                           var return_data = json;
                           return json.d.data;
                       }
                   },
                "columns": [
                     { "data": "studid", "name": "StudID", "width": "10%" },
                      { "data": "fullname", "name": "Preference Name", "width": "25%" },
                    //{ "data": "studaddress", "name": "Address", "width": "10%" },
                     //{ "data": "feenm", "name": "Caste Category", "width": "10%" }, 
                     //{ "data": "mobile", "name": "Mobile", "width": "10%" }, 
                     // { "data": "email", "name": "Email", "width": "10%" },
                      //{ "data": "studentdob", "name": "Date of Birth", "width": "10%" },
                     { "data": "stryear", "name": "Admission Year", "width": "7%" },
                     { "data": "admissiondt", "name": "Admission Date", "width": "8%" },
                     { "data": "clsnm", "name": "Class", "width": "8%" },
                     { "data": "divsnm", "name": "Division", "width": "8%" },
                     //{ "data": "aadharcardnos", "name": "Adhar Card No", "width": "10%" },
                     //{ "data": "ststaus", "name": "Status", "width": "10%" },
                     //{ "data": "isprovi", "name": "IsProvisional", "width": "10%" },
                     { 
                         render: function (data, type, row) {
                             //console.log(JSON.stringify(row.id));
                             return createButton1('edit',row.studid, row.id);
                         }, "width": "10%" 
                     }
                ],


                "language": {
                    "lengthMenu": "Display _MENU_ records per page",
                    "zeroRecords": "Nothing found - sorry",
                    "info": "Showing page _PAGE_ of _PAGES_",
                    "infoEmpty": "",
                    "infoFiltered": ""
                }
            });

            
        } 
        function createButton1(buttonType,studid, rowID) {
            return "<button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=getscroll('" + rowID + "') id='btnedit' class='btn btn-success'><i class='bx bx-message-square-edit'></i></button> <button  style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=deletedata('" + rowID + "') id='btndelete' class='btn btn-danger'><i class='fadeIn animated bx bx-trash-alt'></i></button>&nbsp; <button  style='height:35px; width: 35px; padding-left:7px;display:none' data-bs-toggle'modal' data-bs-target='#exampleLargeModal5' type='button' class='btn btn-primary' onclick='getstudentdetails(\""+studid+"\",'" + rowID + "');'><i class='lni lni-save'></i></button>&nbsp;<button title='cancel' style='height:35px; width: 35px; padding-left:7px;' type='button' onclick=getstudentdetails(\""+ studid +"\")  id='btnedit' class='btn btn-success' data-bs-toggle='modal' data-bs-target='#exampleLargeModal5'><i class='bx bx-x'></i></button>";
        }
        function getscroll(stdids){
            $(window).scrollTop(0);
            editdata(stdids);
        }
        var id1 = "";
        function editdata(id) {
            // $("#dbirth").datepicker({ dateFormat: "dd-mm-yyyy" }).datepicker("setDate", new Date());
            //$.ajax({
            //    type: "POST",
            //    contentType: "application/json; charset=utf-8",
            //    url: "Registration3.aspx/PopulateDropDownList5",
            //    data: "",
            //    dataType: "json",
            //    success: function (result) {
            //        $('select[id$=ddlcountry1]').empty();
            //        $('select[id$=ddlcountry1]').append("<option value='0'>Select Country</option>");
            //        $.each(result.d, function (key, value) {
            //            var ddyear1 = value.DeptName;
                        

            //            $('select[id$=ddlcountry1]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
            //            //console.log(value.DeptName);
            //        });
            //        $('select[id$=ddlcountry1]').val('0').change();
            //        //   $('select[id$=ddlcountry1] option:eq(101)').attr("selected", true);
            //        //  $('select[id$=ddlclassty]').selectpicker('refresh');
            //        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
                 
            //    },
            //    error: function ajaxError(result) {
            //        console.log(result.status + ' : ' + result.statusText);
            //    }

            //});
            //$.ajax({
            //    type: "POST",
            //    contentType: "application/json; charset=utf-8",
            //    url: "Registration3.aspx/PopulateDropDownList4",
            //    data: "",
            //    dataType: "json",
            //    success: function (result) {
            //        $('select[id$=ddlcateg1]').empty();
            //        $('select[id$=ddlcateg1]').append("<option value='0'>Select Category</option>");
            //        $.each(result.d, function (key, value) {
            //            var ddyear1 = value.DeptName;
                     

            //            $('select[id$=ddlcateg1]').append($("<option data-toggle='tooltip' data-placement='top' title='" + ddyear1 + "'></option>").val(value.DeptId).html(ddyear1));
            //            //console.log(value.DeptName);
            //        });
            //        // $('select[id$=ddlcateg]').val('0').change();
            //        //$('select[id$=cat] option:eq(0)').attr("selected", true);
            //        //  $('select[id$=ddlclassty]').selectpicker('refresh');
            //        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
            //    },
            //    error: function ajaxError(result) {
            //        console.log(result.status + ' : ' + result.statusText);
            //    }

            //});
            //$.ajax({
            //    type: "POST",
            //    contentType: "application/json; charset=utf-8",
            //    url: "Registration3.aspx/PopulateDropDownList8",
            //    data: "",
            //    dataType: "json",
            //    success: function (result) {
            //        $('select[id$=ddlyears1]').empty();
            //        //var currentdt = new Date();
            //        //var cuurentyr = currentdt.getFullYear();
            //        //var prevyr = currentdt.setFullYear(currentdt.getFullYear() - 1);
            //        $('select[id$=ddlyears1]').append("<option value='0'>Select Year</option>");
                 
            //        $.each(result.d, function (key, value) {
            //            var ddyear1 = value.DeptName;
            //            var ddyear2 = value.year1;
            //            var dtyear1 = new Date(ddyear1);
            //            var dtyear2 = new Date(ddyear2);
            //            var stryr = dtyear1.getFullYear() + "-" + dtyear2.getFullYear();
                          
            //            $('select[id$=ddlyears1]').append($("<option data-toggle='tooltip' data-placement='top' title='" + stryr + "'></option>").val(value.DeptId).html(stryr));
            //            //console.log(value.DeptName);
            //        });
            //        // $('select[id$=ddlyears]').val('0').change();
            //        //$('select[id$=cat] option:eq(0)').attr("selected", true);
            //        //  $('select[id$=ddlclassty]').selectpicker('refresh');
            //        //  hdndoc=$('select[id$=cat] option:eq(1)').val();
            //    },
            //    error: function ajaxError(result) {
            //        console.log(result.status + ' : ' + result.statusText);
            //    }

           // });
            $("#btnsave").hide();$("#btnupdates").show();
            $.ajax({

                url: "Registration3.aspx/EditData",
                contentType: "application/JSON; charset=utf-8",
                method: "post",
                datatype: "JSON",
                data: "{id:'" + id + "'}",
                success: function (data) {
                    data = JSON.parse(data.d);
                    console.log(data);
                    $("#pre").html(data[0].studid);
                   
                    $("select[id$=ddltitle]").val(data[0].title).change();
                    $("#txtfname").val(data[0].fname);
                    $("#txtmname").val(data[0].mname);
                    $("#txtlname").val(data[0].lname);
                    $("#txtpname").val(data[0].pname);
                    $("#motname").val(data[0].mothernme);
                    
                    $("select[id$=ddlcountry]").val(data[0].country);

                    $('select[id$=ddlcountry]').trigger("change"); 
                    stateid = data[0].state;
                   $('select[id$=ddlstate]').val(stateid).change();
                    cityid = data[0].city;
                    //$("select[id$=ddlstate1]").val(data[0].state);
                    //$('select[id$=ddlstate1]').trigger("change");
                  $("select[id$=ddlcity]").val(data[0].city).change();

                    $("#txtaddress").val(data[0].address);
                    $("#txtresiadd").val(data[0].resiaddrss);
                    $("#txtperadd").val(data[0].peraddrss);
                    $("#txtpin").val(data[0].pin);

                    $("select[id$=ddlcateg]").val(data[0].castcategory).change();
                    $("select[id$=ddlbgroup]").val(data[0].bloodgroup).change();
                     $("#txtcaste").val(data[0].caste);
                       
                    if($("#rbmale").val() == data[0].gender){
                        $("#rbmale").prop('checked',true); gender = data[0].gender;
                    } 
                    else if($("#rbfemale").val() == data[0].gender){
                        $("#rbfemale").prop('checked',true); gender = data[0].gender;
                    }
                    //  $("#dp-6").val(data[0].studdob);
                    let today2 = new Date(data[0].dob).toISOString().substr(0, 10);

                    document.querySelector("#dp-5").value = today2;
                    let today4 = new Date(data[0].today).toISOString().substr(0, 10);

                    document.querySelector("#txtadmdt").value = today4;
                    $("#dp-6").trigger("change");
                    $("#txtage").val(data[0].age);
                
                    $("#txtmob1").val(data[0].mobile1);
                    $("#txtmob2").val(data[0].mobile2);
                    $("#txtemail").val(data[0].email);
                  
                    $("select[id$=ddlyears]").val(data[0].admyears).change();
                    classids = data[0].classd;
                    divsid = data[0].division;
                //    $("select[id$=ddlclass]").val(data[0].classd).change();
                  //  $("select[id$=ddldivi]").val(data[0].division).change();
                    $("#ddlquali").val(data[0].highquali);

                    $("#txtadhar").val(data[0].adharcard);
                    $("#txtvoting").val(data[0].votingcard);
                    
                      
                    studst = data[0].status;
                    if($("#Radio1").val() == studst){
                        $("#Radio1").prop('checked',true);studst = $("#Radio1").val();
                    }else  if($("#Radio2").val() == studst){
                        $("#Radio2").prop('checked',true);studst = $("#Radio2").val();
                    }
                    isprovi = data[0].isprovisional;
                    if($("#Radio3").val() == isprovi){
                        $("#Radio3").prop('checked',true);isprovi = $("#Radio3").val(); 
                    }else  if($("#Radio4").val() == isprovi){
                        $("#Radio4").prop('checked',true);isprovi = $("#Radio4").val();
                    }
                    id1 = id;
                   
                      
                    //   $("#btnadd").val('Update');

                }
            }); 
        }
        function savedata1() {
            // var data_to_send = $.serialize(file);

            // alert(data_to_send);
            path1 = "~/Document/studentdetails.csv";
            //  $("#filename3").attr("src", path1);
            name = "studentdetails.csv";
            if ($("#addcat").val() == "submit") {
                $.ajax({
                    url: 'Registration3.aspx/UploadAndProcessFile',
                    type: 'post',
                    contentType: 'application/json;charset=utf-8',
                    dataType: 'json',
                    data: "{ file:'"+ path1 +"',name:'"+ name +"' }",
                    success: function () {
                        noty({ text: 'Import Successfully', layout: 'topRight', type: 'information' });
                        setTimeout(function () { $.noty.closeAll(); }, 3000);

                                                      
                        getdata();
                    },
                    error: function () {
                        alert("Insert Error");
                                                      
                    }

                });

            }

                                           

        }
        function updatedata() {

            var obj = {};
            obj.upid = id1;
            obj.uhid = $("#pre").html();
            obj.stitle = $("select[id$=ddltitle]").val();
            obj.fname = $("#txtfname").val();
            obj.mname = $("#txtmname").val();
            obj.lname = $("#txtlname").val();
            obj.pname = $("#txtpname").val();
            obj.mothernme = $("#motname").val();
            obj.country = $('select[id$=ddlcountry]').val();
            obj.state = $('select[id$=ddlstate]').val();
            obj.city = $('select[id$=ddlcity]').val();
            obj.address = $("#txtaddress").val();
            obj.resiaddrss = $("#txtresiadd").val();
            obj.peraddrss = $("#txtperadd").val();
            obj.pin = $("#txtpin").val();
            obj.castcategory = $('select[id$=ddlcateg]').val();
            obj.castes = $("#txtcaste").val();
            obj.bloodgroup = $('select[id$=ddlbgroup]').val();
            obj.gender = gender;
            obj.dob = $("#dp-5").val(); 
            obj.age = $("#txtage").val();
            obj.mobile1 = $("#txtmob1").val();
            obj.mobile2 = $("#txtmob2").val();
            obj.email = $("#txtemail").val();
            obj.stdyears = $("select[id$=ddlyears]").val();
            obj.classd = $('select[id$=ddlclass]').val();
            obj.division = $('select[id$=ddldivi]').val();
            obj.highquali = $("#ddlquali").val();
            obj.adharcard = $("#txtadhar").val();
            obj.admdate = $("#txtadmdt").val();
       
            obj.status = studst;
            obj.isprovisional = isprovi;
        
        
            $.ajax({
                url: "Registration3.aspx/UpdateData",
                contentType: "application/JSON; charset=utf-8",
                method: "post",
                datatype: "JSON",
                data: JSON.stringify(obj),
                success: function (data) {
                    getdata();
                    Clear(); getreceipts();
                    $("#btnsave").show();$("#btnupdates").hide();
                    $("#btnclose")[0].click();
                    noty({ text: 'Update Successfully', layout: 'topRight', type: 'information' });
                    setTimeout(function () { $.noty.closeAll(); }, 3000);

                }
            });
        }
        function deletedata(id1) {

            $.ajax({
                url: "Registration3.aspx/DeleteData",
                contentType: "application/JSON; charset=utf-8",
                method: "post",
                datatype: "JSON",
                data: "{id:'" + id1 + "'}",
                success: function (data) {
                    getdata();
                    noty({ text: 'Delete Successfully', layout: 'topRight', type: 'information' });
                    setTimeout(function () { $.noty.closeAll(); }, 3000);
                }
            });
        } 

        function agecalculator() {
            //collect input from HTML form and convert into date format
            var userinput = document.getElementById("dp-5").value;
                                  
            var dateParts = userinput.split("-");

            var dob = new Date(dateParts[2], (dateParts[1] - 1), dateParts[0]);
            // var userinput = document.getElementById("dp-4").value;
            //  var dob = new Date(userinput);
    
            //check user provide input or not
            if(userinput==null || userinput==''){
                //   document.getElementById("message").innerHTML = "**Choose a date please!";  
                return false; 
            } 
    
                //execute if the user entered a date 
            else {
                //extract the year, month, and date from user date input
                var dobYear = dob.getYear();
                var dobMonth = dob.getMonth();
                var dobDate = dob.getDate();
    
                //get the current date from the system
                var now = new Date();
                //extract the year, month, and date from current date
                var currentYear = now.getYear();
                var currentMonth = now.getMonth();
                var currentDate = now.getDate();
	
                //declare a variable to collect the age in year, month, and days
                var age = {};
                var ageString = "";
  
                //get years
                yearAge = currentYear - dobYear;
	
                //get months
                if (currentMonth >= dobMonth)
                    //get months when current month is greater
                    var monthAge = currentMonth - dobMonth;
                else {
                    yearAge--;
                    var monthAge = 12 + currentMonth - dobMonth;
                }

                //get days
                if (currentDate >= dobDate)
                    //get days when the current date is greater
                    var dateAge = currentDate - dobDate;
                else {
                    monthAge--;
                    var dateAge = 31 + currentDate - dobDate;

                    if (monthAge < 0) {
                        monthAge = 11;
                        yearAge--;
                    }
                }
                //group the age in a single variable
                age = {
                    years: yearAge,
                    months: monthAge,
                    days: dateAge
                };
                if ( (age.years == 0) && (age.months == 0) && (age.days > 0) )
                    ageString =   age.days + " days";
                    //when current month and date is same as birth date and month
                else if ( (age.years == 0) && (age.months > 0) && (age.days > 0) )
                    ageString = age.months + " months and " + age.days + " days";
                else  if ( (age.years == 0) && (age.months > 0) && (age.days == 0) )
                    ageString = age.months + " months";
                    //when current date is same as dob(date of birth)
                else ageString = ""; 
      
                $("#txtage").val(ageString);
                                        
             
            }
        }
    </script>

    <!--start page wrapper -->
    <div class="page-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12 mx-auto">

                    <div class="card">
                        <div class="card-body">
                            <div class="card-title d-flex align-items-center">

                                <h6>Student Details</h6>
                            </div>
                            <form class="row g-2">
                                <div class="col-md-12">
                                    <label>Select *.csv file</label>

                                    <%--<asp:FileUpload id ="filename3" runat="server" class="fileinput btn-primary" data-filename-placement="inside" title="File name goes inside"/>--%>

                                    <button type="button" class="btn btn-primary">
                                        <input type="file" class="fileinput btn-primary" name="filename3" id="filename3" data-filename-placement="inside" title="File name goes inside" /></button>
                                    <button type="button" id="addcat" value="submit" onclick="savedata1()" class="btn btn-primary"><span class="fa fa-plus"></span>Import</button>
                                </div>
                                <hr />

                                <div class="col-md-3">
                                    <label style="font-weight: bold">Student ID</label>
                                    <h4 style="margin-bottom: 5px">
                                        <label id="pre" style="color: #0033CC;"></label>
                                    </h4>
                                </div>

                                <%--<div class="col-md-3">
								<label>Student ID</label>
								<input class="form-control mb-3" type="text" placeholder="Student ID"
									aria-label="default input example">
							</div>--%>
                                <div class="col-md-2">
                                    <label style="font-weight: bold">Title<font color="#FF0000">*</font></label>
                                    <select id="ddltitle" class="form-select mb-3" aria-label="Default select example">
                                        <option value="">Select</option>
                                        <option value="Mr.">Mr</option>
                                        <option value="Miss.">Miss</option>
                                        <option value="Mrs.">Mrs</option>
                                        <option value="Ku.">Ku</option>
                                    </select>
                                </div>
                                <div class="col-md-2">
                                    <label style="font-weight: bold">First Name<font color="#FF0000">*</font></label>
                                    <input class="form-control mb-3" id="txtfname" type="text" placeholder="First Name"
                                        aria-label="default input example" />
                                </div>

                                <div class="col-md-2">
                                    <label style="font-weight: bold">Middle Name<font color="#FF0000">*</font></label>
                                    <input class="form-control mb-3" id="txtmname" type="text" placeholder="Middle Name"
                                        aria-label="default input example" />
                                </div>
                                <div class="col-md-2">
                                    <label style="font-weight: bold">Last Name<font color="#FF0000">*</font></label>
                                    <input class="form-control mb-3" id="txtlname" type="text" placeholder="Last Name "
                                        aria-label="default input example" />
                                </div>
                                <div class="col-md-2">
                                    <label style="font-weight: bold">P.Name<font color="#FF0000">*</font></label>
                                    <input class="form-control mb-3" id="txtpname" type="text" placeholder="Pref.Name"
                                        aria-label="default input example" />
                                </div>
                                <div class="col-md-2">
                                    <label style="font-weight: bold">Mother Name</label>
                                    <input class="form-control mb-3" id="motname" type="text" placeholder="Mother Name"
                                        aria-label="default input example" />
                                </div>

                                <div class="col-md-3">
                                    <label style="font-weight: bold">Country</label>
                                    <%-- <input class="form-control mb-3" id="ddlcountry" type="text" placeholder="Country"
									aria-label="default input example">--%>
                                    <select id="ddlcountry" class="form-select">
                                    </select>

                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">State</label>
                                    <%-- <input class="form-control mb-3" id="ddlstate" type="text" placeholder="State"
									aria-label="default input example">--%>
                                    <select id="ddlstate" class="form-select">
                                    </select>

                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">City</label>
                                    <%-- <input class="form-control mb-3" id="ddlcity" type="text" placeholder="City"
									aria-label="default input example">--%>
                                    <select id="ddlcity" class="form-select" data-live-search="true">
                                    </select>

                                </div>
                                <div class="col-3">
                                    <label style="font-weight: bold">Address</label>
                                    <textarea class="form-control" id="txtaddress" placeholder="Address..." rows="1"></textarea>
                                </div>
                                <div class="col-3">
                                    <label style="font-weight: bold">Residential address</label>
                                    <textarea class="form-control" id="txtresiadd" placeholder="Address..." rows="1"></textarea>
                                </div>
                                <div class="col-3">
                                    <label style="font-weight: bold">Permanent address</label>
                                    <textarea class="form-control" id="txtperadd" placeholder="Address..." rows="1"></textarea>
                                </div>

                                <div class="col-md-3">
                                    <label style="font-weight: bold">Pin code</label>
                                    <input class="form-control mb-3" id="txtpin" type="text" placeholder="Pin code"
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Caste Category</label>
                                    <select id="ddlcateg" class="form-select">
                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Caste</label>
                                    <input class="form-control mb-3" id="txtcaste" type="text" placeholder="Caste"
                                        aria-label="default input example">
                                </div>

                                <div class="col-md-3">
                                    <label style="font-weight: bold">Blood Group</label>
                                    <select id="ddlbgroup" class="form-select mb-3" aria-label="Default select example">
                                        <option value="">Select</option>
                                        <option value="A+ve">A+</option>
                                        <option value="B+ve">B+</option>
                                        <option value="AB+ve">AB+</option>
                                        <option value="O+ve">O+</option>
                                        <option value="A-ve">A-</option>
                                        <option value="B-ve">B-</option>
                                        <option value="AB-ve">AB-</option>
                                        <option value="O-ve">O-</option>


                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label style="margin-top: 4vh; font-weight: bold">Gender</label>
                                    <input type="radio" id="rbmale" name="gender" value="male">
                                    Male
                                <input type="radio" id="rbfemale" name="gender" value="female">
                                    Female
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">DOB</label>
                                    <input class="form-control mb-3" id="dp-5" type="date"
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Age</label>
                                    <input id="txtage" class="form-control mb-3" type="text" placeholder="Age"
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Mobile 1<font color="#FF0000">*</font></label>
                                    <input class="form-control mb-3" id="txtmob1" maxlength="10" type="tel" placeholder="Mobile No"
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Mobile 2</label>
                                    <input class="form-control mb-3" id="txtmob2" maxlength="10" type="tel" placeholder="Alternate No"
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Email</label>
                                    <input class="form-control mb-3" id="txtemail" type="email" placeholder="Email"
                                        aria-label="default input example" />
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Academic Year<font color="#FF0000">*</font></label>
                                    <select id="ddlyears" class="form-select mb-3" aria-label="Default select example">
                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Class<font color="#FF0000">*</font></label>
                                    <select id="ddlclass" class="form-select mb-3" aria-label="Default select example">
                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Divison<font color="#FF0000">*</font></label>
                                    <select id="ddldivi" class="form-select mb-3" aria-label="Default select example">
                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Highest Qualification<font color="#FF0000">*</font></label>
                                    <input class="form-control mb-3" id="ddlquali" type="text" placeholder="Highest Qualification"
                                        aria-label="default input example">
                                  
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold">Adhar Card No</label>
                                    <input class="form-control mb-3" id="txtadhar" maxlength="12" type="text" placeholder="Adhar Card No"
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight:bold;">Admission Date :</label>
                                    <input class="form-control mb-3" id="txtadmdt" type="date" 
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3" style="display: none">
                                    <label>BPL Card No</label>
                                    <input class="form-control mb-3" id="txtbpl" type="text" placeholder="BPL Card No"
                                        aria-label="default input example">
                                </div>
                                <div class="col-md-3" style="display: none">
                                    <label>Scheme<font color="#FF0000">*</font></label>
                                    <select id="ddlscheme" class="form-select mb-3" aria-label="Default select example">
                                        <option selected>Select</option>
                                        <option>Private</option>

                                    </select>
                                </div>
                                <div class="col-md-3" style="display: none">
                                    <label>Course Name<font color="#FF0000">*</font></label>
                                    <select class="form-select mb-3" id="ddlcourse" aria-label="Default select example">
                                        <option selected>Select</option>
                                        <option>physics</option>

                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label style="font-weight: bold; margin-bottom: 5px">Status</label>
                                    <br />
                                    <input type="radio" id="Radio1" name="st" value="Scholorship" />
                                    Scholorship &nbsp;&nbsp;&nbsp;
                                <input type="radio" id="Radio2" name="st" value="NonScholorship" />
                                    Non Scholorship
                                </div>

                                <div class="col-md-3">
                                    <label style="font-weight: bold; margin-bottom: 5px">Isprovisional<font color="#FF0000">*</font></label>
                                    <br />
                                    <input type="radio" id="Radio3" name="provi" value="Provisional Admission" />
                                    Provisional &nbsp;&nbsp;&nbsp;
                                <input type="radio" id="Radio4" name="provi" value="Confirm Admission" />
                                    Confirm
                                </div>
                                <div class="col-md-1" id="btnsave" style="margin-top: 2.5vh;display:none">
                                    <button type="button" id="btnadd" value="Submit" class="btn btn-primary">Submit</button>

                                </div>
                                <div class="col-md-1" id="btnupdates" style="margin-top: 2.5vh;display:none">
                                        <button type="button" id="Button3" value="Submit" onclick="updatedata();" class="btn btn-primary">Update</button>

                                    </div>
                            </form>


                        </div>
                    </div>

                    <div class="overlay toggle-icon"></div>
                    <hr />
                    <div class="col-md-12 mx-auto">
                        <div class="card">
                            <div class="card-body">
                                <div class="col-md-12">
                                    <div class="row">
                                        <div class="col-md-2">
                                            <label>Year</label>
                                            <select id="ddlyrs" class="form-select mb-3" aria-label="Default select example">
                                            </select>
                                        </div>
                                        <div class="col-md-2">
                                            <label>Class</label>
                                            <select id="ddlsclass" class="form-select mb-3" aria-label="Default select example">
                                            </select>
                                        </div>
                                        <div class="col-md-2">
                                            <label>Division</label>
                                            <select id="ddldivision" class="form-select mb-3" aria-label="Default select example">
                                            </select>
                                        </div>
                                        <div class="col-md-2" style="display:none">OR</div>
                                        <div class="col-md-2" style="">
                                            <label>Student Name</label>
                                            <select id="ddlstudent" class="form-select mb-3" aria-label="Default select example" data-live-search="true">
                                            </select>
                                        </div>
                                        <div class="col-md-2">
                                            <button type="button" id="Button2" value="Submit" onclick="searchdata();" class="btn btn-primary">Show</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="table-responsive">
                                    <table id="dataemp" class="table table-striped table-bordered">
                                        <thead>
                                            <tr>
                                            
                                                <th>Student ID</th>

                                                <th>Preference Name</th>

                                                <th>Admission Year</th>
                                                <th>Admission Date</th>
                                                <th>Class</th>
                                                <th>Division</th>
                                       
                                                <th style="background-color: #ffffff;">Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
														<%--	<tr>
																<td>1</td>
																<td>1321</td>	
																<td>Purva</td>
																<td>Bhimrao</td>
																<td>Kirnapure</td>
																<td>Purva</td>
																<td>Shanta</td>
																<td>India</td>
																<td>Maharashtra</td>
																<td>Amravati</td>
																<td>Sarswati Nagar</td>
																<td>Sarswati Nagar</td>
																<td>Sarswati Nagar</td>
																<td>444604</td>
																<td>OBC</td>
																<td>989876543</td>
																<td>989876543</td>
																<td>purva34@gmail.com</td>
																<td>A+ve</td>
																<td>12-14-2000</td>
																<td>BE</td>
																<td>7498588040</td>
																<td>7498588</td>
																<td>7498040</td>
																<td>Private</td>
																<td>Pending</td>
																<td style="background-color:#ffff;">
																	<!-- <button style="height:35px; width: 35px; padding-left:7px;"  data-bs-toggle="modal" data-bs-target="#exampleLargeModal" type="button" class="btn btn-secondary"6><i class="fadeIn animated bx bx-user-plus"></i>
																	</button>&nbsp;								 -->
																	<button  style="height:35px; width: 35px; padding-left:7px;" type="button" class="btn btn-success"  data-bs-toggle="modal" data-bs-target="#exampleLargeModal1"><i class='bx bx-message-square-edit'></i>
																	</button>&nbsp;<button  style="height:35px; width: 35px; padding-left:7px;" type="button" class="btn btn-danger"><i class="fadeIn animated bx bx-trash-alt"></i>
																	</button>&nbsp;
																	<button  style="height:35px; width: 35px; padding-left:7px;" type="button" class="btn btn-warning"><i class="lni lni-share"></i>
																	</button>&nbsp;
																	<button  style="height:35px; width: 35px; padding-left:7px;" type="button" class="btn btn-dark"><i class="fadeIn animated bx bx-printer"></i>
																	</button>
																</div>
																   </td>										
																						   
																   </tr>--%>
																	
															</tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
               <div class="col">
		<!-- Button trigger modal -->
		
		<!-- Modal -->
		<div class="modal fade" id="exampleLargeModal5" tabindex="-1" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title">Cancel Admission</h5>
						<button type="button" class="btn-close" data-bs-dismiss="modal" id="mclose1" aria-label="Close"></button>
					</div>
					<div class="modal-body">
                        <form class="row g-2">
					 <div class="col-md-2">
                         </div>
							 
                         <div class="col-md-3">
						
							<label>Cancel Date<font color="#000000">*</font> </label>
									<input type="date" id="incomedate" class="form-control" />
						</div>
                            	<div class="col-md-2" style="margin-top: 15px;">
						<button type="button" onclick="cancelstudent()" class="btn btn-primary">Cancel</button>
						
										
					   </div>

                            </form>
                        </div>
                    </div> 
                </div> 
            </div> 
                   </div>
            <div class="col">
                <!-- Button trigger modal -->
                <!-- Modal -->
                <div class="modal fade" id="exampleLargeModal1" tabindex="-1" aria-hidden="true">
                    <div class="modal-dialog modal-lg">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title">Student Details</h5>
                                <button type="button" class="btn-close" id="btnclose" data-bs-dismiss="modal" aria-label="Close"></button>
                            </div>
                            <div class="modal-body">
                                <form class="row g-2">

                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Student ID</label>
                                        <h4 style="margin-bottom: 5px">
                                            <label id="pre1" style="color: #0033CC;"></label>
                                        </h4>
                                    </div>

                                    <%--<div class="col-md-3">
								<label>Student ID</label>
								<input class="form-control mb-3" type="text" placeholder="Student ID"
									aria-label="default input example">
							</div>--%>
                                    <div class="col-md-2">
                                        <label style="font-weight: bold">Title<font color="#FF0000">*</font></label>
                                        <select id="ddltitle1" class="form-select mb-3" aria-label="Default select example">
                                            <option value="">Select</option>
                                            <option value="Mr">Mr</option>
                                            <option value="Miss">Miss</option>
                                            <option value="Mrs">Mrs</option>
                                            <option value="Ku">Ku</option>
                                        </select>
                                    </div>

                                    <div class="col-md-2">
                                        <label style="font-weight: bold">First Name<font color="#FF0000">*</font></label>
                                        <input class="form-control mb-3" id="txtfname1" type="text" placeholder="First Name"
                                            aria-label="default input example" />
                                    </div>

                                    <div class="col-md-2">
                                        <label style="font-weight: bold">Middle Name<font color="#FF0000">*</font></label>
                                        <input class="form-control mb-3" id="txtmname1" type="text" placeholder="Middle Name"
                                            aria-label="default input example" />
                                    </div>
                                    <div class="col-md-2">
                                        <label style="font-weight: bold">Last Name<font color="#FF0000">*</font></label>
                                        <input class="form-control mb-3" id="txtlname1" type="text" placeholder="Last Name "
                                            aria-label="default input example" />
                                    </div>
                                    <div class="col-md-2">
                                        <label style="font-weight: bold">P.Name<font color="#FF0000">*</font></label>
                                        <input class="form-control mb-3" id="txtpname1" type="text" placeholder="Pref.Name"
                                            aria-label="default input example" />
                                    </div>
                                    <div class="col-md-2">
                                        <label style="font-weight: bold">Mother Name</label>
                                        <input class="form-control mb-3" id="motname1" type="text" placeholder="Mother Name"
                                            aria-label="default input example" />
                                    </div>

                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Country</label>
                                        <%-- <input class="form-control mb-3" id="ddlcountry" type="text" placeholder="Country"
									aria-label="default input example">--%>
                                        <select id="ddlcountry1" class="form-select">
                                        </select>

                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">State</label>
                                        <%-- <input class="form-control mb-3" id="ddlstate" type="text" placeholder="State"
									aria-label="default input example">--%>
                                        <select id="ddlstate1" class="form-select">
                                        </select>

                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">City</label>
                                        <%-- <input class="form-control mb-3" id="ddlcity" type="text" placeholder="City"
									aria-label="default input example">--%>
                                        <select id="ddlcity1" class="form-select" data-live-search="true">
                                        </select>

                                    </div>
                                    <div class="col-3">
                                        <label style="font-weight: bold">Address</label>
                                        <textarea class="form-control" id="txtaddress1" placeholder="Address..." rows="1"></textarea>
                                    </div>
                                    <div class="col-3">
                                        <label style="font-weight: bold">Residential address</label>
                                        <textarea class="form-control" id="txtresiadd1" placeholder="Address..." rows="1"></textarea>
                                    </div>
                                    <div class="col-3">
                                        <label style="font-weight: bold">Permanent address</label>
                                        <textarea class="form-control" id="txtperadd1" placeholder="Address..." rows="1"></textarea>
                                    </div>

                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Pin code</label>
                                        <input class="form-control mb-3" id="txtpin1" type="text" placeholder="Pin code"
                                            aria-label="default input example">
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Caste Category</label>
                                        <select id="ddlcateg1" class="form-select">
                                        </select>
                                    </div>


                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Blood Group</label>
                                        <select id="ddlbgroup1" class="form-select mb-3" aria-label="Default select example">
                                            <option value="">Select</option>
                                            <option value="A+ve">A+</option>
                                            <option value="B+ve">B+</option>
                                            <option value="AB+ve">AB+</option>
                                            <option value="O+ve">O+</option>
                                            <option value="A-ve">A-</option>
                                            <option value="B-ve">B-</option>
                                            <option value="AB-ve">AB-</option>
                                            <option value="O-ve">O-</option>


                                        </select>
                                    </div>


                                    <div class="col-md-3">
                                        <label style="margin-top: 4vh; font-weight: bold">Gender</label>
                                        <input type="radio" id="Radio5" name="gender" value="male">
                                        Male
                                <input type="radio" id="Radio6" name="gender" value="female">
                                        Female
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">DOB</label>
                                        <input class="form-control mb-3" id="dp-6" type="date"
                                            aria-label="default input example">
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Age</label>
                                        <input id="txtage1" class="form-control mb-3" type="text" placeholder="Age"
                                            aria-label="default input example" />
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Mobile 1<font color="#FF0000">*</font></label>
                                        <input class="form-control mb-3" id="txtmob11" maxlength="10" type="tel" placeholder="Mobile No"
                                            aria-label="default input example">
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Mobile 2</label>
                                        <input class="form-control mb-3" id="txtmob21" maxlength="10" type="tel" placeholder="Alternate No"
                                            aria-label="default input example">
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Email</label>
                                        <input class="form-control mb-3" id="txtemail1" type="email" placeholder="Email"
                                            aria-label="default input example" />
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Academic Year<font color="#FF0000">*</font></label>
                                        <select id="ddlyears1" class="form-select mb-3" aria-label="Default select example">
                                        </select>
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Class<font color="#FF0000">*</font></label>
                                        <select id="ddlclass1" class="form-select mb-3" aria-label="Default select example">
                                        </select>
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Divison<font color="#FF0000">*</font></label>
                                        <select id="ddldivi1" class="form-select mb-3" aria-label="Default select example">
                                        </select>
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Highest Qualification<font color="#FF0000">*</font></label>
                                        <input class="form-control mb-3" id="ddlquali1" type="text" placeholder="Highest Qualification"
                                            aria-label="default input example">
                                        <%--<select id="ddlquali" class="form-select mb-3" aria-label="Default select example">
									<option selected>Select</option>
									<option >BE</option>
									<option>Bsc</option>
									<option >B.com</option>
									<option >Other (Please Specify)</option>
							
								</select>--%>
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold">Adhar Card No</label>
                                        <input class="form-control mb-3" id="txtadhar1" maxlength="12" type="text" placeholder="Adhar Card No"
                                            aria-label="default input example">
                                    </div>
                                    <div class="col-md-3" style="display: none">
                                        <label>Voting Card No</label>
                                        <input class="form-control mb-3" id="Text10" type="text" placeholder="Voting Card No"
                                            aria-label="default input example">
                                    </div>
                                    <div class="col-md-3" style="display: none">
                                        <label>BPL Card No</label>
                                        <input class="form-control mb-3" id="Text11" type="text" placeholder="BPL Card No"
                                            aria-label="default input example">
                                    </div>
                                    <div class="col-md-3" style="display: none">
                                        <label>Scheme<font color="#FF0000">*</font></label>
                                        <select id="Select10" class="form-select mb-3" aria-label="Default select example">
                                            <option selected>Select</option>
                                            <option>Private</option>

                                        </select>
                                    </div>
                                    <div class="col-md-3" style="display: none">
                                        <label>Course Name<font color="#FF0000">*</font></label>
                                        <select class="form-select mb-3" id="Select11" aria-label="Default select example">
                                            <option selected>Select</option>
                                            <option>physics</option>

                                        </select>
                                    </div>
                                    <div class="col-md-3">
                                        <label style="font-weight: bold; margin-bottom: 5px">Status</label>
                                        <br />
                                        <input type="radio" id="Radio7" name="st" value="Scholorship" />
                                        Scholorship &nbsp;&nbsp;&nbsp;
                                <input type="radio" id="Radio8" name="st" value="NonScholorship" />
                                        Non Scholorship
                                    </div>

                                    <div class="col-md-3">
                                        <label style="font-weight: bold; margin-bottom: 5px">Isprovisional<font color="#FF0000">*</font></label>
                                        <br />
                                        <input type="radio" id="Radio9" name="provi" value="provisional" />
                                        Provisional &nbsp;&nbsp;&nbsp;
                                <input type="radio" id="Radio10" name="provi" value="confirm" />
                                        Confirm
                                    </div>
                                    <div class="col-md-1" style="margin-top: 2.5vh;">
                                        <button type="button" id="Button1" value="Submit" onclick="updatedata();" class="btn btn-primary">Update</button>

                                    </div>


                                </form>

                                <!-- <div class="modal-footer"> -->

                                <button type="button" class="btn btn-primary" style="display: none">Save</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>




            <!--end page wrapper -->
            <!--start overlay-->

            <!--end page wrapper -->
            <!--start overlay-->
            <div class="overlay toggle-icon"></div>
            <!--end overlay-->
            <!--Start Back To Top Button-->
            <a href="javaScript:;" class="back-to-top"><i class='bx bxs-up-arrow-alt'></i></a>
            <!--End Back To Top Button-->

        </div>
    </div>
</asp:Content>

