Exemplo n.º 1
0
 function execute()
 {
     $list_form = new XTemplate('Home/List.html');
     $left_menu = $this->rmenu();
     $uId = get_userid();
     $infoArr = $this->fnc_get_user_info($type_id = 1, $value = $uId, $html = true);
     $gridview = $infoArr['html'];
     $list_form->assign('slide_bar', $this->slide_bar($left_menu));
     $list_form->assign('tabs', $this->set_tabs());
     $list_form->assign('gridview', $gridview);
     $list_form->assign('dialog_title', 'thành viên');
     $list_form->parse('main');
     $html = $list_form->out_return('main');
     echo $html;
 }
Exemplo n.º 2
0
 function fnc_get_user_info($type_id, $value, $html = false, $html_type = 0)
 {
     $detail_id = 0;
     $user_name = '';
     $user_code = '';
     switch ($type_id) {
         case 1:
             $detail_id = $value;
             break;
         case 2:
             $user_name = $value;
             break;
         case 3:
             $user_code = $value;
             break;
         default:
             break;
     }
     $arr_result['result'] = -1;
     if ($detail_id > 0 || $user_name != '' || $user_code != '') {
         $sSQL = "exec usp_user_info 0,'" . $user_name . "'," . (int) $detail_id . ",'" . $user_code . "'";
         $result = $this->db->query($sSQL, true, "Query failed");
         if ($aRow = $this->db->fetchByAssoc($result)) {
             $token_user = $this->md5sum($aRow['detail_id'] . $aRow['user_name'] . $aRow['position_id'] . $aRow['level_id']);
             $aRow['token_user'] = $token_user;
             $org_chart = $this->getOrgChart($aRow['dep_id']);
             $aRow['org_chart'] = $org_chart;
             $arr_result['result'] = 1;
             $arr_result['data'] = $aRow;
             if ($html) {
                 if ($html_type == 0) {
                     $list_form = new XTemplate('templates/user_info_1.html');
                 } else {
                     $list_form = new XTemplate('templates/user_info.html');
                 }
                 $list_form->assign('user_info', $aRow);
                 $list_form->assign('check_status_' . (int) $aRow['status'], 'checked="checked"');
                 $list_form->parse('main');
                 $html = $list_form->out_return('main');
                 $arr_result['html'] = $html;
             }
         }
     }
     return $arr_result;
 }