JezK
Edit File: hosteller.php
<?php session_start(); 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',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= '2'; $type= '1'; } if($_GET['date']){ $date = $_GET['date']; }else { $date=date('Y-m-d'); } //$delevent=$admin->getEventDates($date); //print_r($delevent); $dates=$admin->getacademicdates($_SESSION); //print_r($dates); if(isset($_POST['submit'])) { $event_data=$_POST['event']; $cal_date=$_POST['cal_date']; //echo "<script>alert('".$cal_date."');</script>"; //exit; $details_cal =$admin->insert_calenderdata($_SESSION,$event_data,$cal_date); if($details_cal==1) { echo "<script>alert('Event submitted successfully.');</script>"; echo "<script>location.replace('multipledates.php?date=".$cal_date."');</script>"; } } $notice_data = $student->generalnotice_data($_SESSION,$type); $notice_calender = $student->generalnotice_calenderview($_SESSION,$type,$date); $school_id = $_SESSION['child']['log_school_id']; $actyearid = $_SESSION['child']['choosen_academic_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; } .ui-datepicker-inline { margin: 0 auto; } .modal { left: 41%!important; width: 765px!important; height: 450px!important; background:rgba(0, 0, 0,0.1); } .Highlighted a{ background-color : Green !important; background-image :none !important; color: White !important; font-weight:bold !important; font-size: 12pt; } .event a{ background-color: #00FF00 !important } </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=5'" 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> <div class="menuu"> <ul id="nav"> <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="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 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;"/>Activities</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="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="for_you.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-12 text-center" style="font:Arial, Helvetica, sans-serif;font-style:normal;font-size:18px; margin-left:20px; margin-top:-5px;"> <img src="images/vacation@2x.png" style="color:#000000; background:#000000; font-size:25px;color:black;" title ="calender" /> Calender </div> </div>--> <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/for-you@2x.png" style="color:#000000; background:#000000; font-size:25px;" title ="For You" /> Hosteller </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:10%">Sl.No</th> <th style="width:10%">class</th> <th style="width:10%">Section</th> <th style="width:10%">Students</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']; } if($val['student_id'] != "all"){ $ids = explode(",",$val['student_id']); $details_students =$student->get_students_data_notice_byids($val['class_id'],$val['section_id'],$val['student_id'],$school_id); $students = ''; if($details_students){ foreach($details_students as $key=>$row){ $students .= $row['student_firstname']." ".$row['student_lastname']."<br>"; } } }else { $students = "All"; } ?> <tr> <td class="col-sm-1 text-center" style=" font-size:14px;width:10%"><?=$i?></td> <td style="width:10%" class="lice_details"><?=$class?></td> <td style="width:10%" class="lice_details"><?=$section?></td> <td style="width:10%" class="lice_details"><?=$students?></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></td> <td>No data available in table</td> <td></td> <td></td> </tr> <?php } ?> </tbody> </table> </div></div> </div> <?php /* <!-- Modal --> <div id="myModal22" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <form method="post"> <div class="modal-content"> <div class="modal-header" style="background:#18b88d;color:#fff"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Event</h4> </div> <div class="modal-body"> <p> Edit Event:</p> <p><textarea name="edit_event" id="edit_event" class="form-control" style="height:100px;margin-left: 58px; width: 438px;" id=""></textarea></p> <input type="hidden" id="cal_date" name="cal_date"> </div> <div class="modal-footer"> <input type="submit" id="edit_submit" name="edit_submit" class="btn btn-default" data-dismiss="modaldads" value="Edit" onclick="return validation()" /> <button type="button" class="btn btn-default" data-dismiss="modal" onclick="test();">Close</button> </div> </div> </form> </div> </div></div> </div> </div> */?> <!--script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script--> <!--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"> </script> --> <!-- <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"> --> <!-- <script src="//code.jquery.com/jquery-1.12.4.js"></script> <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script> --> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css"> <!--script src="https://code.jquery.com/jquery-1.12.4.js"></script--> <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script> <script> $(document).ready(function() { var simple = '<?php echo $date; ?>'; var values = simple.split('-'); $('#datepicker').datepicker("setDate", new Date(values[0],values[1]-1,values[2])); }); //$(document).ready(function() //{ //$(function () { //$( "#datepicker").datepicker({ //dateFormat: 'yy-mm-dd', ////changeMonth: true, ////changeYear: true, //beforeShowDay: function highlightDays(date) { //for (var i = 0; i < dates.length; i++) { //if (new Date(dates[i]).toString() == date.toString()) { //return [true, 'event','Tooltip text']; //} //} //return [true, '']; //} //}); //}); //}); var SelectedDates = []; $( function() { var event_dte='<?php echo $date; ?>'; var academic_id=<?php echo $actyearid;?>; //$(document).ready(function() //{ $.ajax({ url: "ajaxcalls_attn.php", type:"POST", data:"mode="+"event_dates"+"&date="+event_dte+"&academic_yearid="+academic_id, success: function(result) { var result=JSON.parse(result); for(var i=0;i<result.length;i++) { SelectedDates[new Date(result[i])] = new Date(result[i]); //SelectedDates.push(new Date(result[i])] = new Date(result[i])); } var simple = '<?php echo $date; ?>'; var values = simple.split('-'); //$('#datepicker').datepicker("setDate", new Date(values[0],values[1]-1,values[2])); $('#datepicker').datepicker({ dateFormat: 'yy-mm-dd', defaultDate: new Date(values[0],values[1]-1,values[2]), beforeShowDay: function(date) { //var cmp= $("#datepicker").val(); var Highlight = SelectedDates[date]; if (Highlight) { //alert(cmp); return [true, "event",'Tooltip text']; } else { return [true, '', '']; } }, onChangeMonthYear: function (year, month, widget) { //alert(year); //alert(month); var cmp=year+'-'+month+'-'+'01'; location.replace('multipledates.php?date='+cmp); } }).on('change', function() { var start_date='<?php echo $dates['academic_startdate']?>'; var end_date='<?php echo $dates['academic_enddate'] ?>'; //alert('startdate'+start_date); //alert('enddate'+end_date); var cmp= $("#datepicker").val(); // alert(cmp); var nwdate=$("#now_dated").val(); var cudate=nwdate.split("-"); var dcmp=cmp.split('-'); var mcdate=dcmp[1]-1; var mcheck=cudate[1]-1; var cdate= new Date(dcmp[0],mcdate,dcmp[2]); var checkd= new Date(cudate[0],mcheck,cudate[2]); var asdate=start_date.split('-'); var aedate=end_date.split('-'); var amc_smonth=asdate[1]-1; var amc_emonth=aedate[1]-1; var sd1= new Date(asdate[0],amc_smonth,asdate[2]); var end1= new Date(aedate[0],amc_emonth,aedate[2]); //alert(cmp); if(cdate<sd1) { alert("Please choose a date with in the range of Academic Year"); //$('#myModal').modal('show'); $('#datepicker').show(); document.getElementById('cal_date').value=cmp; //$('#myModal').modal('show'); //location.replace('multipledates.php?date='+cmp); } else if(cdate>end1) { alert("Please choose a date with in the range of Academic Year"); //$("#datepicker").val(''); document.getElementById('cal_date').value=cmp; //$('#myModal').modal('show'); $('#datepicker').show(); }else { document.getElementById('cal_date').value=cmp; $('#myModal').modal('show'); $('#datepicker').show(); } }); }, error : function(e) { alert(e); } }); //}); //var aa='11/19/2016'; //var SelectedDates = {}; //SelectedDates[new Date(aa)] = new Date(aa); //SelectedDates[new Date('11/15/2016')] = new Date('11/15/2016'); //SelectedDates[new Date('11/28/2016')] = new Date('11/28/2016'); //SelectedDates[new Date('11/02/2016')] = new Date('11/02/2016'); }); </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); }; } function test() { var cmp= $("#datepicker").val(); //location.replace('multipledates.php?date='+cmp); } function validation() { //alert('hi'); var des=document.getElementById('event').value; if(des=='') { alert('Please enter description'); return false; }else { } } </script> <script> //$( "#datepicker" ).datepicker({ //dateFormat: 'yy-mm-dd' //}).on('change', function() //{ //var start_date='<?php echo $dates['academic_startdate']?>'; //var end_date='<?php echo $dates['academic_enddate'] ?>'; ////alert('startdate'+start_date); ////alert('enddate'+end_date); //var cmp= $("#datepicker").val(); //var nwdate=$("#now_dated").val(); //var cudate=nwdate.split("-"); //var dcmp=cmp.split('-'); //var mcdate=dcmp[1]-1; //var mcheck=cudate[1]-1; //var cdate= new Date(dcmp[0],mcdate,dcmp[2]); //var checkd= new Date(cudate[0],mcheck,cudate[2]); //var asdate=start_date.split('-'); //var aedate=end_date.split('-'); //var amc_smonth=asdate[1]-1; //var amc_emonth=aedate[1]-1; //var sd1= new Date(asdate[0],amc_smonth,asdate[2]); //var end1= new Date(aedate[0],amc_emonth,aedate[2]); ////alert(cmp); //if(cdate<sd1) //{ //alert("Please choose a date with in the range of Academic Year"); ////$('#myModal').modal('show'); //$('#datepicker').show(); //document.getElementById('cal_date').value=cmp; ////$('#myModal').modal('show'); ////location.replace('multipledates.php?date='+cmp); //} //else if(cdate>end1) //{ //alert("Please choose a date with in the range of Academic Year"); ////$("#datepicker").val(''); //document.getElementById('cal_date').value=cmp; ////$('#myModal').modal('show'); //$('#datepicker').show(); //}else //{ //document.getElementById('cal_date').value=cmp; //$('#myModal').modal('show'); //$('#datepicker').show(); //} //}); function delete_event(dairy_id) { var dte = '<?php echo $date; ?>'; //alert(dairy_id); var res=confirm("Do you want to delete the Message ?"); if(res) { $.ajax({ url: "ajaxcalls_attn.php", type:"POST", data:"mode="+"delete_event"+"¬ification_id="+dairy_id, success: function(result) { if(result==1) { //document.getElementById("mydairyid").innerHTML=""; location.replace('multipledates.php?date='+dte); } else { } }, error : function(e) { alert(e); } }); } } </script> </body> </html>