bebeboutik/modules/generate_vouchers/generate_vouchers.php
Srv Bebeboutik 6c0978166c add modules
2016-01-04 12:49:26 +01:00

39 lines
941 B
PHP
Executable File

<?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;
}
}