39 lines
941 B
PHP
39 lines
941 B
PHP
|
<?php
|
||
|
class Generate_Vouchers extends Module {
|
||
|
|
||
|
public function __construct() {
|
||
|
$this->name = 'generate_vouchers';
|
||
|
$this->author = 'antadis';
|
||
|
$this->tab = 'administration';
|
||
|
$this->version = '1.0';
|
||
|
|
||
|
parent::__construct();
|
||
|
|
||
|
$this->displayName = $this->l('Générer des bons de réduction');
|
||
|
$this->description = $this->l('Permets la génération par lot de bon de réduction et export');
|
||
|
}
|
||
|
|
||
|
public function install() {
|
||
|
if(!parent::install() ) {
|
||
|
return FALSE;
|
||
|
}
|
||
|
|
||
|
# Add generate vouchers table
|
||
|
$query = '
|
||
|
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'generate_vouchers` (
|
||
|
`id_generate` INTEGER NOT NULL AUTO_INCREMENT,
|
||
|
`date_add` DATETIME NOT NULL,
|
||
|
`name` VARCHAR(255) NOT NULL,
|
||
|
`prefix` VARCHAR(255) NOT NULL,
|
||
|
PRIMARY KEY(`id_generate`)
|
||
|
) ENGINE=MyIsam DEFAULT CHARSET=utf8
|
||
|
';
|
||
|
if(!Db::getInstance()->Execute($query)) {
|
||
|
return FALSE;
|
||
|
}
|
||
|
return TRUE;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|