Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C:\op\domains\shop.loc\admin\controller\pricelist\price.php
- <?php
- class Controllerpricelistprice extends Controller {
- public function index() {
- $this->load->language('pricelist/price');
- $this->load->model('pricelist/price');
- if (($this->request->server['REQUEST_METHOD'] == 'POST') ) {
- switch($this->request->post['cmd']){
- case 'markup':
- try {
- $this->model_pricelist_price->setMarkup(
- @$this->request->post['STOCK'],
- @$this->request->post['PRICE_S'],
- @$this->request->post['PRICE_E'],
- @$this->request->post['MARKUP'],
- @$this->request->post['DISCOUNT']
- );
- } catch (Exception $e) {
- echo 'Выброшено исключение: ', $e->getMessage(), "\n";
- }
- break;
- }
- }
- $data['price_markup'] = $this->model_pricelist_price->getMarkup();
- $this->document->setTitle($this->language->get('heading_title'));
- $data['heading_title'] = $this->language->get('heading_title');
- $data['markup_submit'] = $this->language->get('markup_submit');
- $data['markup_title'] = $this->language->get('markup_title');
- $data['breadcrumbs'] = array();
- $data['breadcrumbs'][] = array(
- 'text' => $this->language->get('text_home'),
- 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
- );
- $data['breadcrumbs'][] = array(
- 'text' => $this->language->get('heading_title'),
- 'href' => $this->url->link('pricelist/price', 'token=' . $this->session->data['token'], true)
- );
- $data['header'] = $this->load->controller('common/header');
- $data['column_left'] = $this->load->controller('common/column_left');
- $data['footer'] = $this->load->controller('common/footer');
- $this->response->setOutput($this->load->view('pricelist/setting', $data));
- }
- }
- C:\op\domains\shop.loc\admin\language\ru-ru\pricelist\price.php
- <?php
- // Heading
- $_['heading_title'] = 'Настройка прайс-листов!';
- ..
- C:\op\domains\shop.loc\admin\model\pricelist\price.php
- <?php
- class Modelpricelistprice extends Model {
- public function setMarkup( $STOCK,
- $PRICE_S,
- $PRICE_E,
- $MARKUP,
- $DISCOUNT){
- ..
- $this->db->query("UPDATE l..");
- }
- public function getMarkup(){
- $sql="SELECT * FROM `load_markup`";
- $query = $this->db->query($sql);
- return $query->rows;
- }
- }
- C:\op\domains\shop.loc\admin\view\template\pricelist\setting.tpl
- <?php echo $header; ?><?php echo $column_left; ?>
- <div id="content">
- <div class="page-header">
- <div class="container-fluid">
- <h1><?php echo $heading_title; ?></h1>
- <ul class="breadcrumb">
- <?php foreach ($breadcrumbs as $breadcrumb) { ?>
- <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
- <?php } ?>
- </ul>
- </div>
- </div>
- <div class="container-fluid">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title"><i class="fa fa-exclamation-triangle"></i> <?php echo $markup_title; ?></h3>
- </div>
- <div class="panel-body">
- <noscript>Включите JavaScript!</noscript>
- <?php foreach($price_markup as $val): ?>
- <option value='<?=$val['STOCK'];?>'><?=$val['STOCK'];?></option>
- ..
- <?php endforeach; ?>
- </div>
- </div>
- </div>
- <?php echo $footer; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement