?
Current Path : /home1/savoy/public_html/savoyglobal.net/cocorico/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/public_html/savoyglobal.net/cocorico/application/views/student/edit_attendance.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('documentreadyfunctions'); ?> <script type="text/javascript"> $(document).ready(function() { $("#start_time_hour,#start_time_minute,#end_time_hour,#end_time_minute").change(function(){ var id=this.id; var val=this.value; $(":input[name^="+id+"]").val(val); }) $('.calfocus1').datepick({dateFormat: 'dd-mm-yyyy',onClose:function(){ var student_id=$("#student_id").val(); if(student_id=='') { $("#start_date").val(' '); alert("Select Student First") } }}); }); </script> <div class="row-fluid"> <div class="tab-pane " id="tab_2"> <div class="portlet box blue"> <div class="portlet-title"> <div class="caption"><i class="icon-reorder"></i>Updating Attendance</div> <div class="tools"> <a href="#" onclick="viewdata('student','viewinstudentsearch','search_attendance','view_attendance','<?= $_SESSION['pagenum']; ?>')" class="remove"></a> </div> </div> <div class="portlet-body form"> <!-- BEGIN FORM--> <?php $attributes = array('id' => 'validateform', 'class' => 'form-horizontal validate'); echo form_open('student/addinstudent/update_attendance/view_attendance/1', $attributes); $start_time = explode(":", $viewinfo->start_time); $end_time = explode(":", $viewinfo->end_time); $teacher=$this->mastermodel->get_data_joined('employee', 'class_teacher', 'employee_id', 'teacher_id', $viewinfo->class_id, 'class_name_id'); ?> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Attendance Date</label> <div class="controls"> <?php $data = array( 'name' => 'attendance_date', 'id' => 'attendance_date', 'class' => 'required calfocus span12', 'value' => $this->mastermodel->convertdatenormalformat($viewinfo->attendance_date) ); echo form_input($data) . form_error($data); ?> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Class Name </label> <div class="controls"> <span class="text bold"> <?= $this->mastermodel->get_single_field_value('class_name', 'class_name_code', 'class_name_id', $viewinfo->class_id) ?></span> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">Teacher Name</label> <div class="controls"> <select name="teacher_id" id="teacher_id" class="chosen span12" > <option value=''>Select</option> <?php foreach ($teacher as $list) { ?> <option value="<?= $list['employee_id'] ?>"<?php if ($viewinfo->teacher_id == $list['employee_id']) { echo "selected"; } ?>><?= $list['employee_name'] ?></option> <?php } ?> </select> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Start Time</label> <div class="controls"> <?php echo createHours('start_time_hour', $start_time[0]); ?> <?php echo createMinutes('start_time_minute', $start_time[1]); ?> </div> </div> </div> </div> <div class="row-fluid"> <div class="span6 "> <div class="control-group"> <label class="control-label">End Time</label> <div class="controls"> <?php echo createHours('end_time_hour', $end_time[0]); ?> <?php echo createMinutes('end_time_minute', $end_time[1]); ?> </div> </div> </div> <div class="span6 "> <div class="control-group"> <label class="control-label">Remarks</label> <div class="controls"> <textarea name="remarks" class="span12" id="remarks" type="text"><?= $viewinfo->remarks ?></textarea> </div> </div> </div> </div> <div class="portlet box blue"> <div class="portlet-title"> <div class="caption"><i class="icon-check"></i>Attendance Details</div> </div> <div class="portlet-body"> <div class="row-fluid"> <div class="control-group"> <table class="table table-striped table-hover table-bordered" id="stud_sub" style="background-color: white;"> <thead id="stud_sub_head"> <tr> <td style="text-align: center;height: 30px;">Sl no</td> <td style="text-align: center;">Student Name</td> <td style="text-align: center;">Student Reg No</td> <td style="text-align: center;">Gender</td> <td style="text-align: center;">Nationality</td> <td style="text-align: center;">Age</td> <td style="text-align: center" >Attendance</td> <td style="text-align: center;">Time In</td> <td style="text-align: center;">Time Out</td> <td style="text-align: center">Remarks</td> </tr> <tr> <td colspan="10" style="text-align: center;">Present</td> </tr> </thead> <tbody> <?php $html = ""; $students = $this->mastermodel->get_data('attendance_details', $viewinfo->attendance_id, 'attendance_id'); if (!empty($students)) { $j = 1; $k = 0; $l = 1; foreach ($students as $list) { $studnt_name = $this->mastermodel->get_data_srow_joined('student', 'nationality', 'nationality_id', 'nationality_id',$list['student_id'], 'student_id'); $age_details = $this->mastermodel->getAgeDetails($studnt_name->dob); $student_details = $this->mastermodel->get_data_srow('student_deactivate',$list['student_id'], 'student_id'); if(isset($student_details->student_class_id)){ $deactivate = $this->studentmodel->check_deactivate($student_details->student_class_id, $list['student_id'], $viewinfo->attendance_date); if ($deactivate > 0) { $sl = count($students) - $k; $html = '<tr> <input type="hidden" name="student_id_' . $j . '" value="' . $list['student_id'] . '"/> <td style="text-align: center;height: 30px;">' . $sl . '</td> <td>' . $studnt_name->first_name . " " . $studnt_name->last_name . ' </td> <td> ' . $studnt_name->reg_no . '</td> <td>' . $studnt_name->gender . '</td> <td>' . $studnt_name->nationality_name . '</td> <td>' . $age_details['in_words'] . '</td> <td style="text-align: center;"><input type="hidden" name="attendance' . $j . '" value="deactivate" />Deactivated</td> <td>' . createHours("start_time_hour$j", date("H")) . createMinutes("start_time_minute$j", date("i")) . ' </td> <td>' . createHours("end_time_hour$j", date("H")) . createMinutes("end_time_minute$j", date("i")) . ' </td> <td style="text-align: center;"><textarea name="remarks' . $j . '" id="remark_' . $j . '" type="text">' . $list['remarks'] . '</textarea></td> </tr>' . $html; $k++; } } else { $sl = $l; ?> <tr> <input type="hidden" name="student_id_<?= $j ?>" value="<?= $list['student_id'] ?>" /> <td style="text-align: center;width: 120px;height: 30px;"><?= $sl ?></td> <td><?= $studnt_name->first_name . " " . $studnt_name->last_name ?></td> <td><?= $studnt_name->reg_no; ?></td> <td><?= $studnt_name->gender; ?></td> <td><?= $studnt_name->nationality_name; ?></td> <td><?php /* 'yyyy-mm-dd format' */ $age_details = $this->mastermodel->getAgeDetails($studnt_name->dob); echo $age_details['in_words']; ?></td> <?php if ($list['attendance'] == 3) { echo '<td style="text-align: center;"><input type="hidden" name="attendance' . $j . '" value="unallocated" />Unallocated</td>'; } else { ?> <td style="text-align: center;"><input type="checkbox" name="attendance<?= $j ?>" <?php if ($list['attendance'] == 1) { echo "checked"; } ?> /></td> <?php } $start_time_array = explode(':', $list['start_time']); $end_time_array = explode(':', $list['end_time']); ?> <td> <div> <?php echo createHours("start_time_hour$j", $start_time_array[0]); ?> <?php echo createMinutes("start_time_minute$j", $start_time_array[1]); ?> </div> </td> <td> <div> <?php echo createHours("end_time_hour$j", $end_time_array[0]); ?> <?php echo createMinutes("end_time_minute$j", $end_time_array[1]); ?> </div> </td> <td style="text-align: center;"><textarea name="remarks<?= $j ?>" id="remark<?= $j ?>" type="text"><?= $list['remarks'] ?></textarea></td> </tr> <?php $l++; } $j++; } echo $html; } ?> </tbody> </table> </div> </div> </div> </div> <div class="form-actions"> <input type="hidden" name="tab_name" value="attendance"/> <input type="hidden" name="resfunction" value="search_attendance"/> <input name="attendance_id" id="attendance_id" type="hidden" value="<?= $viewinfo->attendance_id ?>"/> <button type="submit" onclick="addformdata('validateform')" class="btn blue"><i class="icon-ok"></i> Save</button> <button type="button" onclick="viewdata('student','viewinstudentsearch','search_attendance','view_attendance','<?= $_SESSION['pagenum']; ?>')" class="btn">Cancel</button> </div> <?php echo form_close(); ?> <!-- END FORM--> </div> </div> </div> </div>