if ($isfriend['fri'] == 0) {
        echo "<div class='showmag'><p>您没有关注此用户!</p><p><a href='index.php?op=friends'>返回我的关注</a></p></div>";
        wapfooter();
        exit;
    }
    if ($isfriend['fri'] == 1) {
        echo "<div class='showmag'><p>是否确认解除对" . $uname . "的关注?</p><p><a href='index.php?op=friends&act=delfriok&uid={$uid}'>确认</a> <a href='index.php?op=friends'>取消</a></p></div>";
        wapfooter();
        exit;
    }
}
//删除确认
if ($act == "delfriok") {
    $uid = $_GET['uid'];
    $uid = $_GET['uid'];
    $uname = idtoname($uid);
    if (!$uname) {
        echo "<div class='showmag'><p>该用户不存在或者已经被管理员删除!</p><p><a href='index.php?op=friends'>返回我的关注</a></p></div>";
        wapfooter();
        exit;
    }
    $isfriend = isfriend($uid, $user_id);
    if ($isfriend['fri'] == 0) {
        echo "<div class='showmag'><p>您没有关注此用户!</p><p><a href='index.php?op=friends'>返回我的关注</a></p></div>";
        wapfooter();
        exit;
    }
    if ($isfriend['fri'] == 1) {
        $db->query("DELETE FROM et_friend WHERE fid_fasong='{$user_id}' && fid_jieshou='{$uid}'");
        frinum($user_id);
        frinum($uid);
Example #2
0
        exit;
    }
    if ($isfriend['fri'] == 0) {
        $msg = "{$my['user_name']} 关注了你,你也去关注他吧,只有相互关注了才能成为好友哦!";
        $db->query("INSERT INTO et_messages  (js_id,fs_id,message_body,m_time) VALUES ('{$uid}','{$user_id}','{$msg}','{$addtime}')");
        $db->query("INSERT INTO et_friend  (fid_jieshou,fid_fasong) VALUES ('{$uid}','{$user_id}')");
        frinum($user_id);
        frinum($uid);
        echo "<div class='showmag'><p>关注好友成功!</p><p><a href='{$refer}'>返回上一页</a></p></div>";
        wapfooter();
        exit;
    }
}
//删除关注
if ($act == "jiechu") {
    if (!idtoname($uid)) {
        echo "<div class='showmag'><p>该用户不存在或者已经被管理员删除!</p><p><a href='{$refer}'>返回上一页</a></p></div>";
        wapfooter();
        exit;
    }
    $isfriend = isfriend($uid, $user_id);
    if ($isfriend['fri'] == 0) {
        echo "<div class='showmag'><p>您没有关注此用户!</p><p><a href='{$refer}'>返回上一页</a></p></div>";
        wapfooter();
        exit;
    }
    if ($isfriend['fri'] == 1) {
        $db->query("DELETE FROM et_friend WHERE fid_fasong='{$user_id}' && fid_jieshou='{$uid}'");
        frinum($user_id);
        frinum($uid);
        echo "<div class='showmag'><p>解除好友成功!</p><p><a href='{$refer}'>返回上一页</a></p></div>";
Example #3
0
function newaiinit_value($fields)
{
    global $common_html, $html_etc;
    global $return_sql_line, $db;
    global $_POST, $_GET, $ROWS_PAGE;
    global $action_add, $action_model, $mark;
    global $read_type, $email_filter, $returnmodel;
    global $sms_filter, $nullshow, $columns;
    global $primarykey_index;
    global $systemorder;
    global $tablename;
    //print $systemorder;
    $systemorderArray = explode(',', $systemorder);
    //echo '<br>';//by cwf
    //var_dump($systemorderArray);//by cwf ='0:desc'
    //var_dump($columns);//by cwf
    for ($xx = 0; $xx < sizeof($systemorderArray); $xx++) {
        $KeyOrderSqlIndexArray = explode(':', $systemorderArray[$xx]);
        //{0,desc} by cwf
        $KeyOrderSqlIndexName = $KeyOrderSqlIndexArray[0];
        // 0
        $KeyOrderSqlIndexOrderDesc = $KeyOrderSqlIndexArray[1];
        //desc
        $OrderSQLARRAY[$xx] = $columns[$KeyOrderSqlIndexName] . " " . $KeyOrderSqlIndexOrderDesc;
        //id desc
    }
    $OrderSQLText = join(' , ', $OrderSQLARRAY);
    //将数组转化成字符串,以,隔开。 =id desc
    if (TRIM($OrderSQLARRAY[0]) != "") {
        //判断移除特殊字符后的变量是否为空
        $systemorderText = $OrderSQLText;
        //id desc
    } else {
        if ($systemorder != "") {
            $systemorder1 = "asc";
        } else {
            $systemorder1 = "desc";
        }
        $systemorderText = $primarykey_index . " {$systemorder1}";
    }
    //print $systemorderText;
    switch ($db->databaseType) {
        case 'mssql':
            if (isset($_GET[ordername]) && in_array($_GET[ordername], $columns)) {
                if ($_GET[doubletime] % 2 == 0) {
                    $addsql = "order by [" . $_GET[ordername] . "] asc";
                } else {
                    $addsql = "order by [" . $_GET[ordername] . "] desc";
                }
            } else {
                $addsql = "order by [" . $primarykey_index . "] {$systemorder1}";
            }
            break;
        case 'mysql':
        default:
            if (isset($_GET[ordername]) && in_array($_GET[ordername], $columns)) {
                if ($_GET[doubletime] % 2 == 0) {
                    $addsql = "order by " . $_GET[ordername] . " asc";
                } else {
                    $addsql = "order by " . $_GET[ordername] . " desc";
                }
            } else {
                $addsql = "order by {$systemorderText}";
            }
            break;
    }
    //end switch
    //判断是否进行搜索设定
    if ($action_add == 'search') {
        $SQL = $return_sql_line['uniquekey_sql_search'] . " " . $addsql;
        $SQL_NUM = $return_sql_line['uniquekey_sql_num_search'];
        $SQL_SUM = $return_sql_line['uniquekey_sql_sum_search'];
    } else {
        $SQL = $return_sql_line['uniquekey_sql'] . " " . $addsql;
        $SQL_NUM = $return_sql_line['uniquekey_sql_num_get'];
        $SQL_SUM = $return_sql_line['uniquekey_sql_sum_get'];
    }
    global $NEWAIINIT_VALUE_SYSTEM;
    global $NEWAIINIT_VALUE_SYSTEM_NUM;
    global $NEWAIINIT_VALUE_SYSTEM_SUM;
    if (strlen($NEWAIINIT_VALUE_SYSTEM) > 10) {
        $SQL = $NEWAIINIT_VALUE_SYSTEM;
        $SQL_NUM = $NEWAIINIT_VALUE_SYSTEM_NUM;
        $SQL_SUM = $NEWAIINIT_VALUE_SYSTEM_SUM;
    }
    global $SYSTEM_MODE, $SYSTEM_PRINT_SQL;
    //print_R($SYSTEM_MODE);
    //print_R($return_sql_line);exit;
    //print_R($return_sql_line);
    if ($SYSTEM_PRINT_SQL) {
        $SYSTEM_PRINT_SQL = $SQL;
        print_R($SQL);
        print "<HR>";
        print_R($_GET);
        print "<HR>";
        //print_R($_SESSION);
        //print "<HR>";
    }
    //print_R($SQL_SUM);EXIT;
    global $rc;
    $rs =& $db->CacheExecute(5, $SQL_NUM);
    $rs_a = $rs->GetArray();
    $rc = $rs_a[0]['num'];
    if ($rc == '') {
        $rc = $rs_a[0]['NUM'];
    }
    //求和开始 2011-01-31日支持数组
    global $UserSumFunction;
    //print $UserSumFunction;exit;
    $UserSumFunctionArray = explode(',', $UserSumFunction);
    $SQL_SUM_原始 = $SQL_SUM;
    for ($ixx = 0; $ixx < sizeof($UserSumFunctionArray); $ixx++) {
        $UserSumFunctionTEMP = $UserSumFunctionArray[$ixx];
        if ($UserSumFunctionTEMP != "") {
            $UserSumFunctionTEMP = $columns[$UserSumFunctionTEMP];
            //有些字段职员看不到汇总
            if ($fields['INPUT_TEXT'][$UserSumFunctionTEMP] == "private") {
                $grade = str_split($fields['inputsize'][$UserSumFunctionTEMP]);
                if (!in_array($_SESSION['LOGIN_USER_PRIV'], $grade)) {
                    continue;
                }
            }
            $SQL_SUM = eregi_replace("___", $UserSumFunctionTEMP, $SQL_SUM_原始);
            //print $SQL_SUM;//exit;
            $rs_sum =& $db->CacheExecute(15, $SQL_SUM);
            $sum_number = $rs_sum->fields['sum'];
            $UserSumFunctionTEMP = $html_etc[$fields['tablename']][$UserSumFunctionTEMP];
            $fields['other']['sum_number'][$UserSumFunctionTEMP] = is_float($sum_number + 0) ? number_format($sum_number, 2, '.', ',') : $sum_number;
        }
    }
    //求和结束
    if ($rc == 0 && $nullshow != 1) {
        $return = "location='?action=init_" . $mark . "'";
        $showtext = $common_html['common_html']['norecord'];
        $location_title = 'sunshine_inside';
        $action_array_temp = explode('_', $_GET['action']);
        if ($action_array_temp[1] == 'customer') {
        } else {
            if ($email_filter != '') {
                $return = isset($returnmodel) ? "location='?action=" . $returnmodel . "'" : "history.back();";
                $showtext = $common_html['common_html']["nomail" . $mark];
            } else {
                if ($sms_filter != '') {
                    $return = isset($returnmodel) ? "location='?action=" . $returnmodel . "'" : "history.back();";
                    $showtext = $common_html['common_html']["nosms" . $mark];
                } else {
                    //page_css('system');
                    //$action_model='add_default:new:n';
                    //show_new_element($action_model);
                }
            }
        }
        print_infor($showtext, 'trip', "{$return}");
        exit;
    }
    if ($ROWS_PAGE <= 0) {
        $pagenums = 0;
    } else {
        $pagenums = ceil($rc / $ROWS_PAGE);
        $pageid = $_GET['pageid'];
    }
    if ($pageid == "" || empty($pageid)) {
        $pageid = 1;
    }
    if ($pageid > $pagenums) {
        $pageid = $pagenums;
    }
    $from = ($pageid - 1) * $ROWS_PAGE;
    //print $SQL;print $SQL_NUM;
    global $SYSTEM_SQL;
    $SYSTEM_SQL = $SQL;
    //print_r($SQL);
    $rsl = $db->SelectLimit($SQL, $ROWS_PAGE, $from);
    $rsa = $rsl->GetArray();
    //print_R($rsa[0]);
    @($fields['header'] = array_keys($rsa[0]));
    $fields['sql']['SQL'] = $SQL;
    $fields['sql']['SQL_NUM'] = $SQL_NUM;
    $fields['value'] = $rsa;
    //print_R(array_keys($rsa[0]));
    //print_R($fields['value']);
    $counter = 0;
    //行数增加
    //是否引入图片放大脚本
    $ifincludemaginfier = false;
    //2011-06-21初始化编辑与删除权限的值
    $fields['view_priv'][$counter] = 0;
    $fields['edit_priv'][$counter] = 0;
    $fields['delete_priv'][$counter] = 0;
    $fields['value2'] = $fields['value'];
    foreach ($fields['value'] as $list) {
        //print_R($list);exit;
        //print $tablename;
        $i = 0;
        //
        global $showlistfieldstopedit;
        $showlistfieldstopeditArray = explode(',', $showlistfieldstopedit);
        global $showlistfieldstopdelete;
        $showlistfieldstopdeleteArray = explode(',', $showlistfieldstopdelete);
        foreach ($fields['name'] as $list_index) {
            $mode = $fields['filter'][$i];
            //在此判断是否在专业科科长权限,如果是,则不显示USER_DEFINE字段
            if ($_SESSION['SUNSHINE_BANJI_LIST'] != "") {
                if ($mode == 'userdefine') {
                    $mode = 'input';
                    //设置为INPUT则不会显示增加操作的连接
                }
            }
            //2011-06-20 处理针对行的编辑和删除按钮的禁用权限处理,兼容用户自定义部分的权限控制
            //用户权限定义部分
            //得到X列Y行的值
            $filtervalue = $fields['value'][$counter][$list_index];
            $showlistfieldstopeditArrayCheckArray = explode(':', $showlistfieldstopeditArray[$i]);
            //print_R($showlistfieldstopeditArrayCheckArray);
            if (in_array($filtervalue, $showlistfieldstopeditArrayCheckArray) && $filtervalue != "") {
                $fields['edit_priv'][$counter] = 1;
            } else {
                //兼容旧的返回结果
                //$fields['edit_priv'][$counter] = 0;
            }
            $filtervalue = $fields['value'][$counter][$list_index];
            $showlistfieldstopdeleteArrayCheckArray = explode(':', $showlistfieldstopdeleteArray[$i]);
            if (in_array($filtervalue, $showlistfieldstopdeleteArrayCheckArray) && $filtervalue != "") {
                $fields['delete_priv'][$counter] = 1;
            } else {
                //兼容旧的返回结果
                //$fields['delete_priv'][$counter] = 0;
            }
            $i++;
            //列数增加
            //exit($mode);
            if (stristr($mode, 'color')) {
                $hascolor = true;
            } else {
                $hascolor = false;
            }
            switch ($mode) {
                case '':
                case 'input':
                case 'autoincrement':
                case 'autoincrementdate':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    break;
                case 'number':
                    $filtervalue = "<div align=right>" . $fields['value'][$counter][$list_index] . "</div>";
                    break;
                case 'money':
                    $filtervalue = "<div align=right>" . number_format(floatval($fields['value'][$counter][$list_index]), 2) . "</div>";
                    break;
                case 'password':
                    $filtervalue = "******";
                    break;
                case 'password_simple':
                    $filtervalue = "******";
                    break;
                case 'ajaxinput':
                    global $sessionkey;
                    $INPUT_TEXT = $fields['INPUT_TEXT'][$list_index];
                    if ($INPUT_TEXT == "") {
                        $INPUT_SIZE = 15;
                    } else {
                        $INPUT_SIZE = $INPUT_TEXT;
                    }
                    //print $sessionkey;
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $AjaxID = $fields['value'][$counter][$primarykey_index];
                    $openDir = "sessionkey={$sessionkey}&action=jiyun512&tablename={$tablename}&primarykey={$primarykey_index}&IDValue={$AjaxID}&FieldName={$list_index}";
                    if (is_file("newai_ajax.php")) {
                        $TempDirPath = "./";
                    } else {
                        if (is_file("../../Framework/newai_ajax.php")) {
                            $TempDirPath = "../../Framework/";
                        } else {
                            $TempDirPath = '';
                        }
                    }
                    $openDir = $TempDirPath . "newai_ajax.php?" . base64_encode($openDir);
                    $filtervalue = "<input type=\"text\" class=\"SmallInput\" size=\"{$INPUT_SIZE}\"  value=\"" . $filtervalue . "\"\n\t\t\t\tonBlur=\"GetResult('" . $openDir . "&FieldValue='+this.value);\"\n\t\t\t\tonkeypress=\"GetResult('" . $openDir . "&FieldValue='+this.value);\"\n\t\t\t\tonchange=\"GetResult('" . $openDir . "&FieldValue='+this.value);\"\n\t\t\t\t>";
                    $filtervalue = $filtervalue;
                    break;
                case 'ajaxinputhidden':
                    global $sessionkey;
                    $INPUT_TEXT = $fields['INPUT_TEXT'][$list_index];
                    if ($INPUT_TEXT == "") {
                        $INPUT_SIZE = 15;
                    } else {
                        $INPUT_SIZE = $INPUT_TEXT;
                    }
                    //print $sessionkey;
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $AjaxID = $fields['value'][$counter][$primarykey_index];
                    $openDir = "sessionkey={$sessionkey}&action=jiyun512&tablename={$tablename}&primarykey={$primarykey_index}&IDValue={$AjaxID}&FieldName={$list_index}";
                    if (is_file("newai_ajax.php")) {
                        $TempDirPath = "./";
                    } else {
                        if (is_file("../../Framework/newai_ajax.php")) {
                            $TempDirPath = "../../Framework/";
                        } else {
                            $TempDirPath = '';
                        }
                    }
                    $openDir = $TempDirPath . "newai_ajax.php?" . base64_encode($openDir);
                    //$filtervalue="<input type=\"text\" class=\"SmallInput\" size=\"$INPUT_SIZE\"  value=\"".$filtervalue."\" onkeyup=\"GetResult('".$openDir."&FieldValue='+this.value);\">";
                    if (TRIM($filtervalue) != "") {
                        $SpanInputText = "";
                    } else {
                        $SpanInputText = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                    }
                    $filtervalue = "<SPAN onclick=\"listTable_edit(this,'{$list_index}',{$AjaxID},'{$sessionkey}','{$tablename}','{$primarykey_index}','{$AjaxID}','{$list_index}','{$openDir}')\">" . $filtervalue . $SpanInputText . "</SPAN>";
                    break;
                case 'ajaxboolean':
                    global $sessionkey;
                    $INPUT_TEXT = $fields['INPUT_TEXT'][$list_index];
                    if ($INPUT_TEXT == "") {
                        $INPUT_SIZE = 15;
                    } else {
                        $INPUT_SIZE = $INPUT_TEXT;
                    }
                    //print $sessionkey;
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $AjaxID = $fields['value'][$counter][$primarykey_index];
                    $openDir = "action=jiyun512&tablename={$tablename}&primarykey={$primarykey_index}&IDValue={$AjaxID}&sessionkey={$sessionkey}&FieldName={$list_index}";
                    if (is_file("newai_ajax.php")) {
                        $TempDirPath = "./";
                    } else {
                        if (is_file("../../newai_ajax.php")) {
                            $TempDirPath = "../../Framework/";
                        } else {
                            $TempDirPath = '';
                        }
                    }
                    if (is_file("images/error.gif")) {
                        $PicDirPath = "./";
                    } else {
                        $PicDirPath = "../../Framework/";
                    }
                    $openDir = $TempDirPath . "newai_ajax.php?" . base64_encode($openDir);
                    //$filtervalue="<input type=\"text\" class=\"SmallInput\" size=\"$INPUT_SIZE\"  value=\"".$filtervalue."\" onkeyup=\"GetResult('".$openDir."&FieldValue='+this.value);\">";
                    if ($filtervalue == "1") {
                        $filtervalue = "<img onclick=\"listTable_boolean(this,'{$list_index}',{$AjaxID},'{$sessionkey}','{$tablename}','{$primarykey_index}','{$AjaxID}','{$list_index}','{$openDir}')\" src=\"" . $PicDirPath . "images/right.gif\" border=0>";
                    } else {
                        $filtervalue = "<img onclick=\"listTable_boolean(this,'{$list_index}',{$AjaxID},'{$sessionkey}','{$tablename}','{$primarykey_index}','{$AjaxID}','{$list_index}','{$openDir}')\" src=\"" . $PicDirPath . "images/error.gif\" border=0>";
                    }
                    break;
                case 'avatar':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $filepath = "images/avatar/{$filtervalue}.gif";
                    if (is_file($filepath)) {
                        $filtervalue = "<img src=\"{$filepath}\" border=0>";
                    } else {
                        $filtervalue = "<img src=\"images/avatar/9.gif\" border=0>";
                    }
                    break;
                case 'textarea':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $filtervalue = strip_tags(htmlspecialchars_decode($filtervalue));
                    if (cutStr($filtervalue, 25) != $filtervalue) {
                        $filtervalue = "<font title='{$filtervalue}'>" . cutStr($filtervalue, 25) . "</font>" . "...";
                    }
                    break;
                case 'textareabr':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $filtervaluetext = addslashes($filtervalue);
                    if (cutStr($filtervalue, 25) != $filtervalue) {
                        $filtervalue = "<font title='{$filtervaluetext}'>" . cutStr($filtervalue, 25) . "</font>" . "...";
                    }
                    //if(strlen($filtervalue)>50)	$filtervalue=substr($filtervalue,0,50)."...";
                    break;
                case 'readonlytextarea':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $filtervaluetext = addslashes($filtervalue);
                    if (cutStr($filtervalue, 25) != $filtervalue) {
                        $filtervalue = "<font title='{$filtervaluetext}'>" . cutStr($filtervalue, 25) . "</font>" . "...";
                    }
                    break;
                case 'idtoname_user':
                    $filtervalue = idtoname($fields['value'][$counter][$list_index], $mode = 'user');
                    break;
                case 'idtoname_course':
                    $filtervalue = idtoname($fields['value'][$counter][$list_index], $mode = 'course');
                    break;
                case 'idtoname_YuanXi':
                    $filtervalue = idtoname($fields['value'][$counter][$list_index], $mode = 'YuanXi');
                    break;
                case 'idtoname_dept':
                    $filtervalue = idtoname($fields['value'][$counter][$list_index], $mode = 'dept');
                    //$filtervalue=$fields['value'][$counter][$list_index];
                    break;
                case 'colorselect':
                    $filtervalue = "<div  style=\"border:1px double #000000;width:16px;height:16px;background-color:{$filtervalue};overflow:hidden;\"></div>";
                    break;
                case 'date':
                case 'date1':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    break;
                case 'dateonly':
                    $filtervalue_Array = explode(' ', $fields['value'][$counter][$list_index]);
                    $filtervalue = $filtervalue_Array[0];
                    break;
                case 'timeonly':
                    $filtervalue_Array = explode(' ', $fields['value'][$counter][$list_index]);
                    $filtervalue = $filtervalue_Array[1];
                    break;
                case 'datetime':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    break;
                case 'url':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $urlfield = $fields['INPUT_TEXT'][$list_index];
                    $urlid = $fields['inputsize'][$list_index];
                    if ($filtervalue != '' && $urlid != '') {
                        $filtervalue = $filtervalue . "-" . $fields['value'][$counter][$urlid];
                    }
                    $url = $fields['value'][$counter][$urlfield];
                    $urlarray = explode("?", $url);
                    $urlarray[1] = str_ireplace("&amp;", "&", $urlarray[1]);
                    $url = $urlarray[0] . "?" . base64_encode($urlarray[1]);
                    $filtervalue = "<a href=\"{$url}\" target=_blank >{$filtervalue}</a>";
                    break;
                case 'mulcheckbox':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $subtablename = $fields['INPUT_TEXT'][$list_index];
                    $subkey = $fields['inputsize'][$list_index];
                    $subval = $fields['inputother'][$list_index];
                    $subcolums = returntablecolumn($subtablename);
                    $subkey = $subcolums[$subkey];
                    $subval = $subcolums[$subval];
                    $fieldValueArray = explode(",", $filtervalue);
                    array_pop($fieldValueArray);
                    $fieldValueArrayTEXT = join("','", $fieldValueArray);
                    $sql = "select {$subval} from {$subtablename} where {$subkey} in ('{$fieldValueArrayTEXT}')";
                    $rsxx = $db->CacheExecute(5, $sql);
                    $rsxxA = $rsxx->GetArray();
                    $fieldValueNameText = '';
                    for ($iD = 0; $iD < sizeof($rsxxA); $iD++) {
                        $fieldValueNameText .= $rsxxA[$iD][$subval] . ",";
                    }
                    //for($iD=0;$iD<sizeof($fieldValueArray);$iD++)			{
                    //	$fieldValueArrayValue = $fieldValueArray[$iD];
                    //	if($fieldValueArrayValue!="")
                    //		$fieldValueNameText .= returntablefield("user","USER_ID",$fieldValueArrayValue,"USER_NAME").",";
                    //}
                    $filtervalue = $fieldValueNameText;
                    break;
                case 'file':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $filtervalue_file = explode('=', $filtervalue);
                    $filtervalue_sizeof = sizeof($filtervalue_file) - 1;
                    $filename = $filtervalue_file[$filtervalue_sizeof];
                    $filtervalue = "<a href=\"{$filtervalue}\">{$filename}</a>";
                    break;
                case 'singlefile':
                case 'picturefile':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $var_value = ereg_replace("&amp;", "&", $filtervalue);
                    //print $filtervalue;
                    $parse_url = parse_url($var_value);
                    $query = $parse_url['query'];
                    parse_str($query, $output);
                    //print_R($output);
                    $attachmentid = $output['attachmentid'];
                    $attachmentname = $output['attachmentname'];
                    $filtervalue_file = explode('=', $filtervalue);
                    $filtervalue_sizeof = sizeof($filtervalue_file) - 1;
                    $filename = $filtervalue_file[$filtervalue_sizeof];
                    $filename_newfile = "../../attachment/{$attachmentid}/{$attachmentname}";
                    $filename_newfile2 = "../../Framework/attachment/{$attachmentid}/{$attachmentname}";
                    //print $filename_newfile;
                    //print_R(is_file($filename_newfile));
                    if (is_file($filename_newfile) || is_file($filename_newfile2)) {
                        $filtervalue = trim($fields['value'][$counter][$list_index]);
                        $filtervalue_file = explode('=', $filtervalue);
                        $filtervalue_sizeof = sizeof($filtervalue_file) - 1;
                        $filename = $filtervalue_file[$filtervalue_sizeof];
                        //$filtervalue = "<a href='".$filtervalue."'>$filename</a>";
                        if (!$ifincludemaginfier) {
                            print "<script type=\"text/javascript\" language=\"javascript\" src=\"" . ROOT_DIR . "general/ERP/Enginee/jquery/jquery.js\"></script>";
                            print "<script type=\"text/javascript\" language=\"javascript\" src=\"" . ROOT_DIR . "general/ERP/Enginee/jquery/jquery.magnifier.js\"></script>";
                            $ifincludemaginfier = true;
                        }
                        $image = "<img src='" . $filtervalue . "' height=25  class=\"magnify\"  data-magnifyto=\"500\" onmouseover=\"this.style.cursor='pointer';this.style.cursor='hand'\" onmouseout=\"this.style.cursor='default'\">";
                        //$filtervalue = "<a href='".$filtervalue."'>$image</a>";
                        $filtervalue = $image;
                    } else {
                        $filtervalue = "";
                    }
                    break;
                case 'tdoafile':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $var_value_array = explode('||', $filtervalue);
                    $ATTACHMENT_ID = $var_value_array[1];
                    $ATTACHMENT_NAME = $var_value_array[0];
                    $ATTACHMENT_ID_ARRAY = explode(",", $ATTACHMENT_ID);
                    $ATTACHMENT_NAME_ARRAY = explode("*", $ATTACHMENT_NAME);
                    $ATTACH_LINK = '';
                    require_once 'lib/utility_file.php';
                    $MODULE = attach_sub_dir();
                    for ($IX = 0; $IX < count($ATTACHMENT_ID_ARRAY); $IX++) {
                        if ($ATTACHMENT_ID_ARRAY[$IX] != "") {
                            $ATTACH_IMAGE = image_mimetype($ATTACHMENT_NAME_ARRAY[$IX]);
                            //print $ATTACH_IMAGE;
                            $ATTACHMENT_ID = $ATTACHMENT_ID_ARRAY[$IX];
                            //print_R($ATTACHMENT_ID);
                            $ATTACHMENT_ID_ARRAY2 = explode('_', $ATTACHMENT_ID);
                            $YM = $ATTACHMENT_ID_ARRAY2[0];
                            $ATTACHMENT_ID = $ATTACHMENT_ID_ARRAY2[1];
                            $SIGN_KEY = "";
                            //$SIGN_KEY = substr( $ATTACHMENT_ID, strpos( $ATTACHMENT_ID, "." ) + 1 );
                            //$ATTACHMENT_ID = substr( $ATTACHMENT_ID, 0, strpos( $ATTACHMENT_ID, "." ) );
                            //print_R($ATTACHMENT_ID);
                            $ATTACHMENT_ID_ENCODED = attach_id_encode($ATTACHMENT_ID, $ATTACHMENT_NAME_ARRAY[$IX]);
                            $ATTACH_SIZE = attach_size($ATTACHMENT_ID_ARRAY[$IX], $ATTACHMENT_NAME_ARRAY[$IX], $MODULE);
                            if (0 < floor($ATTACH_SIZE / 1024 / 1024)) {
                                $ATTACH_SIZE = round($ATTACH_SIZE / 1024 / 1024, 2) . "MB";
                            } else {
                                if (0 < floor($ATTACH_SIZE / 1024)) {
                                    $ATTACH_SIZE = round($ATTACH_SIZE / 1024, 2) . "KB";
                                } else {
                                    $ATTACH_SIZE .= "字节";
                                }
                            }
                            $ATTACH_LINK .= "<img src=\"../../Framework/images/attach/" . $ATTACH_IMAGE . "\" align=\"absmiddle\"\n\t\t\t\t\t\t\ttitle='" . urldecode($ATTACHMENT_NAME_ARRAY[$IX]) . " 大小:{$ATTACH_SIZE}'><a href=\"../../Enginee/lib/attach.php?MODULE=" . $MODULE . "&YM=" . $YM . "&ATTACHMENT_ID=" . $ATTACHMENT_ID_ENCODED . "&ATTACHMENT_NAME=" . urlencode($ATTACHMENT_NAME_ARRAY[$IX]) . "\" " . ($ATTACH_OFFICE_OPEN_IN_IE ? " target=\"_blank\"" : "") . "\n\t\t\t\t\t\t\ttitle='" . urldecode($ATTACHMENT_NAME_ARRAY[$IX]) . " 大小:{$ATTACH_SIZE}'\n\t\t\t\t\t\t\t>" . urldecode($ATTACHMENT_NAME_ARRAY[$IX]) . "</a>\n";
                        }
                    }
                    $filtervalue = $ATTACH_LINK;
                    break;
                case 'binaryfile':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $filtervalue_file = explode('=', $filtervalue);
                    $filtervalue_sizeof = sizeof($filtervalue_file) - 1;
                    $filename = $filtervalue_file[$filtervalue_sizeof];
                    $filtervalue = "<a href=\"{$filtervalue}\">{$filename}</a>";
                    break;
                case 'sex':
                    $filtervalue = returnsexcolor($fields['value'][$counter][$list_index]);
                    break;
                case 'select_sex':
                    $filtervalue = returnsexcolor($fields['value'][$counter][$list_index]);
                    break;
                case 'boolean':
                    $filtervalue = returnboolean_gif($fields['value'][$counter][$list_index]);
                    break;
                case 'checkbox':
                    $filtervalue = returncheckbox($fields['value'][$counter][$list_index]);
                    break;
                case 'select_sms':
                    $filtervalue = return_select_filter('select_sms', $fields['value'][$counter][$list_index]);
                    break;
                case 'select_education':
                    $filtervalue = return_select_filter('select_education', $fields['value'][$counter][$list_index]);
                    break;
                case 'select_marriage':
                    $filtervalue = return_select_filter('select_marriage', $fields['value'][$counter][$list_index]);
                    break;
                case 'select_politics':
                    $filtervalue = return_select_filter('select_politics', $fields['value'][$counter][$list_index]);
                    break;
                case 'sms_self_status':
                    $filtervalue = return_select_filter('sms_self_status', $fields['value'][$counter][$list_index]);
                    break;
                case 'sms_delete_status':
                    $filtervalue = return_select_filter('sms_delete_status', $fields['value'][$counter][$list_index]);
                    break;
                case 'select_worklog':
                    $filtervalue = return_select_filter('select_worklog', $fields['value'][$counter][$list_index]);
                    break;
                case 'email_read_status_inbox':
                    $filtervalue = return_select_filter('email_read_status_inbox', $fields['value'][$counter][$list_index]);
                    break;
                case 'email_read_status_outbox':
                    $filtervalue = return_select_filter('email_read_status_outbox', $fields['value'][$counter][$list_index]);
                    break;
                case 'email_delete_status_outbox':
                    $filtervalue = return_select_filter('email_delete_status_outbox', $fields['value'][$counter][$list_index]);
                    break;
                case 'ajax':
                    $filtervalue = ajaxtablefield($fields['select'][$i - 1]['tablename'], $fields['select'][$i - 1]['value'], $fields['value'][$counter][$list_index], $fields['select'][$i - 1]['field'], $counter, $fields['tablename'], $fields['name'][$i - 1], $primarykey_index, $fields['value'][$counter][$primarykey_index]);
                    break;
                case 'select':
                    $filtervalue = returntablefield($fields['select'][$i - 1]['tablename'], $fields['select'][$i - 1]['value'], $fields['value'][$counter][$list_index], $fields['select'][$i - 1]['field']);
                    break;
                case 'radio':
                    $filtervalue = returntablefield($fields['select'][$i - 1]['tablename'], $fields['select'][$i - 1]['value'], $fields['value'][$counter][$list_index], $fields['select'][$i - 1]['field']);
                    //print_R($fields['select'][$i-1]);;
                    break;
                case 'radiogroup':
                    $filtervalue = returntablefieldColorFilterGray($fields['select'][$i - 1]['tablename'], $fields['select'][$i - 1]['value'], $fields['value'][$counter][$list_index], $fields['select'][$i - 1]['field'], $fields['select'][$i - 1]['groupfield'], $fields['select'][$i - 1]['groupvalue'], '', '', '', $hascolor);
                    break;
                case 'selectcolor':
                    $filtervalue = returntablefieldColorFilterGray($fields['select'][$i - 1]['tablename'], $fields['select'][$i - 1]['value'], $fields['value'][$counter][$list_index], $fields['select'][$i - 1]['field'], '', '', '', $hascolor);
                    break;
                case 'select_input':
                    $value = $fields['value'][$counter][$list_index];
                    $filtervalue = returntablefield($fields['select'][$i - 1]['tablename'], $fields['select'][$i - 1]['value'], $fields['value'][$counter][$list_index], $fields['select'][$i - 1]['field']);
                    break;
                case 'select_textarea':
                    $value = $fields['value'][$counter][$list_index];
                    $filtervalue = idtoname($value, $mode = 'dept');
                    //returntablefield($fields['select'][$i-1]['tablename'],$fields['select'][$i-1]['value'],$fields['value'][$counter][$list_index],$fields['select'][$i-1]['field']);
                    break;
                case 'checkread':
                    $index_key = $fields['table']['primarykeyindex'];
                    $index_key = $fields['value'][$counter][$index_key];
                    $in_array = checkread_username('checkread', $fields['checkread'][$i - 1]['field'], $index_key);
                    $in_array = $in_array == 1 ? 1 : 0;
                    $filtervalue = return_select_filter('notify_read_status', $in_array);
                    break;
                case 'usertonamelist':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $fieldValueArray = explode(",", $filtervalue);
                    array_pop($fieldValueArray);
                    $fieldValueArrayTEXT = join("','", $fieldValueArray);
                    $sql = "select UID,USER_NAME from user where USER_ID in ('{$fieldValueArrayTEXT}') order by USER_NAME";
                    $rsxx = $db->CacheExecute(5, $sql);
                    $rsxxA = $rsxx->GetArray();
                    $fieldValueNameText = '';
                    for ($iD = 0; $iD < sizeof($rsxxA); $iD++) {
                        $fieldValueNameText .= "<a target='_blank' href='../Framework/user_newai.php?action=view_default&UID=" . $rsxxA[$iD]['UID'] . "'>" . $rsxxA[$iD]['USER_NAME'] . "</a>,";
                    }
                    //for($iD=0;$iD<sizeof($fieldValueArray);$iD++)			{
                    //	$fieldValueArrayValue = $fieldValueArray[$iD];
                    //	if($fieldValueArrayValue!="")
                    //		$fieldValueNameText .= returntablefield("user","USER_ID",$fieldValueArrayValue,"USER_NAME").",";
                    //}
                    $filtervalue = $fieldValueNameText;
                    //$filtervalue="<font title='$fieldValueNameText'>".$fieldValueNameText."</font>"."...";
                    break;
                case 'link':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $url = $fields['link'][$i - 1]['url'];
                    $target = $fields['link'][$i - 1]['target'];
                    $filename = $fields['link'][$i - 1]['filename'];
                    $index_key = $fields['table']['primarykeyindex'];
                    $filtervalue = "<a href='{$filename}?" . base64_encode("action={$url}&{$index_key}=" . $fields['value'][$counter][$index_key]) . "' target={$target}>{$filtervalue}</a>";
                    //$filtervalue="<a href='$filename?action=$url&$list_index=$filtervalue&$index_key=".$fields['value'][$counter][$index_key]."' target=$target>$filtervalue</a>";
                    break;
                case 'mobile':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $regex = "/1[34568]+\\d{9}/";
                    preg_match_all($regex, $filtervalue, $phones);
                    if (strlen($phones[0][0]) == 11) {
                        $filtervalue = "<a href='../JXC/sms_sendlist_newai.php?" . base64_encode("action=add_default&sendlist=" . $phones[0][0]) . "' target='_blank'>{$filtervalue}</a>";
                    }
                    break;
                case 'qq':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $filtervalue = !empty($filtervalue) ? "<a target=\"_blank\" href=\"http://wpa.qq.com/msgrd?v=3&amp;uin=" . $filtervalue . "&amp;site=qq&amp;menu=yes\"><img border=\"0\" src=\"http://wpa.qq.com/pa?p=2:" . $filtervalue . ":45\" title=\"点击这里发消息\" onerror=\"this.src='" . ROOT_DIR . "general/ERP/Framework/images/help3.gif';this.title='此QQ号码可能不存在'\">" . $filtervalue . "</a>" : '';
                    break;
                case 'email':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    if ($fields['tablename'] == 'linkman') {
                        $fromsrc = 'customer';
                        $linkman = gettablefield($fields['tablename'], 'email', 'rowid', $filtervalue);
                    } else {
                        if ($fields['tablename'] == 'supplylinkman') {
                            $fromsrc = 'supply';
                            $linkman = gettablefield($fields['tablename'], 'email', 'rowid', $filtervalue);
                        } else {
                            $linkman = $filtervalue;
                            $fromsrc = '';
                        }
                    }
                    $filtervalue = "<a href='../CRM/email_newai.php?" . base64_encode("action=add_default&sendlist=" . $linkman . "&fromsrc=" . $fromsrc) . "' target='_blank' >" . $filtervalue . "</a>";
                    break;
                case 'userdefine':
                    $filtervalue = $fields['value'][$counter][$list_index];
                    $functionName = $fields['userdefine'][$i - 1];
                    $fileName = $functionName . ".php";
                    $fileName0 = "userdefine/{$fileName}";
                    $fileName = "../../Enginee/userdefine/{$fileName}";
                    if (file_exists($fileName0)) {
                        require_once $fileName0;
                        $functionName = $functionName . "_Value";
                        if (function_exists($functionName)) {
                            $filtervalue = $functionName($fields['value'][$counter][$list_index], $fields, $counter);
                        }
                    } else {
                        if (file_exists($fileName)) {
                            require_once $fileName;
                            $functionName = $functionName . "_Value";
                            if (function_exists($functionName)) {
                                $filtervalue = $functionName($fields['value'][$counter][$list_index], $fields, $counter);
                            } else {
                                print "函数名称[{$functionName}]不存在!";
                            }
                        } else {
                            print "没有相应文件,文件名:{$fileName}";
                        }
                    }
                    //用户权限定义部分
                    //print_R($functionName."_PRIV");print_R("<BR>");
                    if (function_exists($functionName . "_PRIV")) {
                        $NewFunctionNamePriv = $functionName . "_PRIV";
                        $userdefine_priv_Infor = $NewFunctionNamePriv($fields['value'][$counter][$list_index], $fields, $counter);
                        if ($userdefine_priv_Infor['view_priv'] == 1) {
                            $fields['view_priv'][$counter] = 1;
                        }
                        if ($userdefine_priv_Infor['edit_priv'] == 1) {
                            $fields['edit_priv'][$counter] = 1;
                        }
                        if ($userdefine_priv_Infor['delete_priv'] == 1) {
                            $fields['delete_priv'][$counter] = 1;
                        }
                        if ($userdefine_priv_Infor['shenhe_priv'] == 1) {
                            $fields['shenhe_priv'][$counter] = 1;
                        }
                        if ($userdefine_priv_Infor['flow_priv'] == 1) {
                            $fields['flow_priv'][$counter] = 1;
                        }
                        if ($userdefine_priv_Infor['next_priv'] == 1) {
                            $fields['next_priv'][$counter] = 1;
                        }
                        if ($userdefine_priv_Infor == 1) {
                            $fields['view_priv'][$counter] = 1;
                            $fields['edit_priv'][$counter] = 1;
                            $fields['delete_priv'][$counter] = 1;
                            $fields['shenhe_priv'][$counter] = 1;
                            $fields['flow_priv'][$counter] = 1;
                            $fields['next_priv'][$counter] = 1;
                        }
                        //print_R($fields['delete_priv']);
                    }
                    break;
            }
            global $limitEditDelUser;
            global $limitEditDelCust;
            if ($limitEditDelUser != '') {
                //限制上级的编辑和删除权限
                if ($_SESSION['limitEditDel'] == '0' && $fields['value2'][$counter][$limitEditDelUser] != $_SESSION['LOGIN_USER_ID'] && $_SESSION['LOGIN_USER_ID'] != 'admin' && $fields['value2'][$counter]['datascope'] != '1') {
                    $fields['edit_priv'][$counter] = 1;
                    $fields['delete_priv'][$counter] = 1;
                }
                //限制公共客户的编辑和删除权限
                if ($fields['value2'][$counter]['datascope'] == '1' && !ifHasRoleUser($fields['value2'][$counter][$limitEditDelUser])) {
                    $fields['edit_priv'][$counter] = 1;
                    $fields['delete_priv'][$counter] = 1;
                }
            }
            if ($limitEditDelCust != '') {
                $guanlianSysuser = returntablefield("customer", "rowid", $fields['value2'][$counter][$limitEditDelCust], "sysuser,datascope");
                ////限制上级的编辑和删除权限
                if ($_SESSION['limitEditDel'] == '0' && $guanlianSysuser['sysuser'] != $_SESSION['LOGIN_USER_ID'] && $_SESSION['LOGIN_USER_ID'] != 'admin' && $guanlianSysuser['datascope'] != '1') {
                    $fields['edit_priv'][$counter] = 1;
                    $fields['delete_priv'][$counter] = 1;
                }
                //限制公共客户的编辑和删除权限
                if ($guanlianSysuser['datascope'] == '1' && !ifHasRoleUser($guanlianSysuser['sysuser'])) {
                    $fields['edit_priv'][$counter] = 1;
                    $fields['delete_priv'][$counter] = 1;
                }
            }
            $fields['elementlink'][$counter][$list_index] = $fields['value'][$counter][$list_index];
            $fields['value'][$counter][$list_index] = $filtervalue;
        }
        $counter++;
    }
    $fields['other']['pageid'] = $pageid;
    $fields['other']['pagenums'] = $pagenums;
    $fields['other']['rc'] = $rc;
    //print_r($fields['delete_priv']);print_r($fields['edit_priv']);exit;
    return $fields;
}
Example #4
0
        frinum($my[user_id]);
        frinum($user[user_id]);
        fsock($user[user_id], "【小T提醒】 " . $my[user_name] . "解除了对你的关注,你去看看TA吧,TA的地址:" . $webaddr . "/home/u." . $my[user_id]);
        echo "success";
        exit;
    }
}
//以下是 发送 代码
if ($action == "msgsend") {
    tologin();
    $content = daddslashes(trim($_POST["content"]));
    $toid = $_POST["toid"];
    $status_id = $_POST["status_id"];
    $status_type = $_POST["status_type"];
    $topid = $_POST["topid"] ? $_POST["topid"] : 0;
    $toname = idtoname($toid);
    if (!empty($content)) {
        $content = replace($content);
        //词语过滤
        if ($toid && $status_id) {
            $content = "@<a href=\"{$webaddr}/home/u.{$toid}\">{$toname}</a> {$content}";
            $db->query("INSERT INTO et_content (user_id,topicid,content_body,posttime,status_id,status_uid,status_uname,status_type) VALUES ('{$my['user_id']}','{$topid}','{$content}','{$addtime}','{$status_id}','{$toid}','{$toname}','{$status_type}')");
            fsock($toid, "【小T提醒】 " . $my[user_name] . "回复了你的TALK,查看地址:" . $webaddr . "/home/replies");
        } else {
            $db->query("INSERT INTO et_content (user_id,topicid,content_body,posttime) VALUES ('{$my['user_id']}','{$topid}','{$content}','{$addtime}')");
        }
        $db->query("UPDATE et_users SET msg_num='" . ($my[msg_num] + 1) . "' where user_id='{$my['user_id']}'");
        header("location: {$webaddr}/home");
        exit;
    } else {
        header("location: {$webaddr}/home?tip=25");
Example #5
0
function newaiadd($mode)
{
    global $fields;
    global $html_etc, $common_html, $custom_type;
    global $db, $return_sql_line, $columns;
    global $_POST, $_GET, $returnmodel;
    global $action_submit, $merge, $form_attribute;
    global $primary_key, $primarykey_index;
    global $_SESSION, $SUNSHINE_USER_NAME_VAR;
    $fields['other']['title'] = $common_html['common_html'][$mode];
    //print_R($html_etc);
    //如果为编辑和查看模型,则进行数据的初始化操作
    global $ADDINIT;
    if ($mode != 'add') {
        $SQL = $return_sql_line['select_sql'];
        //print_R($columns);exit;
        //print_R($html_etc['application']);
        //检测是否进行外来SQL语言执行
        global $NEWAIADD_VALUE_SYSTEM;
        if (strlen($NEWAIADD_VALUE_SYSTEM) > 10) {
            $SQL = $NEWAIADD_VALUE_SYSTEM;
        }
        //print $SQL;
        $result = $db->Execute($SQL);
        $rs_array = $result->GetArray();
        if (count($rs_array) == 0) {
            print_infor("找不到记录,可能已删除", 'trip', "close", "", 0);
            exit;
        }
        $fields['value'] = $rs_array[0];
    } else {
        $fields['value'] = $ADDINIT;
    }
    global $departprivte;
    //用户角色级别权限判断,如果是用户自身的记录则可以修改,
    //如果不是,那么沿用PRIVATE的权限进行管理
    //此区域部分在NEWAI_SQL部分有所复制
    if ($departprivte != "") {
        $departprivteSQLArray = array();
        $departprivteArray = explode('::', $departprivte);
        //print_R($departprivteArray);
        for ($i = 0; $i < sizeof($departprivteArray); $i++) {
            $privText = $departprivteArray[$i];
            $privTextArray = explode(':', $privText);
            switch ($privTextArray[0]) {
                case 'user':
                    $ColumnIndex1 = $privTextArray[1];
                    $USER_NAME = $_SESSION[$SUNSHINE_USER_NAME_VAR];
                    $ColumnName1 = $columns[$ColumnIndex1];
                    if ($ColumnName1 != "" && $fields['value'][$ColumnName1] != "") {
                        if ($USER_NAME == $fields['value'][$ColumnName1]) {
                            $SYSTEM_PRIVATE_USER_DEFINE_CONTROL = 0;
                        } else {
                            $SYSTEM_PRIVATE_USER_DEFINE_CONTROL = 1;
                        }
                    } else {
                        $SYSTEM_PRIVATE_USER_DEFINE_CONTROL = 0;
                    }
                    break;
            }
            //end swtich
        }
        //end for
    }
    //exit;
    //print $SYSTEM_PRIVATE_USER_DEFINE_CONTROL;
    //print $fields['value'][$ColumnName1];
    //print_R($fields['USER_PRIVATE']);
    //-------------------------------------------------------------------
    //附加的EMAIL控制部分,可以删除
    switch ($_GET['action']) {
        case 'edit_reply':
            $fields['form']['action'] = 'action=add_outbox_data';
            break;
        case 'edit_forward':
            $fields['form']['action'] = 'action=add_outbox_data';
            break;
    }
    //加载JS的条件判断代码,主要用于数据新增和编辑时较验数据的格式是否合格
    $tablename = $fields['table']['name'];
    $realtablename = $fields['realtable'];
    if ($form_attribute != 'hidden') {
        if (is_file("../../Enginee/lib/CheckValue.js")) {
            print "<script language = \"JavaScript\"> ";
            print join('', file("../../Enginee/lib/CheckValue.js"));
            print "</script>";
        } else {
            print "<script language = \"JavaScript\"> ";
            print join('', file("../Enginee/lib/CheckValue.js"));
            print "</script>";
        }
        form_begin($fields['form']['name'], $fields['form']['action'], 'post', $fields['null']);
        //单位修改界面表单 by cwf
        //<form name=$name id=form onsubmit=\"return FormCheck();\" \n action=\"$PHP_SELF?$action&pageid=".$_GET['pageid']."\" method=$method encType=multipart/form-data>
        //        echo $fields['form']['action'];//by cwf 'pageid=1&action=edit_default_data&id=1'
    }
    global $tablewidth;
    $tablewidth = $tablewidth != "" ? $tablewidth : 450;
    table_begin($tablewidth);
    switch ($_GET['action']) {
        case 'edit_reply':
            $fields['other']['title'] = $common_html['common_html']['reply'] . " " . $common_html['common_html'][$tablename];
            break;
        case 'edit_forward':
            $fields['other']['title'] = $common_html['common_html']['reply'] . " " . $common_html['common_html'][$tablename];
            break;
        default:
            $fields['other']['title'] = $fields['other']['title'] . " " . $common_html['common_html'][$tablename];
    }
    global $tabletitle;
    switch ($db->databaseType) {
        case 'mysql':
        case 'mssql':
        default:
            break;
        case 'oracle':
            $tabletitle = strtoupper($tabletitle);
            break;
    }
    global $print_title;
    $print_title = $tabletitle != "" ? $html_etc[$tablename][$tabletitle] : $fields['other']['title'];
    print_title($print_title, 6);
    //操作按钮提交
    switch ($mode) {
        case 'add':
        case 'edit':
            show_submit_element($action_submit, 'left');
            //“保存”和“返回”按钮,此函数定义在newai.php中
            break;
        case 'view':
            show_submit_element($action_submit, 'left');
            break;
    }
    //数据的下载及合并,用途:FILE操作部分,可以删除
    //merge -- begin
    if ($merge != '') {
        $merge_array = explode(':', $merge);
        //print $merge;
        $index_array_temp = explode(',', $merge_array[1]);
        $id = $columns['' . $index_array_temp[0] . ''];
        $name = $columns['' . $index_array_temp[1] . ''];
        $array_pop = array_pop($fields['name']);
        $fields['value'][$id] = returnfileurl($fields['value'][$id], $fields['value'][$name]);
    }
    //merge --  end
    //此部分设计为权限部分设计:事业部总监和营销专员的的权限设计
    $SYSTEM_FILTER_ARRAY = returnPrivateTwoInit();
    $USER_PRIV_ID = $_SESSION['SUNSHINE_USER_PRIV'];
    $DEPT_INFOR = $_SESSION['SUNSHINE_USER_DEPT'];
    $USER_INFOR = $_SESSION['SUNSHINE_USER_NAME'];
    $RecordDEPT = $SYSTEM_FILTER_ARRAY['CheckFieldNameDEPT'];
    $RecordDEPT = $columns[$RecordDEPT];
    $RecordUser = $SYSTEM_FILTER_ARRAY['CheckFieldNameUSER'];
    $RecordUser = $columns[$RecordUser];
    //$USER_PRIV = returntablefield("user_priv","USER_PRIV",$USER_PRIV_ID,"PRIV_NO");
    //print $USER_PRIV=5;
    //print_R($fields['USER_PRIVATE']);
    //############################################################
    //是否引入图片放大
    $ifincludemaginfier = false;
    global $colflag;
    //print_R($fields['USER_PRIVATE']);
    //数据显示区域部分,用于整个数据的主体部分
    $colflag = 0;
    for ($i = 0; $i < sizeof($fields['name']); $i++) {
        $fieldname = trim($fields['name'][$i]);
        $fieldfilter = trim($fields['filter'][$i]);
        $notnull = trim($fields['null'][$i]['inputtype']);
        $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
        $colflag = $colflag + 1;
        if ($colflag > 2) {
            $colflag = 1;
        }
        //上一行是单元格
        if ($colflag == 2 && $i > 0 && ($fields['filter'][$i - 1] == "htmlarea" || $fields['filter'][$i - 1] == "textarea")) {
            $colflag = 1;
        }
        //处在最后一行左边
        if ($colflag == 1 && $i == sizeof($fields['name']) - 1) {
            $colflag = 0;
        }
        //下一行是宽单元格
        if ($colflag == 1 && $i < sizeof($fields['name']) - 1 && ($fields['filter'][$i + 1] == "htmlarea" || $fields['filter'][$i + 1] == "textarea")) {
            $colflag = 0;
        }
        $fieldfilter_array = explode(':', $fieldfilter);
        $fieldfilter = trim($fieldfilter_array[0]);
        //用户定义角色权限,是否为只读(可写)选项
        //如用用户定义可写,那么重新调整为可写, 如果非自身记录,则沿用系统设定
        if ($ColumnName1 != "") {
            //判断是否要对用户验证进行操作
            $SYSTEM_PRIVATE_USER_DEFINE_CONTROL == 0 ? $fields['USER_PRIVATE'][$fieldname] = '' : '';
        }
        //数据过滤行为
        //$ShowElement = returnPrivateTwoArray($SYSTEM_FILTER_ARRAY,$USER_PRIV,$fieldname,$fields['value'][$fieldname],$fields['value'][$RecordDEPT],$fields['value'][$RecordUser]);
        //if($ShowElement!="***")					{
        if (1) {
            //2010-6-14 11:20替换以前旧的判断方式
            switch (TRIM($fieldfilter)) {
                case 'email':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "email");
                            break;
                        case 'view':
                            $linkman = '';
                            $fromsrc = '';
                            if ($fields['tablename'] == 'linkman') {
                                $fromsrc = 'customer';
                                $linkman = gettablefield($fields['tablename'], 'email', 'rowid', $fields['value'][$fieldname]);
                            } else {
                                if ($fields['tablename'] == 'supplylinkman') {
                                    $fromsrc = 'supply';
                                    $linkman = gettablefield($fields['tablename'], 'email', 'rowid', $fields['value'][$fieldname]);
                                } else {
                                    $linkman = $fields['value'][$fieldname];
                                    $fromsrc = '';
                                }
                            }
                            $addicon = "<img src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0037.gif' title='点击链接发送邮件'>";
                            if ($fields['value'][$fieldname] != '') {
                                $fields['value'][$fieldname] = "<a href='../CRM/email_newai.php?" . base64_encode("action=add_default&sendlist=" . $linkman . "&fromsrc=" . $fromsrc) . "' target='_blank' >" . $addicon . $fields['value'][$fieldname] . "</a>";
                            }
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    break;
                case 'mobile':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "mobile");
                            break;
                        case 'view':
                            $addicon = "<img  src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0348.gif' title='点击号码发送短信'>";
                            if ($fields['value'][$fieldname] != '') {
                                $fields['value'][$fieldname] = "<a href='../JXC/sms_sendlist_newai.php?" . base64_encode("action=add_default&sendlist=" . $fields['value'][$fieldname]) . "' target='_blank'>" . $addicon . $fields['value'][$fieldname] . "</a>";
                            }
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    break;
                case 'barcode':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "barcode");
                            break;
                        case 'view':
                            $addicon = "<img  src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0348.gif' title='点击号码发送短信'>";
                            if ($fields['value'][$fieldname] != '') {
                                $fields['value'][$fieldname] = "<a href='../JXC/sms_sendlist_newai.php?" . base64_encode("action=add_default&sendlist=" . $fields['value'][$fieldname]) . "' target='_blank'>" . $addicon . $fields['value'][$fieldname] . "</a>";
                            }
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    break;
                case 'qq':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "qq");
                            break;
                        case 'view':
                            $fields['value'][$fieldname] = !empty($fields['value'][$fieldname]) ? "<a target=\"_blank\" href=\"http://wpa.qq.com/msgrd?v=3&amp;uin=" . $fields['value'][$fieldname] . "&amp;site=qq&amp;menu=yes\"><img border=\"0\" src=\"http://wpa.qq.com/pa?p=2:" . $fields['value'][$fieldname] . ":45\" onerror=\"this.src='" . ROOT_DIR . "general/ERP/Framework/images/help3.gif';this.title='此QQ号码可能不存在'\" title=\"点击这里发消息\">" . $fields['value'][$fieldname] . "</a>" : '';
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    break;
                case 'url':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "url");
                            break;
                        case 'view':
                            $urlwangzhi = $fields['value'][$fieldname];
                            $flag = stripos($fields['value'][$fieldname], "http://");
                            if ($flag === false) {
                                $urlwangzhi = "http://" . $urlwangzhi;
                            }
                            $addicon = "<img  src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0668.gif' title='点击链接打开网址'>";
                            if ($fields['value'][$fieldname] != '') {
                                $fields['value'][$fieldname] = "<a href='" . $urlwangzhi . "' target='_blank'>" . $addicon . $fields['value'][$fieldname] . "</a>";
                            }
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    break;
                case 'city':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_city($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]));
                            break;
                        case 'view':
                            $shengcode = substr($fields['value'][$fieldname], 0, 2);
                            $shengcode .= "0000";
                            $shengcode = returntablefield("customerarea", "rowid", $shengcode, "name");
                            $citycode = substr($fields['value'][$fieldname], 0, 4);
                            $citycode .= "00";
                            $citycode = returntablefield("customerarea", "rowid", $citycode, "name");
                            $towncode = returntablefield("customerarea", "rowid", $fields['value'][$fieldname], "name");
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $shengcode . $citycode . $towncode);
                            break;
                    }
                    break;
                case 'account':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_account($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]));
                            break;
                    }
                    break;
                case '':
                case 'input':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $pattern = $fields['INPUT_TEXT'][$fieldname];
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, $pattern);
                            //exit;
                            break;
                        case 'view':
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    break;
                case 'hidden':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            //print_R($fields['inputsize']);exit;
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_notshow($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1);
                            //exit;
                            break;
                        case 'view':
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    break;
                case 'nowshow':
                case 'notshow':
                    break;
                case 'bigrmb':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            break;
                        case 'view':
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            $MoneyValue = trim($fields['value'][$fieldname]);
                            if ($MoneyValue == 0) {
                                $FieldValueTemp = "<font color=green>0</font>";
                            } else {
                                $FieldValueTemp = "<font color=red>" . $MoneyValue . "</font> (" . num2rmb($MoneyValue) . ")";
                            }
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $FieldValueTemp, $colspan);
                            break;
                    }
                    break;
                case 'number':
                    switch ($mode) {
                        case 'add':
                            $_GET[$fieldname] = $fields['INPUT_TEXT'][$fieldname];
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "Number");
                            $custom_type = "";
                            break;
                        case 'view':
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan);
                            break;
                    }
                    break;
                case 'money':
                    switch ($mode) {
                        case 'add':
                            $_GET[$fieldname] = $fields['INPUT_TEXT'][$fieldname];
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "Money");
                            $custom_type = "";
                            break;
                        case 'view':
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan);
                            break;
                    }
                    break;
                case 'autoincrement':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_tr_auto_increment($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputcols']);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]));
                            break;
                    }
                    break;
                case 'autoincrementdate':
                    switch ($mode) {
                        case 'add':
                            print_tr_auto_incrementdate($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputcols'], $fields['INPUT_TEXT'][$fieldname]);
                            break;
                        case 'edit':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]));
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan);
                            break;
                    }
                    break;
                case 'readonly':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'], $fields['other']['inputcols'], 'SmallStatic', "", 'text', 'readonly');
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $colspan);
                            break;
                    }
                    break;
                case 'readonlytextarea':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            //print_R($fields['other']['textarea']);
                            //print $notnulltext;
                            print_textarea_readonly($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['textarea'][$fieldname]['rows'], $fields['other']['textarea'][$fieldname]['cols'], $fields['other']['inputcols'], $notnulltext);
                            break;
                        case 'view':
                            print_text_text($html_etc[$tablename][$fieldname] . ":", nl2br(stripslashes(trim($fields['value'][$fieldname]))));
                            break;
                    }
                    break;
                case 'readonlymulti':
                    switch ($mode) {
                        case 'edit':
                            //print_R($fields['other']['textarea']);
                            //print $notnulltext;
                            print_textarea_mluti_readonly($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['textarea'][$fieldname]['rows'], $fields['other']['textarea'][$fieldname]['cols'], $fields['other']['inputcols'], $notnulltext);
                            break;
                    }
                    break;
                case 'password':
                case 'password_simple':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'] + 4, $fields['other']['inputcols'], $fields['other']['class'], "", 'password');
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", "******", $colspan);
                            break;
                    }
                    break;
                case 'textarea':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            //print_R($fields['other']['textarea']);
                            print_textarea($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['textarea'][$fieldname]['rows'], $fields['other']['textarea'][$fieldname]['cols'], $fields['other']['inputcols'], $notnulltext, $fields['other']['textarea'][$fieldname]['other']);
                            break;
                        case 'view':
                            print_text_text($html_etc[$tablename][$fieldname] . ":", nl2br(stripslashes(trim($fields['value'][$fieldname]))));
                            break;
                    }
                    break;
                case 'spacetime':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_select_spacetime($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]));
                            break;
                        case 'view':
                            print_select_spacetime($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]));
                            break;
                    }
                    break;
                case 'htmlarea':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_htmlarea($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['textarea']['rows'], $fields['other']['textarea']['cols'], $fields['other']['inputcols']);
                            break;
                        case 'view':
                            print_text_html($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]));
                            break;
                    }
                    break;
                case 'idtoname_user':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            break;
                        case 'view':
                            $filtervalue = idtoname(trim($fields['value'][$fieldname]), 'user');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $filtervalue, $colspan);
                            break;
                    }
                    break;
                case 'purview':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_purview($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['textarea']['rows'], $fields['other']['textarea']['cols'], $fields['other']['inputcols']);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'avatar':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_avatar($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'], $fields['other']['inputcols'], $fields['other']['class'], "");
                            break;
                        case 'view':
                            print_text_avatar($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), 2);
                            break;
                    }
                    break;
                case 'file':
                    switch ($mode) {
                        case 'add':
                            print_file($html_etc[$tablename][$fieldname] . ":", $fieldname);
                            break;
                        case 'edit':
                            //print_file($html_etc[$tablename][$fieldname].":",$fieldname);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'singlefile':
                    switch ($mode) {
                        case 'add':
                            print_singlefile($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'], $fields['other']['inputcols']);
                            break;
                        case 'edit':
                            print_singlefile($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'], $fields['other']['inputcols']);
                            break;
                        case 'view':
                            $var_value = trim($fields['value'][$fieldname]);
                            if ($var_value != "") {
                                $var_value = ereg_replace("&amp;", "&", $var_value);
                                //print $var_value;
                                $parse_url = parse_url($var_value);
                                $query = $parse_url['query'];
                                parse_str($query, $output);
                                $attachmentid = $output['attachmentid'];
                                $attachmentname = $output['attachmentname'];
                                //$attachmentid = $output['attachmentname'];
                                //print_R($parse_url);
                                $filename_newfile = "../../attachment/{$attachmentid}/{$attachmentname}";
                                if (is_file($filename_newfile)) {
                                    $filtervalue = trim($fields['value'][$fieldname]);
                                    $filtervalue_file = explode('=', $filtervalue);
                                    $filtervalue_sizeof = sizeof($filtervalue_file) - 1;
                                    $filename = $filtervalue_file[$filtervalue_sizeof];
                                    $filtervalue = "<a href='" . $filtervalue . "'>{$filename}</a>";
                                }
                            }
                            //print $downloadfile = trim($fields['value'][$fieldname]);
                            //if(is_file($downloadfile))		{
                            //print $file_path="<img src=\"../../Framework/images/downloads.gif\" border=0 width=172>\n";
                            //print "<a href='$downloadfile'>下载文件</a>";
                            //$nopicture_path="<img src=\"images/logo_sndg.gif\" border=0 width=172>\n";
                            //is_file(trim($fields['value'][$fieldname]))?$system_picture_line=$file_path:$system_picture_line=$nopicture_path;
                            //}
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $filtervalue);
                            break;
                    }
                    //idnumfile
                    break;
                case 'picturefile':
                    switch ($mode) {
                        case 'add':
                            print_picturefile($html_etc[$tablename][$fieldname] . ":", $fieldname, '', $fields['other']['inputsize']);
                            break;
                        case 'edit':
                            print_picturefile($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'], $fields['other']['inputcols']);
                            break;
                        case 'view':
                            $PicturePath = $fields['value'][$fieldname];
                            if ($PicturePath != "" && strlen($PicturePath) > 10) {
                                if (!$ifincludemaginfier) {
                                    print "<script type=\"text/javascript\" language=\"javascript\" src=\"" . ROOT_DIR . "general/ERP/Enginee/jquery/jquery.js\"></script>";
                                    print "<script type=\"text/javascript\" language=\"javascript\" src=\"" . ROOT_DIR . "general/ERP/Enginee/jquery/jquery.magnifier.js\"></script>";
                                    $ifincludemaginfier = true;
                                }
                                $file_path = "<img src='" . $PicturePath . "' width=32  class=\"magnify\"  data-magnifyto=\"500\" onmouseover=\"this.style.cursor='pointer';this.style.cursor='hand'\" onmouseout=\"this.style.cursor='default'\">";
                                //$file_path="<a href='$PicturePath'><img src='".$PicturePath."' border=0 width=120></a>";
                            } else {
                                $file_path = "";
                            }
                            print_image_view($html_etc[$tablename][$fieldname], $file_path, $width = '120');
                            break;
                    }
                    //idnumfile
                    break;
                case 'tdoafile':
                    require_once 'lib/utility_file.php';
                    //print $fields['other']['inputcols'];
                    switch ($mode) {
                        case 'add':
                            print_tdoafile($html_etc[$tablename][$fieldname] . ":", $fieldname, '', $fields['other']['inputsize'], $fields['other']['inputcols']);
                            break;
                        case 'edit':
                            print_tdoafile($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'], $fields['other']['inputcols']);
                            break;
                        case 'view':
                            //形成通达OA下载文件所需要的变量格式
                            $var_value_array = explode('||', $fields['value'][$fieldname]);
                            $ATTACHMENT_ID = $var_value_array[1];
                            $ATTACHMENT_NAME = $var_value_array[0];
                            if (strlen($fields['value'][$fieldname]) < 3) {
                                $file_path = "无附件";
                            } else {
                                $file_path = attach_link($ATTACHMENT_ID, $ATTACHMENT_NAME, 1, 1, 1, 0, 0, 1, 1, 0);
                            }
                            //print_R($ATTACHMENT_NAME);exit;
                            print "<script src=\"../../Enginee/lib/attach.js\"></script>";
                            print "\n\t\t\t\t\t<input type=\"hidden\" name=\"ATTACHMENT_ID_OLD\" value=\"{$ATTACHMENT_ID}\">\n\t\t\t\t\t<input type=\"hidden\" name=\"ATTACHMENT_NAME_OLD\" value=\"{$ATTACHMENT_NAME}\">";
                            print_image_view($html_etc[$tablename][$fieldname], $file_path, $width = '120', $fields['other']['inputcols']);
                            break;
                    }
                    //idnumfile
                    break;
                case 'binaryfile':
                    switch ($mode) {
                        case 'add':
                            print_binaryfile($html_etc[$tablename][$fieldname] . ":", $fieldname, $fields['other']['inputsize'], $fields['other']['inputcols']);
                            break;
                        case 'edit':
                            print_binaryfile($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['other']['inputsize'], $fields['other']['inputcols']);
                            break;
                        case 'view':
                            global $sessionkey;
                            $filepath = trim($fields['value'][$fieldname]);
                            if (is_file($filepath)) {
                                $file_path = "<img src=\"{$filepath}\" border=0 width=172>\n";
                            } else {
                                $file_path = "<img src=\"images/logo_sndg.gif\" border=0 width=172>\n";
                            }
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $file_path, $colspan);
                            break;
                    }
                    //idnumfile
                    break;
                case 'idnumfile':
                    switch ($mode) {
                        case 'view':
                            $file_path = "<img src=\"idnumimage/" . trim($fields['value'][$fieldname]) . ".jpg\" border=0 width=172>\n";
                            $nopicture_path = "<img src=\"images/logo_sndg.gif\" border=0 width=172>\n";
                            is_file("idnumimage/" . trim($fields['value'][$fieldname]) . ".jpg") ? $system_picture_line = $file_path : ($system_picture_line = $nopicture_path);
                            break;
                    }
                    break;
                case 'colorselect':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            print_colorselect($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $notnulltext);
                            break;
                        case 'view':
                            print "<div  style=\"border:1px double #000000;width:16px;height:16px;background-color:" . $fields['value'][$fieldname] . ";overflow:hidden;\"></div>";
                            break;
                    }
                    break;
                case 'date0':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_date_js();
                            print_date($html_etc[$tablename][$fieldname] . ":", $fieldname, "./sms_index/calendar_begin.php?datetime={$fieldname}", trim($fields['value'][$fieldname]), $fields['other']['inputcols'], $notnulltext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returndate(trim($fields['value'][$fieldname]), 1));
                            break;
                    }
                    break;
                case 'date':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = date("Y-m-d");
                        case 'edit':
                            print_date_js();
                            print_date($html_etc[$tablename][$fieldname] . ":", $fieldname, "./sms_index/calendar_begin.php?datetime={$fieldname}", trim($fields['value'][$fieldname]), $fields['other']['inputcols'], $notnulltext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returndate(trim($fields['value'][$fieldname]), 1));
                            break;
                    }
                    break;
                case 'date1':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = date("Y-m-d", mktime(0, 0, 0, date(m) + 1, date(d), date(Y)));
                        case 'edit':
                            print_date_js();
                            print_date($html_etc[$tablename][$fieldname] . ":", $fieldname, "./sms_index/calendar_begin.php?datetime={$fieldname}", trim($fields['value'][$fieldname]), $fields['other']['inputcols'], $notnulltext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returndate(trim($fields['value'][$fieldname]), 1));
                            break;
                    }
                    break;
                case 'datetime':
                    switch ($mode) {
                        case 'add':
                            if ($fields['value'][$fieldname] == '') {
                                $fields['value'][$fieldname] = date("Y-m-d H:i:s");
                            }
                        case 'edit':
                            $pattern = $fields['INPUT_TEXT'][$fieldname];
                            print_datetime($html_etc[$tablename][$fieldname] . ":", $fieldname, "./sms_index/calendar_begin.php?datetime={$fieldname}", trim($fields['value'][$fieldname]), $fields['other']['inputcols'], $notnulltext, $pattern);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returndate(trim($fields['value'][$fieldname]), 1));
                            break;
                    }
                    break;
                case 'datetime0':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_date_js();
                            print_datetime($html_etc[$tablename][$fieldname] . ":", $fieldname, "./sms_index/calendar_begin.php?datetime={$fieldname}", trim($fields['value'][$fieldname]), $fields['other']['inputcols'], $notnulltext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returndate(trim($fields['value'][$fieldname]), 1));
                            break;
                    }
                    break;
                case 'datetimecheckbox':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = date("Y-m-d H:i:s");
                        case 'edit':
                            print_date_js();
                            print_datetimecheckbox($html_etc[$tablename][$fieldname] . ":", $fieldname, "./sms_index/calendar_begin.php?datetime={$fieldname}", trim($fields['value'][$fieldname]), $fields['other']['inputcols'], $notnulltext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returndate(trim($fields['value'][$fieldname]), 1));
                            break;
                    }
                    break;
                case 'boolean':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['boolean'][$i]['value'];
                        case 'edit':
                            //$fields['value'][$fieldname]=1;
                            print_boolean($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $size = "25", $colspan = 2, "SmallSelect", $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returnboolean(trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'select_sex':
                case 'sex':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = 1;
                        case 'edit':
                            print_sex($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), "SmallSelect", $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returnsex(trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'checkbox':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            print_checkbox($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]));
                            break;
                        case 'view':
                            print_checkbox($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]));
                            break;
                    }
                    break;
                case 'mulcheckbox':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            $subtablename = $fields['INPUT_TEXT'][$fieldname];
                            $subkey = $fields['inputsize'][$fieldname];
                            $subval = $fields['inputother'][$fieldname];
                            print_mulcheckbox($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $subtablename, $subkey, $subval);
                            break;
                        case 'view':
                            $subtablename = $fields['INPUT_TEXT'][$fieldname];
                            $subkey = $fields['inputsize'][$fieldname];
                            $subval = $fields['inputother'][$fieldname];
                            $subcolums = returntablecolumn($subtablename);
                            $subkey = $subcolums[$subkey];
                            $subval = $subcolums[$subval];
                            $fieldValueArray = explode(",", $fields['value'][$fieldname]);
                            array_pop($fieldValueArray);
                            $fieldValueArrayTEXT = join("','", $fieldValueArray);
                            $sql = "select {$subval} from {$subtablename} where {$subkey} in ('{$fieldValueArrayTEXT}')";
                            $rsxx = $db->CacheExecute(5, $sql);
                            $rsxxA = $rsxx->GetArray();
                            $fieldValueNameText = '';
                            for ($iD = 0; $iD < sizeof($rsxxA); $iD++) {
                                $fieldValueNameText .= $rsxxA[$iD][$subval] . ",";
                            }
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fieldValueNameText);
                            break;
                    }
                    break;
                case 'radio':
                    switch ($mode) {
                        case 'add':
                            if ($fields['value'][$fieldname] == '') {
                                $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                            }
                        case 'edit':
                            print_radio($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field'], 2, $fields['select'][$i]['initvalue']);
                            break;
                        case 'view':
                            print_select_text($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $fieldname, $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field']);
                            break;
                    }
                    break;
                case 'radiogroup':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            print_radio($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field'], 1, $fields['select'][$i]['initvalue'], $fields['select'][$i]['groupfield'], $fields['select'][$i]['groupvalue']);
                            break;
                        case 'view':
                            print_select_text($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $fieldname, $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field'], $fields['select'][$i]['groupfield'], $fields['select'][$i]['groupvalue']);
                            break;
                    }
                    break;
                    //JUMPUSERINFOR,弹出窗口的用户名和用户ID
                //JUMPUSERINFOR,弹出窗口的用户名和用户ID
                case 'usertoid':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            //$colspan = $fields['other']['inputcols'];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueName = returntablefield("user", "USER_ID", $fieldValue, "USER_NAME");
                            $PRIV_OP = $fields['INPUT_TEXT'][$fieldname];
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectTeacherSingle('{$PRIV_OP}','{$fieldname}', '{$fieldnameID}')\">选择</a>\n";
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldname}', '{$fieldnameID}')\" title=\"清空\">清空</a>";
                            print "&nbsp;&nbsp;{$notnulltext}</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returntablefield("user", "USER_ID", $fields['value'][$fieldname], "USER_NAME"), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //JUMPUSERINFOR,弹出窗口的用户名和用户ID
                //JUMPUSERINFOR,弹出窗口的用户名和用户ID
                case 'usertoname':
                    $colspan = 2;
                    //print_R($_GET);;
                    switch ($mode) {
                        case 'add':
                            $fieldValue = $_GET[$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueName = returntablefield("user", "USER_NAME", $fieldValue, "USER_ID");
                            $PRIV_OP = $fields['INPUT_TEXT'][$fieldname];
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectTeacherSingle('{$PRIV_OP}','{$fieldnameID}', '{$fieldname}')\">选择</a>\n";
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldnameID}', '{$fieldname}')\" title=\"清空\">清空</a>";
                            //print $addtext = FilterFieldAddText($addtext,$fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueName = returntablefield("user", "USER_NAME", $fieldValue, "USER_ID");
                            $PRIV_OP = $fields['INPUT_TEXT'][$fieldname];
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectTeacherSingle('{$PRIV_OP}','{$fieldnameID}', '{$fieldname}','{$PRIV_OP}')\">选择</a>\n";
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldnameID}', '{$fieldname}')\" title=\"清空\">清空</a>";
                            //print $addtext = FilterFieldAddText($addtext,$fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //JUMPUSERLISTINFOR,弹出窗口的用户名和用户ID,多用户模式
                //JUMPUSERLISTINFOR,弹出窗口的用户名和用户ID,多用户模式
                case 'usertonamelist':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueArray = explode(",", $fieldValue);
                            for ($idddd = 0; $idddd < sizeof($fieldValueArray); $idddd++) {
                                $fieldValueArrayValue = $fieldValueArray[$idddd];
                                if ($fieldValueArrayValue != "") {
                                    $fieldValueNameText .= returntablefield("user", "USER_ID", $fieldValueArrayValue, "USER_NAME") . ",";
                                }
                            }
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            //print "<input type=\"text\" name=\"$fieldnameID\" value=\"$fieldValueName\" readonly class=\"SmallStatic\" size=\"40\">\n";
                            print "<textarea style=\"width:380px;\" name=\"{$fieldnameID}\" id=\"{$fieldnameID}\" rows=\"3\" style=\"overflow-y:auto;\" class=\"BigStatic\" wrap=\"yes\" readonly>{$fieldValueNameText}</textarea>";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectUser('" . $fields['INPUT_TEXT']['zhixingren'] . "','{$fieldname}', '{$fieldnameID}');\">选择</a>\n";
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldname}', '{$fieldnameID}')\" title=\"清空\">清空</a>&nbsp;";
                            print "&nbsp;{$notnulltext}";
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            $fieldValueArray = explode(",", $fields['value'][$fieldname]);
                            $fields['value'][$fieldname] = '';
                            for ($idddd = 0; $idddd < sizeof($fieldValueArray); $idddd++) {
                                $fieldValueArrayValue = $fieldValueArray[$idddd];
                                if ($fieldValueArrayValue != "") {
                                    $userInfo = returntablefield("user", "USER_ID", $fieldValueArrayValue, "UID,USER_NAME");
                                    $fields['value'][$fieldname] .= "<a target='_blank' href='../Framework/user_newai.php?action=view_default&UID=" . $userInfo['UID'] . "'>" . $userInfo['USER_NAME'] . "</a>,";
                                }
                            }
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //JUMPDEPTINFOR,弹出窗口的部门名和部门ID
                //JUMPDEPTINFOR,弹出窗口的部门名和部门ID
                case 'depttoid':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            //$colspan = $fields['other']['inputcols'];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueName = returntablefield("department", "DEPT_ID", $fieldValue, "DEPT_NAME");
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectDeptSingle('','{$fieldname}', '{$fieldnameID}')\">选择</a>\n";
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldname}', '{$fieldnameID}')\" title=\"清空\">清空</a>";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", returntablefield("department", "DEPT_ID", $fields['value'][$fieldname], "DEPT_NAME"), $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //JUMPDEPTINFOR,弹出窗口的部门名和部门ID
                //JUMPDEPTINFOR,弹出窗口的部门名和部门ID
                case 'depttoname':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                            //print_R($_GET);
                            $fieldValue = $_GET[$fieldname];
                            $fieldValueName = returntablefield("department", "DEPT_NAME", $fieldValue, "DEPT_ID");
                            $fieldnameID = $fieldname . "_ID";
                            $showtext = $html_etc[$tablename][$fieldname];
                            $PRIV_OP = $fields['INPUT_TEXT'][$fieldname];
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectDeptSingle('','{$fieldnameID}', '{$fieldname}','{$PRIV_OP}')\">选择</a>\n";
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldnameID}', '{$fieldname}')\" title=\"清空\">清空</a>";
                            //print $addtext = FilterFieldAddText($addtext,$fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueName = returntablefield("department", "DEPT_NAME", $fieldValue, "DEPT_ID");
                            $PRIV_OP = $fields['INPUT_TEXT'][$fieldname];
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectDeptSingle('','{$fieldnameID}', '{$fieldname}','{$PRIV_OP}')\">选择</a>\n";
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldnameID}', '{$fieldname}')\" title=\"清空\">清空</a>";
                            //print $addtext = FilterFieldAddText($addtext,$fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出课程的窗口
                //弹出课程的窗口
                case 'jumpcourse':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectCourseSingle('','{$fieldnameID}', '{$fieldname}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出教材的窗口
                //弹出教材的窗口
                case 'jumpjiaocai':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"25\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectAllInforSingle('../../Enginee/Module/jiaocai_admin_select_single/index.php','','{$fieldnameID}', '{$fieldname}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出客户的窗口
                //弹出客户的窗口
                case 'jumpkehu':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueNAME = returntablefield("customer", "ROWID", $fieldValue, "supplyname");
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldnameID}\" value=\"{$fieldValueNAME}\" readonly class=\"SmallStatic\" size=\"30\">\n";
                            print "<input type=\"button\" title='' value=\"选择\" class=\"SmallButton\"  onClick=\"SelectAllInforSingle('../../Enginee/Module/kehu_select_single/index.php','','{$fieldnameID}', '{$fieldname}')\">\n";
                            print "&nbsp;" . $notnulltext;
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            $fieldValueNAME = returntablefield("customer", "ROWID", $fields['value'][$fieldname], "supplyname");
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fieldValueNAME, $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出客户的多选窗口
                //弹出客户的多选窗口
                case 'jumpkehumulti':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            $fieldnameID = $fieldname . "_ID";
                            $fieldnameArray = explode(",", $fieldValue);
                            $fieldValueNAME = "";
                            for ($j = 0; $j < count($fieldnameArray); $j++) {
                                if ($fieldnameArray[$j] != '') {
                                    $fieldValueNAME = $fieldValueNAME . returntablefield("customer", "ROWID", $fieldnameArray[$j], "supplyname") . ",";
                                }
                            }
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<textarea name='{$fieldnameID}' class=\"SmallInput\" rows=" . $fields['other']['textarea'][$fieldname]["rows"] . " cols=" . $fields['other']['textarea'][$fieldname]["cols"] . " readonly>{$fieldValueNAME}</textarea>";
                            print "&nbsp;&nbsp;" . $notnulltext . "<br>";
                            print "<a href='#' onClick=\"SelectAllInforSingle('../../Enginee/Module/kehu_select_multi/index.php','','{$fieldnameID}', '{$fieldname}')\"><u>选择客户</u></a>\n";
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            $fieldValueNAME = returntablefield("customer", "ROWID", $fields['value'][$fieldname], "supplyname");
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fieldValueNAME, $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出客户联系人的多选窗口
                //弹出客户联系人的多选窗口
                case 'jumplinkmanmulti':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            $fieldnameID = $fieldname . "_ID";
                            $fieldnameArray = explode(",", $fieldValue);
                            $other = $fields['other']['textarea'][$fieldname]['other'];
                            for ($i = 0; $i < count($fieldnameArray); $i++) {
                                if ($fieldnameArray[$i] != '') {
                                    $fieldValueNAME = $fieldValueNAME . returntablefield("linkman", "ROWID", $fieldnameArray[$i], "{$other}") . ",";
                                }
                            }
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<textarea name='{$fieldnameID}' class=\"SmallInput\" rows=" . $fields['other']['textarea'][$fieldname]["rows"] . " cols=" . $fields['other']['textarea'][$fieldname]["cols"] . " readonly>{$fieldValueNAME}</textarea>";
                            print "&nbsp;&nbsp;" . $notnulltext . "<br>";
                            print "<a href='#' onClick=\"SelectAllInforSingle('../../Enginee/Module/linkman_select_multi/index.php','','{$fieldnameID}', '{$fieldname}','{$other}')\"><u>选择客户联系人</u></a>\n";
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            $other = $fields['other']['textarea'][$FieldNameIndex]['other'];
                            $fieldValueNAME = returntablefield("linkman", "ROWID", $fields['value'][$fieldname], "{$other}");
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fieldValueNAME, $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出供应商联系人的多选窗口
                //弹出供应商联系人的多选窗口
                case 'jumpsupplylinkmanmulti':
                    $colspan = 2;
                    $hasPriv = false;
                    $menuid = returntablefield("sys_function", "unimenu", "供应商", "func_Id");
                    $menuStr = explode(",", $_SESSION['LOGIN_FUNC_ID_STR']);
                    if (in_array($menuid, $menuStr)) {
                        $hasPriv = true;
                    }
                    if (!$hasPriv) {
                        continue;
                    }
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            $fieldnameID = $fieldname . "_ID";
                            $fieldnameArray = explode(",", $fieldValue);
                            $other = $fields['other']['textarea'][$fieldname]['other'];
                            for ($j = 0; $j < count($fieldnameArray); $j++) {
                                if ($fieldnameArray[$j] != '') {
                                    $fieldValueNAME = $fieldValueNAME . returntablefield("supplylinkman", "ROWID", $fieldnameArray[$j], "{$other}") . ",";
                                }
                            }
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<textarea name='{$fieldnameID}' class=\"SmallInput\" rows=" . $fields['other']['textarea'][$fieldname]["rows"] . " cols=" . $fields['other']['textarea'][$fieldname]["cols"] . " readonly>{$fieldValueNAME}</textarea>";
                            print "&nbsp;&nbsp;" . $notnulltext . "<br>";
                            print "<a href='#' onClick=\"SelectAllInforSingle('../../Enginee/Module/supplylinkman_select_multi/index.php','','{$fieldnameID}', '{$fieldname}','{$other}')\"><u>选择供应商联系人</u></a>\n";
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            $other = $fields['other']['textarea'][$FieldNameIndex]['other'];
                            $fieldValueNAME = returntablefield("supplylinkman", "ROWID", $fields['value'][$fieldname], "{$other}");
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fieldValueNAME, $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出供应商的单选窗口
                //弹出供应商的单选窗口
                case 'jumpsupply':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $_GET[$fieldname];
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            $fieldValueNAME = returntablefield("supply", "ROWID", $fieldValue, "supplyname");
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldnameID}\" value=\"{$fieldValueNAME}\" readonly class=\"SmallStatic\" size=\"30\">\n";
                            print "<input type=\"button\" title='' value=\"选择\" class=\"SmallButton\"  onClick=\"SelectAllInforSingle('../../Enginee/Module/supply_select_single/index.php','','{$fieldnameID}', '{$fieldname}')\">\n";
                            print "&nbsp;" . $notnulltext . "</TD></TR>\n";
                            break;
                        case 'view':
                            $fieldValueNAME = returntablefield("supply", "ROWID", $fields['value'][$fieldname], "supplyname");
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fieldValueNAME, $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出产品类别的窗口
                //弹出产品类别的窗口
                case 'jumpproducttype':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            if ($fields['INPUT_TEXT'][$fieldname] == '1') {
                                $rec_prod_id = $fields['value']['ROWID'];
                            }
                            //本身的主键,过滤到本身
                            $showfoldorsub = $fields['inputsize'][$fieldname];
                            //空=全部,1=仅显示文件夹,2=只能选择子类
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldValueName = returntablefield("producttype", "ROWID", $fieldValue, "name");
                            $fieldnameID = $fieldname . "_ID";
                            $notnull = trim($fields['null'][$i]['inputtype']);
                            $notnull == 'notnull' ? $notnulltext = $common_html['common_html']['mustinput'] : ($notnulltext = '');
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . ":</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\" readonly class=\"SmallStatic\" size=\"25\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectAllInforSingle('../../Enginee/Module/prodtype_select_single/index.php','{$rec_prod_id}','{$fieldname}', '{$fieldnameID}','{$showfoldorsub}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldnameID}', '{$fieldname}')\" title=\"清空\">清空</a>";
                            print "&nbsp;" . $notnulltext . "</TD></TR>\n";
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            $val = returntablefield("producttype", "rowid", $fields['value'][$fieldname], "name");
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $val, $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出产品窗口
                //弹出产品窗口
                case 'jumpproduct':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldValueName = returntablefield("product", "productid", $fieldValue, "productname");
                            $fieldnameID = $fieldname . "_ID";
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . ":</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldnameID}\" value=\"{$fieldValueName}\" readonly class=\"SmallStatic\" size=\"30\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectAllInforSingle('../../Enginee/Module/product_select_single/index.php','{$fieldValue}','{$fieldname}', '{$fieldnameID}','{$showfoldorsub}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "<a href=\"#\" class=\"orgClear\" onClick=\"ClearUser('{$fieldnameID}', '{$fieldname}')\" title=\"清空\">清空</a>";
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出宿舍的窗口
                //弹出宿舍的窗口
                case 'jumpdorm':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $床位号 = $fields['value']['床位号'];
                            $性别 = $fields['value']['性别'];
                            $fieldValue = $fields['value'][$fieldname] . " " . $床位号 . "号床位";
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"30\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectAllInforSingle('../../Enginee/Module/dorm_room_admin_select_single/index.php','','{$fieldname}', '{$fieldnameID}','{$性别}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出班级的窗口
                //弹出班级的窗口
                case 'jumpbanji':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectBanJiSingle('','{$fieldnameID}', '{$fieldname}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出教室的窗口
                //弹出教室的窗口
                case 'jumpclassroom':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "_ID";
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldname}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldnameID}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectClassroomSingle('','{$fieldname}', '{$fieldnameID}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                    //弹出所有学生的窗口
                //弹出所有学生的窗口
                case 'jumpstudentall':
                    $colspan = 2;
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $fieldValue = $fields['value'][$fieldname];
                            $showtext = $html_etc[$tablename][$fieldname];
                            $fieldnameID = $fieldname . "ID";
                            print "<TR>";
                            print "<TD class=TableData noWrap>" . $showtext . "</TD>\n";
                            print "<TD class=TableData noWrap colspan=\"{$colspan}\">\n";
                            print "<input type=\"hidden\" name=\"{$fieldnameID}\" value=\"{$fieldValue}\">\n";
                            print "<input type=\"text\" name=\"{$fieldname}\" value=\"{$fieldValue}\" readonly class=\"SmallStatic\" size=\"20\">\n";
                            print "<a href=\"javascript:;\" class=\"orgAdd\" onClick=\"SelectAllStudentSingle('','{$fieldnameID}', '{$fieldname}')\">选择</a>\n";
                            print $addtext = FilterFieldAddText($addtext, $fieldname);
                            print "</TD></TR>\n";
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $fields['value'][$fieldname], $colspan, $system_picture_line, $notnulltext);
                            break;
                    }
                    //idnumfile
                    break;
                case 'select':
                case 'selectcolor':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            print_select($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field'], $fields['other']['inputcols'], $fields['select'][$i]['setfieldname'], $fields['select'][$i]['setfieldvalue'], $fields['select'][$i]['setfieldboolean'], $fields['select'][$i]['initvalue']);
                            break;
                        case 'view':
                            if ($tablename == $fields['select'][$i]['tablename']) {
                                $showText = $html_etc[$tablename][$fields['select'][$i]['field']];
                            } else {
                                $showText = $html_etc[$tablename][$fieldname];
                            }
                            print_select_text($showText . ":", trim($fields['value'][$fieldname]), $fieldname, $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field'], $fieldfilter);
                            break;
                    }
                    break;
                case 'selectpriv':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            print_selectpriv($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]));
                            break;
                        case 'view':
                            print_select_text($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $fieldname, "user_priv", "USER_PRIV", "PRIV_NAME");
                            break;
                    }
                    break;
                case 'select2':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            $lastFieldName = $fields['name'][$i - 1];
                            print_select2($html_etc[$tablename][$lastFieldName] . ":", $fieldname, $fields['name'][$i - 1], trim($fields['value'][$fieldname]), $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field']);
                            break;
                        case 'view':
                            print_select_text($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]), $fieldname, $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field']);
                            break;
                    }
                    break;
                case 'tablefilter6':
                    switch ($mode) {
                        case 'add':
                            print_select_four_address('', $tablename);
                            break;
                        case 'edit':
                            print_select_four_address($fields['value'], $tablename);
                            break;
                    }
                    break;
                case 'tablefilter3':
                    switch ($mode) {
                        case 'add':
                            if (file_exists("../../Framework/system_config.ini")) {
                                $iniFile = parse_ini_file("../../Framework/system_config.ini");
                            } else {
                                if (file_exists("../Framework/system_config.ini")) {
                                    $iniFile = parse_ini_file("../Framework/system_config.ini");
                                } else {
                                    if (file_exists("Framework/system_config.ini")) {
                                        $iniFile = parse_ini_file("Framework/system_config.ini");
                                    }
                                }
                            }
                            print_select_countryCode($iniFile['provinces'], $fields);
                            break;
                        case 'edit':
                            $fieldname = $fields['name'][$i + 2];
                            print_select_countryCode($fields['value'][$fieldname], $fields);
                            break;
                    }
                    break;
                case 'select_two':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            $fieldname2 = $fields['name'][$i + 1];
                            print_select_two($html_etc[$tablename][$fieldname] . ":", $fieldname, $html_etc[$tablename][$fieldname2] . ":", $fieldname2, trim($fields['value'][$fieldname]), $fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field'], $fields['select'][$i]['where'], $fields['select'][$i]['where_value'], $fields['select'][$i]['where_table'], $fields['select'][$i]['where_table_value'], $fields['select'][$i]['where_table_name'], 1, trim($fields['value'][$fieldname2]), $notnulltext);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'select_select_input':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = $fields['select'][$i]['initvalue'];
                        case 'edit':
                            $fieldname2 = $fields['name'][$i + 1];
                            //print_select_menu_product($showtext,$showFieldName,$showFieldID,$showtext2,$showFieldName2,$showFieldValue,$tableName,$colspan=1)
                            print_select_menu_product($html_etc[$tablename][$fieldname] . ":", $fields['select'][$i]['field'], $fields['select'][$i]['value'], $html_etc[$tablename][$fieldname2] . ":", $fields['select'][$i]['secondIndexName'], trim($fields['value'][$fieldname]), $fields['select'][$i]['tablename'], $fieldname, $fieldname2, 2);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'select_input':
                    switch ($mode) {
                        case 'add':
                            $filtervalue_name_backup_id = isset($_GET[$fieldname]) ? $_GET[$fieldname] : '';
                            $filtervalue_name_backup_name = isset($_GET[$fieldname . "name"]) ? $_GET[$fieldname . "name"] : '';
                        case 'edit':
                            $filtervalue_name = gettablefield($fields['select'][$i]['tablename'], $fields['select'][$i]['value'], $fields['select'][$i]['field'], trim($fields['value'][$fieldname]));
                            $filename = "frame_depart_notify.php?title=" . $common_html['common_html']['select_record'] . "&tablename=" . $fields['select'][$i]['tablename'] . "&fieldid=" . $fields['select'][$i]['value'] . "&fieldname=" . $fields['select'][$i]['field'] . "&field={$fieldname}&AddUserField=" . $fields['select'][$i]['userField'] . "";
                            //print $fields['select'][$i]['userField'];
                            $temp_id_name = trim($fields['value'][$fieldname]);
                            $filtervalue_id = isset($temp_id_name) ? $temp_id_name : $filtervalue_name_backup_id;
                            $filtervalue_name = isset($filtervalue_name) ? $filtervalue_name : $filtervalue_name_backup_name;
                            global $systemlang;
                            if ($filtervalue_name == '' && $tablename == 'notify') {
                                $filtervalue_name = $common_html['common_html']['AllDepartment'];
                                $filtervalue_id = '0';
                            }
                            select_form('input', $html_etc[$tablename][$fieldname] . ":", $fieldname, $fieldname . "name", $filename, $filtervalue_id, $filtervalue_name, $_GET['fixed']);
                            unset($filename);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'select_textarea':
                    switch ($mode) {
                        case 'add':
                            if ($fields['select'][$i]['tablename'] != "" && $fields['select'][$i]['field'] != "" && $fields['select'][$i]['value'] != "") {
                                $filtervalue_name = idtoname(trim($fields['value'][$fieldname]), $mode = 'dept');
                                $filename = "frame_depart_notify.php?title=" . $common_html['common_html']['select_record'] . "&tablename=" . $fields['select'][$i]['tablename'] . "&type=1&fieldid=" . $fields['select'][$i]['value'] . "&fieldname=" . $fields['select'][$i]['field'] . "&field={$fieldname}";
                            } else {
                                $filtervalue_name = isset($filtervalue_name) ? $filtervalue_name : trim($fields['value'][$fieldname]);
                                $filename = "frame_user.php?title=" . $common_html['common_html']['select_record'] . "&TO_ID=" . $fieldname . "&TO_NAME=" . $fieldname . "name";
                            }
                            //print $fieldname;
                            $filtervalue_id = isset($_GET[$fieldname]) ? $_GET[$fieldname] . "," : '';
                            $filtervalue_name = isset($_GET[$fieldname . "name"]) ? $_GET[$fieldname . "name"] . "," : '';
                            select_form('textarea', $html_etc[$tablename][$fieldname] . ":", $fieldname, $fieldname . "name", $filename, $filtervalue_id, $filtervalue_name);
                            unset($filename);
                            break;
                        case 'edit':
                            switch ($_GET['action']) {
                                case 'edit_reply':
                                    $fields['value'][$fieldname] = $global_hidden_field;
                                    break;
                                case 'edit_forward':
                                    $fields['value'][$fieldname] = '';
                                    break;
                            }
                            if ($fields['select'][$i]['tablename'] != "" && $fields['select'][$i]['field'] != "" && $fields['select'][$i]['value'] != "") {
                                $filtervalue_name = idtoname(trim($fields['value'][$fieldname]), $mode = 'dept');
                                $filename = "frame_depart_notify.php?title=" . $common_html['common_html']['select_record'] . "&tablename=" . $fields['select'][$i]['tablename'] . "&type=1&fieldid=" . $fields['select'][$i]['value'] . "&fieldname=" . $fields['select'][$i]['field'] . "&field={$fieldname}";
                            } else {
                                $filtervalue_name = isset($filtervalue_name) ? $filtervalue_name : trim($fields['value'][$fieldname]);
                                $filename = "frame_user.php?title=" . $common_html['common_html']['select_record'] . "&TO_ID=" . $fieldname . "&TO_NAME=" . $fieldname . "name";
                            }
                            $temp_id_name = trim($fields['value'][$fieldname]);
                            $filtervalue_id = isset($temp_id_name) ? $temp_id_name : $filtervalue_name_backup_id;
                            $filtervalue_name = isset($filtervalue_name) ? $filtervalue_name : $filtervalue_name_backup_name;
                            select_form('textarea', $html_etc[$tablename][$fieldname] . ":", $fieldname, $fieldname . "name", $filename, $filtervalue_id, $filtervalue_name);
                            unset($filename);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'select_sms':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = 1;
                        case 'edit':
                            //$fields['value'][$fieldname]=1;
                            print_select_single($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 'select_sms', $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", return_select_filter('select_sms', trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'select_education':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = 5;
                        case 'edit':
                            //$fields['value'][$fieldname]=5;
                            print_select_single($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 'select_education', $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", return_select_filter('select_education', trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'select_marriage':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = 0;
                        case 'edit':
                            print_select_single($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 'select_marriage', $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", return_select_filter('select_marriage', trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'select_politics':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = 1;
                        case 'edit':
                            print_select_single($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 'select_politics', $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", return_select_filter('select_politics', trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'select_worklog':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = 1;
                        case 'edit':
                            print_select_single($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 'select_worklog', $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", return_select_filter('select_worklog', trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'userlang':
                    switch ($mode) {
                        case 'add':
                            $fields['value'][$fieldname] = 'zh';
                        case 'edit':
                            print_select_single($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 'userlang', $addtext);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", return_select_filter('userlang', trim($fields['value'][$fieldname])));
                            break;
                    }
                    break;
                case 'edit_move':
                    switch ($mode) {
                        case 'add':
                            select_return_navigation($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 1);
                        case 'edit':
                            select_return_navigation($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), 1);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'mobile':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $inputsize = $fields['inputsize'][$fieldname];
                            if ($inputsize == "" || $inputsize == 0) {
                                $inputsize = $fields['other']['inputsize'];
                            }
                            print_tr($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $inputsize, $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1, "mobile");
                            $custom_type = "";
                            break;
                        case 'view':
                            $i < 5 ? $colspan = 2 : ($colspan = 2);
                            $i == 1 ? '' : ($system_picture_line = '');
                            $var = trim($fields['value'][$fieldname]);
                            $var = "<a href='../JXC/sms_sendlist_newai.php?action=add_default&sendlist=" . $var . "' target='_blank'>{$var}</a>";
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $var, $colspan);
                            break;
                    }
                    break;
                case 'multiselect':
                    switch ($mode) {
                        case 'add':
                            print_select_classtable($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['multiselect'][$i]);
                            break;
                        case 'edit':
                            print_select_classtable($html_etc[$tablename][$fieldname] . ":", $fieldname, trim($fields['value'][$fieldname]), $fields['multiselect'][$i]);
                            break;
                        case 'view':
                            $filtervalue = idtoname($fields['value'][$fieldname], $mode = 'course');
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $filtervalue);
                            break;
                    }
                    break;
                case 'hidden_field':
                    $hiddenid = $fields['hidden_field'][$i]['hiddenid'];
                    $hiddenname = $fieldname;
                    global $SUNSHINE_USER_NAME_VAR, $SUNSHINE_USER_DEPT_VAR, $SUNSHINE_USER_DEPT_VAR, $SUNSHINE_USER_ID_VAR, $_SESSION, $SUNSHINE_USER_DEPT_VAR;
                    switch ($fields['hidden_field'][$i]['hiddentype']) {
                        case 'dept':
                            $fields['value'][$fieldname] = $_SESSION['USER_DEPT'];
                            break;
                        case 'name':
                            $fields['value'][$fieldname] = $_SESSION['LOGIN_USER_ID'];
                            break;
                        case 'realname':
                            $fields['value'][$fieldname] = $_SESSION['LOGIN_USER_NAME'];
                            break;
                        case 'id':
                            $fields['value'][$fieldname] = $_SESSION['LOGIN_USER_ID'];
                            break;
                        case 'value':
                            $fields['value'][$fieldname] = $hiddenid;
                            break;
                        case 'get':
                            $fields['value'][$fieldname] = $_GET[$fieldname];
                            break;
                        case 'post':
                            $fields['value'][$fieldname] = $_POST[$fieldname];
                            break;
                        case 'field':
                            //$fields['value'][$fieldname]=$fields['value'][$fieldname];
                            break;
                    }
                    //print $SUNSHINE_USER_NAME_VAR;
                    //print $fields['value'][$fieldname];
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            switch ($_GET['action']) {
                                case 'edit_reply':
                                    print_hidden($_SESSION[$SUNSHINE_USER_NAME_VAR], $hiddenname);
                                    break;
                                case 'edit_forward':
                                    print_hidden($fields['value'][$hiddenname], $hiddenname);
                                    break;
                                default:
                                    print_hidden($fields['value'][$hiddenname], $hiddenname);
                            }
                            break;
                        case 'view':
                            break;
                    }
                    $global_hidden_field = $fields['value'][$hiddenname];
                    break;
                case 'system_datetime':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            print_hidden(date("Y-m-d H:i:s"), $fieldname);
                            break;
                        case 'view':
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", trim($fields['value'][$fieldname]));
                            break;
                    }
                    break;
                case 'attchmentid':
                    switch ($mode) {
                        case 'add':
                            print_file($html_etc[$tablename][$fieldname] . ":", $fieldname);
                            break;
                        case 'edit':
                            $attachmentid_merge = trim($fields['value'][$fieldname]);
                            print_hidden($attachmentid_merge, $fieldname);
                            //print_file($html_etc[$tablename][$fieldname].":",$fieldname);
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'attchmentname':
                    switch ($mode) {
                        case 'add':
                            print_hidden('', $fieldname);
                            break;
                        case 'edit':
                            //判断文件所在路径
                            $PHP_SELF_ARRAY = explode('/', $_SERVER['PHP_SELF']);
                            $IndexNumber = sizeof($PHP_SELF_ARRAY) - 2;
                            $DirNameSelf = $PHP_SELF_ARRAY[$IndexNumber];
                            if ($DirNameSelf != "Framework") {
                                $DirFilePath = "../../Framework/";
                            } else {
                                $DirFilePath = "./";
                            }
                            //判断结束
                            $attachmentname_merge = trim($fields['value'][$fieldname]);
                            $fileurl = returnfileurl($attachmentid_merge, $attachmentname_merge);
                            $span = "<SPAN id=new_file></SPAN><BR>\n";
                            $index_html = $span . "<iframe name=uploadfile frameborder=0 width=100% height=40 scrolling=no src=" . $DirFilePath . "uploadfile.php></iframe>\n";
                            print_text_tr($html_etc[$tablename][$fieldname] . ":", $index_html);
                            print_hidden($attachmentname_merge, $fieldname);
                            print "<script>\n";
                            print "new_file.innerHTML+=\"{$fileurl}\";\n";
                            print "</script>\n";
                            break;
                        case 'view':
                            break;
                    }
                    break;
                case 'userdefine':
                    switch ($mode) {
                        case 'add':
                        case 'edit':
                            $functionName = trim($fields['userdefine'][$i]);
                            $fileName = $functionName . ".php";
                            $fileName0 = "userdefine/{$fileName}";
                            $fileName = "../../Enginee/userdefine/{$fileName}";
                            if (file_exists($fileName0)) {
                                require_once $fileName0;
                                $functionName = $functionName . "_add";
                                if (function_exists($functionName)) {
                                    $filtervalue = $functionName($fields, $i);
                                    print $filtervalue;
                                }
                            } else {
                                if (file_exists($fileName)) {
                                    require_once $fileName;
                                    $functionName = $functionName . "_add";
                                    if (function_exists($functionName)) {
                                        $filtervalue = $functionName($fields, $i);
                                        print $filtervalue;
                                    } else {
                                        print "函数名称[{$functionName}]不存在!";
                                    }
                                } else {
                                    print "没有相应文件,文件名:{$fileName}";
                                }
                            }
                            break;
                        case 'view':
                            if ($colflag == 0) {
                                $colspan = 5;
                            }
                            if ($colflag == 1 || $colflag == 0) {
                                print "<tr>\n";
                            }
                            $functionName = trim($fields['userdefine'][$i]);
                            $fileName = $functionName . ".php";
                            $fileName0 = "userdefine/{$fileName}";
                            $fileName = "../../Enginee/userdefine/{$fileName}";
                            if (file_exists($fileName0)) {
                                require_once $fileName0;
                                $functionName = $functionName . "_view";
                                if (function_exists($functionName)) {
                                    $filtervalue = $functionName($fields, $i);
                                    print $filtervalue;
                                }
                            } else {
                                if (file_exists($fileName)) {
                                    require_once $fileName;
                                    $functionName = $functionName . "_view";
                                    if (function_exists($functionName)) {
                                        $filtervalue = $functionName($fields, $i);
                                        print $filtervalue;
                                    } else {
                                        print "函数名称[{$functionName}]不存在!";
                                    }
                                } else {
                                    print "没有相应文件,文件名:{$fileName}";
                                }
                            }
                            if ($colflag == 2 || $colflag == 0) {
                                print "</tr>\n";
                            }
                            break;
                    }
                    //end userdefine
            }
            //end switch
        } else {
        }
    }
    //光标定位
    //print_R($fields['filter']);
    for ($i = 0; $i < sizeof($fields['filter']); $i++) {
        if ($fields['filter'][$i] == '') {
            $index = $i;
            break;
        }
    }
    $focusname = $fields['name'][$index];
    switch ($mode) {
        case 'add':
        case 'edit':
            if ($focusname != "") {
                print "<script>\n\t\tfunction Object_focus(Object)\n\t\t{\n\t\t var strFloat=Object.legth;\n\t\t Object.focus();\n\t\t}\n\t\tObject_focus(" . $fields['form']['name'] . "." . $focusname . ");\n\t\t</script>";
            }
            break;
        case 'view':
            break;
    }
    //记录子表选项列表模块
    global $subtableArray;
    //Foreign Key Value
    $parent_value = $_GET[$primarykey_index];
    if ($mode == "view") {
        for ($i = 0; $i < sizeof($subtableArray); $i++) {
            $mainkey2 = $subtableArray[$i]['maintable_key'];
            if ($mainkey2 != '') {
                $parent_valueX = returntablefield($tablename, $primarykey_index, $parent_value, $mainkey2);
            } else {
                $parent_valueX = $parent_value;
            }
            ViewChildTableList($subtableArray[$i], $parent_valueX);
        }
    }
    //表单提交按钮部分模块
    switch ($mode) {
        case 'add':
        case 'edit':
            show_submit_element($action_submit, 'left');
            //            echo $action_submit;//by cwf
            break;
        case 'view':
            show_submit_element($action_submit, 'left');
            break;
    }
    table_end();
    if ($form_attribute != 'hidden') {
        form_end();
    }
    global $parse_filename, $tablename;
    //用户自定义设计部分,此部分允许自己定义某些显示特性
    $允许自定义的类型列表 = array("init_default", "init_customer", "add_default", "edit_default", "view_default");
    if (in_array($_GET['action'], $允许自定义的类型列表) && $_SESSION['LOGIN_USER_ID'] == 'admin') {
        if ($parse_filename == "") {
            $parse_filename = $tablename;
        }
        $PHP_SELF_ARRAY = explode('/', $_SERVER['PHP_SELF']);
        //print_R($PHP_SELF_ARRAY);
        $FILE_SELF_NAME = array_pop($PHP_SELF_ARRAY);
        $FileDirName = array_pop($PHP_SELF_ARRAY);
        $是否是接口目录 = array_pop($PHP_SELF_ARRAY);
        if ($是否是接口目录 == "Interface" && $FileDirName != "PGSQL") {
            //print "<BR><div align=center><a href=\"../CONFIG/config.php?XX=XX&action=".$_GET['action']."&Tablename=$tablename&FileIniname=$parse_filename&FileDirName=$FileDirName&actionconfig=config&GOBACKFILENAME=$FILE_SELF_NAME\" title='配置当前页面显示参数 $执行时间TEXT'>配置当前页面显示参数</a>&nbsp;<a href=\"http://www.tongda2000.com/edu/book/index.php?action=add\" target=_blank title='将问题反馈给开发商进行解决'>问题反馈</a></div>";
        }
    }
}
<?php

