Example #1
0
 function ElemInit()
 {
     global $cfg, $sections, $hidden_sections, $_stat, $_sites, $intlang;
     $row = array();
     $modules_in_row = array();
     $i = 0;
     $id = (int) get('id');
     if ($id) {
         $row = sql_getRow("SELECT * FROM `admin_groups` WHERE id='" . $id . "'");
         $row['rights'] = unserialize($row['rights']);
     }
     // ALLOW ->	DEL		INS		UPD		SELECT
     // none  ->	0		0		0		0			=  0
     // view  ->	0		0		0		1           =  1
     // edit	 ->	0		1		1		1           =  7
     // del	 ->	1		1		1		1           = 15
     $row['radios'] = array('0' => '', '1' => '', '7' => '', '15' => '');
     // если указаны скрытые модули - надо их также вывести
     // для возможности задания прав группам пользователей.
     if (isset($hidden_sections)) {
         $sections = array_merge($sections, $hidden_sections);
     }
     foreach ($sections as $key => $section) {
         $row['menu'][$i]['title'] = utf($section[langId()]);
         $row['menu'][$i]['i'] = $i;
         foreach ($section['modules'] as $module_key => $module) {
             if (count(explode("/", $module_key)) > 1) {
                 $arr = explode("/", $module_key);
                 $module = $arr[0];
             }
             if (!is_module_auth($module_key)) {
                 continue;
             }
             // set the title
             unset($title);
             $title = $module[langID()];
             if (!isset($title)) {
                 switch ($module) {
                     case 'stat':
                         $title = $_stat[$module_key][langID()];
                         break;
                     case 'sites':
                         $title = $_sites[$module_key][langID()];
                         break;
                 }
             }
             if (!in_array($module . '_' . $title, $modules_in_row)) {
                 $row['menu'][$i]['rows'][] = array('menu' => $i, 'name' => 'fld[rights][' . $module_key . ']', 'title' => utf($title), 'selected' => !empty($row['rights'][$module_key]) ? $row['rights'][$module_key] : 0);
                 $modules_in_row[] = $module . '_' . $title;
             }
         }
         $i++;
     }
     foreach ($this->elem_str as $str_key => $str_val) {
         $row['str_' . $str_key] = $str_val[$intlang];
     }
     $table = $this->Parse($row, 'admin_groups.editform.tmpl');
     $this->elem_fields['columns']['table'] = array('type' => 'words', 'value' => $table);
     return parent::ElemInit();
 }
Example #2
0
 function modules_select()
 {
     $root_id = 0;
     $id = (int) get('id', 0);
     if ($id) {
         $root_id = sql_getValue("SELECT root_id FROM tree WHERE id=" . $id);
     }
     if (!$root_id) {
         $pid = (int) get('pid', 0);
         if ($pid) {
             $root_id = sql_getValue("SELECT root_id FROM tree WHERE id=" . $pid);
         }
     }
     $function_modules = $root_id ? $GLOBALS['cfg']['function_modules'][$root_id] : array();
     $mods = array('' => $this->str('_default_module'));
     foreach ($function_modules as $k => $v) {
         $mods[$k] = utf($v['name'][int_langId()]);
     }
     return $mods;
 }
Example #3
0
 function GetBasicElement()
 {
     global $elements, $intlang;
     $crm_menu = $this->crm_menu['client'];
     $x = '';
     foreach ($crm_menu as $key => $val) {
         $menu[$key]['name'] = utf($val[LangID()]);
         if (isset($val['link'])) {
             $menu[$key]['href'] = array('link' => $val['link']);
             $menu[$key]['open'] = BASE . $val['link'] == $_SERVER['REQUEST_URI'] ? 'open' : '';
         }
         if (isset($val['items'])) {
             foreach ($val['items'] as $items) {
                 $menu[$key]['items'][] = array('link' => $items['link'], 'target' => 'x', 'open' => BASE . $items['link'] == $_SERVER['REQUEST_URI'] ? 'open' : '', 'name' => utf($items[LangID()]));
             }
         }
     }
     $block = array('basic_caption' => $this->str('crm'), 'basic_icon' => 'box.page.gif', 'src' => $GLOBALS['_SERVER']['QUERY_STRING'], 'menu' => $menu, 'client_info' => $this->GetClientInfo());
     return $block;
 }
