$path_parts = pathinfo($HTTP_SERVER_VARS['PHP_SELF']);
if (strtolower($path_parts['basename']) == 'site_functions.php')
{
exit;
}
// القائمة الرئيسية
function ShowMainMenu()
{
global $DB_site;
if (isset($_SESSION['user']))
{
$item = $DB_site->query_first('select user_balance from sms_user where user_id = ' . $_SESSION['user']);
PrintLoggedMenu();
return;
}
PrintVisitorMenu();
}
function PrintLoggedMenu()
{
global $DB_site;
$item = $DB_site->query_first('select user_balance from sms_user where user_id = ' . $_SESSION['user']);
echo '
';
echo '
الرصيد الحالي: ' . $item['user_balance'] . '
';
}
function PrintVisitorMenu()
{
echo '';
echo '
';
}
?>
$path_parts = pathinfo($HTTP_SERVER_VARS['PHP_SELF']);
if (strtolower($path_parts['basename']) == 'functions.php')
{
exit;
}
function RedirectPage($page)
{
echo "";
}
function StripHtml($text)
{
$search = array ("''si", // Strip out javascript
"'<[\/\!]*?[^<>]*?>'si", // Strip out html tags
"'&(quot|#34);'i", // Replace html entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'(\d+);'e"); // evaluate as php
$replace = array ("",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)");
return @preg_replace ($search, $replace, $text);
}
function print_javascript_message($msg, $flag = false)
{
echo '';
if ($flag == true)
{
echo '';
}
}
function print_message($msg)
{
echo '
' . $msg . '
';
}
function print_go_back($msg = 'عودة')
{
echo "$msg";
}
function print_link($url, $msg = CLICK_HERE)
{
echo "$msg";
}
/////////////////////////////////////////////////////////////////////////////////////
$perpage = 5; //عدد الصفوف في كل صفحة
function naifhreftag($url, $text, $title = '')
{
return '' . $text . '';
}
function ifelse($expression, $returntrue, $returnfalse)
{
if($expression) return $returntrue;
else return $returnfalse;
}
function naifpagelink($link, $page_bar, $pages, $char = '?')
{
global $template;
$pagelink = 'page: ';
if ($page_bar - 5 > 1)
{
$pagelink .= '[' . naifhreftag($link . $char . 'page_bar=1', '«', 'fisrt') . '] ';
}
if ($page_bar > 1)
{
$pagelink .= '[' . naifhreftag($link . $char . 'page_bar=' . ($page_bar - 1), '‹', 'prev') . '] ';
}
$count = ifelse($page_bar + 5 >= $pages, $pages, $page_bar + 5);
for ($i = $page_bar - 5; $i <= $count; $i++)
{
if ($i < 1)
{
$i = 1;
}
if ($i == $page_bar)
{
$pagelink .= "($i) ";
}
else
{
$pagelink .= '[' . naifhreftag($link . $char . 'page_bar=' . ($i), $i) . '] ';
}
}
if ($page_bar < $pages)
{
$pagelink .= '[' . naifhreftag($link . $char . 'page_bar=' . ($page_bar + 1) , '›', 'next' ) . ']';
}
if ($page_bar + 5 < $pages)
{
$pagelink .= '[' . naifhreftag($link . $char . 'page_bar=' . $pages, '»', 'final') . ']';
}
return $pagelink;
}
/////////////////////////////////////////////////////////////////////////////////////
function OpenRightBox($title = '')
{
}
function CloseRightBox()
{
}
function OpenLeftBox($title = '')
{
}
function CloseLeftBox()
{
}
function OpenCenterBox($title = '')
{
}
function CloseCenterBox()
{
}
function PrintHeader()
{
//echo 'هنا الهيدر';
}
function PrintFooter()
{
//echo 'هنا الفوتر';
echo '