public static function conn() { if (static::$conn === null) { static::$config = new \Doctrine\DBAL\Configuration(); $connectionParams = array('host' => Config::get('db_host'), 'driver' => 'pdo_mysql', 'user' => Config::get('db_login'), 'password' => Config::get('db_password'), 'dbname' => Config::get('db_name'), 'charset' => 'utf8'); static::$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, static::$config); static::$conn->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); } return static::$conn; }
public static function install() { $query = "CREATE TABLE IF NOT EXISTS `" . Config::get("db_pref", "shotgun_") . "desc` (\n `desc_id` int(4) NOT NULL AUTO_INCREMENT,\n `desc_titre` varchar(50) NOT NULL,\n `desc_desc` varchar(250) NOT NULL,\n `desc_is_public` int(1) NOT NULL,\n `desc_quota` int(10) NOT NULL,\n `desc_debut` datetime NOT NULL,\n `desc_fin` datetime NOT NULL,\n `desc_public_cible` text NOT NULL,\n `payutc_fun_id` int(4) NOT NULL,\n `payutc_cat_id` int(4) NOT NULL,\n PRIMARY KEY (`desc_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\n"; return $query; }
?> <div class="row"> <div class="col-md-12"> <form role="form" action="install" method="POST"> <?php foreach (Config::$default as $item) { ?> <div class="form-group"> <label for="<?php echo $item[0]; ?> "><?php echo $item[1]; ?> </label> <input type="text" class="form-control" name="<?php echo $item[0]; ?> " value="<?php echo Config::get($item[0], ""); ?> " > </div> <?php } ?> <button type="submit" class="btn btn-primary">Enregistrer</button> <a class="btn btn-default" href="installpayutc">Générer une application sur PayIcam</a> </form> <br /> </div> </div>
function getPayutcClient($service) { return new \JsonClient\AutoJsonClient(Config::get('payutc_server'), $service, array(CURLOPT_PROXY => Config::get('proxy')), "Payutc Json PHP Client", isset($_SESSION['payutc_cookie']) ? $_SESSION['payutc_cookie'] : ""); }
public static function install() { $query = "CREATE TABLE IF NOT EXISTS `" . Config::get("db_pref", "shotgun_") . "option` (\n `option_id` int(6) NOT NULL AUTO_INCREMENT,\n `user_login` varchar(125) NOT NULL,\n `user_prenom` varchar(50) NOT NULL,\n `user_nom` varchar(50) NOT NULL,\n `user_mail` varchar(125) NOT NULL,\n `user_cotisant` int(1) NOT NULL,\n `fk_desc_id` int(5) NOT NULL,\n `fk_choice_id` int(5) NOT NULL,\n `payutc_tra_id` int(9) NOT NULL,\n `payutc_tra_url` varchar(150) NOT NULL,\n `option_date_creation` datetime NOT NULL,\n `option_date_paiement` datetime DEFAULT NULL,\n `option_status` varchar(1) NOT NULL,\n PRIMARY KEY (`option_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\n"; return $query; }
public static function install() { $query = "CREATE TABLE IF NOT EXISTS `" . Config::get("db_pref", "shotgun_") . "choice` (\n `choice_id` int(4) NOT NULL AUTO_INCREMENT,\n `choice_name` varchar(50) NOT NULL,\n `choice_priceC` int(5) NOT NULL,\n `choice_stock` int(5) NOT NULL,\n `fk_desc_id` int(4) NOT NULL,\n `payutc_art_idC` int(11) NOT NULL,\n PRIMARY KEY (`choice_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\n"; // `choice_priceNC` int(5) NOT NULL, // `payutc_art_idNC` int(11) NOT NULL, return $query; }