Example #4
0
File: ajax.php Project: philum/cms
    }
    if ($res) {
        list($s, $h) = split('-', $res);
    }
    $s = $s ? $s : 640;
    if ($id) {
        req(str_replace('-', ',', $id));
    }
    $ret = call_user_func_array($va, array($opt, $optb, $res));
}
$eye = array('art', 'popart', 'popartmod');
if ($eye[$n]) {
    eye();
}
if ($tt && $pp) {
    $t = $tt;
}
if ($t == 'pagup') {
    $ret = pagup($ret);
} elseif ($t) {
    $ret = popup($t, $ret, $s, $p);
}
//
if (Head::$add) {
    Head::add('meta', array('http-equiv', 'Content-Type', 'text/html; charset=' . $_SESSION['enc']));
    echo Head::generate();
} else {
    header('Content-Type:text/html; charset=' . $_SESSION['enc']);
}
echo utf($ret);
mysql_close();
    ?>
</a>
				</td>
				<td>
					<a href="<?php 
    echo $issue->repo_url;
    ?>
" target="_blank"><?php 
    echo $issue->repo;
    ?>
</a>
				</td>
				<td>
					<details>
						<summary><?php 
    echo utf($issue->Title);
    ?>
</summary>
						<kbd><?php 
    echo $parser->text(mb_convert_encoding($issue->Body, 'utf-8'));
    ?>
</kbd>
					</details>
				</td>
				<td>
					<time><?php 
    echo date('D, M jS Y g:i A', strtotime($issue->Created));
    ?>
</time>
				</td>
				<td>
Example #6
0
 function table_get_search_ph($val, $row)
 {
     $word = iconv("UTF-8", "WINDOWS-1251", $val);
     if (empty($word)) {
         $word = $val;
     }
     return $this->table_get_advanced('search_ph', $val) . utf(h($word));
 }
Example #7
0
File: stat.php Project: romlg/cms36
 function GetBasicElement()
 {
     if (!isset($this->advanced)) {
         return array();
     }
     $menu = '';
     foreach ($GLOBALS['_stat'] as $key => $val) {
         // Убираем ненужные отчеты
         if (in_array($key, $this->advanced['exclude'])) {
             continue;
         }
         $menu .= '<a href="stat.php?page=' . $key . '&adv[' . $this->advanced['key'] . ']=' . rawurlencode($this->advanced['value']) . '" class="' . ($GLOBALS['page'] == $key ? 'open' : '') . '"><img src="images/icons/icon.box.gif" width="16" height="16" align="absmiddle" hspace="4" vspace="2" border="0" alt="" /><b>' . utf($val[int_langId()]) . '</b></a><br>';
     }
     return array('basic_caption' => $this->str('reports'), 'basic_icon' => 'box.stat.gif', 'src' => $GLOBALS['_SERVER']['QUERY_STRING'], 'tree' => $menu, 'rows' => array('value' => $this->str($this->advanced['title'])));
 }
