function __construct($db)
 {
     $this->db = $db;
     $this->stockman = SysApplication::callManager('inventory', 'InventoryManager');
     // $this->stockman    = new InventoryManager($db);
     // ДОРАБОТАТЬ ПИДОР МЕТОДА!!!!!!! АППЛИКЕЙШН!!!!!
 }
Example #2
0
 public function markActive()
 {
     if ($this->name == SysApplication::getCurrentPage()->name) {
         return 'id = "active"';
     } else {
         return '';
     }
 }
Example #3
0
}
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'])) {
            $product = $exesProductManager->getProductByID($_GET['id']);
            include 'module/' . $self->id . '/singleView.php';
        } else {
            SysApplication::show404();
        }
        break;
    case 'edit':
        if (isset($_GET['id'])) {
            $product = $exesProductManager->getProductByID($_GET['id']);
        } else {
            $product = new Product();
        }
        $categories = $exesProductManager->getCategoriesList();
        include 'module/' . $self->id . '/editView.php';
        break;
    case 'deleteProduct':
        $exesProductManager->deleteProduct($_GET['id']);
        break;
    case 'deleteCategory':
 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);
 }
Example #5
0
 public static function show404()
 {
     $page = new SysPage();
     $page->turn404();
     SysApplication::$currentPage = $page;
     SysApplication::showCurrentPage();
 }
Example #6
0
<?php

$index = SysApplication::getPageIndexByName('По карте');
$index1 = SysApplication::getPageIndexByName('Закупка');
?>
          <h3 class="main-title">Заказ</h3><br>
            
            <div style="border-top: 1px #ebae08 solid; border-bottom: 1px #ebae08 solid; margin-top: 20px; padding: 20px; overflow-y: scroll;">
                 <a href="<?php 
echo "?page={$index}";
?>
">
                  <div class="div-like-li">
                     <span style='margin-left: auto; margin-right: auto; display: inline;'>По карте</span>
                  </div>
                </a>
               <a href="<?php 
echo "?page={$index1}";
?>
">
                  <div class="div-like-li">
                     <span style='margin-left: auto; margin-right: auto; display: inline;'>Закупка</span>
                  </div>
                </a>                   
            </div>


                  <div class="clear"></div>
                  <br>

               <h3 class="main-title">Новости</h3>
Example #7
0
foreach ($shops as $value) {
    echo "<option value='" . $value['id'] . "'";
    if ($waycup->getCurrentShop() == $value['id']) {
        echo ' selected';
    }
    echo ">" . $value['name'] . "</option>";
}
if (!$waycup->getCurrentShop()) {
    echo '<option value="false" selected>НЕ ВЫБРАНА</option>';
}
?>
              </select>
            </label>
            </form>
            </div></li>
            <li><a href="?page=<?php 
echo SysApplication::getPageIndexByName('Профиль');
?>
">Профиль</a></li>
            <li><a href="../login/logout.php">Выйти</a></li>
          </ul>
          <input type='hidden' id='barista_id' value=<?php 
echo $_SESSION['userID'];
?>
>
        </div>
      </div>
    </div>
   </div>
  <div class="container main-block">
    <div class="row">
Example #8
0
<?php

// Модуль оформления заказа.
// Задачи:
// * Полностью нахуй переделать.
// general todo:
// * Реализовать первую задачу;
// 6.10.2015
// Find a way to avoid this:
$self = SysApplication::getCurrentPage();
$path = 'module/' . $self->id . '/' . $self->id . '_manager.php';
if (file_exists($path)) {
    require_once $path;
}
// '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:
?>


<input type="hidden" id="shop_id" value="<?php 
echo $_SESSION['shop_id'];
?>
">
<script src="../js/react/react.js"></script>
<script src="../js/react/JSXTransformer.js"></script>
<script type="text/jsx" src="module/order/orderHandling.jsx"></script>
 <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
      <div class="menu-block">		
      		<div id="tooltip">
Example #9
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});";
Example #10
0
 function __construct($db)
 {
     $this->db = $db;
     $this->salesManager = SysApplication::callManager('sales', "SalesManager");
     $this->exesManager = SysApplication::callManager('exes.check', 'ExesCheckManager');
 }
Example #11
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()
Example #12
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)
Example #13
0
       <div class="span2">
         <div class="menu-left">
          <ul>
            <?php 
foreach (SysApplication::getAllPages() as $i => $page) {
    if ($page->status != 'blocked' && $page->getType() == 'navigation') {
        echo '<li><a href="?page=' . $i . '"' . $page->markActive() . '><i class="' . $page->getClass() . '"></i>' . $page->name . '</a></li>';
    }
}
?>
          </ul>
         </div>
       </div>

       <div class="span10">
         <div class="main-content">