Exemple #1
0
 function MyCommit($row)
 {
     // Переносим изображение
     if ($row['image'] && getimagesize('..' . $row['image']) && strpos($row['image'], 'plans') === false) {
         $object_id = sql_getValue('SELECT pid FROM obj_elem_plans WHERE id=' . $row['pid']);
         $dir = '../files/objects/' . $object_id;
         if (!is_dir($dir)) {
             mkdir($dir);
             mkdir($dir, 0770);
         }
         $dir .= '/plans';
         if (!is_dir($dir)) {
             mkdir($dir);
             mkdir($dir, 0770);
         }
         $new_name = $dir . '/' . basename($row['image']);
         rename('..' . $row['image'], $new_name);
         $row['image'] = substr($new_name, 2);
     }
     if ($_POST['id']) {
         sql_update($this->elem_table, $row, 'id = ' . $_POST['id']);
     } else {
         sql_insert($this->elem_table, $row);
     }
     $err = sql_getError();
     if (empty($err)) {
         return 1;
     }
     return $err;
 }
Exemple #2
0
 function showType()
 {
     global $notify_subscribe;
     $data['type'] = get('type', '', 'pg');
     $res = mysql_query($notify_subscribe[$data['type']]);
     for ($i = 0; $i < mysql_num_fields($res); $i++) {
         $field = mysql_fetch_field($res);
         $comment = sql_getValue("\n\t\t\t\t\tSELECT \n\t\t\t\t\tcomment\n\t\t\t\t\tFROM phpmyadmin.pma_column_info \n\t\t\t\t\tWHERE \n\t\t\t\t\ttable_name='" . $field->table . "'\n\t\t\t\t\tAND column_name='" . $field->name . "'\n\t\t\t\t\tAND db_name='" . MYSQL_DB . "' \n\t\t\t\t\t");
         $data['fields'][$field->table . '.' . $field->name] = $comment;
     }
     $data['fld'] = sql_getRow('SELECT * FROM notify_subscribe_tpls WHERE id="' . $data['type'] . '"');
     include_fckeditor();
     $oFCKeditor =& Registry::get('FCKeditor');
     $oFCKeditor->ToolbarSet = 'Small';
     $oFCKeditor->Value = $data['fld']['header'];
     $data['fld']['header'] = $oFCKeditor->ReturnFCKeditor('fld[header]', '100%', '100px');
     $oFCKeditor =& Registry::get('FCKeditor');
     $oFCKeditor->ToolbarSet = 'Source';
     $oFCKeditor->Value = $data['fld']['template'];
     $data['fld']['template'] = $oFCKeditor->ReturnFCKeditor('fld[template]', '100%', '200px');
     $oFCKeditor =& Registry::get('FCKeditor');
     $oFCKeditor->ToolbarSet = 'Small';
     $oFCKeditor->Value = $data['fld']['footer'];
     $data['fld']['footer'] = $oFCKeditor->ReturnFCKeditor('fld[footer]', '100%', '100px');
     $this->AddStrings($data);
     $tpl = NOTIFY_DIR . 'tmpls/' . $this->name . '.editform.tmpl';
     if (is_file($tpl)) {
         return Parse($data, $tpl);
     }
     return $content;
 }
Exemple #3
0
 function GetTable()
 {
     global $limit;
     $offset = (int) get('offset');
     $limit = (int) get('limit', $this->Param('limit', $limit));
     $search = get('find', '');
     $search_state = '';
     if (!empty($search)) {
         $search_state = ' AND (pag.uri LIKE "' . $search . '" OR pag.host LIKE "' . $search . '" OR pag.search_ph LIKE "' . $search . '")';
     }
     if (!empty($search)) {
         // Всего строк в таблице
         $count = sql_getValue("SELECT COUNT(DISTINCT(sess.ref_id)) FROM " . $this->sess_table . " AS sess\n            LEFT JOIN " . STAT_PAGES_TABLE . " AS pag ON pag.id=sess.ref_id\n            WHERE robot=0 AND ref_id!=0 {$search_state}");
     } else {
         // Всего строк в таблице
         $count = sql_getValue("SELECT COUNT(DISTINCT(ref_id)) FROM " . $this->sess_table . " WHERE robot=0 AND ref_id!=0");
     }
     // Всего посетителей
     $total_visitors = sql_getValue("SELECT COUNT(*) FROM " . $this->sess_table . " WHERE robot=0");
     // всего по ссылке с других страниц
     $total_links = sql_getValue("SELECT COUNT(*) FROM " . $this->sess_table . " WHERE robot=0 AND ref_id!=0");
     // всего неопределено
     $total_indefinite = $total_visitors - $total_links;
     // всего по поисковой фразе
     $total_search = sql_getValue("SELECT COUNT(*) FROM " . $this->sess_table . " AS sess LEFT JOIN " . STAT_PAGES_TABLE . " AS pag ON pag.id=sess.ref_id WHERE pag.search_ph!=''");
     // данные для таблицы
     $data = sql_getRows("\n\t\t\tSELECT pag.uri AS page, pag.search_ph AS search_ph, COUNT(*) AS kol, count(*)/" . $total_links . "*100 AS proc, pag.host AS host\n\t\t\tFROM " . $this->sess_table . " AS sess LEFT JOIN " . STAT_PAGES_TABLE . " AS pag ON pag.id=sess.ref_id\n\t\t\tWHERE sess.robot=0 AND sess.ref_id!='0' {$search_state} GROUP BY sess.ref_id ORDER BY kol DESC LIMIT " . $offset . ", " . $limit);
     $total_head = array('', $this->_str('from_page'), $this->_str('percent'));
     $total = array(array($this->str('total_visitors'), $total_visitors), array($this->str('total_links'), $total_links, $this->table_get_graph($total_links / $total_visitors * 100, array())), array($this->str('total_search'), $total_search, $this->table_get_graph($total_search / $total_visitors * 100, array())), array($this->str('total_indefinite'), $total_indefinite, $this->table_get_graph($total_indefinite / $total_visitors * 100, array())));
     // Main Table
     $ret['table'] = $this->stat_table(array('columns' => array(array('header' => 'page', 'nowrap' => 1, 'type' => 'page'), array('header' => 'search_ph', 'class' => 'tFirst', 'width' => '10%', 'type' => 'search_ph'), array('header' => 'from_page', 'align' => 'right', 'width' => '10%'), array('header' => 'percent', 'align' => 'right', 'width' => '50%', 'type' => 'graph')), 'data' => $data, 'total' => $total, 'total_head' => $total_head, 'count' => $count, 'offset' => $offset, 'limit' => $limit));
     return $ret;
 }
