JezK
Edit File: edit_student1.php
<?php session_start(); include("header.php"); include_once("encription_key.php"); include_once("student_access.php"); define('STUDENT_IMAGES_PATH',ADMIN_PATH.'uploads/studentspics/timthumb.php?h=100&w=100&src='); $student=new student_access(); $encrypted_id = $_GET['id']; $encry=new Encryption(); ///////////////////////////////////// $timeout=$student->check_my_status($_SESSION['child']['log_school_id']); if($timeout==0) echo "<script>location.replace('logout.php');</script>"; ///////////////////////////////////// $sch_id = $_SESSION['child']['log_school_id']; $acadamic_id = $_SESSION['child']['current_academic_id']; $choosen_acc_id = $_SESSION['child']['choosen_academic_id']; $sessionid = $_SESSION['stude_section_id']; $classid = $_SESSION['stude_class_id']; // $student_id = $encry->decode($encrypted_id); $student_id = $encrypted_id; $student_details = $student->student_data_byid($student_id); $details=$student->get_classes_byschool_total($sch_id,$choosen_acc_id); if(isset($_POST['classes'])) $details_sections =$student->get_sections_bystudent($_POST['classes']); else $details_sections =$student->get_sections_bystudent($student_details['class_id']); if($_POST['action'] == "update") { //$check_fathermail_edit = $student->check_fathermail_edit($_POST,$sch_id); //$check_mothermail_edit = $student->check_mothermail_edit($_POST,$sch_id); $check_student = $student->check_student_edit($_POST['stu_admissionnumber'],$_POST['student_id'],$sch_id,$choosen_acc_id); $check_student_roll = $student->edit_check_student_roll($_POST['student_id'],$_POST['stu_rollnum'],$_POST['classes'],$_POST['sections'],$sch_id,$choosen_acc_id); if(!$check_student) { if(!$check_student_roll) { if($_FILES["profile_pic"]["name"]) { $t = $_FILES["profile_pic"]["tmp_name"]; $n = $_FILES["profile_pic"]["name"]; $p=strtotime(date('d-m-Y H:i:s')); $k=substr(str_shuffle($p),0,5); $tfname=$k.$n; if(move_uploaded_file($t, "uploads/studentspics/".$tfname)) { $im_url=$tfname; }else { $im_url='default.png'; } } $result=$student->update_student($_POST,$_SESSION,$im_url); if($result!=ERR204) { echo "<script>location.replace('student_management.php?cresult=ERR203');</script>" ; } else { echo "<script>location.replace('edit_student.php?cresult=ERR204');</script>" ; } } else { echo "<script>alert('The Roll Number for this class and section already exists');</script>" ; } } else { echo "<script>alert('Admission Number already exists');</script>" ; } } ?> <style> span input[type="text"]:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } </style> <script> $(document).ready(function(){ $('#err_class').hide(); $('#err_fathername').hide(); $('#err_section').hide(); $('#err_fatheremail').hide(); $('#err_admissionumber').hide(); $('#err_fathermobile').hide(); $('#err_admissiondate').hide(); $('#err_mothername').hide(); $('#err_studentrollnum').hide(); $('#err_motheremail').hide(); $('#err_stufirstname').hide(); $('#err_mothermobile').hide(); $('#err_stulastname').hide(); $('#err_stugurdianname').hide(); $('#err_stuaddress').hide(); $('#err_gurdianemail').hide(); $('#err_blodgroup').hide(); $('#err_gurdianmobile').hide(); }); function inputvalidations() { $('#err_class').text(''); $('#err_fathername').text(''); $('#err_section').text(''); $('#err_fatheremail').text(''); $('#err_admissionumber').text(''); $('#err_fathermobile').text(''); $('#err_admissiondate').text(''); $('#err_admissiondate2').text(''); $('#err_mothername').text(''); $('#err_studentrollnum').text(''); $('#err_motheremail').text(''); $('#err_stufirstname').text(''); $('#err_mothermobile').text(''); $('#err_stulastname').text(''); $('#err_stugurdianname').text(''); $('#err_stuaddress').text(''); $('#err_gurdianemail').text(''); $('#err_blodgroup').text(''); $('#err_gurdianmobile').text(''); $('#err_fathermobile2').text(''); $('#err_mothermobile2').text(''); $('#err_guardianmobile2').text(''); var parents = []; var stu_class = document.getElementById('classes').value; var details_father = document.getElementById('details_father').value; var details_mother = document.getElementById('details_mother').value; var details_gaurdian = document.getElementById('details_gaurdian').value; if(stu_class != '') { var stu_section = document.getElementById('sections').value; document.getElementById('classes').focus(); } var stu_fathername = (document.getElementById('stu_fathername').value).trim(); var stu_fatheremail = document.getElementById('stu_fatheremail').value; var stu_fathermobile = document.getElementById('stu_fathermobile').value; var stu_fathermobile2 = document.getElementById('stu_fathermobile2').value; var stu_mothername = (document.getElementById('stu_mothername').value).trim(); var stu_motheremail = document.getElementById('stu_motheremail').value; var stu_mothermobile = document.getElementById('stu_mothermobile').value; var stu_mothermobile2 = document.getElementById('stu_mothermobile2').value; var stu_gurdianname = (document.getElementById('stu_gurdianname').value).trim(); var stu_gurdianemail = document.getElementById('stu_gurdianemail').value; var stu_gurdianmobile = document.getElementById('stu_gurdianmobile').value; var stu_gurdianmobile2 = document.getElementById('stu_gurdianmobile2').value; var stu_admissionnumber = (document.getElementById('stu_admissionnumber').value).trim(); var stu_admidate = document.getElementById('stu_admissiondate').value; var stu_birthdate = document.getElementById('stu_birthdate').value; var stu_rollnum = (document.getElementById('stu_rollnum').value).trim(); var stu_firstname = (document.getElementById('stu_firstname').value).trim(); var stu_lastname = (document.getElementById('stu_lastname').value).trim(); var stu_address = (document.getElementById('stu_address').value).trim(); var stu_blodgroup = document.getElementById('stu_blodgroup').value; var regex_email =/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/; var regex_mobile =/^[0-9]*$/; var regex = /^[a-zA-Z0-9 ]*$/; var regex1=/^[\w\d\s.\-\/()]+$/; var regex_address =/^[A-Za-z0-9\n_@.,#;:\/\- ]*$/; if(stu_class == '0') { $('#err_class').show(); $('#err_class').text('Please select Class'); document.getElementById('classes').focus(); return false; } else if(stu_section == '0') { $('#err_section').text('Please select Section'); $('#err_section').show(); document.getElementById('sections').focus(); return false; } else if(stu_admissionnumber == '') { $('#err_admissionumber').text('Please enter Admission Number'); $('#err_admissionumber').show(); document.getElementById('stu_admissionnumber').focus(); return false; } else if(!regex1.test(stu_admissionnumber)) { $('#err_admissionumber').text('Please enter a valid Admission Number'); $('#err_admissionumber').show(); document.getElementById('stu_admissionnumber').focus(); return false; } else if(stu_admidate == '') { $('#err_admissiondate').text('Please enter Admission Date'); $('#err_admissiondate').show(); document.getElementById('stu_admissiondate').focus(); return false; } else if(stu_birthdate == '') { $('#err_admissiondate2').text('Please enter Date of Birth'); $('#err_admissiondate2').show(); document.getElementById('stu_birthdate').focus(); return false; } else if(stu_rollnum == '') { $('#err_studentrollnum').text('Please enter Student Roll Number'); $('#err_studentrollnum').show(); document.getElementById('stu_rollnum').focus(); return false; } else if(!regex.test(stu_rollnum)) { $('#err_studentrollnum').text('Please enter a valid Student Roll Number'); $('#err_studentrollnum').show(); document.getElementById('stu_rollnum').focus(); return false; } else if(stu_firstname == '') { $('#err_stufirstname').text('Please enter Student First Name'); $('#err_stufirstname').show(); document.getElementById('stu_firstname').focus(); return false; } else if(!regex.test(stu_firstname)) { $('#err_stufirstname').text('Please enter a valid Student First Name'); $('#err_stufirstname').show(); document.getElementById('stu_firstname').focus(); return false; } else if(stu_lastname == '') { $('#err_stulastname').text('Please enter Student Last Name'); $('#err_stulastname').show(); document.getElementById('stu_lastname').focus(); return false; } else if(!regex.test(stu_lastname)) { $('#err_stulastname').text('Please enter a valid Student Last Name'); $('#err_stulastname').show(); document.getElementById('stu_lastname').focus(); return false; } else if(stu_address == '') { $('#err_stuaddress').text('Please enter Student Address'); $('#err_stuaddress').show(); document.getElementById('stu_address').focus(); return false; } else if(!regex_address.test(stu_address)) { $('#err_stuaddress').text('Please enter a valid Student Address'); $('#err_stuaddress').show(); document.getElementById('stu_address').focus(); return false; } else if(stu_fathername == '') { $('#err_fathername').text('Please enter Father Name'); $('#err_fathername').show(); document.getElementById('stu_fathername').focus(); return false; } else if(!regex.test(stu_fathername)) { $('#err_fathername').text('Please enter a valid Father Name'); $('#err_fathername').show(); document.getElementById('stu_fathername').focus(); return false; } else if(stu_fatheremail == '') { $('#err_fatheremail').text('Please enter Father Email Address'); $('#err_fatheremail').show(); document.getElementById('stu_fatheremail').focus(); return false; } else if(!regex_email.test(stu_fatheremail)) { $('#err_fatheremail').text('Please enter a valid Father Email Address'); $('#err_fatheremail').show(); document.getElementById('stu_fatheremail').focus(); return false; } else if(!regex_mobile.test(stu_fathermobile)) { $('#err_fathermobile').text('Please enter a valid Father Mobile Number'); $('#err_fathermobile').show(); document.getElementById('stu_fathermobile').focus(); return false; } else if(stu_fathermobile.length!=10) { $('#err_fathermobile').text('Please enter a valid Father Mobile Number'); $('#err_fathermobile').show(); document.getElementById('stu_fathermobile').focus(); return false; } else if(stu_mothername == '') { $('#err_mothername').text('Please enter Mother Name'); $('#err_mothername').show(); document.getElementById('stu_mothername').focus(); return false; } else if(!regex.test(stu_mothername)) { $('#err_mothername').text('Please enter a valid Mother Name'); $('#err_mothername').show(); document.getElementById('stu_mothername').focus(); return false; } else if(stu_motheremail == '') { $('#err_motheremail').text('Please enter Mother Email Address'); $('#err_motheremail').show(); document.getElementById('stu_motheremail').focus(); return false; } else if(!regex_email.test(stu_motheremail)) { $('#err_motheremail').text('Please enter a valid Mother Email Address'); $('#err_motheremail').show(); document.getElementById('stu_motheremail').focus(); return false; } else if(stu_mothermobile == '') { $('#err_mothermobile').text('Please enter Mother Mobile Number'); $('#err_mothermobile').show(); document.getElementById('stu_mothermobile').focus(); return false; } else if(!regex_mobile.test(stu_mothermobile)) { $('#err_mothermobile').text('Please enter a valid Mother Mobile Number'); $('#err_mothermobile').show(); document.getElementById('stu_mothermobile').focus(); return false; } else if(stu_mothermobile.length!=10) { $('#err_mothermobile').text('Please enter a valid Mother Mobile Number'); $('#err_mothermobile').show(); document.getElementById('stu_mothermobile').focus(); return false; } if(stu_fathermobile2 != '') { if(!regex_mobile.test(stu_fathermobile2)) { $('#err_fathermobile2').text('Please enter a valid Father Mobile Number2'); $('#err_fathermobile2').show(); document.getElementById('stu_fathermobile2').focus(); return false; } else if(stu_fathermobile2.length!=10) { $('#err_fathermobile2').text('Please enter a valid Father Mobile Number2'); $('#err_fathermobile2').show(); document.getElementById('stu_fathermobile2').focus(); return false; } } if(stu_mothermobile2 != '') { if(!regex_mobile.test(stu_mothermobile2)) { $('#err_mothermobile2').text('Please enter a valid Mother Mobile Number2'); $('#err_mothermobile2').show(); document.getElementById('stu_mothermobile2').focus(); return false; } else if(stu_mothermobile2.length!=10) { $('#err_mothermobile2').text('Please enter a valid Mother Mobile Number2'); $('#err_mothermobile2').show(); document.getElementById('stu_mothermobile2').focus(); return false; } } if(stu_gurdianname!='') { if(!regex.test(stu_gurdianname)) { $('#err_stugurdianname').text('Please enter a valid Guardian Name'); $('#err_stugurdianname').show(); document.getElementById('stu_gurdianname').focus(); return false; } } if(stu_gurdianemail != '') { if(!regex_email.test(stu_gurdianemail)) { $('#err_gurdianemail').text('Please enter a valid Guardian Email'); $('#err_gurdianemail').show(); document.getElementById('stu_gurdianemail').focus(); return false; } } if(stu_gurdianmobile != '') { if(!regex_mobile.test(stu_gurdianmobile)) { $('#err_gurdianmobile').text('Please enter a valid Guardian Mobile Number'); $('#err_gurdianmobile').show(); document.getElementById('stu_gurdianmobile').focus(); return false; } else if(stu_gurdianmobile.length!=10) { $('#err_gurdianmobile').text('Please enter a valid Guardian Mobile Number'); $('#err_gurdianmobile').show(); document.getElementById('stu_gurdianmobile').focus(); return false; } } if(stu_gurdianmobile2 != '') { if(!regex_mobile.test(stu_gurdianmobile2)) { $('#err_guardianmobile2').text('Please enter a valid Guardian Mobile Number2'); $('#err_guardianmobile2').show(); document.getElementById('stu_gurdianmobile2').focus(); return false; } else if(stu_gurdianmobile2.length!=10) { $('#err_guardianmobile2').text('Please enter a valid Guardian Mobile Number2'); $('#err_guardianmobile2').show(); document.getElementById('stu_gurdianmobile2').focus(); return false; } } // parents.push(stu_fatheremail); // parents.push(stu_motheremail); // parents.push(stu_gurdianemail); //document.getElementById('student_mails').value=parents; } function clearall() { window.location="student_management.php"; } function check_val(val){ var father = document.getElementById('stu_fathername').value; var mother = document.getElementById('stu_mothername').value; var gurdian = document.getElementById('stu_gurdianname').value; var details_father = document.getElementById('details_father').value; var details_mother = document.getElementById('details_mother').value; var details_gaurdian = document.getElementById('details_gaurdian').value; if(father != '') { document.getElementById('details_father').value = '1'; } if(mother != ''){ document.getElementById('details_mother').value = '2'; } if(gurdian != ''){ document.getElementById('details_gaurdian').value = '3'; } } </script> <script> function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { console.log(e.target.result); $('.img-preview').attr('src', e.target.result); $('.img-preview').removeClass('hide'); } reader.readAsDataURL(input.files[0]); } } $(document).ready(function(){ $('.accept-image').change(function(){ var file = $(this).prop("files")[0]; re = /(\.jpg|\.jpeg|\.png)$/i; if(!re.exec(file.name)) { alert('Please Upload Valid Image File.'); $(this).removeProp('files'); $(this).val(''); } else { readURL(this); } }); }); </script> <body style="overflow-x: hidden;"> <div class="row" style="margin-top:30px;"> <div class="col-md-3 text-center" style="font:Arial, Helvetica, sans-serif;font-style:normal;color:#000000; font-size:1.4em;"> <i class=" glyphicon glyphicon-pencil" title ="Edit Academic Year" style="font-size: 16px;"></i> Edit Student </div> </div> <div class="row"> <div class="col-md-12" > <form class="form-horizontal" method="post" enctype="multipart/form-data"> <div class="box-body" style="background-color:#fff; padding: 10px; font-family:Arial, Helvetica, sans-serif; font-size:13px; margin-top:25px;"> <div class="form-group col-md-6" style="margin-bottom:1.0%;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Choose Class</b><span style="color:#FF0000; margin-left:-2px;"> *</span> </div> <div class="col-md-7"> <select class="form-control" id="classes" name="classes" style="height:29px; font-size:12px;" tabindex="1" > <option value='0'>--Select Class--</option> <?php if(isset($_POST['classes'])) foreach($details as $key=>$row) { if($row['class_id'] == $_POST['classes']) echo "<option value='".$row['class_id']."' selected>".$row['class_name']."</option>"; else echo "<option value='".$row['class_id']."'>".$row['class_name']."</option>"; } else foreach($details as $key=>$row) { if($row['class_id'] == $student_details['class_id']) echo "<option value='".$row['class_id']."' selected>".$row['class_name']."</option>"; else echo "<option value='".$row['class_id']."'>".$row['class_name']."</option>"; } ?> </select> <!-- if there is an error--> <div class="col-md-7" id="err_class" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%;"> <div class="col-md-5 text-right "> <b style="color:#666666;">Father Name</b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="50" id="stu_fathername" onblur="check_val(this.value)" name="stu_fathername" style="height:29px;font-size:13px;" tabindex="10" value="<?php if(isset($_POST['stu_fathername'])) echo$_POST['stu_fathername']; else echo $student_details['student_father_name'];?>"> <!-- if there is an error--> <div class="col-md-7" id="err_fathername" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Choose Section</b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <select class="form-control" id="sections" name="sections" style="height:29px; font-size:12px;" tabindex="2" > <option value='0' >--Select Section--</option> <?php $admision_date = str_replace('-','/',date('d-m-Y',strtotime($student_details['student_admission_date']))); $birth_date = str_replace('-','/',date('d-m-Y',strtotime($student_details['date_of_birth']))); if(isset($_POST['sections'])) { foreach($details_sections as $key=>$row) { if($row['section_id'] == $_POST['sections']) echo "<option value='".$row['section_id']."' selected>".$row['section_name']."</option>"; else echo "<option value='".$row['section_id']."'>".$row['section_name']."</option>"; } } else { foreach($details_sections as $key=>$row) { if($row['section_id'] == $student_details['section_id']) echo "<option value='".$row['section_id']."' selected>".$row['section_name']."</option>"; else echo "<option value='".$row['section_id']."'>".$row['section_name']."</option>"; } } ?> </select> <!-- if there is an error--> <div class="col-md-7" id="err_section" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%;"> <div class="col-md-5 text-right "> <b style="color:#666666;">Father Email</b> <span style="color:#FF0000; margin-left:-2px; ">*</span> </div> <div class="col-md-7"> <input type="text" class="form-control" id="stu_fatheremail" name="stu_fatheremail" maxlength="50" style="height:29px;font-size:13px;" tabindex="11" value="<?php if(isset($_POST['stu_fatheremail'])) echo$_POST['stu_fatheremail']; else echo $student_details['student_father_email'];?>"> <!-- if there is an error--> <div class="col-md-11" id="err_fatheremail" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Admission Number </b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" id="stu_admissionnumber" maxlength="50" name="stu_admissionnumber" style="height:29px;font-size:13px;" tabindex="3" value="<?php if(isset($_POST['stu_admissionnumber'])) echo$_POST['stu_admissionnumber']; else echo $student_details['student_admission_number']?>"> <!-- if there is an error--> <div class="col-md-10" id="err_admissionumber" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6"> <div class="col-md-5 text-right "> <b style="color:#666666;">Father Mobile</b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" id="stu_fathermobile" maxlength="10" name="stu_fathermobile" style="height:29px;font-size:13px;" tabindex="12" value="<?php if(isset($_POST['stu_fathermobile'])) echo$_POST['stu_fathermobile']; else echo $student_details['student_father_mobile']?>"> <!-- if there is an error--> <div class="col-md-11" id="err_fathermobile" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="class" > <div class="form-group col-md-6" style="clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Admission Date</b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7 "> <div id="datetimepicker" name="datetimepicker" class="input-append date"> <input type="text" class="form-control" id="stu_admissiondate" name="stu_admissiondate" style="height:30px; font-size:13px; width:254px;" tabindex="4" value="<?php if(isset($_POST['stu_admissiondate'])) echo$_POST['stu_admissiondate']; else echo $admision_date?>"> <span class="add-on" style="height:30px;"> <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> </span> </div> <!-- if there is an error--> <div class="col-md-10" id="err_admissiondate" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="class" > <div class="form-group col-md-6" style="clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Date of Birth</b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7 "> <div id="datetimepicker2" name="datetimepicker2" class="input-append date" > <input type="text" class="form-control" id="stu_birthdate" name="stu_birthdate" style="height:30px; font-size:13px; width:254px;" tabindex="4" value="<?php if(isset($_POST['stu_birthdate'])) echo$_POST['stu_birthdate']; else echo $birth_date?>"> <span class="add-on" style="height:30px;"> <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> </span> </div> <!-- if there is an error--> <div class="col-md-10" id="err_admissiondate2" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6"> <div class="col-md-5 text-right "> <b style="color:#666666;">Father Mobile2</b> </div> <div class="col-md-7"> <input type="text" class="form-control" id="stu_fathermobile2" maxlength="10" name="stu_fathermobile2" style="height:29px;font-size:13px;" tabindex="13" value="<?php if(isset($_POST['stu_fathermobile2'])) echo$_POST['stu_fathermobile2']; else echo $student_details['student_father_mobile2']?>"> <!-- if there is an error--> <div class="col-md-11" id="err_fathermobile2" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Student Roll Number </b><span style="color:#FF0000; marginleft:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" id="stu_rollnum" maxlength="20" name="stu_rollnum" style="height:29px;font-size:13px;" tabindex="5" value="<?php if(isset($_POST['stu_rollnum'])) echo$_POST['stu_rollnum']; else echo $student_details['student_rollno']?>"> <!-- if there is an error--> <div class="col-md-10" id="err_studentrollnum" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6"> <div class="col-md-5 text-right "> <b style="color:#666666;">Mother Name</b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="50" id="stu_mothername" onblur="check_val(this.value)" name="stu_mothername" style="height:29px;font-size:13px;" tabindex="14" value="<?php if(isset($_POST['stu_mothername'])) echo$_POST['stu_mothername']; else echo $student_details['student_mother_name']?>"> <!-- if there is an error--> <div class="col-md-10" id="err_mothername" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Student First Name </b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="50" id="stu_firstname" name="stu_firstname" style="height:29px;font-size:13px;" tabindex="6" value="<?php if(isset($_POST['stu_firstname'])) echo$_POST['stu_firstname']; else echo $student_details['student_firstname']?>"> <!-- if there is an error--> <div class="col-md-10" id="err_stufirstname" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" > <div class="col-md-5 text-right "> <b style="color:#666666;">Mother Email</b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="50" id="stu_motheremail" name="stu_motheremail" style="height:29px;font-size:13px;" tabindex="15" value="<?php if(isset($_POST['stu_motheremail'])) echo$_POST['stu_motheremail']; else echo $student_details['student_mother_email']?>"> <!-- if there is an error--> <div class="col-md-11" id="err_motheremail" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Student Last Name </b><span style="color:#FF0000; margin-left:-2px; "> *</span> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="50" id="stu_lastname" name="stu_lastname" style="height:29px;font-size:13px;" tabindex="7" value="<?php if(isset($_POST['stu_lastname'])) echo$_POST['stu_lastname']; else echo $student_details['student_lastname']?>"> <!-- if there is an error--> <div class="col-md-10" id="err_stulastname" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" > <div class="col-md-5 text-right "> <b style="color:#666666;">Mother Mobile</b><span style="color:#FF0000; margin-left:2px; ">*</span> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="10" id="stu_mothermobile" name="stu_mothermobile" style="height:29px;font-size:13px;" tabindex="16" value="<?php if(isset($_POST['stu_mothermobile'])) echo$_POST['stu_mothermobile']; else echo $student_details['student_mother_mobile'];?>"> <!-- if there is an error--> <div class="col-md-11" id="err_mothermobile" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Student Address </b><span style="color:#FF0000; margin-left:-3px; ">*</span> </div> <div class="col-md-7"> <textarea class="form-control" rows="3" id="stu_address" tabindex="9" maxlength="100" name="stu_address" style="margin: 0px;"><?php if(isset($_POST['stu_address'])) echo$_POST['stu_address']; else echo $student_details['student_address']?></textarea> <!-- if there is an error--> <div class="col-md-10" id="err_stuaddress" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" > <div class="col-md-5 text-right "> <b style="color:#666666;">Mother Mobile2</b> </div> <div class="col-md-7"> <input type="text" class="form-control" id="stu_mothermobile2" maxlength="10" name="stu_mothermobile2" style="height:29px;font-size:13px;" tabindex="17" value="<?php if(isset($_POST['stu_mothermobile2'])) echo$_POST['stu_mothermobile2']; else echo $student_details['student_mother_mobile2'];?>"> <!-- if there is an error--> <div class="col-md-11" id="err_mothermobile2" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"> <div class="col-md-4 col-md-offset-1 text-right"> <b style="color:#666666;">Student Blood Group </b><span style="color:#FF0000; margin:2px; "></span> </div> <div class="col-md-7"> <select class="form-control" id="stu_blodgroup" name="stu_blodgroup" style="height:29px; font-size:12px;" tabindex="9" > <option value='0'>--Select Blood Group--</option> <?php $blod=array('A+','B+','O+','AB+','A-','B-','O-','AB-'); if(isset($_POST['stu_blodgroup'])) { foreach($blod as $bgroup) if($bgroup==$_POST['stu_blodgroup']) echo "<option value='".$bgroup."' selected>".$bgroup."</option>"; else echo "<option value='".$bgroup."'>".$bgroup."</option>"; } else { foreach($blod as $bgroup) if($bgroup==$student_details['student_blood_group']) echo "<option value='".$bgroup."' selected>".$bgroup."</option>"; else echo "<option value='".$bgroup."'>".$bgroup."</option>"; } ?> </select> <!-- if there is an error--> <div class="col-md-7" id="err_blodgroup" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="col-md-4 col-md-offset-1 text-right"><b style="color:#666666;">Student Profile pic</b></div> <div class="col-md-7 col-md-offset-2" style="padding-left: 58px;width: 100%;margin-bottom: 20px;"> <input type="file" class="form-control accept-image" id="profile_pic" name="profile_pic" style="height:25px;font-size:13px;padding-bottom: 30px;" tabindex="18" value=""> <?php if($student_details['profile_pic']!="") {?> <img class="img-preview " src="<?=STUDENT_IMAGES_PATH.$student_details['profile_pic']?>" height="100px" width="100px" alt=""> <?php }?> <!-- if there is an error--> <div class="col-md-11" id="err_mothermobile2_pic" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> <!--<div class="col-md-8 col-md-offset-4 text-right"> <img style="width:100px;height:100px;" class="img-preview hide" src="<=STUDENT_IMAGES_PATH.$student_details['profile_pic']?>" /> </div>---> </div> </div> <div class="form-group col-md-6" > <div class="col-md-5 text-right "> <b style="color:#666666;">Guardian Name</b> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="50" id="stu_gurdianname" onblur="check_val(this.value)" name="stu_gurdianname" style="height:29px;font-size:13px;" tabindex="18" value="<?php if(isset($_POST['stu_gurdianname'])) echo$_POST['stu_gurdianname']; else echo $student_details['student_guardian_name']?>"> <!-- if there is an error--> <div class="col-md-10" id="err_stugurdianname" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"></div> <div class="form-group col-md-6" > <div class="col-md-5 text-right "> <b style="color:#666666;">Guardian Email</b> </div> <div class="col-md-7"> <input type="text" class="form-control" id="stu_gurdianemail" maxlength="50" name="stu_gurdianemail" style="height:29px;font-size:13px;" tabindex="19" value="<?php if(isset($_POST['stu_gurdianemail'])) echo$_POST['stu_gurdianemail']; else echo $student_details['student_guardian_email']?>"> <!-- if there is an error--> <div class="col-md-11" id="err_gurdianemail" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"></div> <div class="form-group col-md-6"> <div class="col-md-5 text-right "> <b style="color:#666666;">Guardian Mobile</b> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="10" id="stu_gurdianmobile" name="stu_gurdianmobile" style="height:29px;font-size:13px;" tabindex="20" value="<?php if(isset($_POST['stu_gurdianmobile'])) echo$_POST['stu_gurdianmobile']; else echo $student_details['student_guardian_mobile']?>"> <!-- if there is an error--> <div class="col-md-11" id="err_gurdianmobile" style="color:#990000;margin-left:-15px; display:none;" ></div> <!--- end error--> </div> </div> <div class="form-group col-md-6" style="margin-bottom:1.0%; clear:both;"></div> <div class="form-group col-md-6" > <div class="col-md-5 text-right "> <b style="color:#666666;">Guardian Mobile2</b> </div> <div class="col-md-7"> <input type="text" class="form-control" maxlength="10" id="stu_gurdianmobile2" name="stu_gurdianmobile2" style="height:29px;font-size:13px;" tabindex="21" value="<?php if(isset($_POST['stu_gurdianmobile2'])) echo$_POST['stu_gurdianmobile2']; else echo $student_details['student_guardian_mobile2']?>"> <!-- if there is an error--> <div class="col-md-11" id="err_guardianmobile2" style="color:#990000;margin-left:-15px; display:none;"></div> <!--- end error--> </div> </div> </div><!-- /.col --> </div><!-- /.row --> <div class="form-group"> <div class="col-md-12" align="center"> <button type="submit" class="btn btn-default custom-button-width .navbar-right" tabindex="22" onclick="return inputvalidations()" style="font-family:Arial, Helvetica, sans-serif;font-style:normal;font-size:13px; margin:20px; " >Update</button> <button type="button" class="btn btn-default custom-button-width .navbar-right" tabindex="23" style="font-family:Arial, Helvetica, sans-serif;font-style:normal;font-size:13px; margin:20px; " onclick="return clearall()" >Cancel</button> </div> <input type="hidden" name="student_id" id="student_id" value=<?php echo $student_id?>> <input type="hidden" name="details_father" id="details_father" value="<?php echo $student_details['student_father_name']?"1":""?>"> <input type="hidden" name="details_mother" id="details_mother" value="<?php echo $student_details['student_mother_name']?"2":""?>"> <input type="hidden" name="details_gaurdian" id="details_gaurdian" value="<?php echo $student_details['student_guardian_name']?"3":""?>"> <input type="hidden" name="action" id="action" value="update"> </form> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script> <script type="text/javascript" src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"> </script> <script type="text/javascript" src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js"> </script> <script type="text/javascript" src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.pt-BR.js"> </script> <script type="text/javascript"> $('#datetimepicker').datetimepicker({ format: 'dd/MM/yyyy', pickTime: false }).on('changeDate', function(){ $(this).datetimepicker('hide'); }); $('#datetimepicker2').datetimepicker({ format: 'dd/MM/yyyy', pickTime: false }).on('changeDate', function(){ $(this).datetimepicker('hide'); }); </script> <script type="text/javascript"> $('#datetimepicker1').datetimepicker({ format: 'dd/MM/yyyy', pickTime: false }).on('changeDate', function(){ $(this).datetimepicker('hide'); }); $("#classes").change(function() { if($(this).val() == 0) { var section_option = '<option value="0">--Select Section--</option>'; $("#sections").html(section_option); $('#err_class').text('Please choose Class'); return false; } else { var x = $(this).val(); $.ajax({ url: "ajaxcalls.php", type:"POST", data:"mode="+"choose_class"+"&data="+x, success: function(result) { var result2 = eval("("+result+")"); var section_option = '<option value="0">--Select Section--</option>'; for(var i = 0;i < result2.length;i++){ section_option += '<option value="'+result2[i].section_id+'">'+result2[i].section_name+'</option>'; } $("#sections").html(section_option); }, error : function(e) { } }); } }); </script> </body> </html>