64 lines
1.7 KiB
PHP
64 lines
1.7 KiB
PHP
<?php
|
|
defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
class Quote_Estimates extends Admin_Controller
|
|
{
|
|
|
|
public $viewData = array();
|
|
public $pagePerItem = 10;
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
// Load model
|
|
$this->load->model('quote_estimate_model', 'quoteEstimate');
|
|
$this->viewData['selectedTab'] = 'quote_estimate';
|
|
$this->load->helper('pagination');
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$this->viewData['pagination'] = initPagination($this->pagePerItem, 95, 1, '/quote_estimates');
|
|
$this->viewData['list'] = $this->quoteEstimate->getQuoteEstimates();
|
|
$this->renderAdminPage('quote_estimates/list', $this->viewData);
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
$this->template->load('quote_estimates/create', $this->viewData);
|
|
}
|
|
|
|
public function createQuoteEstimate()
|
|
{
|
|
redirect('/quote_estimates');
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
redirect('/quote_estimates');
|
|
}
|
|
|
|
public function search()
|
|
{
|
|
$this->viewData['pagination'] = initPagination($this->pagePerItem, 50, 1, '/quotes_estimates');
|
|
$this->viewData['list'] = $this->address->getAddresses();
|
|
$this->template->load('quote_estimates/list', $this->viewData);
|
|
}
|
|
|
|
public function quoteEstimateDetail($param)
|
|
{
|
|
$this->template->load('quote_estimates/edit', $this->viewData);
|
|
}
|
|
|
|
public function remove($param)
|
|
{
|
|
redirect('/addresses');
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|