JezK
Edit File: ptm.php
<?php include("menuheader.php"); if(!(in_array(3,$access) && in_array(3,$allow))) echo "<script>location.replace('dashboard.php');</script>"; include_once("school_admin_access.php"); include_once("school_admin_student.php"); include_once("encription_key.php"); //define('NOTICEBOARD_IMAGES_PATH','http://'.$_SERVER[HTTP_HOST].'/school/uploads/noticeboard/timthumb.php?h=100&w=100&src='); define('NOTICEBOARD_IMAGES_PATH',ADMIN_PATH.'uploads/noticeboard/timthumb.php?h=100&w=100&src='); $admin=new adminaccess(); $student=new studentacess(); $encry=new Encryption(); if($_GET['type']){ $type = $_GET['type']; }else { $type= '4'; } $notice_data = $student->generalnotice_data($_SESSION,$type); $school_id = $_SESSION['child']['log_school_id']; $details_class =$admin->get_classes_byschool($school_id); $sections=$admin->get_sections_all(); ?> <style> #nav { margin: auto; width:930px; padding-left:0; padding-right:0; list-style: none; background: rgb(51, 93, 220) none repeat scroll 0% 0%; } #nav li { display:inline-block; margin:0 auto; text-align:center; } #nav li a { display: inline-block; padding: 7px 0; text-align:center; text-decoration: none; color: #FFFFFF; margin:auto; } #nav li:hover, li:active { background-color: #0b287b; width:90px; } #nav li.selected { background: #0b287b; } select { width: 62px !important; background-color: #FFF; border: 1px solid #CCC; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 3px; } </style> <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/south-street/jquery-ui.css" id="theme"> <link rel="stylesheet" href="//blueimp.github.io/Gallery/css/blueimp-gallery.min.css"> <body style="overflow-x: hidden;"> <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls"> <div class="slides"></div> <a class="prev">‹</a> <a class="next">›</a> <a class="close">×</a> <a class="play-pause"></a> <ol class="indicator"></ol> </div> <div class="row" style="margin-top: 30px;"> <div class="col-md-9 text-left" style="font:Arial, Helvetica, sans-serif;font-style:normal;font-size:24px; margin-left:20px;"><img src="images/noticeboard@2x.png" title =" Notice Board" style="font-size: 24px;"/> Notice Board </div> <div class="col-md-2 text-center" style="float:right;"> <button type="button" onClick="location.href='send_message.php?type=4'" class="btn btn-default" style="margin-right:20px;font-family: Arial, Helvetica, sans-serif; font-size:14px;padding:4px 10px;"> New Message </button> </div> </div> <br> <div class="menuu"> <ul id="nav" class="margn_auto"> <li style="border-right:1px solid #FFFFFF;width:150px; text-align:center;margin-left:-3px;font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"><a href="multipledates.php"><img src="images/general@2x.png" title ="General" style="margin-right:5px;"/>Calendar</a></li> <li style="border-right:1px solid #FFFFFF;width:150px; text-align:center;margin-left:-3px;font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"><a href="noticeboard_management.php"><img src="images/general@2x.png" title ="General" style="margin-right:5px;"/>General</a></li> <li class="selected" style="border-right:1px solid #FFFFFF; width:150px; text-align:center; margin-left:-3px; font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"><a href="ptm.php"><img src="images/ptm@2x.png" title ="PTM" style="margin-right:5px;"/>PTM</a></li> <li style="border-right:1px solid #FFFFFF; width:150px; text-align:center; margin-left:-3px; font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"><a href="vacation.php"><img src="images/vacation@2x.png" title ="Vacation" style="margin-right:5px;"/>Vacation</a></li> <li style="border-right:1px solid #FFFFFF; width:150px; text-align:center; margin-left:-3px; font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"><a href="activities.php"><img src="images/activity@2x.png" title ="Activities" style="margin-right:5px;"/>Hostlers</a></li> <li style="border-right:0px solid #FFFFFF; width:150px; text-align:center; margin-left:-3px; font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"><a href="for_you.php"><img src="images/for-you@2x.png" title ="For You" style="margin-right:5px;"/>For You</a></li> <!-- <li style="width:150px; text-align:center; margin-left:-3px; font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"><a href="hosteller.php"><img src="images/for-you@2x.png" title ="For You" style="margin-right:5px;"/> Hosteller</a></li>--> </ul> </div> <div class="row" style="margin-top: 30px;"> <div class="col-md-9 text-left" style="font:Arial, Helvetica, sans-serif;font-style:normal;font-size:18px; margin-left:20px; margin-top:-5px;"> <img src="images/ptm@2x.png" style="color:#000000; background:#000000; font-size:25px;color:black;" title ="PTM" /> PTM </div> </div> <div class="row" style="margin-left:10px;margin-right:10px;"> <div class="col-md-12 centered" style="font-family: Arial, Helvetica, sans-serif;margin-top:30px;"> <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:5%">Sl.No</th> <th style="width:12%">Class</th> <th style="width:10%">Section</th> <th style="width:50%">Message</th> <th style="width:10%">Created On</th> <th style="width:10%">Actions</th> </tr> </thead> <tbody> <?php $i =1; $j=1; if($notice_data){ foreach($notice_data as $kk=>$val) { $notice_data_images = $student->generalnotice_images_data($val['notification_id']); $date_date_new = explode(" ",$val['created_on']); $date_date = explode("-",$date_date_new[0]); $notice_date = $date_date['1']."/".$date_date['2']."/".$date_date['0']; if($val['class_id'] == "all"){ $class = "All"; }else{ $class = $details_class[$val['class_id']]['class_name']; } if($val['section_id'] == "all"){ $section = "All"; }else{ $section = $sections[$val['section_id']]['section_name']; } ?> <tr> <td class="col-sm-1 text-center" style=" font-size:14px;width:5%"><?=$i?></td> <td class="col-sm-1 text-center" style=" font-size:14px;width:12%"><?=$class?></td> <td class="col-sm-1 text-center" style=" font-size:14px;width:10%"><?=$section?></td> <td style=" font-size:14px;width:50%"><?=$val['notification_description']?><br> <?php if($notice_data_images){ ?> <div id="links<?=$j?>" > <?php foreach($notice_data_images as $k=>$fl){ ?> <a onclick="changeimage('<?=$j?>')" href="uploads/noticeboard/<?=$fl['image']?>" title="<?=$fl['image']?>"> <img src="<?=NOTICEBOARD_IMAGES_PATH.$fl['image']?>" height="100px" width="100px" alt=""> </a> <?php } ?> </div> <?php }?> </td> <td style="font-size:14px;width:10%"><?=$notice_date?></td> <td class="center" style="width:10%" > <a class=" buttonn" href="edit_notice.php?id=<?=$val['notification_id']?>" style="margin:4px;"> <i class="glyphicon glyphicon-pencil" title ="Edit" style="font-size: 14px; color:#01aee6;"></i> </a> <a class=" buttonn"onclick="return confirm('Do you want to delete the Message ?')" href="delete_notice.php?id=<?=$val['notification_id']?>&type=<?=$val['notification_type']?>" style="margin:4px;"> <i class=" glyphicon glyphicon-remove" title="Delete" style="font-size: 14px; color:#01aee6;"></i> </a> </td> </tr> <?php $i++; $j++; } } else { ?> <tr> <td></td> <td></td> <td></td> <td>No data available in table</td> <td></td> <td></td> </tr> <?php } ?> </tbody> </table> </div></div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <script src="//blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script> <script src="js/jquery.image-gallery.min.js"></script> <script src="//code.jquery.com/jquery-1.12.0.min.js"></script> <script src="https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.1.2/js/dataTables.buttons.min.js"></script> <script src="//cdn.datatables.net/buttons/1.1.2/js/buttons.print.min.js"></script> <script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script> <script src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script> <script src="//cdn.datatables.net/buttons/1.1.2/js/buttons.html5.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script> <script type="text/javascript" language="javascript" class="init"> $(document).ready(function() { /*$('#myTable').DataTable({ "pageLength":100, stateSave: true, dom: 'T<"clear">lfrtip', "oLanguage": { "sSearch": "" }, tableTools: { "aButtons": [ { "sExtends": "xls", "mColumns": [0, 1, 2, 3, 4] }, { "sExtends": "pdf", "sPdfOrientation": "landscape", "mColumns": [0, 1, 2, 3, 4] }, { "sExtends": "print", "mColumns": [0, 1, 2, 3, 4] } ] } }); $('div.dataTables_filter input').attr('placeholder', 'Search');*/ $('#myTable').DataTable( { dom: 'B<"clear">lfrtip', "iDisplayLength": 100, stateSave: true, buttons: [ { extend: 'print', title: '<center><h3><?php echo $_SESSION['child']['school_name']?></h3></center>', message: 'Notice Board Management - Ptm<br>Academic Year:<?php echo $_SESSION[child][choosen_year_name]?><br>', exportOptions: { columns: [ 0, 1, 2, 3, 4 ] } }, { extend: 'pdfHtml5', title:'<?php echo $_SESSION['child']['school_name']?>', message: 'Notice Board Management - Ptm \nAcademic Year:<?php echo $_SESSION[child][choosen_year_name]?>\n', exportOptions: { columns: [ 0, 1, 2, 3, 4 ] } }, { extend: 'excelHtml5', title:'<?php echo $_SESSION['child']['school_name']?>', exportOptions: { columns: [ 0, 1, 2, 3, 4 ] } } ] } ); } ); </script> <script> $(document).ready(function(){ $('#myTable').dataTable(); }); </script> <script> function changeimage(j){ document.getElementById('links'+j).onclick = function (event) { event = event || window.event; var target = event.target || event.srcElement, link = target.src ? target.parentNode : target, options = {index: link, event: event}, links = this.getElementsByTagName('a'); blueimp.Gallery(links, options); }; } </script> </script> </body> </html>