Example #1
0
    function Show()
    {
        $return = '
		<script langauge = "JavaScript">
		function deleteItems()
		{

		}
		</script>
		<script language = "JavaScript">
var Ahistory0 = new Array(0,0,0,0,0,0,0,0,1);
var Ahistory1 = new Array(0,1,1,1,0,0,0,0,1);
var Ahistory2 = new Array(0,1,0,0,0,0,0,0,1);

window.parent.elemActions(\'history\', 0);
</script>
<script language="JavaScript" src="tooltip/tooltip.js"></script>
';
        require_once core('ajax_table');
        // Create templorary table
        sql_query("DROP TABLE tmp_history");
        sql_query("CREATE TABLE tmp_history (\n\t\t\ttype VARCHAR(50) NOT NULL,\n\t\t\tid INT UNSIGNED NOT NULL,\n\t\t\tdate INT UNSIGNED NOT NULL,\n\t\t\tdescription VARCHAR(255) NOT NULL,\n\t\t\ttext TEXT NOT NULL,\n\t\t\tPRIMARY KEY (type, id)\n\t\t)");
        // insert notes
        sql_query("INSERT INTO tmp_history SELECT 'note', id, date, name, text FROM notes WHERE client_id=" . $this->client_id);
        // insert notes
        sql_query("INSERT INTO tmp_history SELECT 'order', id, order_date, id, '' FROM orders WHERE client_id=" . $this->client_id);
        // insert notes
        sql_query("INSERT INTO tmp_history SELECT 'mail', id, UNIX_TIMESTAMP(em.date), em.subject, em.body FROM email_sent AS em LEFT JOIN email_log AS log ON em.id=log.email_id WHERE log.client_id=" . $this->client_id);
        $return .= ajax_table(array('columns' => array(array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'nowrap' => true), array('select' => 'type', 'display' => 'type', 'type' => 'type'), array('select' => 'description', 'display' => 'description', 'type' => 'description', 'width' => '50%'), array('select' => 'text'), array('select' => 'id', 'display' => 'edit', 'type' => 'edit', 'width' => '30', 'align' => 'center')), 'from' => 'tmp_history', 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show', 'client_id' => $this->client_id)), $this);
        return $return;
    }
Example #2
0
 function Show()
 {
     // обязательная фигня
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     global $settings;
     $types = array();
     foreach ($settings['subscribe_categories'] as $key => $val) {
         if (isset($val['sub'])) {
             foreach ($val['sub'] as $k => $v) {
                 $types[$v['type']] = $v['title'];
             }
         }
     }
     require_once core('ajax_table');
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'email', 'display' => 'email', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'type', 'display' => 'type', 'type' => 'type', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_display' => 'type', 'filter_type' => 'array', 'filter_value' => array('' => '-- Все --') + $types, 'filter_field' => 'type')), 'from' => $this->table, 'where' => 'root_id=' . domainRootId(), 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value'), $this);
     $this->AddStrings($data);
     $data['thisname'] = $this->name;
     $data['thisname2'] = str_replace('/', '', $this->name);
     return Parse($data, "notify/tmpls/properties.tmpl");
 }
