add braderie select in VP

This commit is contained in:
Thibault UBUNTU 2016-03-14 10:59:58 +01:00
parent 825bebdeb5
commit 477aaf257f
2 changed files with 16 additions and 1 deletions

View File

@ -242,6 +242,15 @@ class AdminPrivateSalesSales extends AdminTab {
<div class="clear"></div>
</div>';
echo '<label>'.$this->l('Braderie :').'</label>
<div class="margin-form">
<div id="public" style="float: left;">
<input name="braderie" type="radio" value="0"'.($this->cursale!==NULL? ($this->cursale->braderie==0? ' checked="checked"': ''): ' checked="checked"').' /> '.$this->l('No').'&nbsp;&nbsp;&nbsp;<input name="braderie" type="radio" value="1"'.($this->cursale!==NULL && $this->cursale->braderie ==1? ' checked="checked"': '').' /> '.$this->l('Yes').'
<sup> *</sup>
</div>
<div class="clear"></div>
</div>';
echo '<label>'.$this->l('Featured sale:').'</label>
<div class="margin-form">
<div id="featured" style="float: left;">
@ -741,6 +750,7 @@ class AdminPrivateSalesSales extends AdminTab {
$sale->featured = Tools::getValue('featured', 0);
$sale->logout = Tools::getValue('logout', 0);
$sale->new = Tools::getValue('new', 0);
$sale->braderie = Tools::getValue('braderie', 0);
$sale->forward_news = Tools::getValue('forward_news', 0);
$sale->pub = Tools::getValue('pub', 0);
$sale->id_category = Tools::getValue('id_category', Configuration::get('PRIVATESALES_ROOT'));
@ -812,6 +822,7 @@ class AdminPrivateSalesSales extends AdminTab {
$sale->logout = Tools::getValue('logout', 0);
$sale->pub = Tools::getValue('pub', 0);
$sale->new = Tools::getValue('new', 0);
$sale->braderie = Tools::getValue('braderie', 0);
$sale->forward_news = Tools::getValue('forward_news', 0);
$sale->id_category = Tools::getValue('id_category', Configuration::get('PRIVATESALES_ROOT'));
$sale->id_employee = (int) Tools::getValue('id_employee');

View File

@ -12,6 +12,7 @@ class Sale {
var $logout = 0;
var $pub = 0;
var $new = 0;
var $braderie = 0;
var $forward_news = 0;
var $id_category;
var $id_employee = 0;
@ -35,6 +36,7 @@ class Sale {
$this->logout = $sale['logout'];
$this->pub = $sale['pub'];
$this->new = $sale['new'];
$this->braderie = $sale['braderie'];
$this->forward_news = $sale['forward_news'];
$this->id_category = $sale['id_category'];
$this->id_employee = $sale['id_employee'];
@ -76,7 +78,6 @@ class Sale {
public function save() {
if($this->id !== NULL) {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'privatesale` SET
`date_start` = "'.pSQL($this->date_start).'",
@ -85,6 +86,7 @@ class Sale {
`featured` = '.(int) $this->featured.',
`logout` = '.(int) $this->logout.',
`new` = '.(int) $this->new.',
`braderie` = '.(int) $this->braderie.',
`forward_news` = '.(int) $this->forward_news.',
`public` = '.(int) $this->pub.',
`id_category` = '.(int) $this->id_category.',
@ -178,6 +180,7 @@ class Sale {
'.(int) $this->logout.',
'.(int) $this->pub.',
'.(int) $this->new.',
'.(int) $this->braderie.',
'.(int) $this->forward_news.',
'.(int) $this->id_category.',
'.(int) $this->id_employee.',
@ -311,6 +314,7 @@ class Sale {
'logout' => $ps[0]['logout'],
'pub' => $ps[0]['public'],
'new' => $ps[0]['new'],
'braderie' => $ps[0]['braderie'],
'forward_news' => $ps[0]['forward_news'],
'position' => $ps[0]['position'],
'id_category' => $ps[0]['id_category'],