Example #1
0
function GetRecord($id = null)
{
    if ($id == null) {
        global $ID;
        $id = (int) $ID;
    } else {
        $id = (int) $id;
    }
    global $table;
    $prefix = isset($arg['prefix']) ? $arg['prefix'] : $table . '_';
    $rule = ' AND ' . GetRule();
    $model = new TModel($table, $prefix);
    $record = $model->GetRecord($id, $rule);
    return $record;
}
Example #2
0
     if (!isset($url[1])) {
         $url[1] = 'خطا';
     }
     $smarty->assign('title', $url[1] . '-' . $title);
     $smarty->display('header.tpl');
     $smarty->assign('msg', $url[1]);
     $smarty->display('message.tpl');
     break;
 case 'member':
     if ((int) $url[1] < 1) {
         $smarty->assign('title', '404 : چیزی  پیدا نشد  - ' . $title);
         $smarty->display('header.tpl');
         $smarty->display('404.tpl');
     } else {
         $m = new TModel('member', 'member_');
         $member = $m->GetRecord($url[1]);
         if ($member == FALSE) {
             $smarty->assign('title', '404 : چیزی  پیدا نشد  - ' . $title);
             $smarty->display('header.tpl');
             $smarty->display('404.tpl');
         } else {
             $smarty->assign('title', $member['member_name'] . '- نمایه عضو دپارتمان - ' . $title);
             $smarty->display('header.tpl');
             require './inc/member.php';
             $smarty->display('member.tpl');
         }
     }
     break;
 case 'err':
     $smarty->assign('err', $reg->GetValue(ROOT_SYSTEM, 'error'));
     $smarty->display('error.tpl');
Example #3
0
<?php

if (!isset($_COOKIE['mid'])) {
    Redirect('/msg/شما وارد نشده اید');
}
$topix = GetTopicByLiker($_COOKIE['mid'], 10);
$a = new TModel('member', 'member_');
$mem = $a->GetRecord($_COOKIE['mid']);
$rep = new TModel('report', 'report_');
$repz = $rep->Read('report_id,report_title', 99, 'report', 'report_');
$smarty->assign('topix', $topix);
$smarty->assign('left', floor(($_COOKIE['mact'] - time()) / (60 * 60 * 24)));
$smarty->assign('frindz', GetFrienz($_COOKIE['mid'], 999));
$smarty->assign('mem', $mem);
$smarty->assign('repz', $repz);