PHP File Manager
Editing File: Coupons.php
<?php /* * Copyright (C) Wayne Purton-Smith - All Rights Reserved * Unauthorized copying of this file or removing this paragraph, via any medium is strictly prohibited * Proprietary and confidential * Written by Wayne Purton-Smith <waynepurtonsmith@hotmail.co.uk> February 2014 */ class Coupons extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('offers'); $this->users->denyRestricted('offers'); } public function index() { $head_data['page_title'] = 'Offer codes'; $this->load->view('header', $head_data); $data['offers'] = $this->offers->get(NULL, NULL, array('include_stats' => true)); $this->load->view('offers/overview', $data); $this->load->view('footer'); } public function edit($mode = NULL) { if(is_numeric($mode) && !(($offer_id = (int) $mode) > 0 && ($offer_info = $this->offers->get($offer_id)))) { redirect('/offers'); exit; } if($this->input->post('save_offer')) { if(!$this->offers->save($this->input->post(), $mode)) { $this->common->keepPostData(); } $this->common->keepResponseMessage(); redirect($this->agent->referrer()); exit; } $this->common->getPostData(); $head_data['page_title'] = 'Edit offer - Offer codes'; $this->load->view('header', $head_data); $data['offer_info'] = (isset($offer_info)) ? $offer_info : NULL; $this->load->view('offers/edit', $data); $this->load->view('footer'); } public function delete($mode = NULL) { $this->offers->delete($mode); redirect($this->agent->referrer()); } }
Cancel