Example #8
0
function convert_info($sqlite_db, $min)
{
    $sqlite_db->query("begin transaction;");
    $text = "";
    $prior = 0;
    $handle = fopen("db/bookanno", "r");
    while (true) {
        if (feof($handle)) {
            $book = 0;
        } else {
            $buffer = Trim(fgets($handle, 4096), "\n\r");
            if (empty($buffer[0])) {
                continue;
            }
            $fields = explode(chr(9), $buffer);
            $book = $fields[0];
            $text = $text . "\\n" . utf(trim($fields[1]));
        }
        if ($prior && $book != $prior) {
            while (substr($text, 0, 2) == "\\n") {
                $text = substr($text, 2);
            }
            while (substr($text, -2) == "\\n") {
                $text = substr($text, 0, -2);
            }
            $text = str_replace("\\n\\n", "\n", $text);
            $text = str_replace("\\n", "</p><p>", $text);
            $text = "<p>" . $text . "</p>";
            echo "Info: " . $prior . " - " . substr($text, 0, 50) . "\n";
            $sql = "UPDATE books SET description=? where id=?";
            $insert = $sqlite_db->prepare($sql);
            $insert->execute(array($text, $prior));
            $text = "";
        }
        if (feof($handle)) {
            break;
        }
        $prior = $book;
    }
    fclose($handle);
    $sqlite_db->query("commit;");
}
Example #9
0
 function EditForm()
 {
     $id = (int) get('id', 0);
     if ($id) {
         $row = $this->getRow($id);
         $type = $row['html'] ? 'html' : 'img';
     } else {
         $row['id'] = $id;
         $row['visible'] = 1;
         $row['target'] = 1;
         $row['position'] = '';
         $row['root_id'] = get('root_id', '100');
         $columns = sql_getRows('SHOW COLUMNS FROM banners', true);
         if (isset($columns['alt_image'])) {
             $row['alt_image'] = '';
         }
         if (isset($columns['show_at_sites'])) {
             $row['show_at_sites'] = '';
         }
         $type = 'image';
     }
     $GLOBALS['title'] = $this->str($id ? 'edit' : 'add');
     $this->AddStrings($row);
     $row['visible_checked'] = $row['visible'] ? 'checked' : '';
     if (!empty($row['pages'])) {
         $row['pages_checked'] = 'checked';
     }
     if (isset($row['image']) && is_file(".." . $row['image'])) {
         $ext = strtolower(get_file_ext($row['image']));
         $size = getimagesize(".." . $row['image']);
         // Рисуем картинку
         if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') {
             $row['img_preview'] = '<img src="' . $row['image'] . '" ' . $size[3] . ' alt="" />';
         } elseif ($ext == '.swf') {
             $row['img_preview'] = str_replace(array('{filename}', '{width}', '{height}'), array($row['image'], $size[0], $size[1]), $this->swf_code);
         }
     }
     if (isset($row['alt_image']) && is_file(".." . $row['alt_image'])) {
         $ext = strtolower(get_file_ext($row['alt_image']));
         $size = getimagesize(".." . $row['alt_image']);
         // Рисуем картинку
         if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') {
             $row['alt_img_preview'] = '<img src="' . $row['alt_image'] . '" ' . $size[3] . ' alt="" />';
         }
     }
     $row['options_target'] = $this->GetArrayOptions(array('_self', '_blank'), $row['target'], true, true);
     // Список положений баннера
     foreach ($this->position as $key => $val) {
         $options_pos[$key] = utf($val['display'][int_langId()]);
     }
     $row['options_pos'] = $this->GetArrayOptions($options_pos, $row['position'], true, false);
     // Список сайтов
     if (isset($row['show_at_sites'])) {
         global $site_domains;
         $sites = array();
         $root = domainRootID();
         foreach ($site_domains as $key => $val) {
             foreach ($val['langs'] as $l) {
                 if ($l['root_id'] != $root) {
                     $sites[$l['root_id']] = (LANG_SELECT && !empty($val['descr_' . lang()]) ? $val['descr_' . lang()] : (!empty($val['descr']) ? $val['descr'] : $val['name'])) . ' (' . $l['descr'] . ')';
                 }
             }
         }
         $row['sites'] = $sites;
         if (!empty($row['show_at_sites'])) {
             $row['show_at_sites'] = explode(",", $row['show_at_sites']);
         }
     }
     // Список вариантов для редактирования баннеров
     $options_type = array('img', 'html');
     $row['options_type'] = $this->GetArrayOptions($options_type, $type, false, true);
     // Текст для HTML баннера
     include_fckeditor();
     $oFCKeditor = new FCKeditor();
     $oFCKeditor->ToolbarSet = 'Common';
     $oFCKeditor->Value = isset($row['html']) ? $row['html'] : '';
     $row['html'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '300px');
     return $this->Parse($row, $this->name . '.editform.tmpl');
 }