Example #3
0
    function Show()
    {
        if (!empty($GLOBALS['_POST'])) {
            $actions = get('actions', '', 'p');
            if ($actions) {
                return $this->{$actions}();
            }
        }
        require_once core('ajax_table');
        $ret['id'] = 0;
        $ret['auth_group'] = (int) get('auth_group');
        $ret['auth_groups'] = sql_getRows('select id, name from auth_groups order by priority, name', true);
        if (!$ret['auth_group']) {
            $ret['auth_group'] = key($ret['auth_groups']);
        }
        $ret['auth_group_type'] = sql_getValue('
			SELECT dt.type
			FROM auth_groups AS ag
			LEFT JOIN discount_types AS dt ON dt.id = ag.discount_type
			WHERE ag.id = ' . $ret['auth_group']);
        if ($ret['auth_group_type'] == 'fix') {
            $ret['table'] = ajax_table(array('columns' => array(array('select' => 'dg.id', 'type' => 'checkbox'), array('select' => 'dg.name', 'display' => 'product_group'), array('select' => 'discounts.discount', 'display' => 'discount', 'type' => 'edit', 'align' => 'right', 'text-align' => 'right', 'maxlength' => 2, 'size' => 2), array('select' => '""', 'display' => '', 'width' => '50%')), 'from' => 'discount_groups AS dg 
				LEFT OUTER JOIN discounts ON discounts.discount_group_id = dg.id AND discounts.user_discount_group_id=' . $ret['auth_group'], 'orderby' => 'priority, name', 'params' => array('page' => $this->name, 'do' => 'show', 'id' => '', 'auth_group' => $ret['auth_group']), 'click' => 'ID=cb.value;'), $this);
        } else {
            $ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'type' => 'checkbox', 'display' => 'id'), array('select' => 'volume', 'display' => 'upvolume', 'type' => 'edit', 'align' => 'right', 'text-align' => 'right', 'maxlength' => 10, 'size' => 10), array('select' => 'discount', 'display' => 'discount', 'type' => 'edit', 'align' => 'right', 'text-align' => 'right', 'maxlength' => 2, 'size' => 2), array('select' => '""', 'display' => '', 'width' => '50%')), 'from' => 'discounts_volume', 'where' => 'auth_group_id=' . $ret['auth_group'], 'orderby' => 'volume', 'params' => array('page' => $this->name, 'do' => 'show', 'id' => '', 'auth_group' => $ret['auth_group']), 'click' => 'ID=cb.value;'), $this);
        }
        $this->AddStrings($ret);
        return $this->Parse($ret, $this->name . '.tmpl');
    }
Example #4
0
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     $this->SetValues();
     require_once core('ajax_table');
     $data['thisname'] = $this->name;
     $data['root'] = is_root();
     $this->AddStrings($data);
     $_tables = sql_getRows('SHOW tables');
     foreach ($_tables as $key => $val) {
         $tables[$val] = $val;
     }
     $_transactions = sql_getColumn('SELECT distinct action FROM ' . $this->table . ' ORDER BY action');
     foreach ($_transactions as $key => $val) {
         $transactions[$val] = $val;
     }
     $where = '';
     if ($this->from_date && $this->to_date) {
         $where = ' UNIX_TIMESTAMP(date)>=' . $this->from_date . ' AND UNIX_TIMESTAMP(date)<=' . $this->to_date;
     }
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'user', 'display' => 'user', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'object', 'display' => 'object', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_FILTER | FLAG_SEARCH, 'filter_type' => 'array', 'filter_value' => array('' => '-- все --') + $tables, 'filter_rule' => 'find_in_set'), array('select' => 'action', 'display' => 'action', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_FILTER | FLAG_SEARCH, 'filter_type' => 'array', 'filter_value' => array('' => '-- все --') + $transactions), array('select' => 'description', 'display' => 'description', 'type' => 'description', 'flags' => FLAG_SEARCH), array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'width' => '100px', 'flags' => FLAG_SORT)), 'from' => $this->table, 'where' => $where, 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => '', 'click' => ''), $this);
     $data['navig'] = $this->NavigForm();
     return $this->parse($data, $this->name . '.tmpl');
 }
