public function setCategories($data) { $PageID = $data['PageID']; $categories = ''; if (isset($data['Category'])) { foreach ($data['Category'] as $category) { $categories .= $category . ","; } } $generic = new Model_Generic(); $generic->oldSkul("update Pages set Categories = '{$categories}' where ID = {$PageID} ", false); }
public function sendResetPasswordCode($email, $code) { $subject = '[EazyFashion] Reset Password'; $headers = 'From: noreply@eazyfashion.com' . "\r\n" . 'Reply-To: noreply@eazyfashion.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $generic = new Model_Generic(); $generic->oldSkul("update SiteUsers set ResetCode = '" . $code . "' where SiteEmail = '" . $email . "' ", false); $message = "Your reset code is <strong>" . $code . "</strong>"; //$this->Mailer($email,$subject,$message,$headers); }
public function reportsAction() { $generic = new Model_Generic(); $type = $this->_getParam('type'); $data = ""; if ($type == "ubr") { $data = $generic->oldSkul("select count(distinct(Referrer)) count, Referrer from SiteUsers \n\t\t\twhere Referrer != ''\n\t\t\tgroup by Referrer"); } if ($type == "prmi") { //echo '<pre>'; print_r($_GET); /*** Array ( [q1] => [q2] => [qltogt] => > [Quantity] => 100 [mltogt] => [Minimum] => ) ***/ //exit; $where = " where t5.Quantity <= `Minimum` "; if (isset($_GET['q1'])) { if (!empty($_GET['q1'])) { $where = " where t2.Name like '" . $_GET['q1'] . "%' "; } } if (isset($_GET['q2'])) { if (!empty($_GET['q2'])) { $where = " where t2.Code = '" . $_GET['q2'] . "' "; } } if (isset($_GET['qltogt']) && isset($_GET['Quantity'])) { if (!empty($_GET['qltogt']) && !empty($_GET['Quantity'])) { $where = " where t5.Quantity " . $_GET['qltogt'] . " " . $_GET['Quantity']; } } if (isset($_GET['mltogt']) && isset($_GET['Minimum'])) { if (!empty($_GET['mltogt']) && !empty($_GET['Minimum'])) { $where = " where t5.Minimum " . $_GET['mltogt'] . " " . $_GET['Minimum']; } } //echo $where; $sql = "select distinct(t1.ProductID) ID, t2.Name ProductName, t2.Code, t1.Quantity QuantitySold, t4.Name CategoryName, t5.Quantity PresentInventory, t5.Minimum MinimumQuantity, \n\t\tt6.Filename\n\t\tfrom Transactions t1 \n\t\tjoin Products t2 on t2.ID = t1.ProductID \n\t\tleft join ProductCategory t3 on t3.ProductID = t2.ID \n\t\tjoin Category t4 on t4.ID = t3.CategoryID \n\t\tjoin Store t5 on t5.ProductID = t2.ID\n\t\tleft join ProductImages t6 on t6.ProductID = t2.ID\n\t\t{$where}\n\t\tgroup by t1.ProductID order by t1.Created"; $data = $generic->oldSkul($sql); } $this->paginator($data); $this->render("reports" . $type); }
public function reselleryapplyAction() { $user = $this->isLoggedIn(); if ($user && $_POST) { $generic = new Model_Generic(); $generic->oldSkul("delete from ResellerApplications where SiteUserID = " . $user['ID'], false); $Require1 = 0; $Require2 = 0; $Require3 = 0; if (isset($_POST['Require1'])) { $Require1 = 1; } if (isset($_POST['Require2'])) { $Require2 = 1; } if (isset($_POST['Require3'])) { $Require3 = 1; } $sql = "insert into ResellerApplications values(" . $user['ID'] . "," . $Require1 . "," . $Require2 . "," . $Require3 . ")"; $generic->oldSkul($sql, false); } $this->_redirect('/profile/'); }
public function menuAction() { $isAdmin = $this->isAdmin(); $generic = new Model_Generic(); $this->view->menus = $generic->getData("Menu"); $menu_id = isset($_GET['mid']) ? $_GET['mid'] : 0; $this->view->menu_id = $menu_id; $menu_items = $generic->getData("MenuItems", "MenuID=" . $menu_id, "CustomOrder"); $this->view->menu_items = $menu_items; if ($_POST) { if (isset($_POST['MenuEdit'])) { $menu_id = $_POST['MenuID']; $data = array(); foreach ($_POST['Name'] as $row => $val) { $data[$row]['MenuID'] = $menu_id; $data[$row]['Name'] = $val; } foreach ($_POST['Link'] as $row => $val) { $data[$row]['Link'] = $val; } foreach ($_POST['CustomOrder'] as $row => $val) { $data[$row]['CustomOrder'] = $val; } $delete = $generic->oldSkul("delete from MenuItems where MenuID = " . $menu_id, false); foreach ($data as $updatemenu) { $generic->insertData("MenuItems", $updatemenu); } $this->_redirect('/page/menu/?mid=' . $_POST['MenuID']); } if (isset($_POST['MenuAdd'])) { unset($_POST['MenuAdd']); $save = $generic->insertData("MenuItems", $_POST); if ($save) { $this->_redirect('/page/menu/?mid=' . $_POST['MenuID']); } } } if (isset($_GET['mitid'])) { $generic->oldSkul("delete from MenuItems where ID = " . $_GET['mitid'], false); $this->_redirect('/page/menu/?mid=' . $menu_id); } }