Example #10
0
 function GetBasicElement($elems)
 {
     global $cfg, $intlang;
     if (empty($elems)) {
         return;
     }
     # прорисовка дерева елементов
     $tree = '';
     $c = $_bars = $loaded = 0;
     $count = count($elems);
     $pid = get('id');
     # tree.id = common elements pid
     $items = array();
     foreach ($elems as $key => $val) {
         $c++;
         $row = array('id' => 0, 'pid' => $pid, 'priority' => $c, 'next' => $cfg['elements'][$val]['next'] ? $val : '', 'elem' => $val, 'name' => utf($cfg['elements'][$val][$intlang]));
         $tree .= $this->_get_element_item($row, $bars, $_bars, $c, $count, $loaded) . "\n";
         $items[] = $this->_get_element_item_data($row, $bars, $_bars, $c, $count, $loaded);
     }
     $items_data['items'] =& $items;
     $this->AddStrings($items_data);
     $tree = Parse($items_data, 'ced/ced.elements.tmpl');
     return array('STR_BASIC' => $GLOBALS['_name'], 'basic_caption' => str('basic_caption', $this->name), 'basic_icon' => $GLOBALS['str'][$this->name]['basic_icon'], 'src' => $GLOBALS['_SERVER']['QUERY_STRING'], 'tree' => $tree);
 }
Example #11
0
 function GetActions($actions, $pos = '')
 {
     $frame = get("is_fancy", "");
     if (!empty($pos)) {
         $pos = '_' . $pos;
     }
     $data = array();
     foreach ($actions as $key => $val) {
         // Чтобы у fancybox закрывалось окно а не отображался сайт
         if ($frame && $key == 'cancel') {
             $val['onclick'] = "window.top.parent.\$.fancybox.close();";
         }
         $data['actions'][] = array('title' => utf($val['title'][int_lang()]), 'show_title' => isset($val['show_title']) ? $val['show_title'] : false, 'onclick' => $val['onclick'], 'img' => $val['img'], 'hint' => isset($val['hint']) ? utf($val['hint'][int_lang()]) : '', 'display' => $val['display'], 'ondrop' => isset($val['ondrop']) ? $val['ondrop'] : '', 'ondragenter' => isset($val['ondrop']) ? 'window.event.dataTransfer.dropEffect = \'link\';window.event.returnValue = false' : '', 'ondragleave' => isset($val['ondrop']) ? 'window.event.returnValue = false' : '', 'ondragover' => isset($val['ondrop']) ? 'window.event.returnValue = false' : '');
     }
     return $this->Parse($data, 'actions' . $pos . '.tmpl');
 }
Example #12
0
 function EditForm()
 {
     $id = (int) get('id', 0);
     if ($id) {
         $row = $this->getRow($id);
         $type = $row['html'] ? 'html' : 'img';
     } else {
         $row['id'] = $id;
         $row['visible'] = 1;
         $row['target'] = 1;
         $row['position'] = '';
         $row['root_id'] = get('root_id', '100');
         $type = 'image';
     }
     $GLOBALS['title'] = $this->str($id ? 'edit' : 'add');
     $this->AddStrings($row);
     $row['visible_checked'] = $row['visible'] ? 'checked' : '';
     if (!empty($row['pages'])) {
         $row['pages_checked'] = 'checked';
     }
     if (isset($row['image']) && is_file(".." . $row['image'])) {
         $ext = strtolower(get_file_ext($row['image']));
         $size = getimagesize(".." . $row['image']);
         // Рисуем картинку
         if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') {
             $row['img_preview'] = '<img src="' . $row['image'] . '" ' . $size[3] . ' alt="" />';
         } elseif ($ext == '.swf') {
             $row['img_preview'] = str_replace(array('{filename}', '{width}', '{height}'), array($row['image'], $size[0], $size[1]), $this->swf_code);
         }
     }
     $row['options_target'] = $this->GetArrayOptions(array('_self', '_blank'), $row['target'], true, true);
     // Список положений баннера
     foreach ($this->position as $key => $val) {
         $options_pos[$key] = utf($val['display'][int_langId()]);
     }
     $row['options_pos'] = $this->GetArrayOptions($options_pos, $row['position'], true, false);
     // Список вариантов для редактирования баннеров
     $options_type = array('img', 'html');
     $row['options_type'] = $this->GetArrayOptions($options_type, $type, false, true);
     // Текст для HTML баннера
     include_fckeditor();
     $oFCKeditor = new FCKeditor();
     $oFCKeditor->ToolbarSet = 'Common';
     $oFCKeditor->Value = $row['html'];
     $row['html'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '300px');
     return $this->Parse($row, $this->name . '.editform.tmpl');
 }
