?
Current Path : /home1/savoy/www/savoyglobal.net/talentquest2013/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/talentquest2013/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 registration_list($event_id,$pagenum="1") { $_SESSION['admin_page']=$event_id; $perpage= $this->config->item('perpage'); $data['pagenum']=$pagenum; if($pagenum==1) { $data['id']=1; } else { $data['id']= (($pagenum-1)*$perpage)+1; } $output=$this->mastermodel->get_data('registration',$event_id,'registration_event_id','datetime',"desc",$pagenum); $data['startpage']=$output['startpage']; $data['endpage']=$output['endpage']; $data['reg']=$output['results']; $data['event_id']=$event_id; $data['event_name']=$this->mastermodel->get_single_field_value('event','event_name','event_id',$event_id); $this->load->view('admin/registration',$data); } function update_registration($id,$event_id) { $data['viewinfo'] =$this->mastermodel->get_data_srow('registration',$id,'registration_id'); $output= $this->mastermodel->get_data('registration_partcipant',$id,'registration_id'); $data['registration_partcipant'] =$output['results']; $data['event_id']=$event_id; $data['record_id']=$id; if(isset($_POST['savep'])) { $postdata = $this->mastermodel->get_post_values(); $res=$this->adminmodel->update_registration($postdata); redirect("admin/registration_list/$event_id"); } $this->load->view('admin/update_registration',$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 email() { $_SESSION['admin_page']='email'; $this->load->view('admin/email'); } function load_email_list($events_string) { $event_array= json_decode(urldecode($events_string)); $data['viewinfo']=$this->adminmodel->get_contacts_list($event_array); $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,$event_id) { $this->mastermodel->deletedata($table,$field,$id); try { $res=$this->mastermodel->deletedata($table,$field,$id); if($res!=1) { throw new Exception("Error"); } redirect('admin/'.$function.'/'.$event_id); } 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); } } ?>