Exemple #4
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');
    }
Exemple #5
0
 function getDifTabs()
 {
     $id = get('id', 0, 'gp');
     $elems =& $GLOBALS['cfg']['types'][100]['product']['elements'];
     $sql = "SELECT solution_id FROM products WHERE id = " . $id;
     $sol_type = sql_getValue($sql);
     if (!isset($_GET['frame']) || $_GET['frame'] != 'cnt') {
         session_start();
         $_SESSION['elements'][$id] = $sol_type;
         session_write_close();
     } else {
         session_start();
         if (!$_SESSION['elements'][$id] && $sol_type || $_SESSION['elements'][$id] && !$sol_type) {
             echo "\n            \t\t<script>\n            \t\t\tparent.location.reload();\n            \t\t</script>\n            \t";
         }
         session_write_close();
     }
     if ($sol_type && !in_array('elem_composition', $elems)) {
         $elems[] = 'elem_composition';
         foreach ($elems as $k => $v) {
             if ($v == 'elem_params') {
                 unset($elems[$k]);
             }
         }
     }
     return $elems;
 }
Exemple #6
0
 function GetTable()
 {
     global $limit;
     $offset = (int) get('offset');
     $limit = (int) get('limit', $this->Param('limit', $limit));
     $search = get('find', '');
     $search_state = '';
     if (!empty($search)) {
         $search_state = ' AND (city.name LIKE "' . $search . '" OR region.name LIKE "' . $search . '")';
     }
     $q = "SELECT city.name AS city, COUNT(*) AS kol, COUNT(*) as proc, region.name as region\n\t\tFROM " . $this->sess_table . " AS sess\n\t\tLEFT JOIN " . STAT_CITIES_TABLE . " AS city ON sess.city = city.id\n\t\tLEFT JOIN " . STAT_REGIONS_TABLE . " AS region ON city.reg = region.id\n\t\tWHERE sess.robot=0 {$search_state}\n\t\tGROUP BY sess.city\n\t\tORDER BY kol DESC\n\t\t";
     $data = sql_getRows($q);
     $all_total = sql_getValue("SELECT COUNT(*) FROM " . $this->sess_table . " AS sess\n        LEFT JOIN " . STAT_CITIES_TABLE . " AS city ON sess.city = city.id\n        LEFT JOIN " . STAT_REGIONS_TABLE . " AS region ON city.reg = region.id\n        WHERE sess.robot=0");
     # исправляем пустое имя
     foreach ($data as $k => $v) {
         if ($v['city'] == '') {
             $data[$k]['city'] = $this->str('unknown_city');
         } else {
             $data[$k]['city'] = $v['city'] . ' (' . $v['region'] . ')';
         }
     }
     # считаем проценты и записываем для каждого значения
     foreach ($data as $k => $v) {
         $data[$k]['proc'] = 100 * $v['kol'] / $all_total;
         unset($data[$k]['region']);
     }
     $total_head = array('', $this->str('visitors'));
     $total[] = array($this->str('total_period'), $all_total);
     // Main Table
     $ret['table'] = $this->stat_table(array('columns' => array(array('header' => 'city', 'nowrap' => 1, 'type' => 'city'), array('header' => 'visitors', 'align' => 'right', 'width' => '20%'), array('header' => 'percent', 'align' => 'right', 'width' => '50%', 'type' => 'graph')), 'data' => $data, 'total' => $total, 'total_head' => $total_head, 'count' => count($data), 'offset' => $offset, 'limit' => $limit));
     return $ret;
 }
