?
Current Path : /home1/savoy/www/savoyglobal.net/eldertree/application/views/student/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/savoyglobal.net/eldertree/application/views/student/edit_student.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); $this->load->view('qatar_id_validation'); ?> <script src="<?= base_url() ?>assets/scripts/jquery.autocomplete.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#dob').datepick({ dateFormat: 'dd-mm-yyyy', onClose:function(){ $('#age_field').html(''); var bdate=$('#dob').val().split("-"); var birth_year=bdate[2]; var birth_month=bdate[1]; var birth_day=bdate[0]; var today_date = new Date(); var today_year = today_date.getFullYear(); var today_month = today_date.getMonth(); var today_day = today_date.getDate(); var age = today_year - birth_year; var month=0; var x=new Date(); x.setFullYear(birth_year,birth_month-1,birth_day); if (x<today_date) { if ((today_month < (birth_month - 1)) || (((birth_month - 1) == today_month) && (today_day < birth_day))) { age--; } if(today_month>(birth_month - 1)){ month=today_month-(birth_month - 1); } if((birth_month - 1)>today_month){ month=12-((birth_month - 1)-today_month); } if(birth_day>today_day) month--; if(month == -1) age++; } else { age=0; month=0; } var age_string=""; if(age>0) age_string=age; if(month>0) age_string+="."+month $('#age_field').html(age_string+" Yrs"); } }); $("#bg").mouseover(function(){ $("#bg").css("background-color","rgb(54,111,172)"); $("#bg").css("color","#ffffff"); }); $("#bg").mouseout(function(){ $("#bg").css("background-color","white"); $("#bg").css("color","gray"); }); }); function loadparentsdetails(val) { if(val==1) { $('#existparent').css('display','block'); $('#newparent,#newparent1,#parent_box,#sub').css('display','none'); } if(val==0) { $('#parent_id').removeClass(); $('#newparent,#newparent1,#sub').css('display','block'); $('#existparent,#parent_box').css('display','none'); } } function load_parents_details() { var father = $('#father').val(); var mother = $('#mother').val(); var qatar_id = $('#father_qatar_id').val(); $('#sub').css('display','block'); document.getElementById("parent_box").style.display="block"; $("#parent_box").empty().html('<CENTER><img src="<?= base_url() ?>assets/img/loading.gif" class="loading"/></CENTER>'); father=encodeURIComponent(father); mother=encodeURIComponent(mother); qatar_id=encodeURIComponent(qatar_id); $.ajax({ type: "POST", url: "<?= site_url() ?>/student/load_parents/"+father+"/"+mother+"/"+qatar_id, success: function(data) { $("#parent_box").html(data) $('#parent_box_main').show(); }}); } function check_files() { var fup = document.getElementById('attach_photo'); var fileName = fup.value; var ext = fileName.substring(fileName.lastIndexOf('.') + 1); if(ext == "gif" || ext == "GIF" || ext == "JPEG" || ext == "jpeg" || ext == "jpg" || ext == "PNG" || ext == "png"|| ext == "JPG" || ext =='') { addformdata('validateform'); } else { alert("Upload Valid Image Only"); fup.focus(); return false; } } </script> <div class="row-fluid"> <div class="tab-pane " id="tab_2"> <div class="portlet box yellow"> <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Update Student Details</div> <div class="tools"> <a href="#" onclick="viewdata('student','viewinstudentsearch','search_student','view_student','<?= $_SESSION['pagenum']; ?>')" class="remove"></a> </div> </div> <div class="portlet-body form"> <!-- BEGIN FORM--> <?php $attributes = array('id' => 'validateform', 'class' => 'form-horizontal validate'); $parentsdetails=$this->studentmodel->parent($student->student_id); $parents = $this->studentmodel->search_parents(); echo form_open_multipart('student/student_add/update_student/view_student/1', $attributes); ?> <h3 class="form-section">Personal Details </h3> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Student Reg No</label> <div class="controls"> <span class="text bold"><?= $student->reg_no; ?></span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">First Name</label> <div class="controls"> <input name="first_name" id="first_name" class="required span12" value="<?= $student->first_name; ?>" type="text" /> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Last Name</label> <div class="controls"> <input name="last_name" id="last_name" class="required span12" type="text" value="<?= $student->last_name; ?>" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Gender</label> <div class="controls"> <select name="gender" class="required chosen span12" > <option value="">--Select--</option> <option value="Male" <?php if ($student->gender == "Male") { echo "selected"; } ?>>Male</option> <option value="Female" <?php if ($student->gender == "Female") { echo "selected"; } ?>>Female</option> </select> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Date of Birth </label> <div class="controls"> <input id="dob" type="text" class="span12 required calfocus1" value="<?= $this->mastermodel->convertdatenormalformat($student->dob) ?>" name="dob" style="float: left;"/> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Age</label> <div class="controls" id="age_field"> <span class="text bold"> <?php /* 'yyyy-mm-dd format' */ $age_details = $this->mastermodel->getAgeDetails($student->dob); echo $age_details['in_words']; ?> </span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Admission Date </label> <div class="controls"> <input id="admission_date" type="text" class="calfocus span12" name="admission_date" value="<?= $this->mastermodel->convertdatenormalformat($student->admission_date) ?>" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Nationality</label> <div class="controls"> <select name="nationality_id" type="text" class="required chosen span12" id="nationality_id"> <option value="">Select</option> <?php $nationality = $this->mastermodel->search_nationality(); foreach ($nationality['results']->result_array() as $list) { ?> <option value="<?= $list['nationality_id']; ?>"<?php if ($student->nationality_id == $list['nationality_id']) { echo "selected"; } ?>><?= $list['nationality_name']; ?></option> <?php } ?> </select> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Qatar ID NO</label> <div class="controls"> <input type="text" name="qatar_id" id="qatar_id" value="<?= $student->qatar_id ?>" class="span12" onchange="check_length_qatar_id(this)"/> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Blood Group</label> <div class="controls"> <select name="blood_group" type="text" class="required chosen span12" id="blood_group"> <option value="">Select</option> <?php $blood_type = $this->mastermodel->search_blood_type(); foreach ($blood_type['results']->result_array() as $list) { ?> <option value="<?= $list['blood_type_name']; ?>"<?php if ($student->blood_group == $list['blood_type_name']) { echo "selected"; } ?>><?= $list['blood_type_name']; ?></option> <?php } ?> </select> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Previous medical illness / Allergy</label> <div class="controls"> <textarea name="previous_medical_illness" id="previous_medical_illness" class="span12" ><?= $student->previous_medical_illness ?></textarea> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Address</label> <div class="controls"> <input type="text" name="address" id="address" class="span12" value="<?= $student->address ?>"/> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Languages Spoken</label> <div class="controls"> <input id="languages" type="text" name="languages" class="span12" value="<?= $student->languages ?>"/> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Change Photo</label> <div class="controls"> <input type="file" name="attach_photo" id="attach_photo" class="span12"/> <?php if ($student->photo != '') { ?> <img width="130" height="120" src="<?= base_url() ?>assets/uploads/student_photo/<?= $student->photo; ?>" alt="" /> <?php } ?> </div> </div> </div> </div> <h3 class="form-section">Emergency Contact Details </h3> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Contact Person</label> <div class="controls"> <input type="text" name="emergency_contact_person" id="emergency_contact_person" value="<?= $student->emergency_contact_person ?>" class="required span12" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Contact Number</label> <div class="controls"> <input type="text" name="emergency_contact_no" id="emergency_contact_no" value="<?= $student->emergency_contact_no ?>" class="required span12 number" onchange="contact_validation(this)" /> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Relationship</label> <div class="controls"> <input type="text" name="emergency_contact_relationship" id="emergency_contact_relationship" value="<?= $student->emergency_contact_relationship ?>" class="span12" /> </div> </div> </div> </div> <div class="row-fluid portlet box yellow" > <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Father's Details</div> </div> <div class="portlet-body form" > <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Father Name</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->father_name?> </span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Qatar ID NO</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->father_qatar_id_no?> </span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Occupation</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->father_occupation?> </span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Mobile No</label> <div class="controls"> <span class="text bold"> <?=$parentsdetails->father_mobile_no?> </span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Office No</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->father_ofc_no?> </span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Residence No</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->father_residence_no?> </span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Email ID</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->father_email?> </span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Employer Name</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->father_employer_name?> </span> </div> </div> </div> </div> </div> </div> <div class="row-fluid portlet box yellow" > <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Mother's Details</div></span> </div> <div class="portlet-body form" > <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Mother's name</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->mother_name?> </span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Qatar ID NO</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->mother_qatar_id_no?> </span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Occupation</label> <div class="controls"> <?=$parentsdetails->mother_occupation?> </span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Mobile No</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->mother_mobile_no?></span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Office No</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->mother_ofc_no?></span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Residence No</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->mother_residence_no?></span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Email ID</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->mother_email?></span> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Employer Name</label> <div class="controls"> <span class="text bold"><?=$parentsdetails->mother_employer_name?> </span> </div> </div> </div> </div> </div> </div> <div class="row-fluid portlet box yellow"> <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Parents Details</div> </div> <div class="portlet-body form"> <table class="table table-striped table-hover table-bordered" id="sample_3" style="background-color: white;"> <tr> <th>Existing parents</th> <th>New parents</th> </tr> <tr> <td> <input type="radio" name="parentdiv" id="existing" value="1" onclick="loadparentsdetails(this.value)"/> </td> <td> <input type="radio" name="parentdiv" id="new" value="0" onclick="loadparentsdetails(this.value)"/> </td> </tr> </table> <div style="display: none" id="existparent"> <table class="table" > <tr><th colspan="2">Search By</th></tr> <tr> <td style="padding: 25px 0 0 20px"> Father Name</td> <td width="55%" > <div style="height:10px"></div> <select name="father" id="father" class="chosen" style="width: 305px"> <option value="0">All</option> <?php foreach ($parents['results']->result_array() as $row) { ?> <option value="<?= $row['father_name'] ?>"><?= $row['father_name'] ?> </option> <?php } ?> </select> </td> </tr> <tr> <td style="padding: 25px 0 0 20px"> Mother Name</td> <td width="55%"> <div style="height:10px"></div> <select name="mother" class="chosen" id="mother" style="width: 305px"> <option value="0">All</option> <?php foreach ($parents['results']->result_array() as $row) { ?> <option value="<?= $row['mother_name'] ?>"><?= $row['mother_name'] ?> </option> <?php } ?> </select> </td> </tr> <tr> <td style="padding: 25px 0 0 20px"> Qatar ID</td> <td width="55%"> <div style="height:10px"></div> <select name="father_qatar_id" class="chosen" id="father_qatar_id" style="width: 305px"> <option value="0">All</option> <?php foreach ($parents['results']->result_array() as $row) { ?> <option value="<?= $row['father_qatar_id_no'] ?>"><?= $row['father_qatar_id_no'] ?> </option> <?php } ?> </select> </td> </tr> <tr> <td width="25%" colspan="2" align="center"> <input style="width: 150px;height: 30px;margin: 0 auto;" id="bg" type="button" onclick="load_parents_details()" value="Load Parents Details" /> </td> </tr> </table> <div id="parent_box"> </div> </div> </div> </div> <div class="row-fluid portlet box yellow" id="newparent" style="display: none"> <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Father's Details</div> </div> <div class="portlet-body form" > <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Father Name</label> <div class="controls"> <input type="text" name="father_name" id="father_name" class="span12 required" value="<?= $parent->father_name ?>" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Qatar ID NO</label> <div class="controls"> <input type="text" name="father_qatar_id_no" id="father_qatar_id_no" value="<?= $parent->father_qatar_id_no ?>" class="span12" onchange="check_length_qatar_id(this)" /> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Occupation</label> <div class="controls"> <input type="text" name="father_occupation" id="father_occupation" value="<?= $parent->father_occupation ?>" class="span12" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Mobile No</label> <div class="controls"> <input type="text" name="father_mobile_no" id="father_mobile_no" class="span12 number" value="<?= $parent->father_mobile_no ?>" onchange="contact_validation(this)"/> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Office No</label> <div class="controls"> <input type="text" name="father_ofc_no" id="father_ofc_no" class="span12 number" value="<?= $parent->father_ofc_no ?>" onchange="contact_validation(this)" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Residence No</label> <div class="controls"> <input type="text" name="father_residence_no" id="father_residence_no" value="<?= $parent->father_residence_no ?>" class="span12 number" onchange="contact_validation(this)" /> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Email ID</label> <div class="controls"> <input type="text" name="father_email" id="father_email" value="<?= $parent->father_email ?>" class="email span12"/> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Employer Name</label> <div class="controls"> <input type="text" name="father_employer_name" id="father_employer_name" class="span12" value="<?= $parent->father_employer_name ?>" /> </div> </div> </div> </div> </div> </div> <div class="row-fluid portlet box yellow" id="newparent1" style="display: none" > <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Mother's Details</div> </div> <div class="portlet-body form" > <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Mother's name</label> <div class="controls"> <input type="text" name="mother_name" id="mother_name" class=" span12 required" value="<?= $parent->mother_name ?>" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Qatar ID NO</label> <div class="controls"> <input type="text" name="mother_qatar_id_no" id="mother_qatar_id_no" value="<?= $parent->mother_qatar_id_no ?>" class="span12" onchange="check_length_qatar_id(this)" /> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Occupation</label> <div class="controls"> <input type="text" name="mother_occupation" id="mother_occupation" value="<?= $parent->mother_occupation ?>" class="span12" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Mobile No</label> <div class="controls"> <input type="text" name="mother_mobile_no" id="mother_mobile_no" value="<?= $parent->mother_mobile_no ?>" class="span12 number" onchange="contact_validation(this)"/> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Office No</label> <div class="controls"> <input type="text" name="mother_ofc_no" id="mother_ofc_no" value="<?= $parent->mother_ofc_no ?>" class="span12 number" onchange="contact_validation(this)" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Residence No</label> <div class="controls"> <input type="text" name="mother_residence_no" id="mother_residence_no" value="<?= $parent->mother_residence_no ?>" class="span12 number" onchange="contact_validation(this)" /> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Email ID</label> <div class="controls"> <input type="text" name="mother_email" id="mother_email" value="<?= $parent->mother_email ?>" class="span12" /> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Employer Name</label> <div class="controls"> <input type="text" name="mother_employer_name" id="mother_employer_name" class="span12" value="<?= $parent->mother_employer_name ?>" /> </div> </div> </div> </div> </div> </div> <div class="row-fluid portlet box yellow" > <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Sibling Details</div> </div> <div class="portlet-body form" > <table class="table table-striped table-hover table-bordered"> <tr> <th>Student Id no</th> <th>Student Name</th> </tr> <?php $sibling = $this->mastermodel->get_data('parent_student', $parent->parent_id, 'parent_id'); foreach ($sibling as $row) { $sibling_det = $this->mastermodel->get_data_srow('student', $row['student_id'], 'student_id'); if (!empty($sibling_det)) { if ($student->student_id != $sibling_det->student_id) { ?> <tr> <td> <?= $sibling_det->reg_no ?> </td> <td > <?= $sibling_det->first_name . ' ' . $sibling_det->last_name ?> </td> </tr> <?php } } } ?> </table> </div> </div> <div class="form-actions"> <input name="student_id" id="student_id" value="<?= $student->student_id; ?>" type="hidden" /> <input name="reg_no" id="reg_no" value="<?= $student->reg_no; ?>" type="hidden" /> <input type="hidden" name="parent_id" id="parent_id" class="" value="<?= $parent->parent_id ?>"/> <button type="submit" class="btn blue" onclick="return addformdata1('validateform');"><i class="icon-ok"></i> Save</button> <button type="button" onclick="viewdata('student','viewinstudentsearch','search_student','view_student','<?= $_SESSION['pagenum']; ?>')" class="btn">Cancel</button> </div> <?php echo form_close(); ?> <!-- END FORM--> </div> </div> </div> </div>