?
Current Path : /home1/savoy/public_html/savoyglobal.net/koolkids/school/application/controllers/ |
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/koolkids/school/application/controllers/calendar.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Calendar extends BaseController { function __construct() { parent::BaseController(); $this->load->model('calendarmodel'); $this->load->model('mastermodel'); $this->load->library('Fpaginate'); } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } // function viewincalendar($modelfunction,$page,$pagenum="") // { // /*<---------------- For pagination purpose------------>*/ // $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['userid'],0); // if(!$perm) // { // $this->load->view('Settings/nopermission'); // } // else // { // $perpage= $this->config->item('perpage'); // $data['pagenum']=$pagenum; // $_SESSION['searchdata'] = ''; // if($pagenum==1) // { // $data['id']=1; // } // else // { // $data['id']= (($pagenum-1)*$perpage)+1; // } // // // /*<---------------- For pagination purpose------------> */ // if(isset($encoded_data)) // { // $decoded_data= urldecode($encoded_data); // $postdata=json_decode($decoded_data, true); // } // else // { // $postdata=""; // } // // $output=$this->calendarmodel->$modelfunction($postdata,$pagenum); // $data['startpage']=$output['startpage']; // $data['endpage']=$output['endpage']; // $data['viewinfo']=$output['results']; // $this->load->view('Calendar/'.$page.'',$data); // } // // } function viewincalendarsearch($modelfunction,$page,$pagenum) { /*<---------------- For pagination purpose------------>*/ $perpage= $this->config->item('perpage'); $_SESSION['pagenum']=$pagenum; $data['pagenum']=$pagenum; if($pagenum==1) { $data['id']=1; } else { $data['id']= (($pagenum-1)*$perpage)+1; } if(isset($_POST['tab_name'])) { $postdata =""; } else { $postdata=$this->get_post_values(); } /*<---------------- For pagination purpose------------> */ if(!empty ($postdata)) $_SESSION['searchdata']=$postdata; else if(!isset($_SESSION['searchdata'])) $_SESSION['searchdata']=""; $output=$this->calendarmodel->$modelfunction($postdata,$pagenum); $data['startpage']=$output['startpage']; $data['endpage']=$output['endpage']; $data['viewinfo']=$output['results']; $this->load->view('Calendar/'.$page.'',$data); } function addincalendar($modelfunction,$page) { $postdata=$this->get_post_values(); $data=$this->calendarmodel->$modelfunction($postdata); if($data['res']==1) { $this->viewincalendarsearch($data['resfunction'],$page,$_SESSION['pagenum']); $this->load->view('insertsuccess'); } else { $this->viewincalendarsearch($data['resfunction'],$page,$_SESSION['pagenum']); $this->load->view('insertfailure'); } } function editform($controllerfunction,$id) { $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['userid'],1); if(!$perm) { $this->load->view('Settings/nopermission'); } else { $this->$controllerfunction($id); } } function editevent($id) { $data['event']=$this->mastermodel->get_data_srow('calendar',$id,'id'); $this->load->view('Calendar/editevent',$data); } function singleevent($id) { $data['event']=$this->mastermodel->get_data_srow('calendar',$id,'id'); $this->load->view('Calendar/singleevent',$data); } function insertevent($title,$start,$end) { $this->calendarmodel->insertcalevent($title,$start,$end); } function editnoticeboard($id) { $data['noticeboard']=$this->mastermodel->get_data_srow('noticeboard',$id,'id'); $this->load->view('Calendar/editnoticeboard',$data); } function singlenoticeboard($id) { $data['noticeboard']=$this->mastermodel->get_data_srow('noticeboard',$id,'id'); $this->load->view('Calendar/singlenoticeboard',$data); } }