function clear_form_login(){ document.getElementById("txt_birthyear").value = ""; document.getElementById("txt_password").value = ""; document.getElementById("txt_password").focus(); } function show_alert_error_sectors(data){ $('#alert-danger-sectors').removeClass('hide'); $('#alert-danger-sectors').html(data); } function clear_school_dt(){ document.getElementById("txt_sch_mouha").value = ""; document.getElementById("txt_sch_caza").value = ""; document.getElementById("txt_sch_id").value = ""; document.getElementById("txt_sch_tel").value = ""; document.getElementById("txt_sch_add").value = ""; if (document.getElementById("combo_fyear_p1").value) { document.getElementById("combo_fyear_p1").value = ""; } if (document.getElementById("combo_tyear_p1").value){ document.getElementById("combo_tyear_p1").value = ""; } if (document.getElementById("txt_prim_result1").value){ document.getElementById("txt_prim_result1").value = ""; } if(document.getElementById("combo_fyear_p2").value){ document.getElementById("combo_fyear_p2").value = ""; } if(document.getElementById("combo_tyear_p2").value) { document.getElementById("combo_tyear_p2").value = ""; } if (document.getElementById("txt_prim_result2").value){ document.getElementById("txt_prim_result2").value = ""; } if (document.getElementById("combo_fyear_p3").value){ document.getElementById("combo_fyear_p3").value = ""; } if(document.getElementById("combo_tyear_p3").value){ document.getElementById("combo_tyear_p3").value = ""; } if (document.getElementById("txt_prim_result3").value){ document.getElementById("txt_prim_result3").value = ""; } if(document.getElementById("cb_sv_f1").value){ document.getElementById("cb_sv_f1").value = ""; } if(document.getElementById("cb_sv_t1").value){ document.getElementById("cb_sv_t1").value = ""; } if (document.getElementById("txt_sv_result1").value) { document.getElementById("txt_sv_result1").value = ""; } if(document.getElementById("cb_sv_f2").value){ document.getElementById("cb_sv_f2").value = ""; } if(document.getElementById("cb_sv_t2").value){ document.getElementById("cb_sv_t2").value = ""; } if (document.getElementById("txt_sv_result2").value) { document.getElementById("txt_sv_result2").value = ""; } if(document.getElementById("cb_sv_f3").value){ document.getElementById("cb_sv_f3").value = ""; } if(document.getElementById("cb_sv_t3").value){ document.getElementById("cb_sv_t3").value = ""; } if (document.getElementById("txt_sv_result3").value) { document.getElementById("txt_sv_result3").value = ""; } if(document.getElementById("cb_sg_f1").value){ document.getElementById("cb_sg_f1").value = ""; } if(document.getElementById("cb_sg_t1").value){ document.getElementById("cb_sg_t1").value = ""; } if (document.getElementById("txt_sg_result1").value) { document.getElementById("txt_sg_result1").value = ""; } if(document.getElementById("cb_sg_f2").value){ document.getElementById("cb_sg_f2").value = ""; } if(document.getElementById("cb_sg_t2").value){ document.getElementById("cb_sg_t2").value = ""; } if (document.getElementById("txt_sg_result2").value) { document.getElementById("txt_sg_result2").value = ""; } if(document.getElementById("cb_sg_f3").value){ document.getElementById("cb_sg_f3").value = ""; } if(document.getElementById("cb_sg_t3").value){ document.getElementById("cb_sg_t3").value = ""; } if (document.getElementById("txt_sg_result3").value) { document.getElementById("txt_sg_result3").value = ""; } if(document.getElementById("cb_se_f1").value){ document.getElementById("cb_se_f1").value = ""; } if(document.getElementById("cb_se_t1").value){ document.getElementById("cb_se_t1").value = ""; } if (document.getElementById("txt_se_result1").value) { document.getElementById("txt_se_result1").value = ""; } if(document.getElementById("cb_se_f2").value){ document.getElementById("cb_se_f2").value = ""; } if(document.getElementById("cb_se_t2").value){ document.getElementById("cb_se_t2").value = ""; } if (document.getElementById("txt_se_result2").value) { document.getElementById("txt_se_result2").value = ""; } if(document.getElementById("cb_se_f3").value){ document.getElementById("cb_se_f3").value = ""; } if(document.getElementById("cb_se_t3").value){ document.getElementById("cb_se_t3").value = ""; } if (document.getElementById("txt_se_result3").value) { document.getElementById("txt_se_result3").value = ""; } if(document.getElementById("cb_lh_f1").value){ document.getElementById("cb_lh_f1").value = ""; } if(document.getElementById("cb_lh_t1").value){ document.getElementById("cb_lh_t1").value = ""; } if (document.getElementById("txt_lh_result1").value) { document.getElementById("txt_lh_result1").value = ""; } if(document.getElementById("cb_lh_f2").value){ document.getElementById("cb_lh_f2").value = ""; } if(document.getElementById("cb_lh_t2").value){ document.getElementById("cb_lh_t2").value = ""; } if (document.getElementById("txt_lh_result2").value) { document.getElementById("txt_lh_result2").value = ""; } if(document.getElementById("cb_lh_f3").value){ document.getElementById("cb_lh_f3").value = ""; } if(document.getElementById("cb_lh_t3").value){ document.getElementById("cb_lh_t3").value = ""; } if (document.getElementById("txt_lh_result3").value) { document.getElementById("txt_lh_result3").value = ""; } if (document.getElementById('photo6_div')) { document.getElementById('photo6_div').innerHTML = document.getElementById('photo6_div').innerHTML; } if (document.getElementById('photo7_div')) { document.getElementById('photo7_div').innerHTML = document.getElementById('photo7_div').innerHTML; } if (document.getElementById('photo8_div')) { document.getElementById('photo8_div').innerHTML = document.getElementById('photo8_div').innerHTML; } if (document.getElementById('photo9_div')) { document.getElementById('photo9_div').innerHTML = document.getElementById('photo9_div').innerHTML; } if (document.getElementById('photo10_div')) { document.getElementById('photo10_div').innerHTML = document.getElementById('photo10_div').innerHTML; } if (document.getElementById('photo11_div')) { document.getElementById('photo11_div').innerHTML = document.getElementById('photo11_div').innerHTML; } if (document.getElementById('photo12_div')) { document.getElementById('photo12_div').innerHTML = document.getElementById('photo12_div').innerHTML; } if (document.getElementById('photo13_div')) { document.getElementById('photo13_div').innerHTML = document.getElementById('photo13_div').innerHTML; } if (document.getElementById('photo14_div')) { document.getElementById('photo14_div').innerHTML = document.getElementById('photo14_div').innerHTML; } if (document.getElementById('photo15_div')) { document.getElementById('photo15_div').innerHTML = document.getElementById('photo15_div').innerHTML; } if (document.getElementById('photo16_div')) { document.getElementById('photo16_div').innerHTML = document.getElementById('photo16_div').innerHTML; } if (document.getElementById('photo17_div')) { document.getElementById('photo17_div').innerHTML = document.getElementById('photo17_div').innerHTML; } if (document.getElementById('photo18_div')) { document.getElementById('photo18_div').innerHTML = document.getElementById('photo18_div').innerHTML; } if (document.getElementById('photo19_div')) { document.getElementById('photo19_div').innerHTML = document.getElementById('photo19_div').innerHTML; } if (document.getElementById('photo20_div')) { document.getElementById('photo20_div').innerHTML = document.getElementById('photo20_div').innerHTML; } //document.getElementById("txt_fromyear").value = ""; //document.getElementById("txt_toyear").value = ""; //document.getElementById("txt_nbyear").value = ""; } function clear_form_adminwork(){ document.getElementById("txtautonum").value = ""; document.getElementById("txtfno").value = ""; document.getElementById("txtname").value = ""; document.getElementById("txtmothername").value = ""; document.getElementById("txtemail").value = ""; document.getElementById("txtdob").value = ""; document.getElementById("txtpob").value = ""; document.getElementById("txtnationality").value = ""; document.getElementById("txtmobile").value = ""; document.getElementById("txtphone").value = ""; document.getElementById("txtmouha").value = ""; document.getElementById("txtcaza").value = ""; document.getElementById("combo_work").value = ""; document.getElementById("txtcorrectarea").value = ""; document.getElementById("txtbankname").value = ""; document.getElementById("txtbranchbank").value = ""; } function clear_form_dataentry(){ document.getElementById("txtautonum").value = ""; document.getElementById("txtfno").value = ""; document.getElementById("txtiban").value = ""; document.getElementById("txtname").value = ""; document.getElementById("txtmothername").value = ""; document.getElementById("txtemail").value = ""; document.getElementById("txtdob").value = ""; document.getElementById("txtpob").value = ""; document.getElementById("txtnationality").value = ""; document.getElementById("txtmobile").value = ""; document.getElementById("txtphone").value = ""; document.getElementById("combo_work").value = ""; document.getElementById("combo_worktype").value = ""; document.getElementById("txtempstatus_o").checked = false; document.getElementById("txtempstatus_s").checked = false; document.getElementById("txtempstatus_r").checked = false; document.getElementById("txtempstatus_d").checked = false; document.getElementById("txtempstatus_m").checked = false; document.getElementById("txtempstatus_i").checked = false; document.getElementById("txtprimlastdegree").value = ""; document.getElementById("combo_work").value = ""; document.getElementById("txtcorrectarea").value = ""; document.getElementById("txtbankname").value = ""; document.getElementById("txtbranchbank").value = ""; } function clear_form_certificate(){ document.getElementById("txtproctorid").value = ""; document.getElementById("txtfno").value = ""; document.getElementById("txtiban").value = ""; document.getElementById("txtname").value = ""; document.getElementById("txtmothername").value = ""; document.getElementById("txtemail").value = ""; document.getElementById("txtdob").value = ""; document.getElementById("txtpob").value = ""; document.getElementById("txtphone").value = ""; document.getElementById("txtmobile").value = ""; document.getElementById("txtaddress").value = ""; document.getElementById("txtbankname").value = ""; document.getElementById("txtbranchbank").value = ""; document.getElementById("txtempstatus_o").checked = false; document.getElementById("txtempstatus_s").checked = false; document.getElementById("txtempstatus_r").checked = false; document.getElementById("txtempstatus_d").checked = false; document.getElementById("txtempstatus_m").checked = false; document.getElementById("txtempstatus_i").checked = false; document.getElementById("txtprimsubject").value = ""; document.getElementById("txtprimlangfr").checked = false; document.getElementById("txtprimlangen").checked = false; document.getElementById("txtprimlangar").checked = false; document.getElementById("txtprimshareyears").value = "0"; document.getElementById("txtprimquestshareyears").value = "0"; document.getElementById("txtprimexamsshareyears").value = "0"; document.getElementById("txtprimlastdegree").value = ""; document.getElementById("txtsecsubject").value = ""; document.getElementById("txtseclangfr").checked = false; document.getElementById("txtseclangen").checked = false; document.getElementById("txtseclangar").checked = false; document.getElementById("txtcorrect_sv").checked = false; document.getElementById("txtcorrect_sg").checked = false; document.getElementById("txtcorrect_se").checked = false; document.getElementById("txtcorrect_lh").checked = false; document.getElementById("txtsecshareyears").value = "0"; document.getElementById("txtsecquestshareyears").value = "0"; document.getElementById("txtsecexamsshareyears").value = "0"; document.getElementById("txtseclastdegree").value = ""; document.getElementById("txtcorrectarea").value = ""; document.getElementById("txt_sch_tel").value = ""; document.getElementById("txt_sch_add").value = ""; //document.getElementById("txt_sch_major").value = ""; if (document.getElementById('photo1_div')) { document.getElementById('photo1_div').innerHTML = document.getElementById('photo1_div').innerHTML; } if (document.getElementById('photo2_div')) { document.getElementById('photo2_div').innerHTML = document.getElementById('photo2_div').innerHTML; } if (document.getElementById('photo3_div')) { document.getElementById('photo3_div').innerHTML = document.getElementById('photo3_div').innerHTML; } if (document.getElementById('photo4_div')) { document.getElementById('photo4_div').innerHTML = document.getElementById('photo4_div').innerHTML; } if (document.getElementById('photo5_div')) { document.getElementById('photo5_div').innerHTML = document.getElementById('photo5_div').innerHTML; } if (document.getElementById('photo6_div')) { document.getElementById('photo6_div').innerHTML = document.getElementById('photo6_div').innerHTML; } if (document.getElementById('photo7_div')) { document.getElementById('photo7_div').innerHTML = document.getElementById('photo7_div').innerHTML; } if (document.getElementById('photo8_div')) { document.getElementById('photo8_div').innerHTML = document.getElementById('photo8_div').innerHTML; } if (document.getElementById('photo9_div')) { document.getElementById('photo9_div').innerHTML = document.getElementById('photo9_div').innerHTML; } if (document.getElementById('photo10_div')) { document.getElementById('photo10_div').innerHTML = document.getElementById('photo10_div').innerHTML; } if (document.getElementById('photo11_div')) { document.getElementById('photo11_div').innerHTML = document.getElementById('photo11_div').innerHTML; } if (document.getElementById('photo12_div')) { document.getElementById('photo12_div').innerHTML = document.getElementById('photo12_div').innerHTML; } if (document.getElementById('photo13_div')) { document.getElementById('photo13_div').innerHTML = document.getElementById('photo13_div').innerHTML; } if (document.getElementById('photo14_div')) { document.getElementById('photo14_div').innerHTML = document.getElementById('photo14_div').innerHTML; } if (document.getElementById('photo15_div')) { document.getElementById('photo15_div').innerHTML = document.getElementById('photo15_div').innerHTML; } if (document.getElementById('photo16_div')) { document.getElementById('photo16_div').innerHTML = document.getElementById('photo16_div').innerHTML; } if (document.getElementById('photo17_div')) { document.getElementById('photo17_div').innerHTML = document.getElementById('photo17_div').innerHTML; } if (document.getElementById('photo18_div')) { document.getElementById('photo18_div').innerHTML = document.getElementById('photo18_div').innerHTML; } if (document.getElementById('photo19_div')) { document.getElementById('photo19_div').innerHTML = document.getElementById('photo19_div').innerHTML; } if (document.getElementById('photo20_div')) { document.getElementById('photo20_div').innerHTML = document.getElementById('photo20_div').innerHTML; } if (document.getElementById('school-grid')) { document.getElementById('school-grid').innerHTML = ""; } clear_school_dt(); populate_list_proctor_mouha(); populate_list_proctor_caza(); populate_list_sch_mouha(); populate_list_sch_caza(); populate_list_inst(); //search_auto_num(); populate_data_school(); $('#approve_div').addClass('hide'); $('#notapprove_div').addClass('hide'); document.getElementById("txtautonum").focus(); } function clear_form_detail(){ document.getElementById("txt_sch_tel").value = ""; document.getElementById("txt_sch_add").value = ""; populate_list_sch_mouha(); populate_list_sch_caza(); populate_list_inst(); populate_data_school(); } function show_alert_error_certificate(data){ $('#alert-danger-certificate').removeClass('hide'); $('#alert-danger-certificate').html(data); } function show_alert_error_certificate_header(data){ $('#alert-danger-certificate-header').removeClass('hide'); $('#alert-danger-certificate-header').html(data); } function show_alert_success_certificate_header(data){ $('#alert-success-certificate-header').removeClass('hide'); $('#alert-success-certificate-header').html(data); } function show_alert_error_certificate_middle(data){ $('#alert-danger-certificate-middle').removeClass('hide'); $('#alert-danger-certificate-middle').html(data); } function show_alert_error_certificate_middle2(data){ $('#alert-danger-certificate-middle2').removeClass('hide'); $('#alert-danger-certificate-middle2').html(data); } function show_alert_calculation_nbyear(data){ $('#alert-calculation-nbyear').removeClass('hide'); $('#alert-calculation-nbyear').html(data); } function show_alert_success_certificate(data){ $('#alert-success-certificate').removeClass('hide'); $('#alert-success-certificate').html(data); } function submit_form_certificate_dt(action){ var autonum = document.getElementById("txtautonum").value; var fno = document.getElementById("txtfno").value; var firstname = document.getElementById("txtname").value; var dob = document.getElementById("txtdob").value; var mothername = document.getElementById("txtmothername").value ; var pob = document.getElementById("txtpob").value; var mobile = document.getElementById("txtmobile").value; var sch_id = document.getElementById("txt_sch_id").value; var prim_subject = document.getElementById("txtprimsubject").value; var sec_subject = document.getElementById("txtsecsubject").value; var prim_sharingyear = document.getElementById("txtprimshareyears").value; var v_mouha = document.getElementById("txtmouha").value; var v_caza = document.getElementById("txtcaza").value; var v_emp_o =document.getElementById("txtempstatus_o").checked; var v_emp_s =document.getElementById("txtempstatus_s").checked; var v_emp_r =document.getElementById("txtempstatus_r").checked; var v_emp_d =document.getElementById("txtempstatus_d").checked; var v_emp_m =document.getElementById("txtempstatus_m").checked; var v_emp_i =document.getElementById("txtempstatus_i").checked; var v_correctionarea = document.getElementById("txtcorrectarea").value; document.getElementById("txtaction").value = action; $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); if (autonum == "") { show_alert_error_certificate_header('الرجاء تعبئة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (autonum != "" && (autonum*1 != autonum/1)) { show_alert_error_certificate_header('الرجاء تعبئة أرقام في خانة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (dob == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة تاريخ الميلاد.'); document.getElementById("txtdob").focus(); return false; } else if (mobile == "") { show_alert_error_certificate_header('الرجاء إدخال رقم الخليوي.'); document.getElementById("txtmobile").focus(); return false; } else if (pob == "") { show_alert_error_certificate_header('الرجاء تعبئة محل الولادة.'); document.getElementById("txtpob").focus(); return false; } else if (firstname == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة الإسم.'); document.getElementById("txtname").focus(); return false; } else if (mothername == "") { show_alert_error_certificate_header('الرجاء تعبئة اسم الأم'); document.getElementById("txtmothername").focus(); return false; } else if (v_mouha == "" ){ show_alert_error_certificate_header('الرجاء تعبئة اسم المحافظة.'); document.getElementById("txtmouha").focus(); return false; } else if (v_caza == "" ){ show_alert_error_certificate_header('الرجاء تعبئة اسم القضاء'); document.getElementById("txtcaza").focus(); return false; } else if (prim_subject == "" && sec_subject == ""){ show_alert_error_certificate_middle('الرجاء تعبئة اسم المادة.'); document.getElementById("txtprimsubject").focus(); return false; } else if (v_emp_o == false && v_emp_s == false && v_emp_r == false && v_emp_d == false && v_emp_m == false && v_emp_i == false){ show_alert_error_certificate_middle('الرجاء تعبئة الوضع الوظيفي.'); document.getElementById("txtempstatus_o").focus(); return false; } //else if (sch_id == ""){ //show_alert_error_certificate_middle2('الرجاء تعبئة خانة المدرسة/الثانوية.'); //document.getElementById("txt_sch_id").focus(); //return false; //} else if (v_correctionarea == ""){ show_alert_error_certificate_middle2('الرجاء إدخال إسم المحافظة التي ترغب التصحيح فيها.'); document.getElementById("txtcorrectarea").focus(); return false; } else { $("#certificate-form").ajaxForm({ complete: function(data) { if (data.responseText != "" && data.responseText.indexOf("الرقم المتسلسل: ") == -1){ show_alert_error_certificate(data.responseText); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح. ' + data.responseText); var str = data.responseText; var detailseq = str.substring(str.lastIndexOf(':') + 1); if (detailseq != "") { document.getElementById("txttransseq").value = detailseq; } show_grid_school(); clear_form_detail(); clear_school_dt(); if (data.responseText != "") { alert(data.responseText); } } }, error: function(data) { show_alert_error_certificate(data); } }); } } function submit_form_certificate(action){ var autonum = document.getElementById("txtautonum").value; var fno = document.getElementById("txtfno").value; var firstname = document.getElementById("txtname").value; var dob = document.getElementById("txtdob").value; var mothername = document.getElementById("txtmothername").value; var pob = document.getElementById("txtpob").value; var mobile = document.getElementById("txtmobile").value; var sch_id = document.getElementById("txt_sch_id").value; var prim_subject = document.getElementById("txtprimsubject").value; var sec_subject = document.getElementById("txtsecsubject").value; var prim_sharingyear = document.getElementById("txtprimshareyears").value; var v_mouha = document.getElementById("txtmouha").value; var v_caza = document.getElementById("txtcaza").value; var v_emp_o =document.getElementById("txtempstatus_o").checked; var v_emp_s =document.getElementById("txtempstatus_s").checked; var v_emp_r =document.getElementById("txtempstatus_r").checked; var v_emp_d =document.getElementById("txtempstatus_d").checked; var v_emp_m =document.getElementById("txtempstatus_m").checked; var v_emp_i =document.getElementById("txtempstatus_i").checked; var v_correctionarea = document.getElementById("txtcorrectarea").value; document.getElementById("txtaction").value = action; $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); if (autonum == "") { show_alert_error_certificate_header('الرجاء تعبئة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (autonum != "" && (autonum*1 != autonum/1)) { show_alert_error_certificate_header('الرجاء تعبئة أرقام في خانة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (mothername == "") { show_alert_error_certificate_header('الرجاء تعبئة اسم الأم'); document.getElementById("txtmothername").focus(); return false; } else if (pob == "") { show_alert_error_certificate_header('الرجاء إدخال محل الولادة'); document.getElementById("txtpob").focus(); return false; } else if (mobile == "") { show_alert_error_certificate_header('الرجاء إدخال رقم الخليوي'); document.getElementById("txtmobile").focus(); return false; } else if (dob == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة تاريخ الميلاد.'); document.getElementById("txtdob").focus(); return false; } else if (firstname == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة الإسم.'); document.getElementById("txtname").focus(); return false; } else if (v_mouha == "") { show_alert_error_certificate_header('الرجاء ادخال اسم المحافظة.'); document.getElementById("txtmouha").focus(); return false; } else if (v_caza == "") { show_alert_error_certificate_header('الرجاء ادخال قضاء السكن.'); document.getElementById("txtcaza").focus(); return false; } else { $("#certificate-form").ajaxForm({ complete: function(data) { if (data.responseText != "" && data.responseText.indexOf("الرقم المتسلسل: ") == -1){ show_alert_error_certificate(data.responseText); } else { show_alert_success_certificate_header('تم ارسال المعلومات بنجاح. ' + data.responseText); var str = data.responseText; var detailseq = str.substring(str.lastIndexOf(':') + 1); if (detailseq != "") { document.getElementById("txttransseq").value = detailseq; } show_grid_school(); clear_form_detail(); if (data.responseText != "") { alert(data.responseText); } } }, error: function(data) { show_alert_error_certificate(data); } }); } } function submit_form_sch_images() { var proctorid = document.getElementById("txtproctorid").value; var transseq = document.getElementById("txttransseq").value; if (transseq == "") { return false; } var vOption = document.getElementsByName('rdsch'); for (var i=0; i < vOption.length; i++) { if (vOption[i].checked) { var vRecordID = vOption[i].value; } } if (vRecordID != "" && vRecordID != undefined) { document.getElementById("txtaction1").value = 'uploadimage'; document.getElementById("txtrecid").value = vRecordID; $("#certificate-form").ajaxForm({ complete: function(data) { if (data.responseText != ""){ show_alert_error_certificate(data.responseText); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح. '); } }, error: function(data) { show_alert_error_certificate(data); } }); } else { return false; } } function submit_form_images() { var proctorid = document.getElementById("txtproctorid").value; var transseq = document.getElementById("txttransseq").value; if (transseq == "") { return false; } if (proctorid != "" && transseq != "") { $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); document.getElementById("txtaction2").value = 'uploaddocs'; $("#certificate-form").ajaxForm({ complete: function(data) { if (data.responseText != ""){ show_alert_error_certificate(data.responseText); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح. '); } }, error: function(data) { show_alert_error_certificate(data); } }); } else { return false; } } function submit_detailproctors(){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; document.getElementById("txtaction").value = 'update_detail'; $.post('proc_detail_action.php', $('#certificate-form').serialize(), function(data){ if (data.error_msg != ""){ show_alert_error_certificate_header(data.error_msg); } else { show_alert_success_certificate_header('تم ارسال المعلومات بنجاح.'); } }).fail(function(data) { show_alert_error_certificate_header(data); }); return false; } function submit_proctors_data(){ var autonum = document.getElementById("txtautonum").value; var fno = document.getElementById("txtfno").value; var firstname = document.getElementById("txtname").value; var dob = document.getElementById("txtdob").value; var mothername = document.getElementById("txtmothername").value; var pob = document.getElementById("txtpob").value; var mobile = document.getElementById("txtmobile").value; var v_mouha = document.getElementById("txtmouha").value; var v_caza = document.getElementById("txtcaza").value; var v_emp_o =document.getElementById("txtempstatus_o").checked; var v_emp_s =document.getElementById("txtempstatus_s").checked; var v_emp_r =document.getElementById("txtempstatus_r").checked; var v_emp_d =document.getElementById("txtempstatus_d").checked; var v_emp_m =document.getElementById("txtempstatus_m").checked; var v_emp_i =document.getElementById("txtempstatus_i").checked; var v_correctionarea = document.getElementById("txtcorrectarea").value; var v_bankname = document.getElementById("txtbankname").value; var v_bankbranch = document.getElementById("txtbranchbank").value; document.getElementById("txtaction").value = 'save_proctors_info'; $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); if (autonum == "") { show_alert_error_certificate_header('الرجاء تعبئة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (autonum != "" && (autonum*1 != autonum/1)) { show_alert_error_certificate_header('الرجاء تعبئة أرقام في خانة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (mothername == "") { show_alert_error_certificate_header('الرجاء تعبئة اسم الأم'); document.getElementById("txtmothername").focus(); return false; } else if (pob == "") { show_alert_error_certificate_header('الرجاء إدخال محل الولادة'); document.getElementById("txtpob").focus(); return false; } else if (mobile == "") { show_alert_error_certificate_header('الرجاء إدخال رقم الخليوي'); document.getElementById("txtmobile").focus(); return false; } else if (dob == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة تاريخ الميلاد.'); document.getElementById("txtdob").focus(); return false; } else if (firstname == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة الإسم.'); document.getElementById("txtname").focus(); return false; } else if (v_mouha == "") { show_alert_error_certificate_header('الرجاء ادخال اسم المحافظة.'); document.getElementById("txtmouha").focus(); return false; } else if (v_caza == "") { show_alert_error_certificate_header('الرجاء ادخال قضاء السكن.'); document.getElementById("txtcaza").focus(); return false; } else if (v_emp_r == false && v_emp_o == false && v_emp_s == false && v_emp_d == false && v_emp_m == false && v_emp_i == false){ show_alert_error_certificate_header('الرجاء تعبئة الوضع الوظيفي.'); document.getElementById("txtempstatus_o").focus(); return false; }else if (v_bankname == ""){ show_alert_error_certificate_header('الرجاء إدخال إسم المصرف.'); document.getElementById("txtbankname").focus(); return false; }else if (v_bankbranch == ""){ show_alert_error_certificate_header('الرجاء إدخال فرع المصرف.'); document.getElementById("txtbranchbank").focus(); return false; } else { $.post('certificate_action.php', $('#certificate-form').serialize(), function(data){ if (data.error_msg != ""){ show_alert_error_certificate_header(data.error_msg); } else { show_alert_success_certificate_header('تم ارسال المعلومات بنجاح.'); } }).fail(function(data) { show_alert_error_certificate_header(data); }); } // to prevent refreshing the whole page page return false; } function approve_certificate(){ var transseq = document.getElementById("txttransseq").value; if (transseq == "") { show_alert_error_certificate('الرجاء تعبئة خانة الرقم المتسلسل وثم الضغط على زر تأكيد المعلومات.'); document.getElementById("txttransseq").focus(); return false; } $.post('certificate_action.php', {action: 'approve_record', transseq: transseq}, function(data){ if (data.error_msg != ""){ show_alert_error_certificate(data.error_msg); } else { show_alert_success_certificate('تمت الموافقة على الإستمارة رقم: ' + transseq); clear_form_certificate(); } }).fail(function(data) { show_alert_error_certificate(data); }); // to prevent refreshing the whole page page return false; } function submit_form_login() { // var v_name = document.getElementById("txt_name").value; var v_password = document.getElementById("txt_password").value; $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); //if (v_name == "") { //show_alert_error_certificate('الرجاء تعبئة خانة الإسم.'); //document.getElementById("txt_name").focus(); // } else if (v_password == "") { show_alert_error_certificate('الرجاء تعبئة خانة كلمة المرور'); document.getElementById("txt_password").focus(); //return false; } else { $.post('certificate_action.php', $('#certificate-form').serialize(), function(data){ if (data.error_msg != ""){ show_alert_error_certificate(data.error_msg); } else { show_alert_error_certificate('الرجاء تعبئة خانة الإسم'); window.location.href ="/certificate.php"; clear_form_certificate(); } }).fail(function(data) { show_alert_error_certificate(data); }); } return false; } function populate_list_nationalities(){ $.post('populatelists.php', {action: 'list_nationalities'}, function(data){$(".list-nationalities").html(data); }); } function get_work(){ $.post('populatelists.php', {action: 'list_work'}, function(data){$(".combo-work").html(data); }); } function get_worktype(){ $.post('populatelists.php', {action: 'list_worktype'}, function(data){$(".combo-worktype").html(data); }); } function populate_fromyear(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".list-fromyear").html(data); }); } function fill_prim_fyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".combo-fyear-p1").html(data); }); } function fill_prim_fyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".combo-fyear-p2").html(data); }); } function fill_prim_fyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".combo-fyear-p3").html(data); }); } function fill_prim_tyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".combo-tyear-p1").html(data); }); } function fill_prim_tyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".combo-tyear-p2").html(data); }); } function fill_prim_tyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".combo-tyear-p3").html(data); }); } function fill_sv_fyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sv-f1").html(data); }); } function fill_sv_tyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sv-t1").html(data); }); } function fill_sv_fyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sv-f2").html(data); }); } function fill_sv_tyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sv-t2").html(data); }); } function fill_sv_fyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sv-f3").html(data); }); } function fill_sv_tyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sv-t3").html(data); }); } function fill_sg_fyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sg-f1").html(data); }); } function fill_sg_fyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sg-f2").html(data); }); } function fill_sg_fyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sg-f3").html(data); }); } function fill_sg_tyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sg-t1").html(data); }); } function fill_sg_tyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sg-t2").html(data); }); } function fill_sg_tyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-sg-t3").html(data); }); } function fill_se_fyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-se-f1").html(data); }); } function fill_se_fyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-se-f2").html(data); }); } function fill_se_fyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-se-f3").html(data); }); } function fill_se_tyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-se-t1").html(data); }); } function fill_se_tyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-se-t2").html(data); }); } function fill_se_tyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-se-t3").html(data); }); } function fill_lh_fyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-lh-f1").html(data); }); } function fill_lh_fyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-lh-f2").html(data); }); } function fill_lh_fyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-lh-f3").html(data); }); } function fill_lh_tyear1(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-lh-t1").html(data); }); } function fill_lh_tyear2(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-lh-t2").html(data); }); } function fill_lh_tyear3(){ $.post('populatelists.php', {action: 'list_fromyear'}, function(data){$(".cb-lh-t3").html(data); }); } function calc_prim_year1() { var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("combo_fyear_p1").value; v_toyear =document.getElementById("combo_tyear_p1").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح : من العام < الى العام'); } else { document.getElementById("txt_prim_result1").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_prim_year2() { var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("combo_fyear_p2").value; v_toyear =document.getElementById("combo_tyear_p2").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_prim_result2").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_prim_year3() { var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("combo_fyear_p3").value; v_toyear =document.getElementById("combo_tyear_p3").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_prim_result3").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_sv_fyear1(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_sv_f1").value; v_toyear =document.getElementById("cb_sv_t1").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_sv_result1").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_sv_fyear2(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_sv_f2").value; v_toyear =document.getElementById("cb_sv_t2").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_sv_result2").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_sv_fyear3(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_sv_f3").value; v_toyear =document.getElementById("cb_sv_t3").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_sv_result3").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_sg_fyear1(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_sg_f1").value; v_toyear =document.getElementById("cb_sg_t1").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_sg_result1").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_sg_fyear2(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_sg_f2").value; v_toyear =document.getElementById("cb_sg_t2").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_sg_result2").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_sg_fyear3(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_sg_f3").value; v_toyear =document.getElementById("cb_sg_t3").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_sg_result3").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_se_fyear1(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_se_f1").value; v_toyear =document.getElementById("cb_se_t1").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_se_result1").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_se_fyear2(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_se_f2").value; v_toyear =document.getElementById("cb_se_t2").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_se_result2").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_se_fyear3(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_se_f3").value; v_toyear =document.getElementById("cb_se_t3").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_se_result3").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_lh_fyear1(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_lh_f1").value; v_toyear =document.getElementById("cb_lh_t1").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_lh_result1").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_lh_fyear2(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_lh_f2").value; v_toyear =document.getElementById("cb_lh_t2").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_lh_result2").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function calc_lh_fyear3(){ var v_fromyear,v_toyear,nb_year; v_fromyear =document.getElementById("cb_lh_f3").value; v_toyear =document.getElementById("cb_lh_t3").value; if (v_fromyear != "" && v_toyear != "") { nb_year = (v_toyear - v_fromyear)+1; if (nb_year < 0) { show_alert_calculation_nbyear('الرجاء إدخال سنوات الخبرة بشكل صحيح'); } else { document.getElementById("txt_lh_result3").value=nb_year; $('#alert-calculation-nbyear').addClass('hide'); } } } function populate_toyear(){ $.post('populatelists.php', {action: 'list_toyear'}, function(data){$(".list-toyear").html(data); }); } function combo_change(){ $.post('populatelists.php', {action: 'combo_change'}, function(data){ $(".combo-change").html(data); }); } function populate_list_areas(){ $.post('populatelists.php', {action: 'list_areas'}, function(data){ $(".list-areas").html(data); }); } function populate_list_inst(uni_id){ var mouhafaza; if (document.getElementById("txt_sch_mouha")) { mouhafaza =document.getElementById("txt_sch_mouha").value; $.post('populatelists.php', {action: 'list_prim_inst', mouhafaza: mouhafaza}, function(data){ $(".list-sch-id").html(data); if(uni_id != "" && uni_id != "0" && uni_id != undefined) { if (document.getElementById("txt_sch_id")) { document.getElementById("txt_sch_id").value = uni_id; } } }); } } function populate_list_sch_mouha(){ var dflt_mouha = document.getElementById("default_mouha").value; $.post('populatelists.php', {action: 'list_prim_mouha' , param_mouha: dflt_mouha}, function(data){ $(".list-sch-mouha").html(data); }); } function populate_list_sch_caza(kadaaid){ var mouhaid = document.getElementById("txt_sch_mouha").value; $.post('populatelists.php', {action: 'list_caza' , mouhaid: mouhaid}, function(data){ $(".list-sch-caza").html(data); if(kadaaid != "" && kadaaid != "0" && kadaaid != undefined) { if (document.getElementById("txt_sch_caza")) { document.getElementById("txt_sch_caza").value = kadaaid ; } } }); } function populate_list_proctor_mouha(mouhaid,kadaaid){ var dflt_mouha = document.getElementById("default_mouha").value; $.post('populatelists.php', {action: 'list_mouha' , param_mouha: dflt_mouha}, function(data){ $(".list-proctor-mouha").html(data); if(mouhaid != "" && mouhaid != "0" && mouhaid != undefined) { if (document.getElementById("txtmouha")) { document.getElementById("txtmouha").value = mouhaid ; populate_list_proctor_caza(kadaaid); } } }); } function populate_list_assistant_mouha(mouhaid,kadaaid){ var dflt_mouha = document.getElementById("default_mouha").value; $.post('populatelists.php', {action: 'list_mouha' , param_mouha: dflt_mouha}, function(data){ $(".list-proctor-mouha").html(data); if(mouhaid != "" && mouhaid != "0" && mouhaid != undefined) { if (document.getElementById("txtmouha")) { document.getElementById("txtmouha").value = mouhaid ; populate_list_proctor_caza(kadaaid); } } }); } function populate_list_adminwork_mouha(mouhaid,kadaaid){ var dflt_mouha = document.getElementById("default_mouha").value; $.post('populatelists.php', {action: 'list_mouha' , param_mouha: dflt_mouha}, function(data){ $(".list-proctor-mouha").html(data); if(mouhaid != "" && mouhaid != "0" && mouhaid != undefined) { if (document.getElementById("txtmouha")) { document.getElementById("txtmouha").value = mouhaid ; populate_list_proctor_caza(kadaaid); } } }); } function populate_list_assistant_degree(degreeid){ //var dflt_degree = document.getElementById("txtprimlastdegree").value; $.post('populatelists.php', {action: 'list_degree' , degreeid: degreeid}, function(data){ $(".list-prim-degrees").html(data); document.getElementById("txtprimlastdegree").value = degreeid; }); } function populate_list_assistant_work(workid){ $.post('populatelists.php', {action: 'list_work' , workid: workid}, function(data){ $(".combo-work").html(data); }); } function populate_list_proctor_caza(kadaaid){ document.getElementById("txtcaza").value = kadaaid ; var mouhaid = document.getElementById("txtmouha").value; $.post('populatelists.php', {action: 'list_caza' , mouhaid: mouhaid}, function(data){ $(".list-proctor-caza").html(data); if(kadaaid != "" && kadaaid != "0" && kadaaid != undefined) { if (document.getElementById("txtcaza")) { document.getElementById("txtcaza").value = kadaaid ; } }else { document.getElementById("txtcaza").value = data.caza_id; } }); } function populate_list_sec_inst(uni_id){ var secmouhafaza; if (document.getElementById("txtsecmouha")) { secmouhafaza =document.getElementById("txtsecmouha").value; $.post('populatelists.php', {action: 'list_sec_inst', mouhafaza: secmouhafaza}, function(data){ $(".list-sec-inst").html(data); if(uni_id != "" && uni_id != "0" && uni_id != undefined) { if (document.getElementById("txtsecunivname")) { document.getElementById("txtsecunivname").value = uni_id; } } }); } } function populate_list_prim_subjects(){ $.post('populatelists.php', {action: 'list_prim_subjects'}, function(data){ $(".list-prim-subjects").html(data); }); } function populate_list_sec_subjects(){ $.post('populatelists.php', {action: 'list_sec_subjects'}, function(data){ $(".list-sec-subjects").html(data); }); } function populate_list_prim_degrees(){ $.post('populatelists.php', {action: 'list_prim_degrees'}, function(data){ $(".list-prim-degrees").html(data); }); } function populate_list_sec_degrees(){ $.post('populatelists.php', {action: 'list_sec_degrees'}, function(data){ $(".list-sec-degrees").html(data); }); } function empty_sec(){ var detailseq = document.getElementById("txt_reference").value; $.post('certificate_action.php', {action: 'empty_sec', detailseq: detailseq}, function(data){ alert('تمت العملية بنجاح' ); }); } function empty_prim(){ var detailseq = document.getElementById("txt_reference").value; $.post('certificate_action.php', {action: 'empty_prim', detailseq: detailseq}, function(data){ alert('تمت العملية بنجاح' ); }); } function search_reference(){ var autonum = document.getElementById("txt_search_id").value; $.post('search_action.php', {action: 'get_reference', autonum: autonum}, function(data){ alert('الرقم المتسلسل ' + data.detailseq); }); } function search_referencebyname(){ var v_name = document.getElementById("txt_search_name").value; $.post('search_action.php', {action: 'get_name', v_name: v_name}, function(data){ $("#name-grid").html(data); }); } function delete_details(){ var reference = document.getElementById("txt_reference").value; if (reference != '') { $.post('certificate_action.php', {action: 'delete_detail', reference: reference}, function(data){ show_alert_success_certificate_header('تم حذف التفاصيل بنجاح.'); }); } } function search_adminwork(){ var autonum = document.getElementById("txtautonum").value; clear_form_adminwork(); document.getElementById("txtautonum").value = autonum; $.post('adminwork_action.php', {action: 'get_record', autonum: autonum}, function(data){ if (data.proctorid != "" && data.proctorid != null) { $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); document.getElementById("txtproctorid").value = data.proctorid; document.getElementById("txttransseq").value = data.detailseq; document.getElementById("txtfno").value = data.fno; document.getElementById("txtname").value = data.name; document.getElementById("txtmothername").value = data.mothername; document.getElementById("txtemail").value = data.email; document.getElementById("txtdob").value = data.dob; document.getElementById("txtpob").value = data.pob; document.getElementById("txtphone").value = data.phone; document.getElementById("txtmobile").value = data.mobile; document.getElementById("txtcorrectarea").value = data.moudirya; document.getElementById("txtnationality").value = data.nationality_id; document.getElementById("combo_work").value = data.cur_work; for(i = 0; i < document.getElementsByName("txt_workin_mehe").length; i++) { if (document.getElementsByName("txt_workin_mehe")[i].value == data.work_in_mehe) document.getElementsByName("txt_workin_mehe")[i].checked = true; } document.getElementById("txtcorrectarea").value = data.suggestion_areawork; if (document.getElementById("txtapprove")) { if (data.detailapproved == "1") { document.getElementById("txtapprove").checked = true; } else{ document.getElementById("txtapprove").checked = false; } } //populate_list_assistant_work(data.cur_work); populate_list_assistant_mouha(data.mouha_id,data.caza_id); } else { show_alert_error_certificate('الرقم الآلي غير موجود.'); document.getElementById("txtautonum").focus(); } }); } function search_assistant(){ var autonum = document.getElementById("txtautonum").value; clear_form_dataentry(); document.getElementById("txtautonum").value = autonum; $.post('dataentry_action.php', {action: 'get_record', autonum: autonum}, function(data){ if (data.proctorid != "" && data.proctorid != null) { $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); document.getElementById("txtproctorid").value = data.proctorid; document.getElementById("txttransseq").value = data.detailseq2; document.getElementById("txtfno").value = data.fno; document.getElementById("txtname").value = data.name; document.getElementById("txtiban").value = data.iban; document.getElementById("txtmothername").value = data.mothername; document.getElementById("txtemail").value = data.email; document.getElementById("txtdob").value = data.dob; document.getElementById("txtpob").value = data.pob; document.getElementById("txtphone").value = data.phone; document.getElementById("txtmobile").value = data.mobile; document.getElementById("txtcorrectarea").value = data.moudirya; document.getElementById("txtnationality").value = data.nationality_id; document.getElementById("txtbankname").value = data.bankname; document.getElementById("txtbranchbank").value = data.bankbranch ; document.getElementById("txtempstatus_o").checked = false; document.getElementById("txtempstatus_s").checked = false; document.getElementById("txtempstatus_r").checked = false; document.getElementById("txtempstatus_d").checked = false; document.getElementById("txtempstatus_m").checked = false; document.getElementById("txtempstatus_i").checked = false; if (data.emp_statusO == 'O'){ document.getElementById("txtempstatus_o").checked = true; } if (data.emp_statusS == 'S'){ document.getElementById("txtempstatus_s").checked = true; } if (data.emp_statusR == 'R'){ document.getElementById("txtempstatus_r").checked = true; } if (data.emp_statusD == 'D'){ document.getElementById("txtempstatus_d").checked = true; } if (data.emp_statusM == 'M'){ document.getElementById("txtempstatus_m").checked = true; } if (data.emp_statusI == 'I'){ document.getElementById("txtempstatus_i").checked = true; } for(i = 0; i < document.getElementsByName("txtusingcomputer").length; i++) { if (document.getElementsByName("txtusingcomputer")[i].value == data.usingcomputer) document.getElementsByName("txtusingcomputer")[i].checked = true; } document.getElementById("txtprimlastdegree").value = data.prim_degree_id; document.getElementById("combo_work").value = data.cur_work; document.getElementById("combo_worktype").value = data.cur_worktype; for(i = 0; i < document.getElementsByName("txt_workin_mehe").length; i++) { if (document.getElementsByName("txt_workin_mehe")[i].value == data.work_in_mehe) document.getElementsByName("txt_workin_mehe")[i].checked = true; } for(i = 0; i < document.getElementsByName("txtwork_in_it").length; i++) { if (document.getElementsByName("txtwork_in_it")[i].value == data.it_in_previousyear) document.getElementsByName("txtwork_in_it")[i].checked = true; } document.getElementById("txtcorrectarea").value = data.suggestion_areawork; if (document.getElementById("txtapprove")) { if (data.detailapproved == "1") { document.getElementById("txtapprove").checked = true; } else{ document.getElementById("txtapprove").checked = false; } } populate_list_assistant_degree(data.prim_degree_id); populate_list_assistant_mouha(data.mouha_id,data.caza_id); } else { show_alert_error_certificate('الرقم الآلي غير موجود.'); document.getElementById("txtautonum").focus(); } }); } function search_auto_num(){ var autonum = document.getElementById("txtautonum").value; clear_form_certificate(); document.getElementById("txtautonum").value = autonum; $.post('certificate_action.php', {action: 'get_record', autonum: autonum}, function(data){ if (data.proctorid != "" && data.proctorid != null) { document.getElementById("txtproctorid").value = data.proctorid; document.getElementById("txtfno").value = data.fno; document.getElementById("txtname").value = data.name; document.getElementById("txtiban").value = data.iban; document.getElementById("txtbankname").value = data.bankname; document.getElementById("txtbranchbank").value = data.bankbranch; document.getElementById("txtmothername").value = data.mothername; document.getElementById("txtemail").value = data.email; document.getElementById("txtdob").value = data.dob; document.getElementById("txtpob").value = data.pob; document.getElementById("txtphone").value = data.phone; document.getElementById("txtmobile").value = data.mobile; document.getElementById("txtaddress").value = data.fulladdress; document.getElementById("txtcorrectarea").value = data.area_id; document.getElementById("txtnationality").value = data.nationality_id; document.getElementById("txtempstatus_o").checked = false; document.getElementById("txtempstatus_s").checked = false; document.getElementById("txtempstatus_r").checked = false; document.getElementById("txtempstatus_d").checked = false; document.getElementById("txtempstatus_m").checked = false; document.getElementById("txtempstatus_i").checked = false; if (data.emp_statusO == 'O'){ document.getElementById("txtempstatus_o").checked = true; } if (data.emp_statusS == 'S'){ document.getElementById("txtempstatus_s").checked = true; } if (data.emp_statusR == 'R'){ document.getElementById("txtempstatus_r").checked = true; } if (data.emp_statusD == 'D'){ document.getElementById("txtempstatus_d").checked = true; } if (data.emp_statusM == 'M'){ document.getElementById("txtempstatus_m").checked = true; } if (data.emp_statusI == 'I'){ document.getElementById("txtempstatus_i").checked = true; } for(i = 0; i < document.getElementsByName("txtusingcomputer").length; i++) { if (document.getElementsByName("txtusingcomputer")[i].value == data.usingcomputer) document.getElementsByName("txtusingcomputer")[i].checked = true; } populate_list_proctor_mouha(data.mouha_id,data.caza_id); //populate_list_proctor_caza(data.caza_id); } else { show_alert_error_certificate('الرقم الآلي غير موجود.'); document.getElementById("txtautonum").focus(); } }); } function search_trans_seq(){ var transseq = document.getElementById("txttransseq").value; var autonum = document.getElementById("txtautonum").value; if (transseq == "") { show_alert_error_certificate('الرجاء تعبئة خانة الرقم المتسلسل وثم الضغط على زر البحث.'); document.getElementById("txttransseq").focus(); return false; } clear_form_certificate(); document.getElementById("txttransseq").value = transseq; document.getElementById("txtautonum").value = autonum; $.post('search_action.php', {action: 'get_trans_record', transseq: transseq,autonum:autonum}, function(data){ if (data.proctorid != "" && data.proctorid != null) { document.getElementById("txttransseq2").value = data.transseq2; document.getElementById("txtproctorid").value = data.proctorid; document.getElementById("txtautonum").value = data.autonum; document.getElementById("txtfno").value = data.fno; document.getElementById("txtiban").value = data.iban; document.getElementById("txtbankname").value = data.bankname; document.getElementById("txtbranchbank").value = data.bankbranch; document.getElementById("txtname").value = data.name; document.getElementById("txtmothername").value = data.mothername; document.getElementById("txtemail").value = data.email; document.getElementById("txtdob").value = data.dob; document.getElementById("txtpob").value = data.pob; document.getElementById("txtphone").value = data.phone; document.getElementById("txtmobile").value = data.mobile; document.getElementById("txtaddress").value = data.fulladdress; document.getElementById("txtcorrectarea").value = data.area_id; document.getElementById("txtnationality").value = data.nationality_id; document.getElementById("txtempstatus_o").checked = false; document.getElementById("txtempstatus_s").checked = false; document.getElementById("txtempstatus_r").checked = false; document.getElementById("txtempstatus_d").checked = false; document.getElementById("txtempstatus_m").checked = false; document.getElementById("txtempstatus_i").checked = false; if (data.emp_statusO == 'O'){ document.getElementById("txtempstatus_o").checked = true; } if (data.emp_statusS == 'S'){ document.getElementById("txtempstatus_s").checked = true; } if (data.emp_statusR == 'R'){ document.getElementById("txtempstatus_r").checked = true; } if (data.emp_statusD == 'D'){ document.getElementById("txtempstatus_d").checked = true; } if (data.emp_statusM == 'M'){ document.getElementById("txtempstatus_m").checked = true; } if (data.emp_statusI == 'I'){ document.getElementById("txtempstatus_i").checked = true; } for(i = 0; i < document.getElementsByName("txtusingcomputer").length; i++) { if (document.getElementsByName("txtusingcomputer")[i].value == data.usingcomputer) document.getElementsByName("txtusingcomputer")[i].checked = true; } populate_list_proctor_mouha(data.mouha_id,data.caza_id); //populate_list_proctor_caza(data.caza_id); document.getElementById("txtprimsubject").value = data.prim_subject_id; if (data.prim_lang1 == 'FR'){ document.getElementById("txtprimlangfr").checked = true; } if (data.prim_lang2 == 'EN'){ document.getElementById("txtprimlangen").checked = true; } if (data.prim_lang3 == 'AR'){ document.getElementById("txtprimlangar").checked = true; } document.getElementById("txtsecsubject").value = data.sec_subject_id; if (data.sec_lang1 == 'FR'){ document.getElementById("txtseclangfr").checked = true; } if (data.sec_lang2 == 'EN'){ document.getElementById("txtseclangen").checked = true; } if (data.sec_lang3 == 'AR'){ document.getElementById("txtseclangar").checked = true; } if (data.sec_cor_se == 'SE'){ document.getElementById("txtcorrect_se").checked = true; } if (data.sec_cor_sv == 'SV'){ document.getElementById("txtcorrect_sv").checked = true; } if (data.sec_cor_sg == 'SG'){ document.getElementById("txtcorrect_sg").checked = true; } if (data.sec_cor_lh == 'LH'){ document.getElementById("txtcorrect_lh").checked = true; } document.getElementById("txtprimlastdegree").value = data.prim_degree_id; document.getElementById("txtseclastdegree").value = data.sec_degree_id; if (document.getElementById("txtprimshareyears")) { document.getElementById("txtprimshareyears").value = data.prim_sharingyears; } if (document.getElementById("txtsecshareyears")) { document.getElementById("txtsecshareyears").value = data.sec_sharingyears; } if (document.getElementById("txtprimquestshareyears")) { document.getElementById("txtprimquestshareyears").value = data.prim_questsharingyears; } if (document.getElementById("txtsecquestshareyears")) { document.getElementById("txtsecquestshareyears").value = data.sec_questsharingyears; } if (document.getElementById("txtprimexamsshareyears")) { document.getElementById("txtprimexamsshareyears").value = data.prim_examssharingyears; } if (document.getElementById("txtsecexamsshareyears")) { document.getElementById("txtsecexamsshareyears").value = data.sec_examssharingyears; } for(i = 0; i < document.getElementsByName("txtprimprvcorrect").length; i++) { if (document.getElementsByName("txtprimprvcorrect")[i].value == data.prim_prvcorrection) document.getElementsByName("txtprimprvcorrect")[i].checked = true; } for(i = 0; i < document.getElementsByName("txtsecprvcorrect").length; i++) { if (document.getElementsByName("txtsecprvcorrect")[i].value == data.sec_prvcorrection) document.getElementsByName("txtsecprvcorrect")[i].checked = true; } if (data.detailapproved2 == 1) { $('#approve_div').removeClass('hide'); $('#notapprove_div').addClass('hide'); } else { $('#notapprove_div').removeClass('hide'); $('#approve_div').addClass('hide'); } show_grid_school(); } else { show_alert_error_certificate('الرقم المتسلسل غير موجود.'); document.getElementById("txttransseq").focus(); } }); } function get_prim_inst_address(){ var instid =document.getElementById("txt_sch_id").value; $.post('populatelists.php', {action: 'get_inst_address', univid: instid}, function(data){ if (data.error_msg == "") { if (document.getElementById("txt_sch_tel")) { document.getElementById("txt_sch_tel").value = data.telephone1; } if (document.getElementById("txt_sch_add")) { document.getElementById("txt_sch_add").value = data.street; } } else { alert(data.error_msg); } }); } function get_sec_inst_address(){ var secunivid =document.getElementById("txtsecunivname").value; $.post('populatelists.php', {action: 'get_inst_address', univid: secunivid}, function(data){ if (data.error_msg == "") { document.getElementById("txtsectel").value = data.telephone1; document.getElementById("txtsecaddress").value = data.street; } else { alert(data.error_msg); } }); } function populate_data_school(){ var instid = document.getElementById("default_institution").value; if (instid != ""){ $.post('populatelists.php', {action: 'get_inst_address', univid: instid}, function(data){ if (data.error_msg == "") { if (document.getElementById("txt_sch_mouha")) { document.getElementById("txt_sch_mouha").value = data.mouha_ID; populate_list_inst(data.mouha_ID); populate_list_sch_caza(data.kadaa_id); } /*if (document.getElementById("txt_sch_id")) { document.getElementById("txt_sch_id").value = instid; }*/ if (document.getElementById("txt_sch_tel")) { document.getElementById("txt_sch_tel").value = data.telephone1; } if (document.getElementById("txt_sch_add")) { document.getElementById("txt_sch_add").value = data.street; } } else { alert(data.error_msg); } }); } } jQuery(document).ready(function() { jQuery('.tabs .tab-links a').on('click', function(e) { var currentAttrValue = jQuery(this).attr('href'); // Show/Hide Tabs jQuery('.tabs ' + currentAttrValue).show().siblings().hide(); // Change/remove current tab to active jQuery(this).parent('li').addClass('active').siblings().removeClass('active'); e.preventDefault(); }); }); function showonlyone(thechosenone) { if ((thechosenone == 'newboxes2' && document.getElementById('txtprimsubject').value != "") || (thechosenone == 'newboxes1' && document.getElementById('txtsecsubject').value != "")) { return; } $('.newboxes').each(function(index) { if ($(this).attr("id") == thechosenone) { $(this).show(200); } else { $(this).hide(600); } }); } function get_mouha_id(elem) { $V_prim_mouhaid =document.getElementById('txt_sch_mouha').value; } function show_sec_editbox() { if(document.getElementById('is_sec_unchecked').checked){ document.getElementById('label_sec_sharingyear').style.display = "block"; document.getElementById('txtsecshareyears').style.display = "block"; }else { document.getElementById('label_sec_sharingyear').style.display = "none"; document.getElementById('txtsecshareyears').style.display = "none"; } } function show_prim_editbox() { if(document.getElementById('is_prim_unchecked').checked){ document.getElementById('label_prim_sharingyear').style.display = "block"; document.getElementById('txtprimshareyears').style.display = "block"; }else { document.getElementById('label_prim_sharingyear').style.display = "none"; document.getElementById('txtprimshareyears').style.display = "none"; } } function showDiv(val){ if(val == 'prim'){ //if (document.getElementById('txtsecsubject').value == "") { document.getElementById('hidden_prim_sharingyear').style.display = "block"; document.getElementById('hidden_prim_currentsch').style.display = "block"; document.getElementById('hidden_sec_courses').style.display = "none"; document.getElementById('hidden_sec_sharingyear').style.display = "none"; document.getElementById('hidden_sec_currentsch').style.display = "none"; document.getElementById('hidden_sharing_sec_year1').style.display = "none"; document.getElementById('hidden_sharing_prim_year1').style.display = "block"; document.getElementById('hidden_sharing_prim_year2').style.display = "block"; document.getElementById('hidden_sharing_prim_year3').style.display = "block"; document.getElementById('hidden_sharing_sec_year1').style.display = "none"; document.getElementById('hidden_sharing_sec_year2').style.display = "none"; document.getElementById('hidden_sharing_sec_year3').style.display = "none"; } else{ // if (document.getElementById('txtprimsubject').value == "") { document.getElementById('hidden_sharing_sec_year1').style.display = "block"; document.getElementById('hidden_prim_sharingyear').style.display = "none"; document.getElementById('hidden_prim_currentsch').style.display = "none"; document.getElementById('hidden_sec_courses').style.display = "block"; document.getElementById('hidden_sec_sharingyear').style.display = "block"; document.getElementById('hidden_sec_currentsch').style.display = "block"; document.getElementById('hidden_sharing_prim_year1').style.display = "none"; document.getElementById('hidden_sharing_prim_year2').style.display = "none"; document.getElementById('hidden_sharing_prim_year3').style.display = "none"; document.getElementById('hidden_sharing_sec_year1').style.display = "block"; document.getElementById('hidden_sharing_sec_year2').style.display = "block"; document.getElementById('hidden_sharing_sec_year3').style.display = "block"; } } function show_alert_error_login(data){ $('#alert-danger-login').removeClass('hide'); $('#alert-danger-login').html(data); } function show_alert_success_login(data){ $('#alert-success-login').removeClass('hide'); $('#alert-success-login').html(data); } function proc_choose_branch(){ if (document.getElementById('chk_choose_branch_sv').checked) { document.getElementById('div_choose_sv').style.display = "block"; }else { document.getElementById('div_choose_sv').style.display = "none"; } if (document.getElementById('chk_choose_branch_se').checked) { document.getElementById('div_choose_se').style.display = "block"; }else { document.getElementById('div_choose_se').style.display = "none"; } if (document.getElementById('chk_choose_branch_sg').checked) { document.getElementById('div_choose_sg').style.display = "block"; }else { document.getElementById('div_choose_sg').style.display = "none"; } if (document.getElementById('chk_choose_branch_lh').checked) { document.getElementById('div_choose_lh').style.display = "block"; }else { document.getElementById('div_choose_lh').style.display = "none"; } } function open_certificate(){ window.location.href ="./certificate.php?view=cert_ind"; } function open_mainform(){ window.location.href ="./mainform.php"; } function signin() { var birthyear = document.getElementById("txt_birthyear").value; var pass = document.getElementById("txt_password").value; if (pass == "") { show_alert_error_login('الرجاء تعبئة خانة كلمة المرور.'); document.getElementById("txt_password").focus(); }else if (birthyear == "") { show_alert_error_login('الرجاء تعبئة سنة الولادة.'); document.getElementById("txt_password").focus(); } else { $.post('login_action.php', $('#login-form').serialize(), function(data){ if (data.error_msg != ""){ show_alert_error_login('المعلومات غير صحيحة, يرجى التأكد من الرقم الالي او سنة الولادة'); return false; } else if (data.row_count < 1) { show_alert_error_login('كلمة المرور غير صحيحة.'); } else { document.getElementById("php_procname").value =data.name; document.getElementById("php_procinfo").value =data.V_correctioninfo; document.getElementById("php_procinfo2").value =data.V_correctioninfo_proctor; document.getElementById("php_procinfo3").value =data.V_correctioninfo_it; $('#myModal').modal('show'); } }).fail(function(data) { show_alert_error_login('---'); }); } } function getAttach(doc, expyearid){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; $('#doc-modal-content').html(''); $.post('certificate_action.php', {action: 'get_attach', doc: doc, proctorid: proctorid, transseq: transseq, expyearid: expyearid}, function(data){ $('#doc-modal-content').html(data); }); } function deleteAttach(doc, expyearid){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; /*if (transseq == "" || proctorid == "") { return false; }*/ $.post('certificate_action.php', {action: 'delete_attach', doc: doc, proctorid: proctorid, transseq: transseq, expyearid: expyearid}, function(data){ if (data.error_msg != ""){ alert(data.error_msg); } else { alert('تم حذف الملف.'); } }); } function show_grid_school(){ var correctid = document.getElementById("txttransseq").value; $.post('school_grid.php', {action: 'show_grid',correctid:correctid}, function(data){ $("#school-grid").html(data); }); } function get_record_school(personid){ var lang = check_lang(); $.post('persons_grid.php', {action: 'get_record', lang: lang, personid: personid}, function(data){ document.getElementById("txtname").value = data.Person_Name; document.getElementById("txtphoneno").value = data.Person_Phone; document.getElementById("txtaddress").value = data.Person_Address; document.getElementById("txtpersonid").value = data.Person_ID; document.getElementById("txtjobtypeid").value = data.JobType_ID; if (document.getElementById("txtstatedate")) { document.getElementById("txtstatedate").value = data.Person_StateDate; } if (document.getElementById("txtemail")) { document.getElementById("txtemail").value = data.Person_Email; } if (document.getElementById("txtremark")) { document.getElementById("txtremark").value = data.Person_Remark; } }); } function delete_record_school(expyear_id){ var confirm_msg = "تأكيد الحذف"; if (confirm(confirm_msg)) { $.post('certificate_action.php', {action: 'delete_record', expyear_id: expyear_id}, function(data){ if (data.error_msg != ""){ show_alert_error_certificate(data.error_msg); } else { show_grid_school(); } }).fail(function(data) { show_alert_error_certificate(data); }); } } function generate_id(){ var mobile = document.getElementById("txtmobile").value; if (mobile != "") { show_alert_error_certificate_header('لا يمكنك تغيير الرقم الالي'); document.getElementById("txtmobile").focus(); return false; } $.post('dataentry_action.php', {action: 'generate_autonum'}, function(data){ document.getElementById("txtautonum").value = data.newautonum; if (data.error_msg != ""){ show_alert_error_certificate(data.error_msg); } else { //show_grid_school(); } }).fail(function(data) { show_alert_error_certificate(data); }); } function submit_form_teacher(){ var autonum = document.getElementById("txtautonum").value; var name = document.getElementById("txtname").value; var dob = document.getElementById("txtdob").value; var vOption = document.getElementsByName('is_it'); for (var i=0; i < vOption.length; i++) { if (vOption[i].checked) { var vRecordID = vOption[i].value; } } $.post('teacher_action.php', {action :'add_teacher',autonum:autonum, name:name, dob:dob, vRecordID : vRecordID }, function(data){ if (data.error_msg != ""){ show_alert_error_certificate_header(data.error_msg); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح.'); } }).fail(function(data) { show_alert_error_certificate_header(data.error_msg); }); return false; } function submit_form_dataentry(action){ var autonum = document.getElementById("txtautonum").value; var fno = document.getElementById("txtfno").value; var firstname = document.getElementById("txtname").value; var dob = document.getElementById("txtdob").value; var mothername = document.getElementById("txtmothername").value; var pob = document.getElementById("txtpob").value; var mobile = document.getElementById("txtmobile").value; var v_mouha = document.getElementById("txtmouha").value; var v_caza = document.getElementById("txtcaza").value; var v_emp_o =document.getElementById("txtempstatus_o").checked; var v_emp_s =document.getElementById("txtempstatus_s").checked; var v_emp_r =document.getElementById("txtempstatus_r").checked; var v_emp_d =document.getElementById("txtempstatus_d").checked; var v_emp_m =document.getElementById("txtempstatus_m").checked; var v_emp_i =document.getElementById("txtempstatus_i").checked; var v_correctionarea = document.getElementById("txtcorrectarea").value; document.getElementById("txtaction").value = 'save_dataentry_info'; $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); if (autonum == "9999") { show_alert_error_certificate_middle2('الرجاء الضغط على الزر في الاعلى لخلق رقم وهمي.'); document.getElementById("txtautonum").focus(); return false; } else if (autonum == "") { show_alert_error_certificate_header('الرجاء تعبئة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (autonum != "" && (autonum*1 != autonum/1)) { show_alert_error_certificate_header('الرجاء تعبئة أرقام في خانة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (mothername == "") { show_alert_error_certificate_header('الرجاء تعبئة اسم الأم'); document.getElementById("txtmothername").focus(); return false; } else if (pob == "") { show_alert_error_certificate_header('الرجاء إدخال محل الولادة'); document.getElementById("txtpob").focus(); return false; } else if (mobile == "") { show_alert_error_certificate_header('الرجاء إدخال رقم الخليوي'); document.getElementById("txtmobile").focus(); return false; } else if (dob == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة تاريخ الميلاد.'); document.getElementById("txtdob").focus(); return false; } else if (firstname == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة الإسم.'); document.getElementById("txtname").focus(); return false; } else if (v_mouha == "") { show_alert_error_certificate_header('الرجاء ادخال اسم المحافظة.'); document.getElementById("txtmouha").focus(); return false; } else if (v_caza == "") { show_alert_error_certificate_header('الرجاء ادخال قضاء السكن.'); document.getElementById("txtcaza").focus(); return false; } else if (v_emp_o == false && v_emp_r == false && v_emp_s == false && v_emp_d == false && v_emp_m == false && v_emp_i == false){ show_alert_error_certificate_header('الرجاء تعبئة الوضع الوظيفي.'); document.getElementById("txtempstatus_o").focus(); return false; } else if (v_correctionarea == ""){ show_alert_error_certificate_middle2('الرجاء ادخال المنطقة التي تريد العمل بها.'); document.getElementById("txtcorrectarea").focus(); return false; } else { $.post('dataentry_action.php', $('#dataentry-form').serialize(), function(data){ if (data.error_msg != ""){ show_alert_error_certificate_header(data.error_msg); } else { if (data.detail_seq != "") { show_alert_success_certificate('تم ارسال المعلومات بنجاح. الرقم المتسلسل: ' + data.detail_seq); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح.'); } } }).fail(function(data) { show_alert_error_certificate_header(data); }); } return false; } function submit_form_adminwork(action){ var autonum = document.getElementById("txtautonum").value; var fno = document.getElementById("txtfno").value; var firstname = document.getElementById("txtname").value; var dob = document.getElementById("txtdob").value; var mothername = document.getElementById("txtmothername").value; var pob = document.getElementById("txtpob").value; var mobile = document.getElementById("txtmobile").value; var v_mouha = document.getElementById("txtmouha").value; var v_caza = document.getElementById("txtcaza").value; var v_correctionarea = document.getElementById("txtcorrectarea").value; document.getElementById("txtaction").value = 'save_adminwork_info'; $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); if (autonum == "") { show_alert_error_certificate_header('الرجاء تعبئة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (autonum != "" && (autonum*1 != autonum/1)) { show_alert_error_certificate_header('الرجاء تعبئة أرقام في خانة الرقم الآلي.'); document.getElementById("txtautonum").focus(); return false; } else if (mothername == "") { show_alert_error_certificate_header('الرجاء تعبئة اسم الأم'); document.getElementById("txtmothername").focus(); return false; } else if (pob == "") { show_alert_error_certificate_header('الرجاء إدخال محل الولادة'); document.getElementById("txtpob").focus(); return false; } else if (mobile == "") { show_alert_error_certificate_header('الرجاء إدخال رقم الخليوي'); document.getElementById("txtmobile").focus(); return false; } else if (dob == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة تاريخ الميلاد.'); document.getElementById("txtdob").focus(); return false; } else if (firstname == "") { show_alert_error_certificate_header('الرجاء تعبئة خانة الإسم.'); document.getElementById("txtname").focus(); return false; } else if (v_mouha == "") { show_alert_error_certificate_header('الرجاء ادخال اسم المحافظة.'); document.getElementById("txtmouha").focus(); return false; } else if (v_caza == "") { show_alert_error_certificate_header('الرجاء ادخال قضاء السكن.'); document.getElementById("txtcaza").focus(); return false; } else if (v_correctionarea == ""){ show_alert_error_certificate_middle2('الرجاء ادخال المنطقة التي تريد العمل بها.'); document.getElementById("txtcorrectarea").focus(); return false; } else { $.post('adminwork_action.php', $('#adminwork-form').serialize(), function(data){ if (data.error_msg != ""){ show_alert_error_certificate_header(data.error_msg); } else { if (data.detail_seq != "") { show_alert_success_certificate('تم ارسال المعلومات بنجاح. الرقم المتسلسل: ' + data.detail_seq); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح.'); } //show_alert_success_certificate('تم ارسال المعلومات بنجاح.'); } }).fail(function(data) { show_alert_error_certificate_header(data); }); } return false; } function submit_dataentry_images() { var proctorid = document.getElementById("txtproctorid").value; var transseq = document.getElementById("txttransseq").value; if (transseq == "") { return false; } if (proctorid != "" && transseq != "") { $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); document.getElementById("txtaction2").value = 'uploaddocs'; $("#dataentry-form").ajaxForm({ complete: function(data) { if (data.responseText != ""){ show_alert_error_certificate(data.responseText); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح. '); } }, error: function(data) { show_alert_error_certificate(data); } }); } else { return false; } } function submit_adminwork_images() { var proctorid = document.getElementById("txtproctorid").value; var transseq = document.getElementById("txttransseq").value; if (transseq == "") { return false; } if (proctorid != "" && transseq != "") { $('#alert-success-certificate').addClass('hide'); $('#alert-danger-certificate').addClass('hide'); $('#alert-success-certificate-header').addClass('hide'); $('#alert-danger-certificate-header').addClass('hide'); $('#alert-success-certificate-middle').addClass('hide'); $('#alert-danger-certificate-middle').addClass('hide'); $('#alert-success-certificate-middle2').addClass('hide'); $('#alert-danger-certificate-middle2').addClass('hide'); document.getElementById("txtaction2").value = 'uploaddocs'; $("#adminwork-form").ajaxForm({ complete: function(data) { if (data.responseText != ""){ show_alert_error_certificate(data.responseText); } else { show_alert_success_certificate('تم ارسال المعلومات بنجاح. '); } }, error: function(data) { show_alert_error_certificate(data); } }); } else { return false; } } function getAttachadminwork(doc, expyearid){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; $('#doc-modal-content').html(''); $.post('adminwork_action.php', {action: 'get_attach', doc: doc, proctorid: proctorid, transseq: transseq}, function(data){ $('#doc-modal-content').html(data); }); } function getAttachEntry(doc){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; $('#doc-modal-content').html(''); $.post('dataentry_action.php', {action: 'get_attach', doc: doc, proctorid: proctorid, transseq: transseq}, function(data){ $('#doc-modal-content').html(data); }); } function deleteAttachadminwork(doc, expyearid){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; /*if (transseq == "" || proctorid == "") { return false; }*/ $.post('adminwork_action.php', {action: 'delete_attach', doc: doc, proctorid: proctorid, transseq: transseq}, function(data){ if (data.error_msg != ""){ alert(data.error_msg); } else { alert('تم حذف الملف.'); } }); } function deleteAttachEntry(doc, expyearid){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; /*if (transseq == "" || proctorid == "") { return false; }*/ $.post('dataentry_action.php', {action: 'delete_attach', doc: doc, proctorid: proctorid, transseq: transseq}, function(data){ if (data.error_msg != ""){ alert(data.error_msg); } else { alert('تم حذف الملف.'); } }); } function proc_new_ref(){ var transseq = document.getElementById("txttransseq").value; var proctorid = document.getElementById("txtproctorid").value; $.post('teacher_action.php', {action: 'create_newref', proctorid: proctorid, transseq: transseq}, function(data){ if (data.error_msg != ""){ alert(data.error_msg); } else { alert(' تمت العملية بنجاح, الرقم الجديد لسنة 2018 .' ); } }); } function fill_setupform(){ var autonum = document.getElementById("txtautonum").value; /* clear_form_setup(); */ document.getElementById("txtautonum").value = autonum; $.post('teacher_action.php', {action: 'fill_record', autonum: autonum}, function(data){ if (data.proctorid != "" && data.proctorid != null) { document.getElementById("txtname").value = data.name; document.getElementById("txtdob").value = data.dob; } else { show_alert_error_certificate('الرقم الآلي غير موجود.'); document.getElementById("txtautonum").focus(); } }); }