?
Current Path : /home1/savoy/public_html/savoyglobal.net/chess2015open/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/chess2015open/application/controllers/site.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Site extends CI_Controller { /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see http://codeigniter.com/user_guide/general/urls.html */ function __construct() { parent::__construct(); session_start(); $this->load->model('mastermodel'); $this->load->model('adminmodel'); $this->load->library('Fpaginate'); $this->load->library('mail'); } function index($page = '') { if ($page == '') $page = 'home'; redirect('site/' . $page); } function home() { $_SESSION['page'] = 'home'; $this->load->view('site/home'); } function schedule() { $_SESSION['page'] = 'schedule'; $this->load->view('site/schedule'); } function rules() { $_SESSION['page'] = 'rules'; $this->load->view('site/rules'); } function participants_below() { $_SESSION['page'] = 'participants'; $data['viewinfo'] = $this->mastermodel->gettabledata('registration'); $this->load->view('site/participants_below', $data); } function participants_over() { $_SESSION['page'] = 'participants'; $data['viewinfo'] = $this->mastermodel->gettabledata('registration'); $this->load->view('site/participants_over', $data); } function participants() { $_SESSION['page'] = 'participants'; $data['viewinfo'] = $this->mastermodel->gettabledata('registration'); $this->load->view('site/participants', $data); } function registration($flag = 1) { $_SESSION['page'] = 'registration'; $this->load->view('site/registration'); } function results() { $_SESSION['page'] = 'results'; $this->load->view('site/results'); } function draws() { $_SESSION['page'] = 'draws'; $this->load->view('site/draws'); } function draw() { $_SESSION['page'] = 'draws'; $this->load->view('site/draw'); } function doubles_draw() { $_SESSION['page'] = 'draws'; $this->load->view('site/doubles-draw'); } function mixed_doubles_draw() { $_SESSION['page'] = 'draws'; $this->load->view('site/mixed-doubles-draw'); } function contact_us() { $_SESSION['page'] = 'contact_us'; $this->load->view('site/contact-us'); } function insert_contact() { $postdata = $this->mastermodel->get_post_values(); $this->mastermodel->insert_contact($postdata); $data['msg'] = "Thank You! <br/> YOU WILL HEAR FROM US SHORTLY."; $_SESSION['page'] = 'contact_us'; $_SESSION['spage'] = ''; $this->load->view('site/view-message', $data); } function insert_registration() { $_SESSION['page'] = 'registration'; if (isset($_POST['fullname'])) { $postdata = $this->mastermodel->get_post_values(); $data['viewinfo'] = $postdata; $path = './assets/uploads/proof'; $file_name = $this->mastermodel->generateRandomString(); if (isset($_FILES['proof']) && $_FILES['proof']['name'] != "") { $uploaded_file = pathinfo($_FILES["proof"]["name"]); $extension = $uploaded_file['extension']; $image_file = $file_name . '.' . $extension; $_FILES['proof']['name'] = $image_file; if (!is_file("$path/" . $_FILES["proof"]["name"])) { if (move_uploaded_file($_FILES["proof"]["tmp_name"], $path . "/" . $_FILES["proof"]["name"])) { $postdata['proof'] = $_FILES["proof"]["name"]; $res = $this->mastermodel->insert_registration($postdata); redirect('site/message'); } } else { echo "File already exists"; $postdata['proof'] = ''; } } else { $postdata['proof'] = ''; $res = $this->mastermodel->insert_registration($postdata); redirect('site/message'); } } $this->load->view('site/registration'); } function message() { $this->load->view('site/message'); } function admin() { $this->load->view('admin/login'); } public function login($res = "") { if ($res == 'false') $data['result'] = '<font color="red" size=2px; >Username and Password does not match</font>'; else $data['result'] = ''; $this->load->view('admin/login', $data); } public function authenticate() { $username = mysql_real_escape_string($this->input->post('username')); $password = mysql_real_escape_string($this->input->post('password')); $data = $this->adminmodel->authenticate($username, $password); if ($data['numrows'] > 0) { $_SESSION['loggedin'] = 'true'; $_SESSION['userid'] = $data['userid']; $_SESSION['username'] = $data['username']; redirect('admin/home/'); } else { redirect('site/login/false'); } } } /* End of file site.php */ /* Location: ./application/controllers/site.php */