first commit
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Quotes extends Admin_Controller
|
||||
{
|
||||
|
||||
public $viewData = array();
|
||||
public $pagePerItem = 10;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model
|
||||
$this->load->model('quote_model');
|
||||
$this->viewData['selectedTab'] = 'quote';
|
||||
$this->load->helper('pagination');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->viewData['pagination'] = initPagination($this->pagePerItem, 95, 1, '/quotes');
|
||||
$this->viewData['list'] = $this->quote_model->getQuotes();
|
||||
$this->renderAdminPage('quotes/list', $this->viewData);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->template->load('quotes/create', $this->viewData);
|
||||
}
|
||||
|
||||
public function createQuote()
|
||||
{
|
||||
redirect('/quotes');
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
redirect('/edit');
|
||||
}
|
||||
|
||||
// public function search() {
|
||||
// $this->viewData['pagination'] = initPagination($this->pagePerItem, 50, 1, '/address');
|
||||
// $this->viewData['list'] = $this->address->getAddresses();
|
||||
// $this->template->load('addresses/list', $this->viewData);
|
||||
// }
|
||||
|
||||
public function quoteDetail($param)
|
||||
{
|
||||
$this->template->load('quotes/edit', $this->viewData);
|
||||
}
|
||||
|
||||
public function remove($param)
|
||||
{
|
||||
redirect('/quotes');
|
||||
}
|
||||
|
||||
protected function renderAdminPage($page_name, $data) {
|
||||
$this->load->view('admin/view_admin_header', $data);
|
||||
$this->load->view($page_name, $data);
|
||||
$this->load->view('admin/view_admin_footer', $data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user