Exemple #7
0
 function GetTable()
 {
     global $limit;
     $offset = (int) get('offset');
     $limit = (int) get('limit', $this->Param('limit', $limit));
     $search = get('find', '');
     $search_state = '';
     if (!empty($search)) {
         $search_state = ' AND cl.login LIKE "' . $search . '"';
     }
     sql_query("\n\t\t\tCREATE TEMPORARY TABLE tmp_stat_clients\n\t\t\tSELECT sess.client_id AS client_id, cl.login AS login, cl.name AS name , cl.lname AS surname\n\t\t\tFROM " . $this->sess_table . " AS sess LEFT JOIN " . $this->clients_table . " AS cl ON cl.id=sess.client_id\n\t\t\tWHERE sess.client_id!=0 AND sess.robot=0" . $search_state);
     $count = sql_getValue("SELECT COUNT(DISTINCT(client_id)) FROM tmp_stat_clients");
     $total_value = sql_getValue("SELECT COUNT(*) FROM " . $this->sess_table . " AS sess LEFT JOIN " . $this->clients_table . " AS cl ON cl.id=sess.client_id WHERE sess.client_id!=0 AND sess.robot=0");
     if ($count) {
         $data = sql_getRows("SELECT IF(name<>'',CONCAT(login, ' (', surname, ' ', name, ')'),'n/a') AS name, COUNT(*) AS kol, COUNT(*)/" . $total_value . "*100 AS proc, client_id FROM tmp_stat_clients GROUP BY client_id ORDER BY kol DESC LIMIT " . $offset . ", " . $limit);
     } else {
         $data = array();
     }
     $total_head = array('', $this->_str('sessions'));
     $total[] = array($this->str('total_period'), $total_value);
     // Main Table
     $columns = array(array('header' => 'client', 'nowrap' => 1, 'type' => 'name'), array('header' => 'sessions', 'align' => 'right', 'width' => '20%'), array('header' => 'percent', 'align' => 'right', 'width' => '50%', 'type' => 'graph'));
     if (isset($GLOBALS['_stat']['stat/stat_banlist'])) {
         $columns[] = array('header' => 'ban', 'type' => 'ban', 'align' => 'center');
     }
     $ret['table'] = $this->stat_table(array('columns' => $columns, 'data' => $data, 'total' => $total, 'total_head' => $total_head, 'count' => $count, 'offset' => $offset, 'limit' => $limit));
     return $ret;
 }
Exemple #8
0
 /**
  * Функция строит многомерный массив районов
  *
  * @param int $id - id текущего района
  * @param int $level - уровень вложенности
  * @return массив
  */
 function getChilds($id = null, $level = 0, $levels = SHOW_LEVELS)
 {
     $childs = array();
     if (!isset($id)) {
         $childs = sql_getRows("SELECT id, pid, name FROM " . $this->table . " WHERE pid IS NULL ORDER BY name", true);
     } else {
         $childs = sql_getRows("SELECT id, pid, name FROM " . $this->table . " WHERE pid=" . $id . " ORDER BY name", true);
     }
     if (!empty($childs) && $level < $levels - 1) {
         foreach ($childs as $key => $val) {
             for ($i = 1; $i <= $levels; $i++) {
                 $childs[$key]['d_pid'][$i] = isset($childs[$key]['d_pid'][$i - 1]) ? sql_getValue('SELECT pid FROM ' . $this->table . ' WHERE id=' . $childs[$key]['d_pid'][$i - 1]) : $childs[$key]['pid'];
                 if (!$childs[$key]['d_pid'][$i]) {
                     unset($childs[$key]['d_pid'][$i]);
                     break;
                 }
             }
             // Реверс массива пидов
             $count = count($childs[$key]['d_pid']);
             for ($j = 1; $j <= $count; $j++) {
                 $childs[$key]['d' . $j . '.pid'] = $childs[$key]['d_pid'][$count - $j + 1];
             }
             // Пустые значения
             for ($j = 1; $j <= $levels; $j++) {
                 if (!isset($childs[$key]['d' . $j . '.pid'])) {
                     $childs[$key]['d' . $j . '.pid'] = '';
                 }
             }
             $childs[$key]['name'] = str_pad($val['name'], strlen($val['name']) + $level * strlen($this->prefix), $this->prefix, STR_PAD_LEFT);
             $childs[$key]['items'] = $this->getChilds($val['id'], $level + 1, $levels);
         }
     }
     return $childs;
 }
Exemple #9
0
 function get_solutions_type()
 {
     $sol_id = sql_getValue("SELECT solution_id FROM products WHERE id=" . $_GET['id']);
     if ($sol_id) {
         $this->script .= "\n    \t\t\t{literal}\n    \t\t\t\tvar handler = window.onload;\n\t\t\t        window.onload = function(){\n\t\t\t        \thandler();\n\t\t\t        \thideRow('tr_fld[product_type_id]');\n\t\t\t        \thideRow('tr_fld[manufacturer_id]');\n\t\t\t        \thideRow('tr_fld[price]');\n\t\t\t        \thideRow('tr_fld[weight]');\n\t\t\t        }\n    \t\t\t{/literal}\n    \t\t\t";
     }
     $rows = sql_GetRows("SELECT id, name FROM solutions_types ORDER BY priority, name", true);
     return array('0' => 'не указан') + $rows;
 }