if (!defined('IN_ET')) {
    exit('Access Denied');
}
if (!$user_id) {
    echo "<div class='showmag'><p>您还没有登录,不能执行此操作!</p><p><a href='index.php?op=login'>现在登陆</a></p></div>";
    wapfooter();
    exit;
}
$senduid = $_GET['uid'];
$sendname = idtoname($senduid);
if ($action == "post") {
    $msgbody = iconv("utf-8", "gbk", replace(daddslashes($_POST['msgbody'])));
    $tm = $db->query("INSERT INTO et_messages (js_id,fs_id,message_body,m_time) VALUES ('{$senduid}','{$user_id}','{$msgbody}','{$addtime}')");
    if ($tm == 1) {
        echo "<div class='showmag'><p>给" . $sendname . "的私信发送成功</p><p><a href='index.php'>返回首页</a></p></div>";
        wapfooter();
        exit;
    } else {
        echo "<div class='showmag'><p>很抱歉,私信发送失败!</p><p><a href='index.php'>返回首页</a></p></div>";
        wapfooter();
        exit;
    }
}
echo "<h2>给 {$sendname} 发送私信</h2>" . "<form method=\"post\" action=\"index.php?op=sendmsg&uid={$senduid}\">" . "<p><input type=\"text\" name=\"msgbody\" value=\"\" maxlength=\"140\" /></p>" . "<p><input type=\"hidden\" name=\"action\" value=\"post\" /><input type=\"submit\" value=\"发送\" /></p>" . "</form>";