Example #5
0
 function ShowRecipientsAdmins()
 {
     $data = sql_getRows("SELECT id, login, fullname FROM admins");
     require_once core('ajax_table');
     $ret['thisname'] = $this->name;
     $ret['table'] = ajax_table(array('from' => "admins", 'columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'login', 'display' => 'client_login', 'flags' => FLAG_SEARCH), array('select' => 'email', 'display' => 'email', 'flags' => FLAG_SEARCH)), 'where' => 'LENGTH(email)>0 ', 'orderby' => 'id', 'params' => array('page' => 'notify/send', 'do' => 'showplugin', 'func' => 'ShowRecipientsAdmins', 'plugin' => 'email'), 'click' => 'ID=cb.value;', 'target' => 'tmpemailshowrecipients', 'dblclick' => 'PasteRecipientsAdmins(id)'), $this);
     //pr($ret);
     return $ret;
 }
Example #6
0
 function ShowRecycle()
 {
     global $limit;
     $limit = -1;
     require_once core('ajax_table');
     $this->AddStrings($row);
     $row['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => "description", 'display' => 'comment'), array('select' => "subject", 'display' => 'subject')), 'where' => "visible<=0  AND (user_id IS NULL OR user_id=" . $GLOBALS['user']['id'] . ")", 'orderby' => 'updated DESC', 'params' => array('page' => $this->name, 'do' => 'show')), $this);
     return $this->Parse($row, 'recycle.tmpl');
 }
Example #7
0
 function ShowRecycle()
 {
     global $limit;
     $limit = -1;
     require_once core('ajax_table');
     $columns = sql_getRows('SHOW columns FROM ' . $this->table, 'Field');
     $name = isset($columns['name']) ? 'name' : 'address';
     $this->AddStrings($row);
     $row['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => $name, 'display' => 'name')), 'where' => 'visible<0 and obj_type_id="room"', 'orderby' => 'address', 'params' => array('page' => $this->name, 'do' => 'Show')), $this);
     return Parse($row, 'recycle.tmpl');
 }
Example #8
0
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['thisname'] = $this->name;
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'date', 'display' => 'date', 'type' => 'text', 'flags' => FLAG_SORT), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SORT), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible', 'align' => 'center', 'flags' => FLAG_SORT), array('select' => 'open', 'display' => 'open', 'type' => 'visible', 'align' => 'center', 'flags' => FLAG_SORT)), 'where' => "lang='" . lang() . "' AND root_id=" . domainRootID(), 'orderby' => 'priority', 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this);
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #9
0
 function editGroupUsers()
 {
     $group_id = (int) get('id', 0, 'gp');
     if (!$group_id) {
         return;
     }
     $ret = array();
     $_GET['limit'] = -1;
     require_once core('ajax_table');
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'auth_users.name', 'display' => 'user_name', 'flags' => FLAG_SORT), array('select' => 'auth_users.login', 'display' => 'user_login', 'flags' => FLAG_SORT)), 'from' => 'auth_users LEFT JOIN auth_users_groups ON (auth_users_groups.user_id = auth_users.id)', 'params' => array('page' => $this->name, 'do' => 'editgroupusers', 'id' => $group_id), 'orderby' => 'auth_users.name', 'where' => 'auth_users_groups.group_id=' . $group_id, 'roll' => 0), $this);
     $this->AddStrings($ret);
     return $this->Parse($ret, $this->name . '.groupusers.tmpl');
 }
Example #10
0
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['thisname'] = $this->name;
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'name', 'display' => 'name')), 'orderby' => 'priority, name', 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #11
0
 function Show()
 {
     if (!empty($_POST)) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'as' => 'id', 'width' => '1%', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '1px'), array('select' => 'okrug', 'display' => 'okrug', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '1px', 'type' => 'okrug')), 'from' => $this->table, 'params' => array('page' => $this->name, 'do' => 'show'), 'orderby' => 'name', 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     $ret['thisname'] = $this->name;
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #12
0
 function Show()
 {
     global $lang;
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['thisname'] = $this->name;
     $ret['params'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'object_id', 'display' => 'lot_id', 'type' => 'lot'), array('select' => 'flat_id', 'display' => 'flat_id', 'type' => 'flat'), array('select' => 'name', 'display' => 'name'), array('select' => 'date', 'display' => 'date', 'type' => 'date'), array('select' => 'contacts', 'display' => 'contacts')), 'orderby' => 'date desc', 'from' => $this->table, 'where' => '', 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #13
0
 function Show()
 {
     if (!empty($_POST)) {
         $action = get('actions', '', 'p');
         if ($action) {
             return $this->{$action}();
         }
     }
     require_once core('ajax_table');
     $columns = array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'name', 'display' => 'name'), array('select' => 'image', 'display' => 'image', 'type' => 'image'));
     $ret['table'] = ajax_table(array('columns' => $columns, 'from' => $this->table, 'where' => 'pid=' . $_GET['pid'], 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'orderby' => 'priority', 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     $ret['thisname'] = $this->name;
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #14
0
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $data['thisname'] = $this->name;
     $this->AddStrings($data);
     $client_id = get('client_id', 0, 'g');
     $data['client_id'] = $client_id;
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'valign' => 'top'), array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'valign' => 'top', 'nowrap' => 1), array('select' => 'name', 'display' => 'subject', 'width' => '30%', 'valign' => 'top'), array('select' => 'SUBSTRING_INDEX(text, " ", 10)', 'display' => 'text', 'width' => '50%', 'type' => 'text'), array('select' => 'link', 'display' => 'link', 'width' => '20', 'align' => 'center', 'type' => 'link'), array('select' => 'text')), 'where' => 'visible="1" and client_id=' . $client_id, 'params' => array('page' => $this->name, 'do' => 'show', 'client_id' => $client_id), 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this);
     return $this->parse($data, $this->name . '.tmpl');
 }
