JezK
Edit File: dairy_data.php
<?php session_start(); include_once("school_admin_access.php"); include_once("school_admin_student.php"); include_once("encription_key.php"); $admin = new adminaccess(); $encry = new Encryption(); $student = new studentacess(); $class_id = $_REQUEST['classid']; $section_id = $_REQUEST['sec_id']; $dairy_date = $_REQUEST['dairy_date']; $dairy_type = $_REQUEST['dairy_type']; $studentids = $_REQUEST['stuids']; $studentids = ltrim($studentids, ','); //$studentids =rtrim($studentids,','); $_SESSION['child']['dairy_section_id'] = $section_id; $_SESSION['child']['dairy_class_id'] = $class_id; $_SESSION['child']['dairy_date'] = $dairy_date; $classid = $_SESSION['child']['general_class']; $sectionid = $_SESSION['child']['general_section']; $classname = $admin->get_classname($classid); $sectioname = $admin->get_sectionsname($sectionid); $_SESSION['child']['general_classname'] = isset($classname['class_name'])?$classname['class_name']:" "; $_SESSION['child']['general_sectioname'] = isset($sectioname['section_name'])?$sectioname['section_name']:" "; $school_id = $_SESSION['child']['log_school_id']; $acadamic_year = $_SESSION['child']['choosen_academic_id']; $dairy_details = $student->dairy_data($class_id, $section_id, $dairy_date, $school_id, $dairy_type, $acadamic_year, $studentids); ?> <table id="myTable" class="table table-condensed table-hover" style="margin-top:-10px;"> <thead> <tr class="info"> <th class="col-md-1 text-center" style="width:80px!important;">Sl.No</th> <th style="width:191px!important;">Subject</th> <th style="width:284px!important;">Description</th> <th style="width:284px!important;">Attachment</th> <th style="width:169px!important;">Actions</th> </tr> </thead> <tbody> <?php if ($dairy_details) { $i = 1; foreach ($dairy_details as $key => $val) { ?> <tr> <td class="col-sm-1 text-center" style=" font-size:14px;width:80px!important;"><?php echo $i ?></td> <td style=" font-size:14px;width:191px!important;"><?php echo $val['subject_name'] ?></td> <td style=" font-size:14px;width:284px;"><?php echo $val['description'] ?></td> <td style=" font-size:14px;width:284px;"><?php echo substr($val['attachment'], 5); ?></td> <td style="width:169px!important;" class="center"> <a class="buttonn" href="edit_comment.php?id=<?php echo $val['School_diary_id'] ?>" style="margin:4px;"> <i class="fa fa-pencil" title="Edit" style="font-size: 13px; color:#01aee6;"></i> </a> <a class=" buttonn" onclick="return confirm('Do you want to delete the Comment ?')" href="delete_comment.php?id=<?php echo $val['School_diary_id'] ?>" style="margin:4px;"> <i class="fa fa-remove" title="Delete" style="font-size: 14px; color:#01aee6;"></i> </a> </td> </tr> <?php $i++; } } else { ?> <tr> <td></td> <td></td> <td>No data available in table</td> <td></td> </tr> <?php } ?> </tbody> </table>