Example #13
0
File: login.php Project: qquk/IBAG2
//$rec['username']=iconv("Windows-1251", "UTF-8" , $rec['username']);
//onmouseover=\"this.style.backgroundPosition=\'0 -25px\';\" onmouseout=\"this.style.backgroundPosition=\'0 0px\';\" onclick=\"this.style.backgroundPosition=\'0 -25px\';\"
require "func.php";
$servicestr = "";
$link = mysql_connect("localhost", "dobro", "bitdobru") or die("Could not connect");
mysql_select_db("dobro_db4") or die("Could not select database");
$sql = "select * from iusers where login='******'first'] . "' and userpass='******'psw'] . "'";
$query = mysql_query($sql) or die("e");
$row = mysql_fetch_array($query);
if (mysql_num_rows($query) < 1) {
    $strerr = utf("Ошибка имени пользователя и пароля");
    $str = "false";
} else {
    $strerr = "";
    $strname = "<table cellspacing=2 cellpadding=0 height=22><tbody><tr><td><div><img src=img/user-icon.png></div></td><td><div>&nbsp;&nbsp;</div></td><td><div  class=north-panel-div>" . utf(get_div_parent($row['div_id'])) . ". " . utf(get_div_name($row['div_id'])) . ". </div></td><td><div class=north-panel-name>" . utf($row['username']) . "</div></td></tr></tbody></table>";
    $user_id = $row['user_id'];
    $div_id = $row['div_id'];
    $str = "true";
}
$queryservice = "select * from services order by id";
$resultservice = mysql_query($queryservice) or die("er service11111");
$i = 0;
$servicestr = "<table cellspacing=6 cellpadding=0><tbody><tr>";
$servicestr = $servicestr . "<td><div id=userlist_act  class=button-home>&nbsp</div></td>";
while ($rowserv = mysql_fetch_array($resultservice)) {
    $servicestr = $servicestr . "<td><div id=service_act_" . $i . "  class=button-" . utf($rowserv['serviceprefix']) . " ></div></td>";
    $i++;
}
// while
$servicestr = $servicestr . "</tr></tbody></table>";
echo "{ success: {$str}, username: '******',user_id: '" . $user_id . "' ,div_id: '" . $div_id . "' , servicestr: '" . $servicestr . "', errors: { reason: '" . $strerr . "' }}";
Example #14
0
 /**
  * Список всех доступных для данного пользователя модулей
  *
  * @return array
  */
 function getAllModules()
 {
     global $cfg, $sections, $hidden_sections, $_stat, $_sites;
     $row = array();
     $modules_in_row = array();
     $id = (int) get('id');
     if ($id) {
         $row = $this->getRow($id);
         $row['rights'] = unserialize($row['rights']);
     }
     // если указаны скрытые модули - надо их также вывести
     // для возможности задания прав группам пользователей.
     if (isset($hidden_sections)) {
         $sections = array_merge($sections, $hidden_sections);
     }
     $i = 0;
     foreach ($sections as $key => $section) {
         $row[$i] = array('name' => $section[0], 'items' => array());
         foreach ($section['modules'] as $module_key => $module) {
             $module_name = $module_key;
             if (count(explode("/", $module_key)) > 1) {
                 $arr = explode("/", $module_key);
                 $module_name = $arr[0];
             }
             if (!is_module_auth($module_name)) {
                 continue;
             }
             // set the title
             unset($title);
             $title = $module[int_langId()];
             if (!isset($title)) {
                 switch ($module) {
                     case 'stat':
                         $title = $_stat[$module_name][int_langId()];
                         break;
                     case 'sites':
                         $title = $_sites[$module_name][int_langId()];
                         break;
                 }
             }
             if (!in_array($title, $modules_in_row)) {
                 $row[$i]['items'][] = array('name' => $module_name, 'title' => utf($title));
                 $modules_in_row[] = $title;
             }
         }
         $i++;
     }
     return $row;
 }
Example #15
0
 function table_get_search_ph($val, $row)
 {
     $word = iconv("UTF-8", "WINDOWS-1251", $val);
     if (empty($word)) {
         $word = $val;
     }
     return utf(h($word));
 }