Example #15
0
 function Show()
 {
     // обязательная фигня
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SORT), array('select' => 'id', 'display' => 'docopy', 'type' => 'docopy')), 'from' => $this->table, 'where' => '', 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value', 'orderby' => 'id'), $this);
     $this->AddStrings($data);
     $data['thisname'] = $this->name;
     $data['thisname2'] = str_replace('/', '', $this->name);
     return $this->Parse($data, "surveys_tmpl.tmpl");
 }
Example #16
0
File: news.php Project: romlg/cms36
 function Show()
 {
     // обязательная фигня
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     // подключение библиотеки для построения таблиц
     require_once core('ajax_table');
     // строим таблицу
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'visible', 'display' => 'visible', 'type' => 'news_visible', 'flags' => FLAG_SORT), array('select' => 'type', 'display' => 'type', 'type' => 'str', 'flags' => FLAG_SORT), array('select' => 'UNIX_TIMESTAMP(date)', 'as' => 'date', 'type' => 'news_date', 'display' => 'date', 'flags' => FLAG_SEARCH | FLAG_SORT)), 'from' => $this->table, 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'where' => '', 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value'), $this);
     $this->AddStrings($data);
     return $this->Parse($data, $this->name . '.tmpl');
 }
Example #17
0
 function Show($product_type_id)
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     if (!$product_type_id) {
         return;
     }
     require_once core('ajax_table');
     $ret['thisname'] = $this->name;
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'param_names'), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible', 'align' => 'center', 'flags' => FLAG_SORT)), 'from' => 'product_type_params', 'orderby' => 'priority, name', 'where' => 'product_type_id=' . $product_type_id, 'params' => array('page' => 'product_types', 'do' => 'editform', 'id' => $product_type_id), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #18
0
 function Show()
 {
     if (!empty($_POST)) {
         $action = get('actions', '', 'p');
         if ($action) {
             if ($this->Allow($action)) {
                 return $this->{$action}();
             } else {
                 return $this->alert_method_not_allowed();
             }
         }
     }
     require_once core('ajax_table');
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'display_' . int_lang(), 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'type', 'display' => 'type', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'allowed', 'display' => is_devel() ? 'allowed' : NULL, 'type' => 'allowed', 'align' => 'center'), array('select' => 'required', 'display' => 'required', 'type' => 'required', 'align' => 'center'), array('select' => 'enabled', 'display' => 'enabled', 'type' => 'enabled', 'align' => 'center')), 'from' => $this->table, 'orderby' => 'required DESC, id', 'params' => array('page' => $this->name, 'do' => 'show'), 'where' => !is_devel() ? 'allowed=1' : '', 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this);
     $this->AddStrings($data);
     return $this->Parse($data, $this->name . '.tmpl');
 }
Example #19
0
 function Show()
 {
     // обязательная фигня
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     // подключение библиотеки для построения таблиц
     require_once core('ajax_table');
     // строим таблицу
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'rooms', 'display' => 'rooms', 'flags' => FLAG_SORT), array('select' => 'street', 'display' => 'street', 'flags' => FLAG_SORT), array('select' => 'price_rub', 'display' => 'price_rub', 'flags' => FLAG_SORT)), 'from' => $this->table, 'orderby' => 'id DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'where' => '', 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value', '_sql' => true), $this);
     $this->AddStrings($data);
     $data['mode'] = DEV_MODE;
     return $this->Parse($data, $this->name . '.tmpl');
 }
