?
Current Path : /home1/savoy/www/savoyglobal.net/badminton2013/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/www/savoyglobal.net/badminton2013/application/controllers/admin.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <?php class Admin extends MY_Controller { public function __construct() { parent::MY_Controller(); $this->load->model('adminmodel'); $this->load->model('mastermodel'); $this->load->library('Fpaginate'); $this->load->library('mail'); } function home() { $_SESSION['admin_page']='home'; $this->load->view('admin/home'); } function singles($pagenum="1") { $_SESSION['admin_page']='singles'; $perpage= $this->config->item('perpage'); $data['pagenum']=$pagenum; if($pagenum==1) { $data['id']=1; } else { $data['id']= (($pagenum-1)*$perpage)+1; } $output=$this->mastermodel->getdatas('registration_singles','datetime','desc',$pagenum); $data['startpage']=$output['startpage']; $data['endpage']=$output['endpage']; $data['singles']=$output['results']; $this->load->view('admin/singles',$data); } function update_singles($id="") { $_SESSION['admin_page']='singles'; if(isset($_POST['savep'])) { $postdata = $this->mastermodel->get_post_values(); $res= $this->adminmodel->update_singles($postdata); redirect('admin/singles'); } $data['programs']=$this->mastermodel->get_data_srow('registration_singles',$id,'registration_singles_id'); $this->load->view('admin/update_singles',$data); } function doubles($pagenum="1") { $_SESSION['admin_page']='doubles'; $perpage= $this->config->item('perpage'); $data['pagenum']=$pagenum; if($pagenum==1) { $data['id']=1; } else { $data['id']= (($pagenum-1)*$perpage)+1; } $output=$this->mastermodel->getdatas('registration_doubles','datetime','desc',$pagenum); $data['startpage']=$output['startpage']; $data['endpage']=$output['endpage']; $data['doubles']=$output['results']; $this->load->view('admin/doubles',$data); } function update_doubles($id="") { $_SESSION['admin_page']='doubles'; if(isset($_POST['savep'])) { $postdata = $this->mastermodel->get_post_values(); $res= $this->adminmodel->update_doubles($postdata); redirect('admin/doubles'); } $data['programs']=$this->mastermodel->get_data_srow('registration_doubles',$id,'registration_doubles_id'); $this->load->view('admin/update_doubles',$data); } function mixed($pagenum="1") { $_SESSION['admin_page']='mixed'; $perpage= $this->config->item('perpage'); $data['pagenum']=$pagenum; if($pagenum==1) { $data['id']=1; } else { $data['id']= (($pagenum-1)*$perpage)+1; } $output=$this->mastermodel->getdatas('registration_mixed','datetime','desc',$pagenum); $data['startpage']=$output['startpage']; $data['endpage']=$output['endpage']; $data['mixed']=$output['results']; $this->load->view('admin/mixed',$data); } function update_mixed($id="") { $_SESSION['admin_page']='mixed'; if(isset($_POST['savep'])) { $postdata=$this->mastermodel->get_post_values(); $res=$this->adminmodel->update_mixed($postdata); redirect('admin/mixed'); } $data['programs']=$this->mastermodel->get_data_srow('registration_mixed',$id,'registration_mixed_id'); $this->load->view('admin/update_mixed',$data); } function email() { $_SESSION['admin_page']='email'; $this->load->view('admin/email'); } function load_email_list($singles,$doubles,$mixed) { $data['viewinfo']=$this->adminmodel->get_contacts_list($singles,$doubles,$mixed); $this->load->view('admin/email_list',$data); } function load_sms_list($singles,$doubles,$mixed) { $data['viewinfo']=$this->adminmodel->get_contacts_list($singles,$doubles,$mixed); $this->load->view('admin/sms_list',$data); } function settings() { $_SESSION['admin_page']='settings'; $this->load->view('admin/settings'); } function update_password() { $_SESSION['admin_page']='settings'; $postdata = $this->mastermodel->get_post_values(); $this->adminmodel->update_password($postdata); $this->load->view('admin/settings'); } public function logout() { session_destroy(); redirect('site/login'); } function delete($table,$field,$id,$function) { $this->mastermodel->deletedata($table,$field,$id); try { $res=$this->mastermodel->deletedata($table,$field,$id); if($res!=1) { throw new Exception("Error"); } redirect('admin/'.$function); } catch(Exception $exception) { redirect('admin/'.$function); } } function send_email() { $postdata = $this->mastermodel->get_post_values(); $this->adminmodel->send_email($postdata); $data['msg'] = "Email Sent! "; $_SESSION['admin_page']='email_list'; $this->load->view('admin/view-message',$data); } } ?>