ACC SHELL
<?php
/*************************************************************************
*
* Skrtipt obsahujici funkce pouzite v jinych skriptech
*
************************************************************************/
/* fce, ktera vrati kod, pro strankovani
/*
/* parametry: $on_page - pocet zaznamu na stranku
$count - celkovy pocet zaznamu
$pages_count - pocet stranek ve strankovadle
$offset - offset zaznamu
$page - jmeno stranky, ze ktere je strankovadlo volano
$params - GET parametry
*/
function pageLang($ID, $id_lang){
$dtb = new Db();
$pat = $dtb -> select(
'spl.name, spl.path',
'sys_pages as sp LEFT JOIN sys_pages_languages as spl on (spl.id_page = sp.id)',
'spl.id_language = '.$id_lang.' AND sp.id = '.(int)$ID,
'1'
);
return $pat["path"];
}
function paging($on_page, $count, $pages_count, $offset, $page, $params, $rel_href='', $offset_str='offset')
{
if (FALSE==$count) return '';
$result='<div class="paging">';
$get_str=get_params2($params, array($offset_str));
$pages=ceil($count/$on_page);
$actual=floor($offset/$on_page);
$start=$actual-floor($pages_count/2);
if ($start<0)
{
$start=0;
}
$end=$start+$pages_count;
if ($end>$pages)
{
$end=$pages;
$start=$end-$pages_count;
}
if ($start<0)
{
$start=0;
}
if ($start>0)
{
$tmp_pos=$offset-$on_page*floor($pages_count);
if ($tmp_pos<0)
{
$tmp_pos=0;
}
$result.='<a class="straight" href="'.$page.'?'.$offset_str.'='.$tmp_pos.$get_str.$rel_href.'"> « </a> ';
}
if ($actual>0)
{
$result.='<a class="straight" href="'.$page.'?'.$offset_str.'='.($offset-$on_page).$get_str.$rel_href.'"> ‹ </a> ';
}
if ($start==$end-1)
{
return '';
}
for ($i=$start; $i<$end; $i++)
{
if ($i==$actual)
{
$result.='<span class="red"> '.($i+1).'</span> ';
}
else
{
$result.='<a href="'.$page.'?'.$offset_str.'='.($i*$on_page).$get_str.$rel_href.'"> '.($i+1).'</a> ';
}
}
if ($actual<$pages-1)
{
$result.='<a class="straight" href="'.$page.'?'.$offset_str.'='.($offset+$on_page).$get_str.$rel_href.'"> › </a> ';
}
if ($end<$pages)
{
$tmp_pos=$offset+$on_page*floor($pages_count);
if ($tmp_pos>$count-$on_page)
{
$tmp_pos=$count-$on_page;
}
$result.='<a class="straight" href="'.$page.'?'.$offset_str.'='.$tmp_pos.$get_str.$rel_href.'"> » </a> ';
}
$result.='</div>';
return $result;
}
function query($sql)
{
$query=mysql_query($sql);
if (TRUE==mysql_error())
{
die(mysql_error().'<br />'.nl2br($sql));
}
$result=array();
while ($data=mysql_fetch_array($query))
{
$result[]=$data;
}
return $result;
}
function text_paging($text, $on_page, $offset, $page='', $params=array())
{
if (FALSE==$on_page) return '';
$result='<div class="text_paging">';
$get_str=get_params($params, array('toffset'));
$pages=ceil(strlen($text)/$on_page);
$actual=floor($offset/$on_page);
$start=$actual-floor($pages_count/2);
if ($start<0)
{
$start=0;
}
$end=$start+$pages_count;
if ($end>$pages)
{
$end=$pages;
$start=$end-$pages_count;
}
if ($start<0)
{
$start=0;
}
if ($start>0)
{
$tmp_pos=$offset-$on_page*floor($pages_count);
if ($tmp_pos<0)
{
$tmp_pos=0;
}
$result.='<a class="paging-text-right" href="'.$page.'?toffset='.$tmp_pos.$get_str.'"> « </a> ';
}
if ($actual>0)
{
$result.='<a class="paging-text-left" href="'.$page.'?toffset='.($offset-$on_page).$get_str.'"> ‹ </a> ';
}
if ($start==$end-1)
{
return '';
}
for ($i=$start; $i<$end; $i++)
{
if ($i==$actual)
{
$result.='<span class="red"> '.($i+1).'</span> ';
}
else
{
$result.='<a href="'.$page.'?offset='.($i*$on_page).$get_str.'"> '.($i+1).'</a> ';
}
}
if ($actual<$pages-1)
{
$result.='<a class="paging-text-right" href="'.$page.'?offset='.($offset+$on_page).$get_str.'"> › </a> ';
}
if ($end<$pages)
{
$tmp_pos=$offset+$on_page*floor($pages_count);
if ($tmp_pos>$count-$on_page)
{
$tmp_pos=$count-$on_page;
}
$result.='<a class="paging-text-left" href="'.$page.'?offset='.$tmp_pos.$get_str.'"> » </a> ';
}
$result.='</div>';
return $result;
}
// fce, ktera vezme parametry a vrati GET string
function get_params($params, $trash=array())
{
$get_str='';
$trash[]='page_name';
$keys=array_keys($params);
for ($i=0; $i<count($keys); $i++)
{
if (FALSE==in_array($keys[$i], $trash))
{
$get_str.='&'.$keys[$i].'='.$params[$keys[$i]];
}
}
return $get_str;
}
// fce, ktera vezme parametry a vrati GET string pocita i s poli
function get_params2($params, $trash=array())
{
$get_str='';
$trash[]='page_name';
foreach($params AS $key => $value){
if (FALSE==in_array($key, $trash)){
if (is_array($params[$key])){
foreach($params[$key] as $k => $v){
$get_str.='&'.$key.'%5B%5D='.$v;
}
}else{
$get_str.='&'.$key.'='.$value;
}
}
}
return $get_str;
}
function get_params3($params, $trash=array())
{
$get_str='';
$trash[]='page_name';
$keys=array_keys($params);
for ($i=0; $i<count($keys); $i++)
{
if (FALSE==in_array($keys[$i], $trash))
{
$get_str.='<input type="hidden" name="'.$keys[$i].'" value="'.$params[$keys[$i]].'" />
';
}
}
return $get_str;
}
// prevede nazev na systemovy nazev (bez diakritiky, ridicich znaku a mezer + zkrati jej na 40 znaku)
function forum_suffix($number)
{
if (
(0==($number%10))
||
((10<$number) && (20>$number))
)
{
return 'vků';
}
else
if (1==($number%10))
{
return 'vek';
}
else
if (5>($number%10))
{
return 'vky';
}
else
return 'vků';
}
// fce na kontrolu a preformatovani casu
function checkTime($datetime)
{
$tmp_date=explode(', ', $datetime);
$date=explode('. ', $tmp_date[0]);
$time=explode(':', $tmp_date[1]);
$daysinmonth=array(31,28,31,30,31,30,31,31,30,31,30,31);
if ((($date[2]%4==0) && ($date[2]%100!=0)) || ($date[2]%400==0)) $daysinmonth[2]=29;
if (
((int)$date[0]>0) && ((int)$date[0]<=(int)$daysinmonth[(int)$date[1]-1])
&&
((int)$date[1]>0) && ((int)$date[1]<13)
&&
((int)$date[2]>=1970) && ((int)$date[2]<=3000)
&&
((int)$time[0]>=0) && ((int)$time[0]<24)
&&
((int)$time[1]>=0) && ((int)$time[0]<60)
)
{
return $datetime;
}
else
{
return '';
}
}
// konec fce
// prevede nazev na systemovy nazev (bez diakritiky, ridicich znaku a mezer + zkrati jej na 40 znaku)
function sys_name($string)
{
$origin=array('ě','š','č','ř','ž','ý','á','í','é','ů','ú','ó','ď','ň','ť','Ě','Š','Č','Ř','Ž','Ý','Á','Í','É','Ů','Ú','Ó','Ď','Ň','Ť', ' ', ',', ';', ':', '(', ')', '-', '?', '!');
$new=array('e','s','c','r','z','y','a','i','e','u','u','o','d','n','t','E','S','C','R','Z','Y','A','I','E','U','U','O','D','N','T', '_', '', '', '', '', '', '', '', '');
$spec_chars=array('\'','\\',',','@','#','$','%','^','&','*','()');
$string=str_replace($origin, $new, $string);
$string=str_replace($spec_chars, '', $string);
if (count($string)>40)
{
$string=trim(substr($string.' ', 0, 40), 'a..z');
}
return str_replace(' ', '_', trim($string));
}
function sys_name2($string)
{
$origin=array('ě','š','č','ř','ž','ý','á','í','é','ů','ú','ó','ď','ň','ť','Ě','Š','Č','Ř','Ž','Ý','Á','Í','É','Ů','Ú','Ó','Ď','Ň','Ť', ' ', ' ', '/');
$new=array('e','s','c','r','z','y','a','i','e','u','u','o','d','n','t','E','S','C','R','Z','Y','A','I','E','U','U','O','D','N','T', '-', '-', '-');
$spec_chars=array('\'','\\',',','@','#','$','%','^','&','*','()');
$string=str_replace($origin, $new, $string);
$string=str_replace($spec_chars, '', $string);
return trim(strtolower($string));
}
function get_attr($array, $name, $attrs, $sep=array(), &$parity)
{
$result='';
$separator='';
$attr='';
$class=array(
true=>'dark',
false=>'bright',
);
for ($i=0; $i<count($attrs); $i++)
{
if (TRUE==$array[$attrs[$i]])
{
$attr.=$sep[$i].$array[$attrs[$i]];
}
}
for ($i=count($attrs); $i<count($sep); $i++)
{
if (TRUE==$attr)
{
$attr.=$sep[$i];
}
}
$text=$attr;
$text=ereg_replace("[^\ \n][a-zA-Z]+://([-]*[.]?[a-zA-Z0-9_/-?&%])*", "<a href=\"\\0\">\\0</a>", $text);
$text=ereg_replace("[a-zA-Z0-9_/-?&%\.]+@([-]*[.]?[a-zA-Z0-9_/-?&%\.])+\.[a-zA-Z0-9_/-?&%]+", "<a href=\"mailto:\\0\">\\0</a>", $text);
$text=ereg_replace("(^| |\n)(www([.]?[a-zA-Z0-9_/-])*)", "\\1<a href=\"http://\\2\">\\2</a>", $text);
$text=nl2br($text);
if (TRUE==$attr)
{
if (TRUE==$name)
{
$name='<div><div class="label">'.$name.':</div>';
}
else
{
$name='<div><div class="label"><!-- --></div>';
}
$result.='<div class="attr '.$class[$parity].'">
'.$name.'<div class="value">'.$text.'</div>
</div>
<div class="clear_both"><!-- --></div>
</div>
';
$parity=!$parity;
}
return $result;
}
function seconds($value)
{
$result='';
$tmp=explode(',', ereg_replace('^(.*)°(.*)\'(.*)$', '\\1,\\2,\\3', trim($value, '"')));
$result=$tmp[2]+$tmp[1]*60+$tmp[0]*3600;
return $result;
}
function htmlentities_iso88592($string='') {
$pl_iso = array('ê', 'ó', '±', '¶', '³', '¿', '¼', 'æ', 'ñ', 'Ê', 'Ó', '¡', '¦', '£', '¬', '¯', 'Æ', 'Ñ');
$entitles = get_html_translation_table(HTML_ENTITIES);
$entitles = array_diff($entitles, $pl_iso);
return strtr($string, $entitles);
}
// Funkce na prevod libovolneho ceskeho textu $str na kodovani $code
// (puvodni kodovani neni nutne znat)
function AutoCzech($str, $code)
{
// Ceske znaky v ruznych kodovanich (ASCII, Win-1250, ISO 8859-2, UTF-8)
$autocp['asc'] = array ('A','C','D','E','E','I','N','O','R','S','T','U','U','Y','Z',
'a','c','d','e','e','i','n','o','r','s','t','u','u','y','z');
$autocp['win'] = array ('Á','Č','Ď','É','Ě','Í','Ň','Ó','Ř','©','«','Ú','Ů','Ý','®',
'á','č','ď','é','ě','í','ň','ó','ř','ą','»','ú','ů','ý','ľ');
$autocp['iso'] = array ('Á','Č','Ď','É','Ě','Í','Ň','Ó','Ř','©','«','Ú','Ů','Ý','®',
'á','č','ď','é','ě','í','ň','ó','ř','±','»','ú','ů','ý','µ');
$autocp['utf'] = array("\xc3\x81", "\xc3\x88", "\xc3\x8f", "\xc3\x89", "\xc3\x83", "\xc3\x8d", "\xc3\x92", "\xc3\x93", "\xc3\x98", "\xc5\xa0", "\xc2\x8d", "\xc3\x9a", "\xc3\x99", "\xc3\x9d", "\xc5\xbd",
"\xc3\xa1", "\xc3\xa8", "\xc3\xaf", "\xc3\xa9", "\xc3\xac", "\xc3\xad", "\xc3\xb2", "\xc3\xb3", "\xc3\xb8", "\xc5\xa1", "\xc2\x9d", "\xc3\xba", "\xc3\xb9", "\xc3\xbd", "\xc5\xbe");
// Vsechny ceske znaky ktere je mozne prevadet
$autocp['merge'] = array_merge ($autocp['utf'], $autocp['win'], $autocp['iso']);
// Prevod do UTF nelze primo, takze AutoCzech na ISO a pak FromToCzech ISO->UTF.
if ($code=='utf') {
$str = AutoCzech($str, 'iso');
return str_replace($autocp['iso'], $autocp['utf'], $str);
}
// ... do vseho osttaniho (ISO, WIN, ASC) muzeme prevezt primo
else {
$to = array_merge ($autocp[$code], $autocp[$code], $autocp[$code]);
return str_replace($autocp['merge'], $to, $str);
}
}
function GetMetaCharset ($code)
{
$code = strtolower(substr($code, 0, 3));
$charset['iso'] = 'iso-8859-2';
$charset['win'] = 'windows-1250';
$charset['utf'] = '????';
$charset['asc'] = 'iso-8859-1';
return $charset[$code];
}
function unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
function repair_name($name)
{
$tmp=explode('-', $name);
if (0<count($tmp))
{
$tmp=explode(' ', $tmp[0]);
}
$result='';
for ($i=0; $i<count($tmp); $i++)
{
$result.=ucfirst(strtolower($tmp[$i])).' ';
}
if (TRUE==trim($result))
{
return trim($result);
}
else
{
return $name;
}
}
function repair_name_lite($name)
{
$tmp=explode(' ', $name);
$result='';
for ($i=0; $i<count($tmp); $i++)
{
$result.=ucfirst(strtolower($tmp[$i])).' ';
}
if (TRUE==trim($result))
{
return trim($result);
}
else
{
return $name;
}
}
function record_update($admin)
{
if ('object'==$admin->table)
{
$old_data=$GLOBALS['db']->select(
'*
',
'
objects AS o
LEFT JOIN objects_languages AS ol ON (o.id=ol.id_object)
LEFT JOIN attribute_values AS av ON (o.id=av.id_object)
',
'o.id='.(int)$admin->id
);
$new_data=$GLOBALS['db']->select(
'*
',
'
tmp_objects AS o
LEFT JOIN tmp_objects_languages AS ol ON (o.id=ol.id_object)
LEFT JOIN tmp_attribute_values AS av ON (o.id=av.id_object)
',
'o.id='.(int)$admin->id
);
}
if ('action'==$admin->table)
{
$old_data=$GLOBALS['db']->select(
'*
',
'
actions AS o
LEFT JOIN actions_languages AS ol ON (o.id=ol.id_action)
',
'o.id='.(int)$admin->id
);
$new_data=$GLOBALS['db']->select(
'*
',
'
tmp_actions AS o
LEFT JOIN tmp_actions_languages AS ol ON (o.id=ol.id_action)
',
'o.id='.(int)$admin->id
);
}
if ('programme'==$admin->table)
{
$old_data=$GLOBALS['db']->select(
'*
',
'
programmes AS o
LEFT JOIN programmes_languages AS ol ON (o.id=ol.id_programme)
',
'o.id='.(int)$admin->id
);
$new_data=$GLOBALS['db']->select(
'*
',
'
tmp_programmes AS o
LEFT JOIN tmp_programmes_languages AS ol ON (o.id=ol.id_programme)
',
'o.id='.(int)$admin->id
);
}
if ('accomodation'==$admin->table)
{
$old_data=$GLOBALS['db']->select(
'*
',
'
accomodations AS o
LEFT JOIN accomodations_languages AS ol ON (o.id=ol.id_accomodation)
LEFT JOIN accomodations_accomodation_attributes AS av ON (o.id=av.id_accomodation)
',
'o.id='.(int)$admin->id
);
$new_data=$GLOBALS['db']->select(
'*
',
'
tmp_accomodations AS o
LEFT JOIN tmp_accomodations_languages AS ol ON (o.id=ol.id_accomodation)
LEFT JOIN tmp_accomodations_accomodation_attributes AS av ON (o.id=av.id_accomodation)
',
'o.id='.(int)$admin->id
);
}
if ($new_data!=$old_data)
{
$GLOBALS['db']->queryN('DELETE FROM operations WHERE admin_table=\''.addslashes($admin->table).'\' AND admin_id='.(int)$admin->id.' AND status=1 AND id_operation_type=1');
$tmp2=$GLOBALS['db']->select('*', 'operations', 'admin_table=\''.addslashes($admin->table).'\' AND admin_id='.(int)$admin->id.' AND status=3 AND id_operation_type=3', '1');
$tmp=$GLOBALS['db']->select('*', 'operations', 'admin_table=\''.addslashes($admin->table).'\' AND admin_id='.(int)$admin->id.' AND status=1 AND id_operation_type=1', '1');
if ( (0==count($tmp)) && (0==count($tmp2)) )
{
if ('4'==$GLOBALS['user']['rights'])
{
$state=1;
}
else
{
$state=2;
}
$row=array(
'id_operation_type'=>1,
'id_user'=>(int)$GLOBALS['user']['id'],
'admin_table'=>addslashes($admin->table),
'admin_id'=>(int)$admin->id,
'state'=>(int)$state,
'rank'=>5,
);
$GLOBALS['db']->insert('operations', $row);
}
}
}
function record_update_declined($admin)
{
$GLOBALS['db']->queryN('UPDATE operations SET status=1 WHERE admin_table=\''.addslashes($admin->table).'\' AND admin_id='.(int)$admin->id.' AND status=3 AND id_operation_type=2');
}
function record_insert($admin, $id)
{
if ('4'==$GLOBALS['user']['rights'])
{
$state=1;
}
else
{
$state=2;
}
$row=array(
'id_operation_type'=>2,
'id_user'=>(int)$GLOBALS['user']['id'],
'admin_table'=>addslashes($admin->table),
'admin_id'=>(int)$id,
'state'=>(int)$state,
'rank'=>10,
);
$GLOBALS['db']->insert('operations', $row);
if ('object'==$admin->table)
{
// ulozi se prava uzivatele k pristupu k objektu
$GLOBALS['db']->queryN('DELETE FROM objects_users WHERE id_object='.(int)$id.' AND id_user='.(int)$GLOBALS['user']['id']);
$row=array(
'id_object'=>(int)$id,
'id_user'=>(int)$GLOBALS['user']['id'],
);
$GLOBALS['db']->insert('objects_users', $row);
}
}
function document_upload($admin, $id)
{
$GLOBALS['db']->queryN('DELETE FROM operations WHERE admin_table=\''.addslashes($admin->table).'\' AND admin_id='.(int)$admin->id.' AND status=1 AND id_operation_type=3');
$tmp=$GLOBALS['db']->select('*', 'operations', 'admin_table=\''.addslashes($admin->table).'\' AND admin_id='.(int)$admin->id.' AND status=3 AND (id_operation_type=3 OR id_operation_type=2)', '1');
if (0==count($tmp))
{
if ('4'==$GLOBALS['user']['rights'])
{
$state=1;
}
else
{
$state=2;
}
$row=array(
'id_operation_type'=>3,
'id_user'=>(int)$GLOBALS['user']['id'],
'admin_table'=>addslashes($admin->table),
'admin_id'=>(int)$admin->id,
'state'=>(int)$state,
'rank'=>5,
);
$GLOBALS['db']->insert('operations', $row);
}
}
// zjisti zda PC HLASOVALO
function hlasoval($id){
if (isset($_COOKIE['ank_'.$id])){
return true;
}else return false;
}
// fce na kotrolu promene
function var_test(&$variable, $default, $pattern){
if ((isSet($variable)) && (eregi($pattern, trim(StripSlashes($variable)))))
return trim(StripSlashes($variable));
else
return $default;
}
// vypise text pokud je natavena promenna
function show($at, $text){
if ($at != false ){
return $text;
}else return;
}
function get_childs($category){
$db = new Db();
if ($category > 0){
$ichild = array();
$ichild [0] = $category;
for ($i=0;$i<count($ichild);$i++){
$tmp = $db->select(
'ot.id',
'object_types AS ot',
'ot.id_parent = '.$ichild[$i]
);
for ($j=0;$j<count($tmp);$j++){
$ichild[] = $tmp[$j]['id'];
}
}
}
return $ichild;
}
function get_auto_increment($table){
$tmp=$GLOBALS['db']->query('SHOW TABLE STATUS LIKE \''.addslashes($table).'\'');
return $tmp[0]['Auto_increment'];
}
// funkce, tera zkontroluje prava uzivatele a pripadne jej vyhosti na index.php
function allow($rights_str){
if (FALSE==in_array($GLOBALS['user']['rights'], explode(',', $rights_str)))
{
header('location: index.php');
die();
}
return TRUE;
}
function get_map_coords($map_borders, $map_size, $gps)
{
$east=$map_borders['east'];
$west=$map_borders['west'];
$south=$map_borders['south'];
$north=$map_borders['north'];
$map_width=$map_size['x'];
$map_height=$map_size['y'];
$sn=seconds($north);
$ss=seconds($south);
$cx=(seconds($east)+seconds($west))/2;
$cy=(seconds($north)+seconds($south))/2;
$width=(seconds($east)-seconds($west));
$height=($sn-$ss);
$x=($map_width/2-($cx-seconds($gps['x']))/$width*$map_width);
$x=round($x+($width/2-$x)*0.04);
$y=($map_height/2+($cy-seconds($gps['y']))/$height*$map_height);
$y=round($y+($height/2-$y)*0.04);
return array('x'=>$x, 'y'=>$y);
}
function documents($table, $id, $preview=0, $where=' AND f.active=\'Y\'')
{
$files=$GLOBALS['db']->select(
'f.*',
$table.'s_files AS of
LEFT JOIN files AS f ON (of.id_file=f.id)
',
'of.id_'.$table.'='.(int)$id.'
AND f.id!='.(int)$preview.'
'.$where.'
'
);
$files_str=$img_str='';
for ($i=0; $i<count($files); $i++)
{
if (TRUE==in_array($files[$i]['type'], $GLOBALS['image_types']))
{
$img_str.='
<a class="'.$table.'-img" href="'.$GLOBALS['ftp']['http_root'].'/'.$table.''.$id.'/'.$files[$i]['path'].'" onclick="return !showImage(\''.$GLOBALS['ftp']['http_root'].'/'.$table.''.$id.'/'.$files[$i]['path'].'\');">
<img src="'.$GLOBALS['ftp']['http_root'].'/'.$table.''.$id.'/thumb-s/'.$files[$i]['path'].'" alt="" />
</a>
';
}
else
{
$files_str.='<img src="/images/ico/'.$GLOBALS['icons'][$files[$i]['type']].'" alt="" style="float: left; padding-right: 5px;" /><a target="_blank" class="'.$icons[$files[$i]['type']].'" href="'.$GLOBALS['ftp']['http_root'].''.$table.''.$id.'/'.$files[$i]['path'].'">'.$files[$i]['name'].'</a><br />';
}
}
if (TRUE==$files_str)
{
$files_str='<p id="documents">
<b>Soubory ke staľení:</b><br />
'.$files_str.'
</p>
';
}
return array('images'=>$img_str, 'files'=>$files_str);
}
// $GLOBALS['db']->queryN('UPDATE operations SET status=1 WHERE admin_table=\''.addslashes($admin->table).'\' AND admin_id='.(int)$admin->id.' AND status=3 AND id_operation_type=2');
function convert_html_sequences($str) {
$r = $str;
$r = str_replace(" "," ", $r);
$r = str_replace("¡","!", $r);
$r = str_replace("¢","c", $r);
$r = str_replace("£","L", $r);
$r = str_replace("¤","¤", $r);
$r = str_replace("¥","Y", $r);
$r = str_replace("¦","Š", $r);
$r = str_replace("§","§", $r);
$r = str_replace("¨","¨", $r);
$r = str_replace("©","Ś", $r);
$r = str_replace("ª","a", $r);
$r = str_replace("«","Ť", $r);
$r = str_replace("¬","Ž", $r);
$r = str_replace("­","", $r);
$r = str_replace("®","Ź", $r);
$r = str_replace("¯","—", $r);
$r = str_replace("°","°", $r);
$r = str_replace("±","‘", $r);
$r = str_replace("²","2", $r);
$r = str_replace("³","3", $r);
$r = str_replace("´","´", $r);
$r = str_replace("µ","ś", $r);
$r = str_replace("¶","ť", $r);
$r = str_replace("·","ž", $r);
$r = str_replace("¸","¸", $r);
$r = str_replace("¹","1", $r);
$r = str_replace("º","o", $r);
$r = str_replace("»","ź", $r);
$r = str_replace("¼","1", $r);
$r = str_replace("½","1", $r);
$r = str_replace("¾","3", $r);
$r = str_replace("¿","?", $r);
$r = str_replace("À","A", $r);
$r = str_replace("Á","Á", $r);
$r = str_replace("Â","Â", $r);
$r = str_replace("Ã","A", $r);
$r = str_replace("Ä","Ä", $r);
$r = str_replace("Å","A", $r);
$r = str_replace("Æ","A", $r);
$r = str_replace("Ç","Ç", $r);
$r = str_replace("È","E", $r);
$r = str_replace("É","É", $r);
$r = str_replace("Ê","E", $r);
$r = str_replace("Ë","Ë", $r);
$r = str_replace("Ì","I", $r);
$r = str_replace("Í","Í", $r);
$r = str_replace("Î","Î", $r);
$r = str_replace("Ï","I", $r);
$r = str_replace("Ð","?", $r);
$r = str_replace("Ñ","N", $r);
$r = str_replace("Ò","O", $r);
$r = str_replace("Ó","Ó", $r);
$r = str_replace("Ô","Ô", $r);
$r = str_replace("Õ","O", $r);
$r = str_replace("Ö","Ö", $r);
$r = str_replace("×","×", $r);
$r = str_replace("Ø","O", $r);
$r = str_replace("Ù","U", $r);
$r = str_replace("Ú","Ú", $r);
$r = str_replace("Û","U", $r);
$r = str_replace("Ü","Ü", $r);
$r = str_replace("Ý","Ý", $r);
$r = str_replace("Þ","?", $r);
$r = str_replace("ß","ß", $r);
$r = str_replace("à","a", $r);
$r = str_replace("á","á", $r);
$r = str_replace("â","â", $r);
$r = str_replace("ã","a", $r);
$r = str_replace("ä","ä", $r);
$r = str_replace("å","a", $r);
$r = str_replace("æ","a", $r);
$r = str_replace("ç","ç", $r);
$r = str_replace("è","e", $r);
$r = str_replace("é","é", $r);
$r = str_replace("ê","e", $r);
$r = str_replace("ë","ë", $r);
$r = str_replace("ì","i", $r);
$r = str_replace("í","í", $r);
$r = str_replace("î","î", $r);
$r = str_replace("ï","i", $r);
$r = str_replace("ð","?", $r);
$r = str_replace("ñ","n", $r);
$r = str_replace("ò","o", $r);
$r = str_replace("ó","ó", $r);
$r = str_replace("ô","ô", $r);
$r = str_replace("õ","o", $r);
$r = str_replace("ö","ö", $r);
$r = str_replace("÷","÷", $r);
$r = str_replace("ø","o", $r);
$r = str_replace("ù","u", $r);
$r = str_replace("ú","ú", $r);
$r = str_replace("û","u", $r);
$r = str_replace("ü","ü", $r);
$r = str_replace("ý","ý", $r);
$r = str_replace("þ","?", $r);
$r = str_replace("ÿ","y", $r);
$r = str_replace("š","ą", $r);
$r = str_replace("„","\"", $r);
$r = str_replace("“","\"", $r);
$r = str_replace("Š","©", $r);
$r = str_replace("–","-", $r);
$r = str_replace("&rchar;","\r", $r);
return $r;
}
function logCheck()
{
global $admin;
$result=true;
if (TRUE==isset($_COOKIE['brpasswd']))
{
if ($_COOKIE['brpasswd']!=md5($admin['passwd']))
{
$result=false;
}
}
else
{
$result=false;
}
return $result;
}
function XMLStrFormat($str){
global $asc2uni;
$str = str_replace("&", "&", $str);
$str = str_replace("<", "<", $str);
$str = str_replace(">", ">", $str);
$str = str_replace("'", "'", $str);
$str = str_replace("\"", """, $str);
$str = str_replace("\r", "", $str);
$astr = @strtr($str,$asc2uni);
return $str;
}
?>
ACC SHELL 2018