public function recipe() { $recettes = App::getInstance()->getTable('recette')->show($_GET['id']); $categories = App::getInstance()->getTable('categorie')->show($_GET['id']); $ingredients = App::getInstance()->getTable('ingredient')->show($_GET['id']); $instructions = APP::getInstance()->getTable('recette')->expl($recettes); $this->render('posts.recipe', compact('recettes', 'categories', 'ingredients', 'instructions', 'progress')); }
/** * Init connexion pgsql * @throws Exception */ public function __construct() { try { $this->config = APP::getInstance()->config['database']; $dsn = "pgsql:host=" . $this->config['server'] . " dbname=" . $this->config['dbname'] . " user="******" password=" . $this->config['password']; $this->connexion = new PDO($dsn, $this->config['username'], $this->config['password']); } catch (PDOException $e) { throw new Exception($e->getMessage()); } }
/** * When an application is loaded on the frontend, * load the language files from the app folder too * * @param AppEvent $event The event triggered */ public static function init($event) { $account = $event->getSubject(); $app = APP::getInstance('zoo'); $new = $event['new']; if (is_string($account->params) || is_null($account->params)) { // decorate data as this $account->params = $app->parameter->create($account->params); } if (is_string($account->elements) || is_null($account->elements)) { // decorate data as this $account->elements = $app->parameter->create($account->elements); } $account->loadMappedAccounts(); }
if(data && ("success" in data) && data.success == true) { var content = $( data.data ); $( "#res_sms" ).empty().append( content ); } else { var content = $( data.error ); $( "#res_sms" ).empty().append( content ); } }); } </script> </div> <div class="sidebar-pane" id="messages"><h1>Nous contacter</h1><a href="mailto:<?php print APP::getInstance()->config['mail']; ?> ?subject=Contact+gendloc">PGHM ISERE - GENDLOC</a></div> </div> </div> <!-- LA CARTE --> <div id="map" class="sidebar-map"></div> <script type="text/javascript"> // Carte Open OpenStreetMap_Mapnik var OpenStreetMap_Mapnik = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' });
// $code = User::get('code'); $val = $this->waitParam('get', 'val', array(Request::PARAM_NOT_NULL, Request::PARAM_TYPE_INTEGER)); $tel = $this->waitParam('get', 'tel', array(Request::PARAM_NOT_NULL, Request::PARAM_TYPE_TPH)); $DB = new Database(); $lastid = $DB->addSmsLock($unite, $msg, $lang, $tel, $val); $urlSMS = APP::getInstance()->config['url']; //génération texte suivant msg langue et code $sender = "GENDLOC"; if ($msg == "Geoloc") { $text = "* Vérifier GPS et DATA à ON\r\n* Cliquer le lien " . $urlSMS . "/pos?c=" . $lastid . "\r\n* Accepter le partage\r\n* Patienter\r\n" . $unite; } elseif ($msg == "Tracking") { $text = "* Vérifier GPS et DATA à ON\r\n* Cliquer le lien " . $urlSMS . "/trace?c=" . $lastid . "\r\n* Accepter le partage\r\n" . $unite; } //envoi SMS et récupération du hash d'envoi // require('/js/thecallR/src/ThecallrClient.php'); $config = APP::getInstance()->config['thecallr']; $thecallrLogin = $config['login']; $thecallrPassword = $config['password']; $THECALLR = new ThecallrClient($thecallrLogin, $thecallrPassword); $settings = $config['settings']; $res = $THECALLR->send($config['order']['set'], array($settings)); // Options $options = new stdClass(); $options->flash_message = FALSE; // "sms.send" method execution $result = $THECALLR->call($config['order']['send'], $sender, $tel, $text, $options); // The method returns the SMS ID $nModif = $DB->setSmsSend($lastid, $result); if ($nModif != 1) { throw new Exception("l'envoi du sms a échoué"); }
function check() { /** @var usersModel */ $model = APP::getInstance('UsersModel'); # Tipo de conta if (!$model->getType($this->getType())) { throw new Exception('Tipo inválido.'); } # E-mail if ($this->Email and !$this->getEmail()) { throw new Exception('E-mail inválido.'); } else { if ($this->getEmail() and count($model->Lista('WHERE a.email = :email AND a.id != :id LIMIT 1', ['email' => $this->getEmail(), 'id' => $this->getId()]))) { throw new Exception('E-mail já está sendo utilizado por outro usuário.'); } } # Login if (is_string($teste = VALIDAR::username($this->Login))) { throw new Exception(strip_tags($teste)); } # Criptografando a senha if (strlen($this->Senha) != PASSWORD_LENG) { if (is_string($teste = VALIDAR::password($this->Senha))) { throw new Exception(strip_tags($teste)); } $this->Senha = password($this->Senha); } return true; }
public function __construct() { $this->ModelTypes = APP::getInstance('UsersTypesModel'); }
/** * Retorna uma instancia Controller * @param string $NameClass * @param string $Path * @return Controller */ public static function getInstanceController($NameClass, $Path = null) { return APP::getInstance(strtolower(preg_replace('/Controller$/', null, $NameClass)) . 'Controller', $Path); }
} else { $renderer = 'nav'; $widget->nav_settings["accordion"] = true; } } } } $content = $this['menu']->process($widget, array('pre', 'subnav', $renderer, 'post')); } // Render widget if (in_array($widget->position, array('breadcrumbs', 'logo', 'logo-small', 'search', 'fullscreen', 'top-image', 'bottom-image', 'debug')) || $widget->position == 'offcanvas' && $widget->menu) { echo $content; } elseif ($widget->position == 'menu') { if ($widget->menu) { if ($widget->parameter->get('menutype') == 'account') { $zoo = APP::getInstance('zoo'); $user = $zoo->storeuser->get(); $account = $user->getAccount(true); $account_line = $zoo->store->merchantTestMode() ? '<div class="test-mode">' . $account->name . '<span>- Test Mode -</span></div>' : '<div>' . $account->name . '</div>'; $content = str_replace('{user-name}', $user->name, $content); $content = $account ? str_replace('<div>{account-name}</div>', $account_line, $content) : $content; $content = str_replace('<ul class="uk-navbar-nav uk-hidden-small">', '<ul class="uk-navbar-nav uk-hidden-small uk-navbar-flip">', $content); } echo $content; } elseif ($widget->module == 'mod_zoocart') { echo $content; } else { echo ' <ul class="uk-navbar-nav uk-hidden-small ' . $cart_class . '"> <li class="uk-parent" data-uk-dropdown> <a href="#">' . $title . '</a>
public static function payment() { $order = $event->getSubject(); $app = APP::getInstance('zoo'); echo 'Testing Email'; }