Example #20
0
 function Show()
 {
     if (!empty($_POST)) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'login', 'display' => 'login', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '1px'), array('select' => 'id', 'display' => 'id', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '1px'), array('select' => 'CONCAT(lname,CHAR(32),name,CHAR(32),tname)', 'as' => 'name', 'display' => 'fullname', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '100%'), array('select' => 'email', 'display' => 'email'), array('select' => 'DATE_FORMAT(last_visited,"%H:%i:%s&nbsp;%d.%m.%Y")', 'display' => 'last_access', 'flags' => FLAG_SORT), array('select' => 'DATE_FORMAT(reg_date,"%d.%m.%Y")', 'display' => 'reg_date', 'flags' => FLAG_SORT), array('select' => 'subscribe', 'display' => 'subscribe', 'flags' => FLAG_SORT, 'align' => 'center', 'type' => 'visible')), 'from' => $this->table, 'params' => array('page' => $this->name, 'do' => 'show'), 'orderby' => 'last_visited DESC', 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     # сохранение в сессию
     session_start();
     $_SESSION['client_selection'] = $GLOBALS['where'];
     session_write_close();
     $ret['thisname'] = $this->name;
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #21
0
 function Show()
 {
     if (!empty($_POST)) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'cl.id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'login', 'display' => 'login', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '1px'), array('select' => 'cl.id', 'display' => 'id', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '1px'), array('select' => 'fio', 'as' => 'name', 'display' => 'fullname', 'flags' => FLAG_SEARCH | FLAG_SORT, 'width' => '100%'), array('select' => 'last_visited', 'type' => 'last_access', 'display' => 'last_access', 'flags' => FLAG_SORT), array('select' => 'reg_date', 'type' => 'reg_date', 'display' => 'reg_date', 'flags' => FLAG_SORT), array('select' => 'trusted', 'display' => 'trusted', 'type' => 'visible', 'flags' => FLAG_SORT), array('select' => 'COUNT(o.id)', 'as' => 'sum', 'display' => 'count_objects', 'flags' => FLAG_SORT), array('select' => 'cl.balance', 'display' => 'balance', 'flags' => FLAG_SORT)), 'from' => $this->table . ' as cl LEFT JOIN objects AS o ON o.client_id=cl.id', 'where' => 'cl.deleted=0', 'params' => array('page' => $this->name, 'do' => 'show'), 'orderby' => 'last_visited DESC', 'groupby' => 'cl.id', 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     # сохранение в сессию
     session_start();
     $_SESSION['client_selection'] = $GLOBALS['where'];
     session_write_close();
     $ret['thisname'] = $this->name;
     return $this->Parse($ret, $this->name . '.tmpl');
 }