Exemple #10
0
 function TNotifyLog()
 {
     global $actions, $str;
     TTable::TTable();
     $actions[$this->name] = array();
     $actions[$this->name . '.editform'] = array('cancel' => array('title' => array('ru' => 'Закрыть', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
     if (!empty($_GET['id'])) {
         $temp = sql_getValue("SELECT `event` FROM `" . $this->table . "` WHERE `id`=" . $_GET['id']);
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Логи уведомлений', 'Notifications log'), 'event' => array('Событие', 'Event'), 'date' => array('Дата', 'Date'), 'email' => array('Адрес', 'Email'), 'all_events' => array('Все события', 'All events')));
 }
Exemple #11
0
 function TGeo()
 {
     global $str, $actions;
     TCustom_tree::TCustom_tree();
     if ((int) $_GET['id']) {
         $temp = sql_getValue("SELECT name FROM " . $this->table . " WHERE id=" . (int) $_GET['id']);
     } else {
         $temp = "Новый район";
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('География', 'Geo'), 'title_editform' => array("Район: " . $temp, 'Region: ' . $temp)));
 }
Exemple #12
0
 /**
  * Вызывается перед сохранением в базу
  *
  * @param array $fld
  * @return array
  */
 function ElemRedactBefore($fld)
 {
     $fld = parent::ElemRedactBefore($fld);
     $error = "";
     $page_id = get('id', 0, 'gp');
     $page_pid = get('pid', 0, 'gp');
     if ($page_pid) {
         $parent = sql_getRow("SELECT dir, pids, level FROM " . $this->elem_table . " WHERE id=" . $page_pid);
     } else {
         $page_pid = sql_getValue("SELECT pid FROM `" . $this->elem_table . "` WHERE id=" . $page_id);
         $parent = sql_getRow("SELECT dir, pids, level FROM " . $this->elem_table . " WHERE id=" . $page_pid);
     }
     if (!$page_id) {
         // создание нового раздела
         $auto = sql_getRow("SHOW TABLE STATUS LIKE '" . $this->elem_table . "'");
         if ($auto['Auto_increment']) {
             $new_id = $auto['Auto_increment'];
         }
         if ($page_pid == $page_id) {
             $fld['level'] = 1;
         } else {
             $fld['level'] = $parent['level'] + 1;
         }
         $fld['priority'] = sql_getValue("SELECT MAX(priority) FROM `" . $this->elem_table . "` WHERE pid=" . $page_pid) + 1;
     }
     $page = $page_id ? $page_id : $new_id;
     if ($page_pid != $page_id) {
         # pids
         $pids = explode('/', $parent['pids']);
         if (!$pids[0]) {
             array_shift($pids);
         }
         if (!$pids[count($pids) - 1]) {
             array_pop($pids);
         }
         $pids[] = $page_pid;
         $fld['pids'] = '/' . join('/', $pids) . '/';
         # dir
         $fld['dir'] = $parent['dir'] . $page . '/';
     } else {
         # pids
         $fld['pids'] = '/' . $page_pid . '/';
         $fld['dir'] = '/' . $page . '/';
     }
     # изменим next у родителя
     sql_query("UPDATE tree SET next='1' WHERE id='" . (isset($parent['id']) ? $parent['id'] : $page_pid) . "'");
     # Проверка на существование dir
     $check = sql_getValue("SELECT id FROM " . $this->elem_table . " WHERE dir='" . $fld['dir'] . "'");
     if ($check && $check != $page_id) {
         $error_tab = $k;
         $error = "Раздел с таким URL уже существует";
     }
     return array('fld' => $fld, '_error_text' => $error);
 }
Exemple #13
0
 function GetTable()
 {
     global $limit;
     $offset = (int) get('offset');
     $limit = (int) get('limit', $this->Param('limit', $limit));
     $data = sql_getRows("SELECT id, ip FROM stat_banlist ORDER BY ip LIMIT " . $offset . ", " . $limit);
     $count = sql_getValue("SELECT COUNT(DISTINCT(ip)) FROM stat_banlist");
     // Main Table
     $ret['table'] = $this->stat_table(array('columns' => array(array('header' => 'ip', 'type' => 'ip'), array('header' => 'unban', 'type' => 'unban', 'align' => 'center')), 'data' => $data, 'total' => $total, 'count' => $count, 'offset' => $offset, 'limit' => $limit));
     return $ret;
 }
Exemple #14
0
 function TOrdersEd()
 {
     global $str;
     TTable::TTable();
     ####### Массив строковых констант ##########
     if (!empty($_GET['id'])) {
         $temp = sql_getValue('SELECT name FROM orders WHERE id=' . $_GET['id']);
     } else {
         $temp = '';
     }
     $str[get_class($this)] = array('saved' => array('Информация была успешно сохранена', 'Info has been successfully saved'), 'basic_caption' => array('Заявки', 'Order'), 'basic_tab' => array($temp, 'Order'), 'title' => array($temp, 'Order'));
 }
Exemple #15
0
 function ElemRedactB($fld)
 {
     $fld = parent::ElemRedactB($fld);
     // Пересчет цены в у.е
     if ($fld['price']) {
         $value = sql_getValue('SELECT value FROM currencies WHERE name="USD"');
         if ($value) {
             $fld['price_metr'] = $fld['price'] / $value;
         }
     }
     return $fld;
 }
Exemple #16
0
 function TPlans_Ed()
 {
     global $str;
     TTable::TTable();
     $this->actions = array('add' => array('title' => array('ru' => 'Добавить', 'en' => 'Add new'), 'onclick' => 'cnt.editElem(0)', 'img' => 'icon.create.gif', 'display' => 'none', 'show_title' => true), 'edit' => array('title' => array('ru' => 'Изменить', 'en' => 'Edit'), 'onclick' => 'cnt.editElem()', 'img' => 'icon.edit.gif', 'display' => 'none', 'show_title' => true), 'delete' => array('title' => array('ru' => 'Удалить', 'en' => 'Delete'), 'onclick' => 'cnt.deleteElems(\'' . $this->name . '\')', 'img' => 'icon.delete.gif', 'display' => 'none', 'show_title' => true));
     if (!empty($_GET['id'])) {
         $temp = sql_getValue('SELECT name FROM ' . $this->table . ' WHERE id=' . $_GET['id']);
     } else {
         $temp = 'Новая секция';
     }
     $str[get_class_name($this)] = array('saved' => array('Информация была успешно сохранена', 'Info has been successfully saved'), 'basic_caption' => array('Планировка', 'Plan'), 'basic_tab' => array($temp, 'Plan'), 'title' => array($temp, 'Plan'));
 }
Exemple #17
0
 function TStatReklama_ObjEd()
 {
     global $str;
     TTable::TTable();
     if (!empty($_GET['id'])) {
         $temp = sql_getValue('SELECT name FROM stat_reklama WHERE id=' . $_GET['id']);
     } else {
         $temp = '';
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('saved' => array('Информация была успешно сохранена', 'Info has been successfully saved'), 'basic_caption' => array('Рекламная кампания', 'Advertising campaign'), 'basic_tab' => array($temp, 'Advertising campaign'), 'title' => array($temp, 'Advertising campaign')));
     $this->actions = array('add' => array('title' => array('ru' => 'Добавить', 'en' => 'Add new'), 'onclick' => 'cnt.editElem(0)', 'img' => 'icon.create.gif', 'display' => 'none', 'show_title' => true), 'edit' => array('title' => array('ru' => 'Изменить', 'en' => 'Edit'), 'onclick' => 'cnt.editElem()', 'img' => 'icon.edit.gif', 'display' => 'none', 'show_title' => true), 'delete' => array('title' => array('ru' => 'Удалить', 'en' => 'Delete'), 'onclick' => 'cnt.deleteElems(\'' . $this->name . '\')', 'img' => 'icon.delete.gif', 'display' => 'none', 'show_title' => true), 'moveup' => array('title' => array('ru' => 'Выше', 'en' => 'Up'), 'onclick' => 'cnt.swapElems(-1)', 'img' => 'icon.moveup.gif', 'display' => 'none', 'show_title' => true), 'movedown' => array('title' => array('ru' => 'Ниже', 'en' => 'Down'), 'onclick' => 'cnt.swapElems(1)', 'img' => 'icon.movedown.gif', 'display' => 'none', 'show_title' => true));
 }
Exemple #18
0
 function TObjects_Ed()
 {
     global $str;
     TTable::TTable();
     $this->actions = array('add' => array('title' => array('ru' => 'Добавить', 'en' => 'Add new'), 'onclick' => 'cnt.editElem(0)', 'img' => 'icon.create.gif', 'display' => 'none', 'show_title' => true), 'edit' => array('title' => array('ru' => 'Изменить', 'en' => 'Edit'), 'onclick' => 'cnt.editElem()', 'img' => 'icon.edit.gif', 'display' => 'none', 'show_title' => true), 'delete' => array('title' => array('ru' => 'Удалить', 'en' => 'Delete'), 'onclick' => 'cnt.deleteElems(\'' . $this->name . '\')', 'img' => 'icon.delete.gif', 'display' => 'none', 'show_title' => true), 'moveup' => array('title' => array('ru' => 'Выше', 'en' => 'Up'), 'onclick' => 'cnt.swapElems(-1)', 'img' => 'icon.moveup.gif', 'display' => 'none', 'show_title' => true), 'movedown' => array('title' => array('ru' => 'Ниже', 'en' => 'Down'), 'onclick' => 'cnt.swapElems(1)', 'img' => 'icon.movedown.gif', 'display' => 'none', 'show_title' => true));
     if (!empty($_GET['id'])) {
         $temp = 'Лот ' . sql_getValue('SELECT lot_id FROM ' . $this->table . ' WHERE id=' . $_GET['id']);
     } else {
         $temp = '';
     }
     $str[get_class_name($this)] = array('saved' => array('Информация была успешно сохранена', 'Info has been successfully saved'), 'basic_caption' => array('Объект недвижимости', 'Realty Object'), 'basic_tab' => array($temp, 'Realty Object'), 'title' => array($temp, 'Realty Object'));
 }
Exemple #19
0
 function table_get_ban($val, $row)
 {
     // Узнаем забаннен этот ip или нет
     $res = sql_getValue("SELECT id FROM stat_banlist WHERE ip='" . $row['ip'] . "'");
     if (!$res) {
         // Можно забаннить
         return "<input type='image' src='/admin/images/icons/icon.rcard.gif' width='16' height='18' style='cursor: hand' title='" . $this->str('ban1') . "' onclick='if (confirm(\"" . sprintf($this->str('confirm1'), long2ip($row['ip'])) . "\") == true) location.href=\"cnt.php?page=stat/stat_banlist&do=editinsertip&ip=" . $row['ip'] . "\"; return false;'>";
     } else {
         // Можно разбаннить
         return "<input type='image' src='/admin/images/icons/icon.gcard.gif' width='16' height='18' style='cursor: hand' title='" . $this->str('ban2') . "' onclick='if (confirm(\"" . sprintf($this->str('confirm2'), long2ip($row['ip'])) . "\") == true) location.href=\"cnt.php?page=stat/stat_banlist&do=editdeleteip&id=" . $res . "\"; return false;'>";
     }
 }
Exemple #20
0
 function TNotify()
 {
     global $actions, $str;
     TTable::TTable();
     $actions[$this->name] = array();
     $actions[$this->name . '.editform'] = array('save' => array('title' => array('ru' => '—охранить', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'cancel' => array('title' => array('ru' => 'ќтмена', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
     if (!empty($_GET['id'])) {
         $temp = sql_getValue("SELECT `description` FROM `" . $this->table . "` WHERE `id`=" . (int) $_GET['id']);
     } else {
         $temp = 'новое уведомление';
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('”ведомлени¤', 'Notifications'), 'title_editform' => array('”ведомление: ' . $temp, 'Notification: ' . $temp), 'event' => array('—обытие', 'Event'), 'description' => array('ќписание', 'Description'), 'template' => array('Ўаблон', 'Template'), 'mails' => array('јдреса дл¤ отправки', 'Emails'), 'saved' => array('ƒаные были успешно сохранены', 'Data has been saved successfully')));
 }
Exemple #21
0
 function TAdmins()
 {
     global $str, $actions;
     TTable::TTable();
     if (!empty($_GET['id'])) {
         $temp = sql_getValue("SELECT login FROM " . $this->table . " WHERE id=" . $_GET['id']);
     } else {
         $temp = "Новый пользователь";
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Администраторы', 'Users'), 'title_editform' => array("Администраторы : " . $temp, 'Users : ' . $temp), 'login' => array('Логин', 'Login'), 'fullname' => array('Имя', 'Name'), 'email' => array('E-mail', 'E-mail'), 'phone' => array('Телефон', 'Phone'), 'cellphone' => array('Сотовый Телефон', 'Cell Phone'), 'description' => array('Описание', 'Description'), 'pwd' => array('Установить пароль', 'Set Password'), 'pwd2' => array('Пароль еще раз', 'Password Again'), 'group' => array('Группа', 'Group'), 'department' => array('Раздел', 'Department'), 'saved' => array('Данные успешно сохранены', 'Data has been saved successfully'), 'error_login' => array('Пользователь с таким логиным уже зарегистрирован', 'User with such loginym is already registered'), 'subst' => array('Замена', 'Substitute'), '_subst' => array('Используйте клавишу CTRL для выделения нескольких записей', 'Use CTRL key to select multiple records')));
     $actions[$this->name] = array('create' => &$actions['table']['create'], 'edit' => &$actions['table']['edit'], 'delete' => &$actions['table']['delete']);
     $actions[$this->name . '.editform'] = array('apply' => array('title' => array('ru' => 'Сохранить', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].elements[\'do\'].value=\'apply\'; document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'save_close' => array('title' => array('ru' => 'Сохранить и закрыть', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].elements[\'do\'].value=\'save\'; document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'cancel' => array('title' => array('ru' => 'Отмена', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
 }
Exemple #22
0
 function TGuestbook()
 {
     global $str, $actions;
     TTable::TTable();
     $actions[$this->name] = array('create' => &$actions['table']['create'], 'edit' => &$actions['table']['edit'], 'delete' => &$actions['table']['delete']);
     $actions[$this->name . '.editform'] = array('save' => array('title' => array('ru' => 'Сохранить', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].submit(); return false;', 'display' => 'block', 'show_title' => true), 'cancel' => array('title' => array('ru' => 'Отмена', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
     if ((int) $_GET['id']) {
         $temp = sql_getValue("SELECT name FROM " . $this->table . " WHERE id=" . (int) $_GET['id']);
     } else {
         $temp = "Добавить";
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('name' => array('Название', 'User'), 'date' => array('Дата', 'Date'), 'message' => array('Текст', 'Message'), 'visible' => array('Показывать', 'Visible'), 'visiblemain' => array('Показывать на главной', 'Visible main'), 'saved' => array('Даные были успешно сохранены', 'Data has been saved successfully')));
 }
Exemple #23
0
 function TAdmin_groups()
 {
     global $str, $actions;
     TTable::TTable();
     $actions[$this->name] = array('create' => &$actions['table']['create'], 'edit' => &$actions['table']['edit'], 'delete' => &$actions['table']['delete']);
     $actions[$this->name . '.editform'] = array('apply' => array('title' => array('ru' => 'Сохранить', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].elements[\'do\'].value=\'apply\'; document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'save_close' => array('title' => array('ru' => 'Сохранить и закрыть', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].elements[\'do\'].value=\'save\'; document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'cancel' => array('title' => array('ru' => 'Отмена', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
     if (!empty($_GET['id'])) {
         $temp = sql_getValue("SELECT name FROM " . $this->table . " WHERE id=" . $_GET['id']);
     } else {
         $temp = "Новая группа";
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Группы пользователей', 'User Groups'), 'title_editform' => array("Группа : " . $temp, 'Group : ' . $temp), 'editform' => array('Группа пользователей', 'User Groups'), 'name' => array('Название', 'Name'), 'rights' => array('Права доступа', 'Access Rights'), 'saved' => array('Группа была успешно сохранена', 'The group has been saved successfully'), 'none' => array('Нет', 'No'), 'read' => array('Чт', 'Rd'), 'edit' => array('Ред', 'Ed'), 'delete' => array('Уд', 'Del'), 'norights' => array('Запретить разделы', 'The limited sections'), 'module_title' => array('Название модуля', 'Module Title')));
 }
Exemple #24
0
 function TInfoblocks_rules()
 {
     global $actions, $str;
     TTable::TTable();
     if ((int) $_GET['id']) {
         $temp = sql_getValue("SELECT url FROM " . $this->table . " WHERE id=" . (int) $_GET['id']);
         $temp = 'Правило для:' . $temp;
     } else {
         $temp = 'Новое правило';
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Правила', 'Rules'), 'title_editform' => array($temp, $temp), 'url' => array('URL', 'URL Rules'), 'active' => array('Разрешить показ по этому адресу', 'Active')));
     $actions[$this->name] = array('create' => &$actions['table']['create'], 'edit' => &$actions['table']['edit'], 'delete' => &$actions['table']['delete']);
     $actions[$this->name . '.editform'] = array('save' => array('title' => array('ru' => 'Сохранить', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'cancel' => array('title' => array('ru' => 'Отмена', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
 }
Exemple #25
0
 function TProductTypesEd()
 {
     global $str;
     TTable::TTable();
     ############### Массив экшенов ################
     $this->actions = array('add' => array('title' => array('ru' => 'Добавить', 'en' => 'Add new'), 'onclick' => 'cnt.editElem(0)', 'img' => 'icon.create.gif', 'display' => 'none', 'show_title' => true), 'edit' => array('title' => array('ru' => 'Изменить', 'en' => 'Edit'), 'onclick' => 'cnt.editElem()', 'img' => 'icon.edit.gif', 'display' => 'none', 'show_title' => true), 'delete' => array('title' => array('ru' => 'Удалить', 'en' => 'Delete'), 'onclick' => 'cnt.deleteElems(\'' . $this->name . '\')', 'img' => 'icon.delete.gif', 'display' => 'none', 'show_title' => true), 'moveup' => array('title' => array('ru' => 'Выше', 'en' => 'Up'), 'onclick' => 'cnt.swapElems(-1)', 'img' => 'icon.moveup.gif', 'display' => 'none', 'show_title' => true), 'movedown' => array('title' => array('ru' => 'Ниже', 'en' => 'Down'), 'onclick' => 'cnt.swapElems(1)', 'img' => 'icon.movedown.gif', 'display' => 'none', 'show_title' => true));
     ####### Массив строковых констант ##########
     if (!empty($_GET['id'])) {
         $temp = sql_getValue('SELECT name FROM product_types WHERE id=' . $_GET['id']);
     } else {
         $temp = '';
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('saved' => array('Информация была успешно сохранена', 'Info has been successfully saved'), 'basic_caption' => array('Типы продуктов', 'Product types'), 'basic_tab' => array($temp, 'Product types'), 'title' => array($temp, 'Product types')));
 }
Exemple #26
0
 function TObjDirectionEd()
 {
     global $str;
     TTable::TTable();
     ############### Массив экшенов ################
     $this->actions = array('add' => array('title' => array('ru' => 'Добавить', 'en' => 'Add new'), 'onclick' => 'cnt.editElem(0)', 'img' => 'icon.create.gif', 'display' => 'none', 'show_title' => true), 'edit' => array('title' => array('ru' => 'Изменить', 'en' => 'Edit'), 'onclick' => 'cnt.editElem()', 'img' => 'icon.edit.gif', 'display' => 'none', 'show_title' => true), 'delete' => array('title' => array('ru' => 'Удалить', 'en' => 'Delete'), 'onclick' => 'cnt.deleteElems(\'' . $this->name . '\')', 'img' => 'icon.delete.gif', 'display' => 'none', 'show_title' => true));
     ####### Массив строковых констант ##########
     if (!empty($_GET['id'])) {
         $temp = sql_getValue("SELECT " . (LANG_SELECT ? "IF (name_" . lang() . " <> '', name_" . lang() . ", name_" . DEFAULT_LANG . ") as name" : "name") . " FROM " . $this->table . " WHERE id=" . $_GET['id']);
     } else {
         $temp = '';
     }
     $str[get_class($this)] = array('saved' => array('Информация была успешно сохранена', 'Info has been successfully saved'), 'basic_caption' => array('Направление', 'Direction'), 'basic_tab' => array($temp, 'Direction'), 'title' => array($temp, 'Direction'));
 }
Exemple #27
0
 function TBalconyEd()
 {
     global $str;
     TTable::TTable();
     ############### Массив экшенов ################
     $this->actions = array('add' => array('title' => array('ru' => 'Добавить', 'en' => 'Add new'), 'onclick' => 'cnt.editElem(0)', 'img' => 'icon.create.gif', 'display' => 'none', 'show_title' => true), 'edit' => array('title' => array('ru' => 'Изменить', 'en' => 'Edit'), 'onclick' => 'cnt.editElem()', 'img' => 'icon.edit.gif', 'display' => 'none', 'show_title' => true), 'delete' => array('title' => array('ru' => 'Удалить', 'en' => 'Delete'), 'onclick' => 'cnt.deleteElems(\'' . $this->name . '\')', 'img' => 'icon.delete.gif', 'display' => 'none', 'show_title' => true));
     ####### Массив строковых констант ##########
     if (!empty($_GET['id'])) {
         $temp = sql_getValue("SELECT name FROM " . $this->table . " WHERE id=" . $_GET['id']);
     } else {
         $temp = 'Новый';
     }
     $str[get_class($this)] = array('saved' => array('Информация была успешно сохранена', 'Info has been successfully saved'), 'basic_caption' => array('Балкон', 'Balcony'), 'basic_tab' => array($temp, 'Balcony'), 'title' => array($temp, 'Balcony'));
 }
Exemple #28
0
 function TFile()
 {
     global $actions, $str;
     TTable::TTable();
     $actions[$this->name] = array('create' => &$actions['table']['create'], 'edit' => &$actions['table']['edit'], 'delete' => &$actions['table']['delete']);
     $actions[$this->name . '.editform'] = array('save' => array('title' => array('ru' => 'Сохранить', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'cancel' => array('title' => array('ru' => 'Отмена', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
     if ((int) $_GET['id']) {
         $temp = sql_getValue("SELECT name FROM " . $this->table . " WHERE id=" . (int) $_GET['id']);
     } else {
         $temp = "Новый файл";
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Файлы', 'File'), 'title_editform' => array("Файл: " . $temp, 'File: ' . $temp), 'name' => array('Заголовок', 'Title'), 'fname' => array('Имя файла', 'Filename'), 'visible' => array('Показывать', 'Visible'), 'saved' => array('Даные были успешно сохранены', 'Data has been saved successfully')));
     // Здесь описываются поля по умолчанию для отображения списка
     $this->columns_default = array(array('select' => 'id', 'display' => 'ids', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SEARCH), array('select' => 'fname', 'display' => 'fname'), array('select' => 'priority', 'display' => 'priority', 'type' => 'edit_priority'));
 }
Exemple #29
0
 function TDynamic_img()
 {
     global $str, $actions;
     TTable::TTable();
     if ((int) $_GET['id']) {
         $temp = sql_getValue("SELECT name FROM " . $this->table . " WHERE id=" . (int) $_GET['id']);
     } else {
         $temp = "Новое изображение";
     }
     $str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Сменяющиеся изображения', 'Dynamic images'), 'title_editform' => array("Сменяющиеся изображения: " . $temp, 'Dynamic images: ' . $temp), 'name' => array('Название', 'Title'), 'priority' => array('Порядок отображения', 'priority'), 'image' => array('Изображение', 'image'), 'alt' => array('Альтернативный текст', 'alt'), 'link' => array('Название кнопки', 'link'), 'link_url' => array('Ссылка кнопки', 'link'), 'visible' => array('Отображать', 'visible'), 'description' => array('Описание', 'description'), 'root_ids' => array('На каких сайтах показывать', 'root ids')));
     $actions[$this->name] = array('create' => &$actions['table']['create'], 'edit' => &$actions['table']['edit'], 'delete' => &$actions['table']['delete']);
     $actions[$this->name . '.editform'] = array('apply' => array('title' => array('ru' => 'Сохранить', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].elements[\'do\'].value=\'apply\'; document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'save_close' => array('title' => array('ru' => 'Сохранить и закрыть', 'en' => 'Save'), 'onclick' => 'document.forms[\'editform\'].elements[\'do\'].value=\'save\'; document.forms[\'editform\'].submit(); return false;', 'img' => 'icon.save.gif', 'display' => 'block', 'show_title' => true), 'cancel' => array('title' => array('ru' => 'Отмена', 'en' => 'Cancel'), 'onclick' => 'window.location=\'/admin/?page=' . $this->name . '\'', 'img' => 'icon.close.gif', 'display' => 'block', 'show_title' => true));
     // Здесь описываются поля по умолчанию для отображения списка
     $this->columns_default = array(array('select' => 'id', 'display' => 'ids', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'name', 'display' => 'name'), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible'), array('select' => 'priority', 'display' => 'priority'));
 }
Exemple #30
0
 function ElemRedactBefore($fld)
 {
     if (isset($fld['root_id'])) {
         $root_id = $fld['root_id'];
         while ($pid = sql_getValue("SELECT pid FROM tree WHERE id = {$root_id}")) {
             if ($pid == $root_id) {
                 break;
             } else {
                 $root_id = $pid;
             }
         }
         $fld['root_id'] = $root_id ? $root_id : 'NULL';
     }
     return parent::ElemRedactBefore($fld);
 }