function __construct($db)
 {
     $this->db = $db;
     $this->stockman = SysApplication::callManager('inventory', 'InventoryManager');
     // $this->stockman    = new InventoryManager($db);
     // ДОРАБОТАТЬ ПИДОР МЕТОДА!!!!!!! АППЛИКЕЙШН!!!!!
 }
Esempio n. 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'])) {
 public function saveShiftProducts($date, $shop, $HRID)
 {
     $salesMan = SysApplication::callManager('sales', 'SalesManager');
     $products = $salesMan->getListOfShiftProducts($date, $shop, $HRID);
     $this->saveRecord($products, $shop, $HRID, 3);
     $this->writeOff($products, $shop);
 }
Esempio n. 4
0
// * Припилить список посещений клиента в синглвью
// (этим будет заниматься метод менеджера модуля продаж, так што, сначала нужно запилить его)
// * Валидацию и безопасность запилить
// general todo:
// * Реализовать первую задачу; √
// * Реализовать вторую задачу; √
// * Реализовать третью задачу; √
// * Реализовать четвёртую задачу; √
// * Отметить завершение разработки модуля бутылочкой игристого жигуля. √
// 23.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:
$crmManager = SysApplication::callManager($self->id);
if (!isset($_GET['action'])) {
    $action = 'list';
} else {
    $action = $_GET['action'];
}
if (isset($_POST['clientid'])) {
    $crmManager->saveClient($_POST['clientid'], $_POST['coffees'], $_POST['freeCups'], $_POST['firstname'], $_POST['middlename'], $_POST['lastname'], $_POST['telephone'], $_POST['email'], $_POST['comment']);
}
switch ($action) {
    case 'single':
        if (isset($_GET['id'])) {
            $client = $crmManager->getClientByID($_GET['id']);
            // todo:
            // Ебануть уи. Вот.
            // Ещё надо инфу по покупкам. Но это, по идее, не так уж сложно должно быть.
Esempio n. 5
0
<?php

// Модуль склада.
// Задачи:
//  Сделать, плез, начинай писать уже, хорош пиздеть.
// 09.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:
$inventoryManager = SysApplication::callManager($self->id);
global $waycup;
$shop = $waycup->getCurrentShop();
if (!isset($_GET['action'])) {
    $action = 'list';
} else {
    $action = $_GET['action'];
}
if (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case 'edit':
            $resource = new Resource();
            $resource = $inventoryManager->getResourceByID($_POST['ResourceID']);
            $product = $resource->product;
            $product->Amount = $_POST['minusQuantity'];
            $inventoryManager->saveRecord(array($product), $shop, $_SESSION['userID'], 2);
            $inventoryManager->writeOff(array($product), $shop);
            echo "Done!";
            break;
        default:
Esempio n. 6
0
if (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case 'draw':
            $draw = new Transaction(0, 4, '', $_POST['comment'], -$_POST['summ'], '');
            $financeManager->save($draw);
            break;
        case 'debit':
            $debit = new Transaction(0, 3, '', $_POST['comment'], $_POST['summ'], '');
            $financeManager->save($debit);
            break;
        case 'delete':
            $financeManager->kEbenyam($_POST['transactionID']);
            break;
        case 'close':
            $close = new Transaction(0, 5, '', $_POST['comment'], $_POST['summ'], '');
            $stockMan = SysApplication::callManager('inventory', 'InventoryManager');
            $date = date('Y-m-d');
            $shop = $shopID;
            $HRID = $_SESSION['userID'];
            $stockMan->saveShiftProducts($date, $shop, $HRID);
            $financeManager->save($close);
            break;
        default:
            break;
    }
}
switch ($action) {
    case 'single':
        if (isset($_GET['id'])) {
            include 'module/' . $self->id . '/editView.php';
        } else {
Esempio n. 7
0
                     echo 'Отлично! Схоронил чек по карте #' . $cardnum;
                 }
             } else {
                 echo 'Всё очень плохо. Очень плохо.';
             }
         }
     }
     break;
 case 'saveOutcomeCheck':
     if (!isset($_POST['idset']) || count($_POST['idset']) == 0) {
         echo "ЗАКАЗ ПУСТОЙ";
     } else {
         $idset = $_POST['idset'];
         $baristaId = $_POST['barista'];
         $shop = $_POST['shop'];
         $exesManager = SysApplication::callManager('exes.products');
         setlocale(LC_ALL, 'rus');
         date_default_timezone_set('Europe/Moscow');
         $timecode = date('Y-m-d H:i:s');
         if (!$shop) {
             echo 'Точка не выбрана!';
         } else {
             $query = "INSERT INTO `exes_check` VALUES (0, '{$baristaId}', '{$shop}', '{$timecode}');";
             //Execute query
             $qry_result = $mysqli->query($query);
             $checkID = $mysqli->insert_id;
             if ($qry_result) {
                 $check = true;
                 foreach ($idset as $id) {
                     $product = $exesManager->getProductByID($id);
                     $query = "INSERT INTO `exes_check_item` VALUES ({$checkID}, {$id});";
Esempio n. 8
0
 function __construct($db)
 {
     $this->db = $db;
     $this->salesManager = SysApplication::callManager('sales', "SalesManager");
     $this->exesManager = SysApplication::callManager('exes.check', 'ExesCheckManager');
 }
Esempio n. 9
0
                while ($row = $stmt->fetch_assoc()) {
                    if ($row['clientID'] != 0) {
                        $registred++;
                        $loyalityLevel[$this->getLoyalityStat($db, $row['clientID'])]++;
                    } else {
                        $notregistred++;
                    }
                }
            }
            $result[$month] = array("registred" => $registred, "not" => $notregistred, 'loyalityLevel' => $loyalityLevel);
        }
        return $result;
    }
}
if (!class_exists('Item')) {
    SysApplication::callManager('menu');
}
class IncomeCheck
{
    public $id = 0;
    public $HRID = 0;
    public $HRString = '';
    public $clientID = 0;
    public $clientString = '';
    public $clientTel = 0;
    public $shopID = 0;
    public $money = 0;
    public $timecode = "2014-12-28";
    public $listOfProducts = array();
    private $db;
    function __construct()
Esempio n. 10
0
<?php

if (!class_exists('Product')) {
    SysApplication::callManager('exes.check');
}
/**
*Item Category class
*/
class ItemCategory
{
    public function __construct($ID = 0, $Name = '', $Bonus = 0)
    {
        $this->id = $ID;
        $this->categoryName = $Name;
        $this->bonus = $Bonus;
    }
    public function queryCategory($db, $id)
    {
        $query = "SELECT `id`, name, bonus FROM {$this->TABLE_NAME} WHERE `id` = '{$id}'";
        if (!($stmt = $db->query($query))) {
            echo '<h2>Ошибка поддключения к базе данных!</h2>';
            die;
        } else {
            if ($row = $stmt->fetch_assoc()) {
                $this->id = $row['id'];
                $this->bonus = $row['bonus'];
                $this->categoryName = $row['name'];
            }
        }
    }
    public function save($db)