Example #1
0
 public function getVisits($db, $id)
 {
     // $query = "SELECT `id` FROM `sales_check` WHERE `clientid` = '$this->id'";
     // 			if (!$stmt = $db->query($query)) {
     // 				echo '<h2>Ошибка поддключения к базе данных!</h2>';
     // 				die();
     // 			} else {
     // 			    if ($row = $stmt->fetch_assoc()) {
     // 			    	array_push($this->visits, $row['id']);
     // 			    }
     // 			}
     $salesManager = SYSApplication::callManager('sales');
     // $this->visits = salesManager->getClientVisits($this->id);
 }
Example #2
0
<?php

// Менеджер продуктов
// Задачи:
// НУТЫПОНЕЛ, некогда писать тз.
// Автор:
// Копипастер228.
// При участии команды сайта Ognemet.co
// 9.09.2015
// Find a way to avoid this:
$self = SysApplication::getCurrentPage();
// 'cause this shit is the same for all the managers using modules.
$index = SYSApplication::getPageIndexByName($self->name);
// Generaly, the shit below is the only shit that should be here:
$exesProductManager = SysApplication::callManager($self->id);
if (!isset($_GET['action'])) {
    $action = 'list';
} else {
    $action = $_GET['action'];
}
if (isset($_POST['ProductID'])) {
    $handleViewCheckbox = isset($_POST['OnView']) ? 1 : 0;
    $handleStoreCheckbox = isset($_POST['ToStore']) ? 1 : 0;
    $exesProductManager->saveProduct($_POST['ProductID'], $_POST['Price'], $_POST['Name'], $_POST['ProductCategoryID'], $handleViewCheckbox, $handleStoreCheckbox, $_POST['Amount'], $_POST['Unit']);
}
if (isset($_POST['CategoryID'])) {
    $exesProductManager->saveCategory($_POST['CategoryID'], $_POST['CategoryName']);
}
switch ($action) {
    case 'single':
        if (isset($_GET['id'])) {