Example #22
0
    function Show()
    {
        if (!empty($_POST)) {
            $actions = get('actions', '', 'p');
            if ($actions) {
                return $this->{$actions}();
            }
        }
        $pids = $this->getChilds();
        $this->getList($pids, $rows, 1);
        $districts = sql_getRows('SELECT id, name FROM ' . $this->table . ' WHERE pid IS NULL ORDER BY name', true);
        require_once core('ajax_table');
        $ret['table'] = ajax_table(array('columns' => array(array('select' => 'd4.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'd4.name', 'display' => 'district', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'd1.pid', 'flags' => FLAG_FILTER, 'filter_display' => 'pid1', 'filter_type' => 'array', 'filter_value' => array('' => '-- все --') + $districts), array('select' => 'd2.pid'), array('select' => 'd3.pid'), array('select' => 'd4.pid')), 'from' => $this->table . ' AS d4 
							LEFT JOIN ' . $this->table . ' AS d3 ON d4.pid=d3.id
							LEFT JOIN ' . $this->table . ' AS d2 ON d3.pid=d2.id
							LEFT JOIN ' . $this->table . ' AS d1 ON d2.pid=d1.id', 'dataset' => $rows, 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)', 'function' => 'setFilterData'), $this);
        $ret['thisname'] = $this->name;
        return $this->Parse($ret, $this->name . '.tmpl');
    }
Example #23
0
    function ElemList()
    {
        $id = (int) get('id', 0);
        $rows = array();
        // если редактируем
        if ($id) {
            $object = $this->getObject();
            $rows = $object['object'];
        }
        require_once core('ajax_table');
        $_GET['limit'] = '-1';
        $data['table'] = ajax_table(array('columns' => array(array('select' => 'ep.id', 'as' => 'id', 'display' => 'ids', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'p.name', 'as' => 'name', 'display' => 'name')), 'dataset' => $rows, 'from' => 'elem_product AS ep
						 LEFT JOIN products AS p ON ep.id=p.id
						 LEFT JOIN tree AS t ON ep.pid=t.id', 'params' => array('id' => $id, 'page' => $this->name, 'esId' => $this->esId, 'tab' => $this->tab, 'frame' => 'cnt'), 'editform_params' => array('do' => 'closeTab', 'act2' => '', 'newTab' => '', 'move' => '', 'frame' => 'tmp'), 'action' => 'ed.php', 'click' => 'ID=cb.value', 'target' => 'tmp' . $this->name . $id), $this);
        $this->AddStrings($data);
        $data['id'] = $id;
        $data['tab'] = $this->tab;
        $data['esId'] = $this->esId;
        return $this->Parse($data, 'elem_product.list.tmpl');
    }
Example #24
0
 function Show()
 {
     global $cfg;
     if (!empty($_POST)) {
         $action = get('actions', '', 'p');
         if ($action) {
             if ($this->Allow($action)) {
                 return $this->{$action}();
             } else {
                 return $this->alert_method_not_allowed();
             }
         }
     }
     // подключение библиотеки для построения таблиц
     require_once core('ajax_table');
     // строим таблицу
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'value', 'display' => 'value', 'flags' => FLAG_SEARCH | FLAG_SORT)), 'from' => $this->table, 'orderby' => '', 'params' => array('page' => $this->name, 'do' => 'show'), 'where' => '', 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value'), $this);
     $this->AddStrings($data);
     return $this->Parse($data, $this->name . '.tmpl');
 }
Example #25
0
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['thisname'] = $this->name;
     global $site_domains;
     $sites = array();
     foreach ($site_domains as $key => $val) {
         foreach ($val['langs'] as $l) {
             $sites[$l['root_id']] = $val['name'] . ' (' . $l['descr'] . ')';
         }
     }
     $ret['params'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'budget', 'display' => 'budget', 'flags' => FLAG_SEARCH), array('select' => 'start_date', 'display' => 'start_date', 'type' => 'text', 'flags' => FLAG_SORT), array('select' => 'end_date', 'display' => 'end_date', 'type' => 'text', 'flags' => FLAG_SORT), array('select' => 'root_id', 'type' => 'text', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_display' => 'root_id', 'filter_value' => array('' => '-- все --') + $sites)), 'from' => $this->table, 'where' => '', 'orderby' => 'id', 'params' => array('page' => "stat/reklama_obj", 'do' => 'show'), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this);
     $ret['thisname2'] = str_replace('/', '', $this->name);
     return Parse($ret, $this->name . '/reklama_obj.tmpl');
 }
Example #26
0
    function Show()
    {
        if (!empty($_POST)) {
            $action = get('actions', '', 'p');
            if ($action) {
                if ($this->Allow($action)) {
                    return $this->{$action}();
                } else {
                    return $this->alert_method_not_allowed();
                }
            }
        }
        require_once core('ajax_table');
        $client_id = get('client_id', 0, 'g');
        $ret['thisname'] = $this->name;
        $ret['table'] = ajax_table(array('columns' => array(array('select' => 'em.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'COUNT(*)', 'as' => 'em_count'), array('select' => 'CONCAT(cl.name,CHAR(32),cl.lname,CHAR(32),"&lt;",cl.login,"&gt;")', 'as' => 'to_field', 'display' => $client_id ? NULL : 'to', 'type' => 'to'), array('select' => 'u.id', 'display' => $client_id || is_root() ? 'from' : NULL, 'type' => 'from'), array('select' => 'em.subject', 'display' => 'subject'), array('select' => 'UNIX_TIMESTAMP(em.date)', 'as' => 'from_date', 'display' => 'date', 'type' => 'datetime'), array('select' => 'CONCAT(u.fullname,CHAR(32),"&lt;",u.login,"&gt;")', 'as' => 'u_fullname')), 'from' => $this->table . ' AS em
							LEFT JOIN email_log AS log ON em.id=log.email_id
							LEFT JOIN auth_users AS cl ON log.client_id=cl.id
							LEFT JOIN users AS u ON em.user_id=u.id', 'where' => $client_id ? 'log.client_id=' . $client_id : '', 'orderby' => 'em.date DESC', 'groupby' => 'em.id', 'params' => array('page' => $this->name, 'do' => 'show', 'client_id' => $client_id), 'click' => 'ID=cb.value;', 'dblclick' => 'editItem(id)'), $this);
        return $this->Parse($ret, $this->name . '.tmpl');
    }
Example #27
0
File: cart.php Project: romlg/cms36
    function Show()
    {
        require_once core('ajax_table');
        $client_id = get('client_id', '');
        $ret['table'] = ajax_table(array('columns' => array(array('select' => 'p.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'p.name', 'display' => 'product_name', 'flags' => FLAG_SORT), array('select' => 'o.order_date', 'display' => 'order_date', 'type' => 'datetime', 'flags' => FLAG_SORT), array('select' => 'o.id', 'display' => 'order_id', 'type' => 'order', 'flags' => FLAG_SORT), array('select' => 'o.status', 'display' => 'status', 'type' => 'status', 'flags' => FLAG_SORT), array('select' => 'c.quantity', 'display' => 'quantity', 'align' => 'right', 'flags' => FLAG_SORT), array('select' => 'ROUND((c.price+c.delta)*(1-c.discount))', 'display' => 'price', 'align' => 'right', 'type' => 'number', 'flags' => FLAG_SORT)), 'from' => '
				orders AS o,
				cart AS c
				LEFT JOIN products AS p ON c.product_id=p.id
				LEFT JOIN auth_users AS cl ON o.client_id=cl.id', 'where' => 'c.order_id=o.id' . ' AND o.status IN ("Delivered","ReadyPaid")' . ($client_id ? ' AND o.client_id=' . $client_id : ''), 'orderby' => 'o.order_date', 'params' => array('page' => $this->name, 'do' => 'show', 'client_id' => $client_id)), $this);
        /****** Навигация *********/
        /*
                $navig['from_date'] = get('from_date', '');
                $navig['to_date'] = get('to_date', '');
        
                // Set Default From_date and To_date
                if (empty($navig['from_date'])) {
                    $navig['from_date'] = mktime(0,0,0,date('m') ,date('d')-7 ,date('Y'));
                    $navig['from_date'] = date('Y-m-d', $navig['from_date']);
                }
                else
                    $navig['from_date'] = date('Y-m-d', get('from_date', ''));
        
                if (empty($navig['to_date'])) {
                    $navig['to_date'] = mktime(23, 59, 59, date('m'), date('d') ,date('Y'));
                    $navig['to_date'] = date('Y-m-d', $navig['to_date']);
                }
                else
                    $navig['to_date'] = date('Y-m-d', get('to_date', ''));
        
                $ret['navig'] = $navig;
        */
        /**************************/
        $ret['client_id'] = $client_id;
        $this->AddStrings($ret);
        return $this->Parse($ret, $this->name . '.tmpl');
    }
Example #28
0
 function Show()
 {
     // обязательная фигня
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     // подключение библиотеки для построения таблиц
     require_once core('ajax_table');
     // строим таблицу
     $columns = array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'));
     if (is_devel()) {
         $columns[] = array('select' => 'name', 'display' => 'name', 'width' => '1px', 'flags' => FLAG_SEARCH | FLAG_SORT);
     }
     $columns[] = array('select' => 'recipient', 'display' => 'recipient', 'width' => '1px', 'flags' => FLAG_SORT, 'type' => 'recipient');
     $columns[] = array('select' => 'description', 'display' => 'description');
     $columns[] = array('select' => 'comments', 'display' => 'comments');
     $data['table'] = ajax_table(array('columns' => $columns, 'from' => $this->table, 'params' => array('page' => 'notify/' . $this->name, 'do' => 'show'), 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value'), $this);
     $this->AddStrings($data);
     $data['thisname'] = 'events';
     return Parse($data, "notify/tmpls/" . $this->name . '.tmpl');
 }
Example #29
0
 function ShowComponentSelector()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $prod_id = get('prod_id', '', 'g');
     $temp = array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'component', 'flags' => FLAG_SEARCH)), 'from' => "products", 'where' => "product_type_id=" . $prod_id, 'orderby' => 'id', 'params' => array('page' => $this->name, 'do' => 'showcomponentselector'), 'click' => 'ID=cb.value', 'dblclick' => 'addToList2()', 'target' => 'tmp' . $this->name . 'select');
     if (empty($prod_id) || $prod_id == 0) {
         $temp['where'] = "";
     }
     $ret['table'] = ajax_table($temp, $this);
     $this->AddStrings($ret);
     return $this->Parse($ret, 'selectwindow.tmpl');
 }
Example #30
0
 function ShowRecycle()
 {
     global $limit;
     $limit = -1;
     require_once core('ajax_table');
     $this->AddStrings($row);
     $row['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => "name", 'display' => 'name')), 'where' => 'lang="' . lang() . '" AND visible<0', 'orderby' => 'id DESC', 'params' => array('page' => $this->name, 'do' => 'Show')), $this);
     return Parse($row, 'recycle.tmpl');
 }