Example #1
0
 function __construct($uid = "")
 {
     if ($uid != "") {
         $this->id = "u" . $uid;
     } else {
         $this->id = __get_new_upanel_id();
     }
     $this->idname = "cgui_upanel_id" . $this->id;
     page_ScriptNeed("gui_upanel.js", "gui");
 }
Example #2
0
<?php

use Components\Classes\Roles;
use Components\Entity\Order;
need_data('data_vuz');
need_data('data_worktypes');
need_data('data_napravl');
need_data('data_discip');
need_data('data_payments');
need_data('data_filials');
page_ScriptNeed("gui_table.js", "gui");
if (isset($_REQUEST["p"])) {
    $order_id = intval(@$_REQUEST["order"]);
    $order_info = get_order_info($order_id);
    if (!$order_info) {
        $GUI->ERR("Заказ не найден");
        page_ReloadSec();
    }
    $GUI->mmenu->selected->selected->caption = "Управление заказом #" . $order_id;
    if (Roles::isActionAllowed($GUI->mmenu->selected->id, $GUI->mmenu->selected->selected->id, $_SESSION["user"]["data"]["group_id"], "Просмотр содержания")) {
        $GUI->cmdmenu->AddItem("Просмотр содержания", "?section=ord&subsection=2&order=" . $order_id . "&p=1");
    }
    if (Roles::isActionAllowed($GUI->mmenu->selected->id, $GUI->mmenu->selected->selected->id, $_SESSION["user"]["data"]["group_id"], "Правка содержания")) {
        $GUI->cmdmenu->AddItem("Правка содержания", "?section=ord&subsection=2&order=" . $order_id . "&p=2");
    }
    if (Roles::isActionAllowed($GUI->mmenu->selected->id, $GUI->mmenu->selected->selected->id, $_SESSION["user"]["data"]["group_id"], "Распределение")) {
        $GUI->cmdmenu->AddItem("Распределение", "?section=ord&subsection=2&order=" . $order_id . "&p=3");
    }
    if (Roles::isActionAllowed($GUI->mmenu->selected->id, $GUI->mmenu->selected->selected->id, $_SESSION["user"]["data"]["group_id"], "Файлы")) {
        $GUI->cmdmenu->AddItem("Файлы", "?section=ord&subsection=2&order=" . $order_id . "&p=4");
    }
Example #3
0
<?php

const ORD_SUBSECTION_NEW = 1;
const ORD_SUBSECTION_LIST = 2;
const ORD_SUBSECTION_ARCHIVE = 3;
const ORD_SUBSECTION_DELETE_CLIENT_FILES = 4;
$n = $GUI->mmenu->selected->selected->section;
$GUI->tmpls[] = $active_module_root . $n . ".tmpl.php";
page_ScriptNeed("scripts.js", "modules/ord");
require_once 'functions.php';
switch ($n) {
    case ORD_SUBSECTION_NEW:
        //add
        include "new.inc.php";
        break;
    case ORD_SUBSECTION_LIST:
        // list
        include "list.inc.php";
        break;
    case ORD_SUBSECTION_ARCHIVE:
        include "archive.inc.php";
        break;
    case ORD_SUBSECTION_DELETE_CLIENT_FILES:
        include "delete_client_files.inc.php";
        break;
    case 'instant_edit':
        require_once 'instant_edit_handler.php';
        break;
    case 'autocomplete':
        require_once 'autocomplete.php';
        break;
Example #4
0
<?php

use Components\Entity\Employee;
use Components\Classes\db;
use Components\Classes\Roles;
page_ScriptNeed("scripts.js", "modules/finances/referrer_system");
page_ScriptNeed("instant_edit.js", "js");
global $GUI;
if (isset($_REQUEST["ref_system_flds_cfg"])) {
    if (isset($_POST["flds"])) {
        $_SESSION["user"]["data"]["conf_ref_system_fld"] = serialize($_POST["flds"]);
    } else {
        $_SESSION["user"]["data"]["conf_ref_system_fld"] = serialize(array());
    }
    Employee::update($_SESSION["user"]["data"]["id"], array('conf_ref_system_fld' => $_SESSION["user"]["data"]["conf_ref_system_fld"]));
    $_SESSION["ref_system_flds_cfg"] = true;
    $GUI->OK("Выполнено");
    die("");
}
$temp_table = 'referrer_system_' . $_SESSION["user"]["data"]["id"];
$query = "\n  SELECT o.*, ref.id AS referrer_id, ref.fio AS referrer_fio, ref.email AS referrer_email, ref.telnum AS referrer_phone, ref.city AS referrer_city, ref.referrer_code\n  FROM " . TBL_PREF . "orders o\n  JOIN " . TBL_PREF . "clients c ON c.id = o.klient_id\n  JOIN " . TBL_PREF . "clients ref ON ref.id = c.ref_id\n  WHERE c.ref_id != 0\n  ORDER BY o.id ASC\n";
db::query("CREATE TEMPORARY TABLE " . TBL_PREF . $temp_table . " AS (" . $query . ")");
//Search panel
$sp = $GUI->UPanel();
$sp->Caption = "Поиск партнера";
$searchWhere = '';
if (!empty($_REQUEST["kln_search"])) {
    $sp->defOpen = true;
    if (!empty($_REQUEST['search_id'])) {
        if (!empty($searchWhere)) {
            $searchWhere .= ' OR';
Example #5
0
<?php

use Components\Classes\db;
use Components\Classes\Roles;
use Components\Entity\Employee;
page_ScriptNeed("scripts.js", "modules/finances/income");
global $data_filials, $GUI;
if (isset($_REQUEST["income_flds_cfg"])) {
    if (isset($_POST["flds"])) {
        $_SESSION["user"]["data"]["conf_income_fld"] = serialize($_POST["flds"]);
    } else {
        $_SESSION["user"]["data"]["conf_income_fld"] = serialize(array());
    }
    Employee::update($_SESSION["user"]["data"]["id"], array('conf_income_fld' => $_SESSION["user"]["data"]["conf_income_fld"]));
    $_SESSION["income_flds_cfg"] = true;
    $GUI->OK("Выполнено");
    die("");
}
$temp_table = 'income_' . $_SESSION["user"]["data"]["id"];
$result_filter = 1;
//////////// Filters
$Filter = $GUI->FltrCol("income", "data_users:conf_income_fltr");
$Filter->SrcTable = null;
$Filter->DstTable = $temp_table;
$Filter->OpenPanel = true;
// Добавляем фильтры
$filialFilter = $Filter->AddFilter("CGUI_FilterSelect");
$filialFilter->name = "Филиал";
$filialFilter->keyid = "id";
$filialFilter->SetSelectData($data_filials + array(array('id' => 0, 'name' => 'не указан')), "name");
$filialFilter->hidden = true;
Example #6
0
<?php

$n = $GUI->mmenu->selected->selected->section;
$GUI->tmpls[] = $active_module_root . "1.tmpl.php";
page_ScriptNeed("scripts.js", "modules/vis");
require_once 'functions.php';
need_data('data_filials');
switch ($n) {
    case 1:
        require_once 'add.php';
        break;
    case 2:
        if (isset($_REQUEST['visit'])) {
            require_once 'edit.php';
        } else {
            require_once 'list.php';
        }
        break;
    case 3:
        break;
    default:
        break;
}
Example #7
0
 function __construct($x, $y, $w, $v)
 {
     $this->left = $x;
     $this->top = $y;
     $this->width = $w;
     $this->defval = $v;
     page_ScriptNeed("gui_tracker.js", "gui");
 }
Example #8
0
<?php

$n = $GUI->mmenu->selected->selected->section;
$GUI->tmpls[] = $active_module_root . "1.tmpl.php";
page_ScriptNeed("scripts.js", "modules/kln");
switch ($n) {
    case 1:
        require_once 'add.php';
        break;
    case 2:
        if (isset($_REQUEST['edit'])) {
            require_once 'edit.php';
        } elseif (!empty($_REQUEST['action'])) {
            $client_id = $_REQUEST['kln_id'];
            switch ($_REQUEST['action']) {
                case 'history_table':
                default:
                    $GUI->Vars["page_hdr"] = "История изменений данных о клиенте №" . $client_id;
                    $tbl = $GUI->Table("client_history" . $n);
                    $tbl->Width = "50%";
                    $tbl->DataMYSQL("clients_changes_history");
                    $tbl->Pager(CGUI_PAGER_FLAG_SEL | CGUI_PAGER_FLAG_RR | CGUI_PAGER_FLAG_R | CGUI_PAGER_FLAG_FF | CGUI_PAGER_FLAG_F, 10, array(10, 20, 50, 100, 0));
                    $tbl->FilterMYSQL("client_id = " . $client_id);
                    $tbl->RowEvent2 = "document.location.href=\"?section=kln&subsection=2&kln_id=" . $client_id . "&change=%var%&action=show_history\"";
                    $column = $tbl->NewColumn();
                    $column->Caption = "Автор изменений";
                    $column->DoSort = true;
                    $column->Key = "change_user_id";
                    $column->Process = "sotr_getFullName";
                    $column = $tbl->NewColumn();
                    $column->Caption = "Дата изменений";