$this->title = $str; $this->category = $str; App::$id = $str; $this->categories = $this->get_category($str); } /** * @param $cat * @return array */ private function get_category($cat) { $result = App::$db->query("\r SELECT *\r FROM categories\r WHERE title = '{$cat}'\r "); if ($result->columnCount() != 0) { $result->setFetchMode(PDO::FETCH_ASSOC); while ($category = $result->fetch()) { $arr[] = $category; } /** @var Category $arr */ foreach ($arr as $cat) { $this->id = $cat['id']; if ($cat['parent_id'] == 0) { $category_arr = $this->add_category($cat['id']); $this->sale = $this->get_sale(); parent::template('p_category'); } else { $category_arr = $this->add_category($cat['parent_id'] <= 3 ? $cat['id'] : $cat['parent_id']); $this->product = $this->get_product($cat['id']); $this->price = $this->get_categoryPriceSort($cat['id']); $this->brands = $this->get_categoryBrandSort();
function __construct() { parent::__construct(); $this->catalog = $this->get_catalog(); $this->brand = $this->get_brands(); parent::template('sliders_main'); }
function __construct($str) { parent::__construct(); if (App::POST('button_buy')) { $this->go_toPay(App::POST('button_buy')); } $this->search = $str; $this->product = $this->get_product($str); parent::template('search'); }
private function get_brandProduct($id) { $result = App::$db->query("\n\t\t\t\tSELECT * FROM product WHERE id_brand = '" . $id . "'\n\t\t\t"); if ($result->rowCount() != 0) { $result->setFetchMode(PDO::FETCH_ASSOC); while ($brand = $result->fetch()) { $product[] = $brand; } parent::template('brands'); } /** @var Brands $product */ return $product; }
function __construct($str) { parent::__construct(); if (empty($str) or !is_numeric($str)) { parent::page_404(); } if (App::POST('button_buy')) { $this->go_toPay(App::POST('button_buy')); } if (App::POST('button buy_credit')) { $this->go_toPay(App::POST('button buy_credit')); } $this->sendMessage(App::POST('comment_item_id'), App::POST('comment_author'), App::POST('comment_text')); $this->product = $this->get_product($str); $this->sale = $this->get_sale(); parent::template('product'); }
/** * @return array */ private function get_Product() { if (!empty($_COOKIE['Cookie'])) { foreach ($_COOKIE['Cookie'] as $name => $value) { $value = htmlspecialchars($value); $sql = App::$db->query("\n SELECT id, title, price_g, price_d, img\n FROM product\n WHERE id = '" . $value . "'\n "); $sql->setFetchMode(PDO::FETCH_ASSOC); if ($sql->rowCount() != 0) { for ($i = 0; $i < $sql->rowCount(); $i++) { $row = $sql->fetch(); $product[] = $row; } } } parent::template('basket'); } else { parent::template('no_basket'); } /** @var Basket $product */ return $product; }
public function updating($model) { if ($model->isDirty('status') && $model->status == 1) { Mail::send(array("body" => Module::template('signup-approved')->compile(array("BASE_URL" => AppConfig::get("retrieve.email.url"))), "subject" => "Approved!", "to" => $model->email, "from" => "*****@*****.**")); } }
<?php Module\Http\Router::get('/send', function () { return $this->json(array("success" => Mail::send(array("body" => Module::template('signup-confirmation')->compile(array("base_url" => AppConfig::get("retrieve.email.url"))), "subject" => "Sign-up confirmation", "to" => $model->email, "from" => "*****@*****.**")))); });