Example #1
0
function newaiinit($fields, $mode)
{
    global $common_html, $html_etc;
    global $return_sql_line, $db;
    global $action_add, $action_model;
    global $_POST, $_GET, $ROWS_PAGE, $mark;
    global $merge, $childnums, $childsums, $child_filter;
    global $SYSTEM_ADD_SQL;
    $fields = newaiinit_value($fields);
    if ($merge) {
        $fields = newai_merge($fields, $merge);
    }
    if ($childnums) {
        $fields = newai_childnums($fields, $childnums);
    }
    if ($childsums) {
        $fields = newai_childsums($fields, $childsums);
    }
    global $tablewidth;
    $tablewidth = $tablewidth != "" ? $tablewidth : 450;
    //增加对高级搜索支持
    if ($_GET['actionadv'] == "exportadv_default") {
        newai_search($fields);
    }
    table_begin($tablewidth);
    show_search_element($mark);
    //“新建”按钮查询按钮的控制函数,此函数在newai.php中定义
    newaiinit_view($fields);
    UserDefineFunction();
    UserSumFunction($fields);
    //print_R($_REQUEST);
    if ($_GET['action'] == "") {
        $_GET['action'] = "init_default";
    }
    if ($_REQUEST['action'] != "") {
        $_GET['action'] = $_REQUEST['action'];
    }
    //print_R($_GET);
    newaiinit_bottommemo();
    newaiinit_bottom($fields['other']['rc'], $fields['other']['pageid'], $fields['other']['pagenums'], $ROWS_PAGE, $add = 'action', $add_var = $_GET['action']);
    table_end();
}
 function _query($sql, $inputarr)
 {
     global $ADODB_COUNTRECS;
     // Move to the next recordset, or return false if there is none. In a stored proc
     // call, mysqli_next_result returns true for the last "recordset", but mysqli_store_result
     // returns false. I think this is because the last "recordset" is actually just the
     // return value of the stored proc (ie the number of rows affected).
     // Commented out for reasons of performance. You should retrieve every recordset yourself.
     //	if (!mysqli_next_result($this->connection->_connectionID))	return false;
     if (is_array($sql)) {
         // Prepare() not supported because mysqli_stmt_execute does not return a recordset, but
         // returns as bound variables.
         $stmt = $sql[1];
         $a = '';
         foreach ($inputarr as $k => $v) {
             if (is_string($v)) {
                 $a .= 's';
             } else {
                 if (is_integer($v)) {
                     $a .= 'i';
                 } else {
                     $a .= 'd';
                 }
             }
         }
         $fnarr = array_merge(array($stmt, $a), $inputarr);
         $ret = call_user_func_array('mysqli_stmt_bind_param', $fnarr);
         $ret = mysqli_stmt_execute($stmt);
         return $ret;
     }
     /*
     if (!$mysql_res =  mysqli_query($this->_connectionID, $sql, ($ADODB_COUNTRECS) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT)) {
         if ($this->debug) ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg());
         return false;
     }
     
     return $mysql_res;
     */
     if ($this->multiQuery) {
         $rs = mysqli_multi_query($this->_connectionID, $sql . ';');
         if ($rs) {
             $rs = $ADODB_COUNTRECS ? @mysqli_store_result($this->_connectionID) : @mysqli_use_result($this->_connectionID);
             return $rs ? $rs : true;
             // mysqli_more_results( $this->_connectionID )
         }
     } else {
         $rs = mysqli_query($this->_connectionID, $sql, $ADODB_COUNTRECS ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
         if ($rs) {
             return $rs;
         } else {
             $sql = trim($sql);
             //print_R($rs);
             global $SYSTEM_DEBUG_SQL;
             if (strlen($sql) > 6 && $SYSTEM_DEBUG_SQL == 1 && !$rs) {
                 page_css("向软件开发商报告错误");
                 table_begin("600");
                 print_title("警告:发生SQL语句错误信息!");
                 print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;报告时间</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . date("Y-m-d H:i:s") . "</TD>\n\t\t\t\t\t\t\t</TR>";
                 print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;错误类型</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;SQL语句出现错误</TD>\n\t\t\t\t\t\t\t</TR>";
                 print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;文件地址</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . $_SERVER['PHP_SELF'] . "</TD>\n\t\t\t\t\t\t\t</TR>";
                 print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;SQL语句</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . $sql . "</TD>\n\t\t\t\t\t\t\t</TR>";
                 print "<TR>\n\t\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;错误信息</TD>\n\t\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . $this->ErrorMsg() . "</TD>\n\t\t\t\t\t\t\t</TR>";
                 //$sqlTEXT2010 = ereg_replace("'","____",$sqlTEXT2010);
                 $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010);
                 $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010);
                 //$mysql_error = ereg_replace("'","____",$mysql_error);
                 $mysql_error = ereg_replace("=", "+", $mysql_error);
                 $mysql_error = ereg_replace("=", "+", $mysql_error);
                 $FILE_PATH = $_SERVER['REQUEST_URI'];
                 $FILE_PATH = ereg_replace("=", "+", $FILE_PATH);
                 $FILE_PATH = ereg_replace("=", "+", $FILE_PATH);
                 table_end();
                 //print_R($_SERVER);
                 exit;
             }
         }
     }
     if ($this->debug) {
         ADOConnection::outp("Query: " . $sql . " failed. " . $this->ErrorMsg());
     }
     return false;
 }
Example #3
0
function newaiCharts()
{
    global $html_etc, $tablename, $common_html, $custom_type;
    global $db, $return_sql_line, $columns;
    global $_POST, $_GET, $returnmodel, $primarykey_index;
    global $action_submit, $merge, $form_attribute;
    global $tabletitle;
    global $showlistfieldlist, $showlistfieldfilter, $showlistfieldtype;
    $showlistfieldlistArray = explode(',', $showlistfieldlist);
    $showlistfieldfilterArray = explode(',', $showlistfieldfilter);
    $showlistfieldtypeArray = explode(',', $showlistfieldtype);
    //获取系统显示的色彩信息
    $ColorArray = returnColorArray();
    //获取系统求和字段信息
    global $sum_index, $UserUnitFunctionIndex;
    if ($sum_index != "") {
        $sum_sql_index = " ,sum({$sum_index}) as sum ";
    } else {
        $sum_sql_index = "";
    }
    //报表统计主体部分开始
    for ($k = 0; $k < sizeof($showlistfieldlistArray); $k++) {
        $fieldIndex = $showlistfieldlistArray[$k];
        $fieldName = $columns[$fieldIndex];
        $fieldText = $html_etc[$tablename][$fieldName];
        $mode = $showlistfieldfilterArray[$k];
        $modeArray = explode(':', $mode);
        //print_R($modeArray);
        $modeIndex = $modeArray[0];
        $Mode = "";
        switch ($modeIndex) {
            case '':
                break;
            case 'tablefilter':
            case 'tablefiltercolor':
            case 'radiofilter':
            case 'radiofiltercolor':
                if ($modeArray[1] == "month" && $modeArray[2] == "") {
                    $Mode = "Month";
                    $SQL = "select Date_Format({$fieldName},'%c') AS {$fieldName},Sum({$sum_index}) as sum,Count({$fieldName}) as num from {$tablename} group by {$fieldName}";
                } else {
                    if ($modeArray[1] == "year" && $modeArray[2] == "") {
                        $Mode = "Year";
                        $SQL = "select Date_Format({$fieldName},'%Y') AS {$fieldName},Sum({$sum_index}) as sum,Count({$fieldName}) as num from {$tablename} group by {$fieldName}";
                    } else {
                        $Mode = "";
                        $SQL = "select {$fieldName},Count({$fieldName}) as num {$sum_sql_index} from {$tablename} group by {$fieldName}";
                    }
                }
                $rs = $db->CacheExecute(150, $SQL);
                $rs_array = $rs->GetArray();
                //print_R($rs_array);
                //父表结构部分
                $tablenameIndex = $modeArray[1];
                $ColumnsIndex = returntablecolumn($tablenameIndex);
                $html_etcIndex = returnsystemlang($tablenameIndex, $tablenameIndex);
                $WhatIndex = $ColumnsIndex[(string) $modeArray[2]];
                $ReturnIndex = $ColumnsIndex[(string) $modeArray[3]];
                //本表操作部分--数据处理部分 --形成FLASH要处理的数据类型
                $TotalNumberIndex = 0;
                $TotalSumIndex = 0;
                $Array = array();
                for ($i = 0; $i < sizeof($rs_array); $i++) {
                    $ResultNumber = $rs_array[$i]['num'];
                    $ResultSum = $rs_array[$i]['sum'];
                    $ResultFieldCode = $rs_array[$i][$fieldName];
                    switch ($Mode) {
                        case 'Month':
                            $ResultFieldName = $ResultFieldCode . "" . $common_html['common_html']['month'];
                            break;
                        case 'Year':
                            $ResultFieldName = $ResultFieldCode . "" . $common_html['common_html']['year'];
                            break;
                        default:
                            $ResultFieldName = returntablefield($tablenameIndex, $WhatIndex, $ResultFieldCode, $ReturnIndex);
                            if ($ResultFieldName == "") {
                                $ResultFieldName = $ResultFieldCode;
                            }
                            break;
                    }
                    $TotalNumberIndex += $ResultNumber;
                    $TotalSumIndex += $ResultSum;
                    $Array_Statistic_Value = $sum_index != "" ? $ResultSum : $ResultNumber;
                    $Array['XData'][$i]['Name'] = $ResultFieldName;
                    $Array['XData'][$i]['Value'] = $Array_Statistic_Value;
                    $Array['XData'][$i]['Dir'] = $ResultFieldName;
                    $Array['XData'][$i]['AltText'] = $ResultFieldName;
                    //$Array['XData'][$i]['Url'] = "?action=init_customer&$fieldName=$ResultFieldCode";
                    $ColorArray[$i] == "" ? $ColorArray[$i] = "0xCC0000" : '';
                    $Array['XData'][$i]['Color'] = $ColorArray[$i];
                    $Array['Dir'][$i]['Name'] = $ResultFieldName;
                    $Array['Dir'][$i]['Color'] = $ColorArray[$i];
                    $Array['YData']['AltText'] = "移动查看详细信息";
                    $Array['YData']['Value'] < $Array_Statistic_Value ? $Array['YData']['Value'] = $Array_Statistic_Value : '';
                }
                $Array['title'] = $html_etc[$tablename][$tabletitle] . "[" . $html_etc[$tablename][$fieldName] . "]";
                $array_graphInfo = $Array['title'] . "[" . date("Y-m-d H:i:s") . "] " . $common_html['common_html']['totalrecords'] . ": " . $TotalNumberIndex;
                if ($sum_index != "") {
                    $array_graphInfo .= " " . $common_html['common_html']['allnumbers'] . ": " . $TotalSumIndex . " &nbsp;" . $UserUnitFunctionIndex . "\n";
                }
                $Array['graphInfo'] = $array_graphInfo;
                //print_R($FlashFileName);
                //本表操作部分--FALSH图表显示部分--显示FLASH图表的结果
                table_begin("650");
                $ChartMode = $showlistfieldtypeArray[$k];
                //采用的图表类型选择
                //print $tablename;
                switch ($ChartMode) {
                    case 'vBarF':
                        $FlashFileName = WriteXmlFilevBarF($Array, $tablename, $k);
                        //Flash XML 数据写入文件区
                        $create_chart = create_chart("vBarF", $FlashFileName);
                        //FLASH 图表读入XML数据处理以后的显示区
                        break;
                    case 'hBarF':
                        $FlashFileName = WriteXmlFilehBarF($Array, $tablename, $k);
                        //Flash XML 数据写入文件区
                        $create_chart = create_chart("hBarF", $FlashFileName);
                        //FLASH 图表读入XML数据处理以后的显示区
                        break;
                    case 'pieF':
                        $FlashFileName = WriteXmlFilePieF($Array, $tablename, $k);
                        //Flash XML 数据写入文件区
                        $create_chart = create_chart("pieF", $FlashFileName);
                        //FLASH 图表读入XML数据处理以后的显示区
                        break;
                    default:
                        $FlashFileName = WriteXmlFilevBarF($Array, $tablename, $k);
                        //Flash XML 数据写入文件区
                        $create_chart = create_chart("vBarF", $FlashFileName);
                        //FLASH 图表读入XML数据处理以后的显示区
                        break;
                }
                //HTML文体显示部分
                print "<TR class=TableData>";
                print "<TD noWrap width=100% align=center colspan=40>";
                print "{$create_chart} &nbsp;</TD>";
                print "</TR>";
                //本文信息显示部分
                //print_title($html_etc[$tablename][$tabletitle]."<font color=green>[".$html_etc[$tablename][$fieldName]."]</font>",40);
                print_title($html_etc[$tablename][$tabletitle] . "[" . $html_etc[$tablename][$fieldName] . "]", 6);
                for ($i = 0; $i < sizeof($rs_array); $i++) {
                    $ResultNumber = $rs_array[$i][num];
                    $ResultSum = $rs_array[$i][sum];
                    $ResultFieldCode = $rs_array[$i][$fieldName];
                    $ResultFieldName = returntablefield($tablenameIndex, $WhatIndex, $ResultFieldCode, $ReturnIndex);
                    if ($ResultFieldName == "") {
                        $ResultFieldName = $ResultFieldCode;
                    }
                    print "<TR class=TableData>";
                    print "<TD noWrap width=15%>统计类别名称&nbsp;</TD>";
                    print "<TD width=35%>" . $ResultFieldName . "&nbsp;</TD>";
                    if ($sum_index != "") {
                        print "<TD noWrap width=15%>统计额度&nbsp;</TD>";
                        print "<TD noWrap width=10%><font color=red>" . $ResultSum . "&nbsp;" . $UserUnitFunctionIndex . "</font></TD>";
                    } else {
                        //print "<TD noWrap width=15%>统计类别代码&nbsp;</TD>";
                        //print "<TD noWrap width=10%>".$ResultFieldCode."&nbsp;</TD>";
                    }
                    print "<TD  width=15%>统计记录数&nbsp;</TD>";
                    print "<TD noWrap width=10%><font color=red>" . $ResultNumber . "&nbsp;条</font></TD>";
                    print "</TR>";
                }
                print "<TR class=TableData>";
                print "<TD noWrap colspan = 40>\n";
                print $common_html['common_html']['totalrecords'] . ": <font color=red>{$TotalNumberIndex} &nbsp;条</font>\n";
                if ($sum_index != "") {
                    print $common_html['common_html']['allnumbers'] . ": <font color=red>{$TotalSumIndex} &nbsp;" . $UserUnitFunctionIndex . "</font>\n";
                }
                print "</TD>";
                print "</TR>";
                table_end();
                print "<BR>";
                break;
        }
    }
}
Example #4
0
CheckSystemPrivate("数字化校园系统设置-数据字典");
//######################教育组件-权限较验部分##########################
$GLOBAL_SESSION = returnsession();
$CurXueQi = returntablefield("edu_xueqiexec", "当前学期", '1', "学期名称");
if ($_GET['开课教师'] != "") {
    $SHOWTEXT = "1";
} else {
    $SHOWTEXT = "0";
}
$goalfile = "../../Framework/system_config.ini";
if ($_GET['action'] == "") {
    $parse_ini_file = parse_ini_file($goalfile);
    page_css("预设省份区域");
    print "<SCRIPT>\n\tfunction FormCheck()\n\t{\n\t\t//if (document.form1.开课教师.value == \"\") {\n\t\t//alert(\"教师信息没有填写\");\n\t\t//return false;}\n\t}\n\tfunction td_calendar(fieldname) {\n\t\tmyleft=document.body.scrollLeft+event.clientX-event.offsetX-80;\n\t\tmytop=document.body.scrollTop+event.clientY-event.offsetY+140;\n\t\twindow.showModalDialog(fieldname,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:200px;dialogTop:\"+mytop+\"px;dialogLeft:\"+myleft+\"px\");\n\t\t}\n\t</SCRIPT>";
    print "<FORM name=form1 onsubmit=\"return FormCheck();\"  action=\"?action=DataDeal&pageid=1\" method=post encType=multipart/form-data>";
    table_begin("80%");
    print "<tr class=TableHeader><td colspan=2>&nbsp;预设省份区域[在某些使用到省份地市区县三级联动时,进行默认的值]</td></tr>";
    print_select_countryCode($parse_ini_file['provinces'], $fields);
    print_submit("提交");
    table_end();
    form_end();
    exit;
}
if ($_GET['action'] == "DataDeal") {
    page_css("预设省份区域");
    //$file = file($goalfile);
    $DataText = "[section]\nprovinces=" . $_POST['areaCode'];
    @(!($handle = fopen($goalfile, 'w')));
    fwrite($handle, $DataText);
    fclose($handle);
    //print_R($_POST);
Example #5
0
 $returnmodel = $file_ini[$action]['returnmodel'];
 $hidden_field = $file_ini[$action]['hidden_field'];
 $passwordcheck = $file_ini[$action]['passwordcheck'];
 $delete_attribute = $file_ini[$action]['delete_attribute'];
 $showlistfieldfilter = $file_ini['init_default']['showlistfieldfilter'];
 $showlistfieldlist = $file_ini['init_default']['showlistfieldlist'];
 $columns = returntablecolumn($tablename);
 $html_etc = returnsystemlang($tablename, $SYTEM_CONFIG_TABLE);
 $primarykey_index = $columns[$primarykey];
 //print $passwordcheck;
 if ($passwordcheck == "1" && $_GET['actionAdvDelete'] != "AdvDelete" && $_GET['actionAdvDelete'] != "InforCheck") {
     page_css("密码二次验证");
     print "<body onload=\"document.form1.PASSWORD.focus();\">\n";
     //Array ( [action] => delete_array [returnmodel] => init_default [selectid] => 412, [pageid] => 1
     print "<form name=form1 action=\"?XX=XX&actionAdvDelete=InforCheck&action=delete_array&returnmodel=init_default&selectid=" . $_GET['selectid'] . "\" method=post encType=multipart/form-data>";
     table_begin("500");
     print_title("请输入您的用户密码,属于关键性操作,需要进行二次密码验证");
     print "<tr class=TableData><td width=25%>&nbsp;您的密码:</td><td>\n\t\t\t\t\t\t<input type=password name='PASSWORD' class=SmallInput >\n\t\t\t\t\t\t(您当前的登录密码)</td></tr>";
     print_submit("提交");
     table_end();
     form_end();
     //print_R($_GET);
     exit;
 } else {
     if ($passwordcheck == "1" && $_GET['actionAdvDelete'] == "InforCheck") {
         page_css("密码二次验证");
         global $db;
         //print_R($_SESSION);
         $LOGIN_USER_ID = $_SESSION['LOGIN_USER_ID'];
         $返回当前用户的密码 = returntablefield("user", "USER_ID", $LOGIN_USER_ID, "PASSWORD");
         //$PASSWORD		= md5(TRIM($_POST['PASSWORD']));
    $rs_a = $rs->GetArray();
    //print_R($cursor1);exit;
    $MODULE2 = TRIM($rs_a[0]['MODULE']);
    //print $MODULE2;
    if ($MODULE2 != "") {
        $sql = "update systemprivateinc set `DEPT_ID`='{$DEPT_ID}',`USER_ID`='{$USER_ID}',`ROLE_ID`='{$ROLE_ID}',`DEPT_NAME`='{$DEPT_NAME}',`USER_NAME`='{$USER_NAME}',`ROLE_NAME`='{$ROLE_NAME}' where `FILE`='{$FILE}' and `MODULE`='{$MODULE}'";
    } else {
        $sql = "insert into systemprivateinc values('','{$FILE}','{$MODULE}','{$DEPT_ID}','{$DEPT_NAME}','{$ROLE_ID}','{$ROLE_NAME}','{$USER_ID}','{$USER_NAME}')";
    }
    $db->Execute($sql);
    print_infor("您的配置已经完成", '', "location='?'", "?");
    exit;
}
table_begin("100%");
print "<tr class=TableHeader><td colspan=5>&nbsp;" . $TextHeader . "</td></tr>";
print "<tr class=TableHeader><td>&nbsp;所属部门</td><td>&nbsp;编辑权限</td><td>&nbsp;管理人员</td></tr>";
for ($i = 0; $i < sizeof($rsX_a); $i++) {
    $部门名称 = $rsX_a[$i]['所属部门'];
    $sql = "select * from systemprivateinc where MODULE='" . $部门名称 . "' and FILE='{$PHP_SELF}'";
    $rs = $db->Execute($sql);
    $rs_a = $rs->GetArray();
    if ($部门名称 != "") {
        print "<tr class=TableData><td>&nbsp;" . $部门名称 . "</td><td><a href=\"?" . base64_encode("FileNameSELF=" . $PHP_SELF_SELF . "&FileName=" . $PHP_SELF . "&ModuleName=" . $部门名称 . "") . "\">&nbsp;编辑权限</a></td>\n\t\t\t<td>&nbsp;" . $rs_a[0]['USER_NAME'] . "</td>\n\t\t\t</tr>";
    }
}
table_end();
print "<BR>";
table_begin("100%");
print "<tr class=TableHeader><td>事项说明:</td></tr>";
print "<tr class=TableData><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;每个部门指定一个管理员,那么这个管理员可以在'部门级管理'这个菜单中管理对应所属部门的相关信息;这个功能适用于分部门权限管理情形.</td></tr>";
table_end();
Example #7
0
function getpagedata_checkall($sql, $sql_num, $pageid, $functionname, $tablename, $add, $add_var, $width = "450", $pagenum = "15", $isshowtableheader = '', $disabled = '', $action_page = 'action_page', $action_page_value = 'action_page_value')
{
    global $db;
    global $html_etc;
    global $common_html;
    //require_once('lang/getpagedata_html.php');
    $rs =& $db->Execute($sql_num);
    $rc = $rs->fields['num'];
    if ($rc == 0) {
        print_infor($common_html['common_html']['norecord'], 'trip', "location='?action=init'");
        exit;
    }
    $ROWS_PAGE = $pagenum;
    $pagenums = ceil($rc / $ROWS_PAGE);
    if ($pageid == "" || empty($pageid)) {
        $pageid = 1;
    }
    if ($pageid > $pagenums) {
        $pageid = $pagenums;
    }
    $from = ($pageid - 1) * $ROWS_PAGE;
    $rsl = $db->CacheSelectLimit(15, $sql, $ROWS_PAGE, $from);
    require_once "./lib/choose_all_en.js";
    table_begin($width);
    if ($isshowtableheader == '') {
        $function_header = "show" . $tablename . "_header";
        $function_header();
    } else {
        if ($notshowtableheader == 'notshowtableheader') {
        } else {
            if ($isshowtableheader != 'notshowtableheader' && $isshowtableheader != '') {
                $isshowtableheader();
            } else {
            }
        }
    }
    while (!$rsl->EOF) {
        $functionname($rsl, $pageid);
        $rsl->MoveNext();
    }
    print "<tr><td class=TableData noWrap colspan=20>";
    if ($rc == 0) {
        print "<input type=\"checkbox\" name=\"allbox\" disabled onClick=\"check_all();\">" . $common_html['common_html']['chooseall'] . " &nbsp;&nbsp;\n";
        print "<input type=\"button\"  value=\"" . $common_html['common_html']['delete'] . "\" class=\"SmallButton\" disabled onClick=\"delete_mail();\" title=\"" . $common_html['common_html']['delete'] . "\"> &nbsp;&nbsp;&nbsp;&nbsp;\n";
    } else {
        print "<input type=\"checkbox\" name=\"allbox\"  onClick=\"check_all();\">" . $common_html['common_html']['chooseall'] . " &nbsp;&nbsp;\n";
        print "<input type=\"button\"  value=\"" . $common_html['common_html']['delete'] . "\" class=\"SmallButton\" {$disabled} onClick=\"delete_mail();\" title=\"" . $common_html['common_html']['delete'] . "\"> &nbsp;&nbsp;&nbsp;&nbsp;\n";
    }
    if ($add != "" && $add_var != "") {
        if ($pageid <= 1) {
            echo "" . $common_html['common_html']['firstpage'] . " ";
            echo "" . $common_html['common_html']['prevpage'] . " ";
        } else {
            echo "<a href=\"{$PHP_SELF}?{$add}={$add_var}&pageid=1\" title=\"" . $common_html['common_html']['firstpage'] . "\">" . $common_html['common_html']['firstpage'] . "</a> ";
            echo "<a href=\"{$PHP_SELF}?{$add}={$add_var}&pageid=" . ($pageid - 1) . "\" title=\"" . $common_html['common_html']['prevpage'] . "\">" . $common_html['common_html']['prevpage'] . "</a> ";
        }
        //end if
        if ($pageid == $pagenums) {
            echo "" . $common_html['common_html']['nextpage'] . " ";
            echo "" . $common_html['common_html']['lastpage'] . "";
        } else {
            echo "<a href=\"{$PHP_SELF}?{$add}={$add_var}&pageid=" . ($pageid + 1) . "\" title=\"" . $common_html['common_html']['nextpage'] . "\">" . $common_html['common_html']['nextpage'] . "</a> ";
            echo "<a href=\"{$PHP_SELF}?{$add}={$add_var}&pageid={$pagenums}\" title=\"" . $common_html['common_html']['lastpage'] . "\">" . $common_html['common_html']['lastpage'] . "</a> ";
        }
        //end if
    } else {
        if ($pageid <= 1) {
            echo "" . $common_html['common_html']['firstpage'] . " ";
            echo "" . $common_html['common_html']['prevpage'] . " ";
        } else {
            echo "<a href=\"{$PHP_SELF}?pageid=1\" title=\"" . $common_html['common_html']['firstpage'] . "\">" . $common_html['common_html']['firstpage'] . "</a> ";
            echo "<a href=\"{$PHP_SELF}?pageid=" . ($pageid - 1) . "\" title=\"" . $common_html['common_html']['prevpage'] . "\">" . $common_html['common_html']['prevpage'] . "</a> ";
        }
        //end if
        if ($pageid == $pagenums) {
            echo "" . $common_html['common_html']['nextpage'] . " ";
            echo "" . $common_html['common_html']['lastpage'] . " ";
        } else {
            echo "<a href=\"{$PHP_SELF}?pageid=" . ($pageid + 1) . "\" title=\"" . $common_html['common_html']['nextpage'] . "\">" . $common_html['common_html']['nextpage'] . "</a> ";
            echo "<a href=\"{$PHP_SELF}?pageid={$pagenums}\" title=\"" . $common_html['common_html']['lastpage'] . "\">" . $common_html['common_html']['lastpage'] . "</a> ";
        }
        //end if
    }
    print "( " . $common_html['common_html']['page'] . " " . $pageid . "/" . $pagenums . "  " . $rc . " )\n";
    if ($add == '' || $add_var == '') {
        $add = 'add';
        $add_var = 'add_var';
    }
    print "<input type=\"hidden\" name=\"ADD_INPUT\" value=\"{$add}\">\n";
    print "<input type=\"hidden\" name=\"ADD_VAR_INPUT\" value=\"{$add_var}\">\n";
    print "<input type=\"hidden\" name=\"action_page\" value=\"{$action_page}\">\n";
    print "<input type=\"hidden\" name=\"action_page_value\" value=\"{$action_page_value}\">\n";
    print "<input type=\"button\"  value=\"" . $common_html['common_html']['indexto'] . "\" class=\"SmallButton\" onclick=\"set_page();\" title=\"" . $common_html['common_html']['indexto'] . "\">&nbsp;\n";
    print "<input type=\"text\" name=\"PAGE_NUM\" value=\"{$pageid}\" class=\"SmallInput\" size=\"2\">&nbsp;&nbsp;\n";
    print "</td></tr>\n";
    print "</table>";
}
Example #8
0
function newai_export($fields, $mode = 'table')
{
    global $common_html, $html_etc;
    global $return_sql_line, $db;
    global $columns;
    //print_R($_GET);
    global $showlistfieldlist, $group_filter;
    $tablename = $fields['table']['name'];
    $SQL = $fields['sql']['SQL'];
    $init = explode('_', $_GET['action']);
    $mark = $init[1];
    global $tablewidth;
    $tablewidth = $tablewidth != "" ? $tablewidth : 450;
    if ($group_filter != "") {
        $group_filter_Array = explode(':', $group_filter);
        $TableFieldIndex = $group_filter_Array[0];
        $KeyName = $columns[$TableFieldIndex];
        $ChildTableName = $group_filter_Array[1];
        $ChildTableFieldValueIndex = $group_filter_Array[2];
        $ChildTableFieldNameIndex = $group_filter_Array[3];
        $ChildColumns = returntablecolumn($ChildTableName);
        $ChildTableFieldValue = $ChildColumns[$ChildTableFieldValueIndex];
        $ChildTableFieldName = $ChildColumns[$ChildTableFieldNameIndex];
        $Childhtml_etc = returnsystemlang($ChildTableName, $SYTEM_CONFIG_TABLE);
        //print_R($Childhtml_etc);
        $ChildTableFieldHTMLValue = $Childhtml_etc[$ChildTableName][$ChildTableFieldValue];
        $ChildTableFieldHTMLName = $Childhtml_etc[$ChildTableName][$ChildTableFieldName];
    } else {
        $KeyName = "说明";
    }
    print "<script>\n\t//CSV\n\tfunction selectid_str_init_CSV(mark)\n\t{\n\tselectid_str = \"\";\n\tfor(i=0;i<document.all(\"selectid\").length-1;i++)\n\t\t{\n\n\t\tel = document.all(\"selectid\").item(i);\n\t\tif(el.checked)\n\t\t{\tval = el.value;\n\t\t\tif(val !=\"\")\t{\n\t\t\t\tselectid_str += val + \",\";\n\t\t\t}\n\t\t}\n\t}\n\n\tell = document.all(\"selectid\").item(document.all(\"selectid\").length-1);\n\tif(ell.checked)\n\t{\tval = ell.value;\n\t\tif(val !=\"\")\t{\n\t\t\tselectid_str += val ;\n\t\t}\n\t}\n\n\ttablename_\t\t=\tdocument.form1.tablename.value;\n\tsearchfield_\t=\tdocument.form1.searchfield.value;\n\tsearchvalue_\t=\tdocument.form1.searchvalue.value;\n\tAdvanceSearch_\t=\tdocument.form1.AdvanceSearch.value;\n\texportfield= selectid_str;\n\n\n\t";
    if ($_GET['actionadv'] == "exportadv_default") {
        //不用显示或得到SELECTID的值
        print "\turl=\"?action=export_\"+mark+\"_data&method=CSV&actionadv=exportadv_default&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+AdvanceSearch_";
    } else {
        print "\tvar " . $KeyName . "SelectValue = document.form1." . $KeyName . ".options[document.form1." . $KeyName . ".selectedIndex].value;\n\t\t";
        print "\turl=\"?action=export_\"+mark+\"_data&method=CSV&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+\"&" . $KeyName . "=\"+" . $KeyName . "SelectValue+AdvanceSearch_";
    }
    print "\n\t//alert(url);\n\tlocation=url;\n\t}\n\t//XLS\n\tfunction selectid_str_init_XLS(mark)\n\t{\n\tselectid_str = \"\";\n\tfor(i=0;i<document.all(\"selectid\").length-1;i++)\n\t\t{\n\n\t\tel = document.all(\"selectid\").item(i);\n\t\tif(el.checked)\n\t\t{\tval = el.value;\n\t\t\tif(val !=\"\")\t{\n\t\t\t\tselectid_str += val + \",\";\n\t\t\t}\n\t\t}\n\t}\n\n\tell = document.all(\"selectid\").item(document.all(\"selectid\").length-1);\n\tif(ell.checked)\n\t{\tval = ell.value;\n\t\tif(val !=\"\")\t{\n\t\t\tselectid_str += val ;\n\t\t}\n\t}\n\n\ttablename_\t\t=\tdocument.form1.tablename.value;\n\tsearchfield_\t=\tdocument.form1.searchfield.value;\n\tsearchvalue_\t=\tdocument.form1.searchvalue.value;\n\tAdvanceSearch_\t=\tdocument.form1.AdvanceSearch.value;\n\texportfield= selectid_str;\n\t";
    if ($_GET['actionadv'] == "exportadv_default") {
        //不用显示或得到SELECTID的值
        print "\turl=\"?action=export_\"+mark+\"_data&actionadv=exportadv_default&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+AdvanceSearch_";
    } else {
        print "\tvar " . $KeyName . "SelectValue = document.form1." . $KeyName . ".options[document.form1." . $KeyName . ".selectedIndex].value;\n\t\t";
        print "\turl=\"?action=export_\"+mark+\"_data&exportfield=\"+exportfield+\"&tablename=\"+tablename_+\"&searchfield=\"+searchfield_+\"&searchvalue=\"+searchvalue_+\"&" . $KeyName . "=\"+" . $KeyName . "SelectValue+AdvanceSearch_";
    }
    print "\n\t//url\n\t//alert(url);\n\tlocation=url;\n\t}\n\t</script>";
    form_begin("form1");
    table_begin($tablewidth);
    switch ($mode) {
        case 'table':
            print_title($common_html['common_html']['tableexport'], 3);
            print "<TR class=TableData>\n";
            print "<TD noWrap align=middle>选择</TD>\n";
            print "<TD width=200>字段描述</TD>\n";
            print "<TD width=200>字段名称</TD>\n";
            print "</TR>\n";
            for ($i = 0; $i < sizeof($columns); $i++) {
                $list = $columns[$i];
                print "<TR class=TableData>\n";
                print "<TD noWrap align=middle width=20><input type=\"checkbox\" checked name=\"selectfield\" value=\"{$list}\"></TD>\n";
                print "<TD>" . $html_etc[$tablename][$list] . "</TD>\n";
                print "<TD>{$list}</TD>\n";
                print "</TR>\n";
                $temp_function = 'selectfield_str';
            }
            break;
        case 'content':
            print_title($common_html['common_html']['contentexport'], 3);
            print "<TR class=TableData>\n";
            print "<TD noWrap align=center width=30>选择</TD>\n";
            print "<TD width=100>字段描述</TD>\n";
            print "<TD width=150>字段名称</TD>\n";
            print "</TR>\n";
            //附加组数据导出--开始
            //print_R($group_filter_Array);
            if ($group_filter != "" && $_GET['actionadv'] != "exportadv_default") {
                //如果强制GET变量已经进行过预定义,那么沿用预定义内容进行 2010-9-2
                $TableFieldIndex = $group_filter_Array[0];
                $KeyName = $columns[$TableFieldIndex];
                $PHP_SELF_ARRAY = explode('/', $_SERVER['PHP_SELF']);
                $FILE_SELF_NAME = array_pop($PHP_SELF_ARRAY);
                $FileDirName = array_pop($PHP_SELF_ARRAY);
                //用于PGSQL下面不进行数据较验
                //print $_SESSION['LOGIN_USER_ID'];
                //如果强制GET变量已经进行过预定义,那么沿用预定义内容进行 2010-9-2
                //&&$FileDirName=="Teacher" 只有在Teacher目录下面使用 2010-9-25 正常使用
                if ($_GET[$KeyName] != "") {
                    //$ChildTableName = $group_filter_Array[1];
                    //$ChildTableFieldValueIndex = $group_filter_Array[2];
                    //$ChildTableFieldNameIndex = $group_filter_Array[3];
                    //print $KeyName;
                    $附加判断条件Array = explode(',', $_GET[$KeyName]);
                    $附加判断条件 = "'" . join("','", $附加判断条件Array) . "'";
                    $sql = "\n\t\t\t\t\tselect {$ChildTableFieldValue},{$ChildTableFieldName}\n\t\t\t\t\tfrom {$ChildTableName}\n\t\t\t\t\twhere ( {$ChildTableFieldValue} in ({$附加判断条件})\n\t\t\t\t\t\t\tor\n\t\t\t\t\t\t\t{$ChildTableFieldName} in ({$附加判断条件})\n\t\t\t\t\t\t\t)\n\t\t\t\t\torder by {$ChildTableFieldName}";
                    //
                } else {
                    $sql = "select {$ChildTableFieldValue},{$ChildTableFieldName} from {$ChildTableName} order by {$ChildTableFieldName}";
                }
                //print $sql;
                //print $index_name;print_R($_GET);
                $rs = $db->CacheExecute(150, $sql);
                $rs_a = $rs->GetArray();
                if ($Childhtml_etc[$ChildTableName][$ChildTableFieldName] != "") {
                    $ShowText = "按" . $html_etc[$tablename][$KeyName] . "过滤";
                    //$ShowText = "按".$Childhtml_etc[$ChildTableName][$ChildTableFieldName]."过滤";
                } else {
                    $ShowText = "按" . $html_etc[$tablename][$KeyName] . "过滤";
                }
                print "<TR class=TableData>\n";
                print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectidtemp\" disabled value=\"{$index}\"></TD>\n";
                print "<TD  width=120 nowrap>" . $ShowText . "</TD>\n";
                print "<TD  width=150 nowrap>";
                //print_R($_GET);
                //print $KeyName;
                //如果隐藏的话就显示为只读
                if ($group_filter_Array[4] == "hidden") {
                    //如果隐藏的话就显示为只读
                    $显示名称 = returntablefield($ChildTableName, $ChildTableFieldValue, $_GET[$KeyName], $ChildTableFieldName);
                    print "<select class=\"SmallSelect\" name=\"" . $KeyName . "\">\n";
                    print "<option value=\"" . $_GET[$KeyName] . "\" >" . $显示名称 . "[" . $_GET[$KeyName] . "]</option>\n";
                    print "</select>\n";
                } else {
                    //显示成为列表
                    print "<select class=\"SmallSelect\" name=\"" . $KeyName . "\" >\n";
                    //print "<option value=\"\" >".$common_html['common_html']['allrecords']."</option>\n";
                    print "<option value=\"\" >" . $html_etc[$tablename][$list['index_name']] . "[" . $common_html['common_html']['allrecords'] . "]</option>\n";
                    //2009-12-24加入对列表组的过滤
                    for ($i = 0; $i < sizeof($rs_a); $i++) {
                        if ($_GET[$KeyName] == $rs_a[$i][$ChildTableFieldValue]) {
                            $CheckedX = "selected";
                        } else {
                            $CheckedX = "";
                        }
                        print "<option value=\"" . $rs_a[$i][$ChildTableFieldValue] . "\" {$CheckedX} >" . $rs_a[$i][$ChildTableFieldName] . "[" . $rs_a[$i][$ChildTableFieldValue] . "]</option>\n";
                    }
                    print "</select>\n";
                }
                //2009-12-24加入对搜索属性的支持
                print "<input type=hidden name='searchfield' value='" . $_GET['searchfield'] . "'>\n";
                print "<input type=hidden name='searchvalue' value='" . $_GET['searchvalue'] . "'>\n";
                print "<input type=hidden name='tablename' value='{$tablename}'>\n";
                print "<input type=hidden name='AdvanceSearch' value='{$ADD_SEARCH_VALUE}'>\n";
                print "</TD></TR>\n";
            } else {
                //高级搜索时出现的隐藏变量
                if ($_GET['actionadv'] == "exportadv_default") {
                    print "<TR class=TableData>\n";
                    print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectidtemp\" disabled value=\"{$index}\"></TD>\n";
                    print "<TD  width=90% colspan=2>高级搜索:\n";
                    //print "<select class=\"SmallSelect\" name=\"".$KeyName."\" disabled>\n";
                    //print "<option value=\"\" >".$common_html['common_html']['allrecords']."</option>\n";
                    //print "<option value=\"\" >".$html_etc[$tablename][$list['index_name']]."[".$common_html['common_html']['allrecords']."]</option>\n";
                    //print "</select>\n";
                    $showlistfieldlist_array = explode(',', $showlistfieldlist);
                    //print_R($showlistfieldlist_array);
                    for ($i = 0; $i < sizeof($showlistfieldlist_array); $i++) {
                        $index = $showlistfieldlist_array[$i];
                        $list = $columns[$index];
                        if ($_GET[$list] != "") {
                            $ADD_SEARCH_VALUE .= "&{$list}=" . $_GET[$list];
                            $ADD_SEARCH_TEXT .= " {$list}:" . $_GET[$list];
                        } else {
                            if ($_GET[$list . "_最小值"] != "" && $_GET[$list . "_最大值"] != "") {
                                $ADD_SEARCH_VALUE .= "&" . $list . "_最小值=" . $_GET[$list . "_最小值"] . "&" . $list . "_最大值=" . $_GET[$list . "_最大值"] . "";
                                $ADD_SEARCH_TEXT .= " " . $list . "最小值:" . $_GET[$list . "_最小值"] . " " . $list . "最大值:" . $_GET[$list . "_最大值"] . "";
                            } else {
                                if ($_GET[$list . "_开始时间"] != "" && $_GET[$list . "_结束时间"] != "") {
                                    $ADD_SEARCH_VALUE .= "&" . $list . "_开始时间=" . $_GET[$list . "_开始时间"] . "&" . $list . "_结束时间=" . $_GET[$list . "_结束时间"] . "";
                                    $ADD_SEARCH_TEXT .= " " . $list . "开始时间:" . $_GET[$list . "_开始时间"] . " " . $list . "结束时间:" . $_GET[$list . "_结束时间"] . "";
                                }
                            }
                        }
                    }
                    print $ADD_SEARCH_TEXT;
                    //print $ADD_SEARCH_VALUE;
                    print "<input type=hidden name='{$KeyName}' value='" . $_GET['searchfield'] . "'>\n";
                    print "<input type=hidden name='searchfield' value='" . $_GET['searchfield'] . "'>\n";
                    print "<input type=hidden name='searchvalue' value='" . $_GET['searchvalue'] . "'>\n";
                    print "<input type=hidden name='tablename' value='{$tablename}'>\n";
                    print "<input type=hidden name='AdvanceSearch' value='{$ADD_SEARCH_VALUE}'>\n";
                    print "</TD></TR>\n";
                } else {
                    print "<TR class=TableData>\n";
                    print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectidtemp\" disabled value=\"{$index}\"></TD>\n";
                    print "<TD  width=120 disabled>数据过滤</TD>\n";
                    print "<TD  width=150 nowrap>";
                    print "<select class=\"SmallSelect\" name=\"" . $KeyName . "\" disabled>\n";
                    //print "<option value=\"\" >".$common_html['common_html']['allrecords']."</option>\n";
                    print "<option value=\"\" >" . $html_etc[$tablename][$list['index_name']] . "[" . $common_html['common_html']['allrecords'] . "]</option>\n";
                    print "</select>\n";
                    print "<input type=hidden name='searchfield' value='" . $_GET['searchfield'] . "'>\n";
                    print "<input type=hidden name='searchvalue' value='" . $_GET['searchvalue'] . "'>\n";
                    print "<input type=hidden name='tablename' value='{$tablename}'>\n";
                    print "<input type=hidden name='AdvanceSearch' value='{$ADD_SEARCH_VALUE}'>\n";
                    print "</TD></TR>\n";
                }
            }
            //附加组数据导出--结束
            $showlistfieldlist_array = explode(',', $showlistfieldlist);
            //print_R($showlistfieldlist_array);
            for ($i = 0; $i < sizeof($showlistfieldlist_array); $i++) {
                $index = $showlistfieldlist_array[$i];
                $list = $columns[$index];
                print "<TR class=TableData>\n";
                print "<TD noWrap align=middle><input type=\"checkbox\" checked name=\"selectid\" value=\"{$index}\"></TD>\n";
                print "<TD >" . $html_etc[$tablename][$list] . "</TD>\n";
                print "<TD >{$list}</TD>\n";
                print "</TR>\n";
                $temp_function = 'selectid_str_init';
            }
            break;
    }
    global $returnmodel;
    $returnmodelArray = explode(',', $returnmodel);
    if ($returnmodelArray[1] != "") {
        $returnmodelURL = $returnmodelArray[1];
    } else {
        $returnmodelURL = "?";
    }
    print "<tr align=\"center\" class=\"TableControl\">\n<td colspan=\"3\" nowrap>\n<div align=\"center\">\n\n\t<input type=\"button\" value=\"" . $common_html['common_html']['export'] . "CSV\" accesskey='v' title=\"" . $common_html['common_html']['accesskey'] . ":ALT+V\" class=\"SmallButton\" onClick=\"selectid_str_init_CSV('{$mark}');\">\n\t<input type=\"button\" value=\" " . $common_html['common_html']['export'] . "EXCEL \" accesskey='x' title=\"" . $common_html['common_html']['accesskey'] . ":ALT+X\" class=\"SmallButton\" onClick=\"selectid_str_init_XLS('{$mark}');\">\n\t<input type=\"button\" accesskey='c' title=\"" . $common_html['common_html']['accesskey'] . ":ALT+C\" value=\"" . $common_html['common_html']['cancel'] . "\"  class=\"SmallButton\" onClick=\"location='{$returnmodelURL}'\"></div>\n</td></tr>\n";
    table_end();
    form_end();
    print "<BR>";
}
        }
    }
    $pro_printfieldlist = array_flip($pro_printfieldlist);
    global $db;
    $sql = "select fieldname,chinese from systemlang where tablename='sellplanmain_detail'";
    $rs = $db->Execute($sql);
    $rs_a = $rs->GetArray();
    foreach ($rs_a as $row) {
        if (isset($pro_printfieldlist[$row['fieldname']])) {
            $pro_printfieldlist[$row['fieldname']] = $row['chinese'];
        }
    }
    $sell_order_print_field = $ini_file['sell_order_print_field'];
    $sell_order_detail_print_field = $ini_file['sell_order_detail_print_field'];
    form_begin("form1", "action=updatedata");
    table_begin(0);
    //print_title("销售单打印纸张宽度");
    //print_tr( "纸张宽度(mm):", "order_print_paper_width", $ini_file[section][order_print_paper_width], 25, 1, "SmallInput", "" );
    print_title("店面销售单打印字段配置");
    print '<tr>
				<td class="TableHeader" nowrap="" >字段</td>
				<td class="TableHeader" nowrap="" colspan="1" >是否显示</td>
				<td class="TableHeader" nowrap="" colspan="1">显示顺序</td>
			</tr>';
    foreach ($printfieldlist as $key => $val) {
        $checked = isset($sell_order_print_field[$key]) ? 'checked' : '';
        print '<tr>
				<td class="TableData" nowrap="" >' . $val . '</td>
				<td class="TableData" nowrap="" colspan="1">
					<input type="checkbox" title=""  maxlength="20"  name="sellfiled[' . $key . ']" value="" ' . $checked . '>
				</td><td class="TableData" nowrap="" colspan="1"><input type="text" title="顺序"  maxlength="20" size="5" name="sellfiledorder[' . $key . ']" value="' . $sell_order_print_field[$key] . '" ' . $checked . '>
Example #10
0
function newaiReportSearch($fields, $list)
{
    global $html_etc, $tablename, $common_html;
    global $db, $return_sql_line, $columns;
    global $_POST, $_GET, $returnmodel, $primarykey_index;
    global $action_submit, $merge, $form_attribute;
    global $showlistfieldlistSearch, $showlistfieldfilterSearch, $showlistfieldfilter2Search;
    global $totalnumber;
    $totalnumber == "" ? $totalnumber = 30 : '';
    $showlistfieldlistArray = explode(',', $showlistfieldlistSearch);
    $showlistfieldfilterArray = explode(',', $showlistfieldfilterSearch);
    print_date_js();
    form_begin($fields['form']['name'], "action", 'GET');
    table_begin("450");
    global $tabletitle;
    print_hidden($_GET['action'] . "_data", "action");
    print_title($html_etc[$tablename][$tabletitle]);
    //print_title("<font color=green>".$common_html['common_html']['totalNumber'].":".$totalnumber."</font>");
    print_title($common_html['common_html']['totalNumber'] . ":" . $totalnumber);
    for ($i = 0; $i < sizeof($showlistfieldlistArray); $i++) {
        $fieldIndex = $showlistfieldlistArray[$i];
        $fieldName = $columns[$fieldIndex];
        $fieldText = $html_etc[$tablename][$fieldName];
        $mode = $showlistfieldfilterArray[$i];
        switch ($mode) {
            case '':
                break;
            case 'input':
                print_tr($fieldText . ":", $fieldName, '', $fields['other']['inputsize'], $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1);
                break;
            case 'date':
                print_report_date($fieldText . ":", $fieldName, '', $fields['other']['inputsize'], $fields['other']['inputcols'], $fields['other']['class'], $notnulltext, 'text', '', $i + 1);
                break;
        }
    }
    print_submit($common_html['common_html']['reportsearch'], 3, "");
    print "<TR><TD class=TableControl noWrap align=middle  colspan=\"3\">\n";
    print "<div align=\"center\">\n<INPUT class=SmallButton title=" . $common_html['common_html']['reportsearch'] . " type=submit value=\"" . $common_html['common_html']['reportsearch'] . "\" name=button>\n ";
    print "</TD></TR>\n";
    table_end();
    form_end();
}
Example #11
0
function viewChildTableList($subtable, $parent_value)
{
    global $db;
    $maintable_key = $subtable['maintable_key'];
    $table_title = $subtable['subtable_title'];
    $tablename2 = $subtable['subtable_name'];
    $childkey2 = $subtable['subtable_key'];
    $where2 = $subtable['subtable_where'];
    $where2 = str_replace("(", "(", $where2);
    $where2 = str_replace(")", ")", $where2);
    $showlistfieldlist2 = $subtable['subtable_showlistfieldlist'];
    $columns2 = returntablecolumn($tablename2);
    $html_etc2 = returnsystemlang($tablename2);
    $showlistfieldlistArray2 = explode(",", $showlistfieldlist2);
    $iniFilename = "Model/" . $tablename2 . "_newai.ini";
    if (!file_exists($iniFilename)) {
        $iniFilename = "../JXC/Model/" . $tablename2 . "_newai.ini";
    }
    if (!file_exists($iniFilename)) {
        $iniFilename = "../CRM/Model/" . $tablename2 . "_newai.ini";
    }
    if (!file_exists($iniFilename)) {
        $iniFilename = "../Framework/Model/" . $tablename2 . "_newai.ini";
    }
    $file_ini2 = parse_ini_file($iniFilename, true);
    $org_showlistfieldlist = explode(",", $file_ini2['view_default']['showlistfieldlist']);
    $org_showlistfieldfilter = explode(",", $file_ini2['view_default']['showlistfieldfilter']);
    $showlistfieldfilterArray2 = array();
    for ($i = 0; $i < sizeof($org_showlistfieldlist); $i++) {
        if (in_array($org_showlistfieldlist[$i], $showlistfieldlistArray2)) {
            $showlistfieldfilterArray2[$org_showlistfieldlist[$i]] = $org_showlistfieldfilter[$i];
        }
    }
    //构建SQL语句
    $SQLText = "";
    for ($i = 0; $i < sizeof($showlistfieldlistArray2); $i++) {
        $listIndex = $showlistfieldlistArray2[$i];
        $listIndexName = $columns2[$listIndex];
        if ($SQLText != "") {
            $SQLText .= ",";
        }
        $SQLText .= $listIndexName;
    }
    if (is_array($parent_value)) {
        $childkey2Array = explode(",", $childkey2);
        $mainkey2Array = explode(",", $maintable_key);
        $SQL_Select = "select {$SQLText} from {$tablename2} where 1=1 ";
        $i = 0;
        foreach ($mainkey2Array as $row) {
            $SQL_Select = $SQL_Select . "and " . $childkey2Array[$i] . "='" . $parent_value[$row] . "' ";
            $i++;
        }
    } else {
        $SQL_Select = "select {$SQLText} from {$tablename2} where {$childkey2} = '" . $parent_value . "'";
    }
    if ($where2 != '') {
        $where2 = str_replace(":", "=", $where2);
        $where2 = str_replace("\\", "", $where2);
        $SQL_Select .= " and " . $where2;
    }
    $rs = $db->Execute($SQL_Select);
    $rs_a = $rs->GetArray();
    //print_R($rs_a);print_R($showlistfieldlistArray2);
    print "<tr ><td colspan=6 nowrap width=100%>\n";
    table_begin("100%");
    //标题显示部分
    if ($table_title != "") {
        $url_filename = $tablename2 . "_newai.php";
        if (file_exists("../JXC/" . $url_filename)) {
            $url_filename = "../JXC/" . $url_filename;
        } else {
            if (file_exists("../CRM/" . $url_filename)) {
                $url_filename = "../CRM/" . $url_filename;
            } else {
                $url_filename = "";
            }
        }
        if ($url_filename != '') {
            $table_title = "<a href='{$url_filename}' target='_blank'>{$table_title}</a>";
        }
        print "<tr><td class=TableHeader align=center colspan=" . sizeof($showlistfieldlistArray2) . ">{$table_title}</td></tr>";
    }
    print "<tr class=TableContent>\n";
    for ($i = 0; $i < sizeof($showlistfieldlistArray2); $i++) {
        $listIndex = $showlistfieldlistArray2[$i];
        $listIndexName = $columns2[$listIndex];
        $listFilter = $showlistfieldfilterArray2[$listIndex];
        $listFilterArray = explode(":", $listFilter);
        if (stristr($listFilterArray[0], "tablefilter") && $listFilterArray[1] == $tablename2) {
            $TempColumns = returntablecolumn($listFilterArray[1]);
            $showText = $html_etc2[$tablename2][$TempColumns[$listFilterArray[3]]];
        } else {
            $showText = $html_etc2[$tablename2][$listIndexName];
        }
        print "<td nowrap>" . $showText . "</td>";
    }
    print "</tr>";
    $allnum = array();
    $allmoney = array();
    //数据窗口部分
    for ($j = 0; $j < sizeof($rs_a); $j++) {
        print "<tr class=TableData>\n";
        for ($i = 0; $i < sizeof($showlistfieldlistArray2); $i++) {
            $listIndex = $showlistfieldlistArray2[$i];
            $listIndexName = $columns2[$listIndex];
            $listFilter = $showlistfieldfilterArray2[$listIndex];
            //数据过滤区
            $listFilterArray = explode(":", $listFilter);
            if (stristr($listFilterArray[0], 'color')) {
                $hascolor = true;
            } else {
                $hascolor = false;
            }
            $nowrap = "";
            if (strlen($rs_a[$j][$listIndexName]) < 20) {
                $nowrap = "nowrap";
            }
            switch ($listFilterArray[0]) {
                case 'tablefilter':
                case 'tablefiltercolor':
                    $TempColumns = returntablecolumn($listFilterArray[1]);
                    $DataElement = returntablefieldColorFilterGray($listFilterArray[1], $TempColumns[(string) $listFilterArray[2]], $rs_a[$j][$listIndexName], $TempColumns[(string) $listFilterArray[3]], '', '', '', $hascolor);
                    break;
                case 'radiofilter':
                    $TempColumns = returntablecolumn($listFilterArray[1]);
                    $DataElement = returntablefield($listFilterArray[1], $TempColumns[(string) $listFilterArray[2]], $rs_a[$j][$listIndexName], $TempColumns[(string) $listFilterArray[3]]);
                    break;
                case 'radiofiltergroup':
                    $TempColumns = returntablecolumn($listFilterArray[1]);
                    $DataElement = returntablefield($listFilterArray[1], $TempColumns[(string) $listFilterArray[2]], $rs_a[$j][$listIndexName], $TempColumns[(string) $listFilterArray[3]]);
                    break;
                case 'select_sex':
                    $DataElement = returnsex($rs_a[$j][$listIndexName]);
                    break;
                case 'boolean':
                    $DataElement = returnboolean($rs_a[$j][$listIndexName]);
                    break;
                case 'datetime':
                    if ($rs_a[$j][$listIndexName] == '0000-00-00 00:00:00') {
                        $DataElement = '';
                    } else {
                        $DataElement = $rs_a[$j][$listIndexName];
                    }
                    break;
                    /*
                    case 'input':
                    	$DataElement=cutStr($rs_a[$j][$listIndexName],15);
                    	if($DataElement!=$rs_a[$j][$listIndexName])
                    		$DataElement="<span title='".$rs_a[$j][$listIndexName]."'>".$DataElement."..</span>";
                    	else
                    		$DataElement = $rs_a[$j][$listIndexName];
                    	break;
                    case 'textarea':
                    	if(cutStr($rs_a[$j][$listIndexName],30)!=$rs_a[$j][$listIndexName])
                    		$DataElement = "<div title='".$rs_a[$j][$listIndexName]."'>".cutStr($rs_a[$j][$listIndexName],30)."...</div>";
                    	else 
                    		$DataElement = $rs_a[$j][$listIndexName];
                    	break;
                    */
                /*
                case 'input':
                	$DataElement=cutStr($rs_a[$j][$listIndexName],15);
                	if($DataElement!=$rs_a[$j][$listIndexName])
                		$DataElement="<span title='".$rs_a[$j][$listIndexName]."'>".$DataElement."..</span>";
                	else
                		$DataElement = $rs_a[$j][$listIndexName];
                	break;
                case 'textarea':
                	if(cutStr($rs_a[$j][$listIndexName],30)!=$rs_a[$j][$listIndexName])
                		$DataElement = "<div title='".$rs_a[$j][$listIndexName]."'>".cutStr($rs_a[$j][$listIndexName],30)."...</div>";
                	else 
                		$DataElement = $rs_a[$j][$listIndexName];
                	break;
                */
                case 'qq':
                    $DataElement = !empty($rs_a[$j][$listIndexName]) ? "<a target=\"_blank\" href=\"http://wpa.qq.com/msgrd?v=3&amp;uin=" . $rs_a[$j][$listIndexName] . "&amp;site=qq&amp;menu=yes\"><img border=\"0\" src=\"http://wpa.qq.com/pa?p=2:" . $rs_a[$j][$listIndexName] . ":45\" onerror=\"this.src='" . ROOT_DIR . "general/ERP/Framework/images/help3.gif';this.title='此QQ号码可能不存在'\" title=\"点击这里发消息\">" . $rs_a[$j][$listIndexName] . "</a>" : '';
                    break;
                case 'mobile':
                    $addicon = "<img  src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0348.gif' title='点击号码发送短信'>";
                    if ($rs_a[$j][$listIndexName] != '') {
                        $DataElement = "<a href='../JXC/sms_sendlist_newai.php?" . base64_encode("action=add_default&sendlist=" . $rs_a[$j][$listIndexName]) . "' target='_blank'>" . $addicon . $rs_a[$j][$listIndexName] . "</a>";
                    } else {
                        $DataElement = $rs_a[$j][$listIndexName];
                    }
                    break;
                case 'email':
                    $linkman = '';
                    $fromsrc = '';
                    if ($tablename2 == 'linkman') {
                        $fromsrc = 'customer';
                        $linkman = gettablefield($tablename2, 'email', 'rowid', $rs_a[$j][$listIndexName]);
                    } else {
                        if ($tablename2 == 'supplylinkman') {
                            $fromsrc = 'supply';
                            $linkman = gettablefield($tablename2, 'email', 'rowid', $rs_a[$j][$listIndexName]);
                        } else {
                            $linkman = $rs_a[$j][$listIndexName];
                            $fromsrc = '';
                        }
                    }
                    $addicon = "<img src='" . ROOT_DIR . "general/ERP/Framework/images/menu/gif-0037.gif' title='点击链接发送邮件'>";
                    if ($rs_a[$j][$listIndexName] != '') {
                        $DataElement = "<a href='../CRM/email_newai.php?" . base64_encode("action=add_default&sendlist=" . $linkman . "&fromsrc=" . $fromsrc) . "' target='_blank' >" . $addicon . $rs_a[$j][$listIndexName] . "</a>";
                    }
                    break;
                case 'picturefile':
                    global $ifincludemaginfier;
                    $PicturePath = $rs_a[$j][$listIndexName];
                    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;
                        }
                        $DataElement = "<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 {
                        $DataElement = "";
                    }
                    break;
                case 'userdefine':
                    $functionName = trim($listFilterArray[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)) {
                            $DataElement = $functionName($rs_a[$j][$listIndexName], $rs_a, $j);
                        }
                    } else {
                        $DataElement = $rs_a[$j][$listIndexName];
                    }
                    break;
                case 'tdoafile':
                    require_once 'lib/utility_file.php';
                    //形成通达OA下载文件所需要的变量格式
                    $var_value_array = explode('||', $rs_a[$j][$listIndexName]);
                    $ATTACHMENT_ID = $var_value_array[1];
                    $ATTACHMENT_NAME = $var_value_array[0];
                    if (strlen($rs_a[$j][$listIndexName]) < 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}\">";
                    $DataElement = $file_path;
                    break;
                default:
                    $DataElement = $rs_a[$j][$listIndexName];
                    break;
            }
            if ($listIndexName == 'zhekou') {
                $DataElement = $DataElement * 100 . "%";
            }
            $tip = '';
            if ((stristr($tablename2, "detail") || $tablename2 == "store_product") && $listIndexName == 'num') {
                $tablename3 = $tablename2 . "_color";
                if ($tablename2 == "store_product") {
                    $tablename3 = "store_color";
                }
                $sql = "SELECT COUNT(*) as allnum FROM information_schema.TABLES WHERE TABLE_NAME='{$tablename3}'";
                $rs = $db->Execute($sql);
                if ($rs->fields['allnum'] == 1) {
                    $sql = "select id,{$SQLText} from {$tablename2} where {$childkey2} = '" . $parent_value . "'";
                    $rs = $db->Execute($sql);
                    $rs_id = $rs->GetArray();
                    $id = $rs_id[$j][id];
                    $sql = "select a.num,b.name from {$tablename3} a inner join productcolor b on a.color=b.id where a.id={$id}";
                    $rs = $db->Execute($sql);
                    $rs_color = $rs->GetArray();
                    foreach ($rs_color as $row) {
                        $tip .= $row[name] . ":" . $row[num] . "\r\n";
                    }
                    if ($tip != '') {
                        $tip = " <span title='{$tip}'><img src='" . ROOT_DIR . "general/ERP/Framework/images/sepan.gif'></span>";
                    }
                }
            }
            print "<td {$nowrap}>" . $DataElement . $tip . "</td>";
            if (stristr($html_etc2[$tablename2][$listIndexName], "数量")) {
                $allnum[$html_etc2[$tablename2][$listIndexName]] = $allnum[$html_etc2[$tablename2][$listIndexName]] + $rs_a[$j][$listIndexName];
            } else {
                if (stristr($html_etc2[$tablename2][$listIndexName], "金额")) {
                    $allmoney[$html_etc2[$tablename2][$listIndexName]] = $allmoney[$html_etc2[$tablename2][$listIndexName]] + $rs_a[$j][$listIndexName];
                }
            }
        }
        print "</tr>";
    }
    if (sizeof($allnum) > 0 || sizeof($allmoney) > 0) {
        print "<tr class=TableData><td align=center><b>合计</b></td>";
        for ($i = 1; $i < sizeof($showlistfieldlistArray2); $i++) {
            $listIndex = $showlistfieldlistArray2[$i];
            $listIndexName = $columns2[$listIndex];
            if (array_key_exists($html_etc2[$tablename2][$listIndexName], $allnum)) {
                print "<td nowrap>" . $allnum[$html_etc2[$tablename2][$listIndexName]] . "</td>";
            } else {
                if (array_key_exists($html_etc2[$tablename2][$listIndexName], $allmoney)) {
                    print "<td nowrap>" . $allmoney[$html_etc2[$tablename2][$listIndexName]] . "</td>";
                } else {
                    print "<td nowrap></td>";
                }
            }
        }
        print "</tr>";
    }
    if (sizeof($rs_a) == 0) {
        print "<tr class=TableData><td align=center nowrap colspan=" . sizeof($showlistfieldlistArray2) . "><font color=gray>无此项记录</font></td>";
        print "</tr>";
    }
    table_end();
    print "</td></tr>";
}
 function _query($sql, $inputarr = false)
 {
     //global $ADODB_COUNTRECS;
     //if($ADODB_COUNTRECS)
     ////print $sql."<BR>";
     $sql_VALUE = $sql;
     #########################################################################################################
     //在此处进行SQL语句操作日志的记录工作,必须在该条SQL语句执行之前进行判断日志
     #########################################################################################################
     $sqlTEXT2010 = $sql;
     $sqlTEXT2010InsertInto = substr($sqlTEXT2010, 0, strlen("insert into"));
     $sqlTEXT2010InsertInto = trim(strtolower($sqlTEXT2010InsertInto));
     if ($sqlTEXT2010InsertInto == "insert into") {
         $sqlTEXT2010Array = explode(' ', $sqlTEXT2010);
         $临时表名称 = trim($sqlTEXT2010Array[2]);
         $临时表名称Array = explode('(', $临时表名称);
         $临时表名称 = trim($临时表名称Array[0]);
         if ($临时表名称 != "system_log") {
             $LOGINACTION = "insertinto" . $临时表名称;
         }
     }
     $sqlTEXT2010InsertInto = substr($sqlTEXT2010, 0, strlen("update "));
     $sqlTEXT2010InsertInto = trim(strtolower($sqlTEXT2010InsertInto));
     if ($sqlTEXT2010InsertInto == "update") {
         $sqlTEXT2010Array = explode(' ', $sqlTEXT2010);
         $临时表名称 = trim($sqlTEXT2010Array[1]);
         if ($临时表名称 != "system_log") {
             $LOGINACTION = "update" . $临时表名称;
         }
     }
     $sqlTEXT2010InsertInto = substr($sqlTEXT2010, 0, strlen("delete from "));
     $sqlTEXT2010InsertInto = trim(strtolower($sqlTEXT2010InsertInto));
     if ($sqlTEXT2010InsertInto == "delete from") {
         $sqlTEXT2010Array = explode(' ', $sqlTEXT2010);
         $临时表名称 = $sqlTEXT2010Array[2];
         if ($临时表名称 != "system_log") {
             $LOGINACTION = "deletefrom" . $临时表名称;
         }
         //print $sqlTEXT2010;exit;
         $sqlTEXT2010Array[0] = "select *";
         $sqlX = @join(' ', $sqlTEXT2010Array);
         $result = mysql_query($sqlX, $this->_connectionID);
         $SQLTEXT = '';
         while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
             $rowKEYS = @array_keys($row);
             for ($i = 0; $i < sizeof($rowKEYS); $i++) {
                 $KEY = $rowKEYS[$i];
                 $SQLTEXT .= "{$KEY}:" . $row[$KEY] . " ";
             }
         }
         //print $SQLTEXT;exit;
         $sqlTEXT2010 = $sqlTEXT2010 . "<BR>" . $SQLTEXT;
     }
     if ($LOGINACTION != "" && $临时表名称 != "system_log") {
         //print $sqlTEXT2010;exit;
         $DATETIME = date("Y-m-d H:i:s");
         $REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
         $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
         $QUERY_STRING = $_SERVER['QUERY_STRING'];
         $SCRIPT_NAME = $_SERVER['SCRIPT_NAME'];
         $LOGIN_USER_ID = $_SESSION['LOGIN_USER_ID'];
         if ($_GET['USER_ID'] != "") {
             $LOGIN_USER_ID = $_GET['USER_ID'];
         }
         $sqlTEXT2010 = ereg_replace("'", "&#039;", $sqlTEXT2010);
         $sql = "insert into system_log(loginaction,DATE,REMOTE_ADDR,HTTP_USER_AGENT,QUERY_STRING,SCRIPT_NAME,USERID,SQLTEXT)\n\t\t\t\t\tvalues('{$LOGINACTION}','{$DATETIME}','{$REMOTE_ADDR}','{$HTTP_USER_AGENT}','{$QUERY_STRING}','{$SCRIPT_NAME}','{$LOGIN_USER_ID}','{$sqlTEXT2010}');";
         //print $sql;exit;
         mysql_query($sql, $this->_connectionID);
     }
     //对MYSQL系统进行性能监控 2010-9-30 15:09
     $sql = $sql_VALUE;
     $sqlTEXT2010 = $sql;
     $开始时间 = time();
     $mysql_query = mysql_query($sql, $this->_connectionID);
     $mysql_error = mysql_error();
     $mysql_errno = mysql_errno();
     //print $mysql_error;
     if (function_exists("iconv")) {
         $mysql_error = iconv('UTF-8', 'GB2312', $mysql_error);
     }
     //print $mysql_error;
     if (!$mysql_error) {
         //放到最下面进行执行
     } else {
         $sql = trim($sql);
         global $SYSTEM_DEBUG_SQL;
         if (strlen($sql) > 6 && $SYSTEM_DEBUG_SQL == 1 && !$rez) {
             $mysql_error = ereg_replace("Table", "数据表:", $mysql_error);
             $mysql_error = ereg_replace("doesn't exist", "不存在.", $mysql_error);
             $mysql_error = ereg_replace("Duplicate entry", "以下数据要求是唯一性的,但发生重复,该字段的值为:", $mysql_error);
             $mysql_error = ereg_replace("for key", "重复次数:", $mysql_error);
             $mysql_error = ereg_replace("Unknown column", "不存在的列", $mysql_error);
             $mysql_error = ereg_replace("in 'where clause'", "在WHERE判断语句中.", $mysql_error);
             //$mysql_error = ereg_replace("Table","数据表",$mysql_error);
             //$mysql_error = ereg_replace("Table","数据表",$mysql_error);
             $mysql_error = "错误代码:" . $mysql_errno . " 解释:" . $mysql_error;
             $fileVersion = @file(ROOT_DIR . "/general/EDU/Interface/EDU/version.ini");
             $fileVersionNumber = $fileVersion[0];
             $errorsql = "insert into systemerrorsql values('','" . $_SERVER['REQUEST_URI'] . "','" . ereg_replace("'", "&#039;", $sqlTEXT2010) . "','" . ereg_replace("'", "&#039;", $mysql_error) . "','" . $_SERVER['SERVER_NAME'] . "_" . $fileVersionNumber . "','" . date("Y-m-d H:i:s") . "');";
             //print $errorsql;
             mysql_query($errorsql, $this->_connectionID);
             page_css("向软件开发商报告错误");
             table_begin("600");
             print_title("警告:发生SQL语句错误信息!点击按钮向软件开发商报告错误");
             print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;报告时间</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . date("Y-m-d H:i:s") . "</TD>\n\t\t\t\t\t\t</TR>";
             print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;错误类型</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;SQL语句出现错误</TD>\n\t\t\t\t\t\t</TR>";
             print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;文件地址</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . $_SERVER['PHP_SELF'] . "</TD>\n\t\t\t\t\t\t</TR>";
             print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;SQL语句</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . $sql . "</TD>\n\t\t\t\t\t\t</TR>";
             print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=left colSpan=1 width=30%>&nbsp;错误信息</TD>\n\t\t\t\t\t\t<TD class=TableData align=left colSpan=2>&nbsp;" . $mysql_error . "</TD>\n\t\t\t\t\t\t</TR>";
             //$sqlTEXT2010 = ereg_replace("'","____",$sqlTEXT2010);
             $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010);
             $sqlTEXT2010 = ereg_replace("=", "+", $sqlTEXT2010);
             //$mysql_error = ereg_replace("'","____",$mysql_error);
             $mysql_error = ereg_replace("=", "+", $mysql_error);
             $mysql_error = ereg_replace("=", "+", $mysql_error);
             $FILE_PATH = $_SERVER['REQUEST_URI'];
             $FILE_PATH = ereg_replace("=", "+", $FILE_PATH);
             $FILE_PATH = ereg_replace("=", "+", $FILE_PATH);
             print "<TR>\n\t\t\t\t\t\t<TD class=TableContent align=center colSpan=3>&nbsp;<input type=button name=ButtonName class=SmallButton value='向软件开发商报告错误' OnClick=\"location='http://www.dandian.net/tryout/SunshineOACRM/errorsql.php?" . base64_encode("fffffff=xxxxxxxx&SDDDD=XXXX&FILE_PATH=" . $FILE_PATH . "&SERVER_NAME=" . $_SERVER['SERVER_NAME'] . "_" . $fileVersionNumber . "&SQL_CONTENT={$sqlTEXT2010}&ERROR_INFOR={$mysql_error}&DATE_TIME=" . date("Y-m-d H:i:s") . "&fffffff=xxxxxxxx") . "'\"></TD>\n\t\t\t\t\t\t</TR>";
             table_end();
             //print_R($_SERVER);
             exit;
         }
     }
     #########################################################################################################
     //SQL语句解析函数_应用于消息中心($sql,$操作记录编号);
     #########################################################################################################
     //对MYSQL系统进行性能监控 2010-9-30 15:09
     $结束时间 = time();
     $执行时间 = $结束时间 - $开始时间;
     if ($sql != "show status" && $sql != "set names gbk" && $执行时间 > 2) {
         $sqlTEXT = "show status";
         $result = mysql_query($sqlTEXT, $this->_connectionID);
         while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
             $KEYNAME = $row['Variable_name'];
             $Element2[$KEYNAME] = $row['Value'];
         }
         //exit;
         //print_R($Element2);
         $Element['编号'] = "";
         $Element['当前时间'] = date("Y-m-d H:i:s");
         $Element['执行时间'] = $执行时间;
         $Element['SQL语句'] = ereg_replace("'", "&#039;", $sqlTEXT2010);
         $Element['Slow_launch_threads'] = $Element2['Slow_launch_threads'];
         $Element['Threads_cached'] = $Element2['Threads_cached'];
         $Element['Threads_connected'] = $Element2['Threads_connected'];
         $Element['Threads_created'] = $Element2['Threads_created'];
         $Element['Threads_running'] = $Element2['Threads_running'];
         $Element['Qcache_free_blocks'] = $Element2['Qcache_free_blocks'];
         $Element['Qcache_free_memory'] = $Element2['Qcache_free_memory'];
         $Element['Qcache_hits'] = $Element2['Qcache_hits'];
         $Element['Qcache_inserts'] = $Element2['Qcache_inserts'];
         $Element['Qcache_lowmem_prunes'] = $Element2['Qcache_lowmem_prunes'];
         $Element['Qcache_not_cached'] = $Element2['Qcache_not_cached'];
         $Element['Qcache_queries_in_cache'] = $Element2['Qcache_queries_in_cache'];
         $Element['Qcache_total_blocks'] = $Element2['Qcache_total_blocks'];
         $Element['SQL语句'] .= " |||| " . $_SERVER['SCRIPT_NAME'];
         $KEYS = array_keys($Element);
         $VALUES = array_values($Element);
         $KEYSTEXT = join(",", $KEYS);
         $VALUESTEXT = join("','", $VALUES);
         $sql = "insert into system_logall({$KEYSTEXT}) values('{$VALUESTEXT}');";
         mysql_query($sql, $this->_connectionID);
         //print $sql;
     }
     //返回结果
     return $mysql_query;
     //else return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
 }
function BaseStatistics($showlistfieldlist1Array, $action_model_2)
{
    global $html_etc, $common_html, $tablename, $tabletitle;
    global $db, $columns;
    global $_POST, $_GET, $primarykey_index;
    //获取系统显示的色彩信息
    $ColorArray = returnColorArray();
    //初始化信息
    $USER_Field = $showlistfieldlist1Array[0];
    $DEPT_Field = $showlistfieldlist1Array[1];
    $DATE_Field = $showlistfieldlist1Array[2];
    $FIELD_Field = $showlistfieldlist1Array[3];
    $FIELD_LIST = explode(':', $FIELD_Field);
    $Action_Model = $FIELD_LIST[0];
    switch ($Action_Model) {
        case 'NUM':
            //array_shift($FIELD_LIST);
            $SQL_Text = "Count({$FIELD_LIST['1']}) AS Number";
            break;
        case 'SUM':
            break;
    }
    $_GET['Year'] == "" ? $_GET['Year'] = Date("Y") : '';
    $Year = $_GET['Year'];
    if ($DATE_Field == "BaoBeiDate") {
        $SQL_ADD1 = "IsFor AS IsFor,";
        $SQL_ADD2 = ",IsFor";
        $SQL_ADD3 = " and IsFor = 'on' ";
        $SQL_ADD4 = "";
    } else {
        $SQL_ADD1 = "";
        $SQL_ADD2 = "";
        $SQL_ADD3 = "";
        $SQL_ADD4 = "";
    }
    $sql = "select Date_Format({$DATE_Field},'%Y-%c') AS Date,\n\t\tDate_Format({$DATE_Field},'%Y') AS Year,\n\t\t\t{$SQL_ADD1}\n\t\t\t{$SQL_Text},\n\t\t\t{$USER_Field} AS USER_Field,\n\t\t\t{$DEPT_Field} AS DEPT_Field\n\t\t\tfrom {$tablename}\n\t\t\tgroup by {$DATE_Field},{$USER_Field},{$DEPT_Field} {$SQL_ADD2}\n\t\t\thaving Year='{$Year}' {$SQL_ADD3}\n\t\t\torder by DEPT_Field\n\t\t\t";
    // having CommunicationNeeds_SureDate != null
    //$SQL = "select Date_Format($fieldName,'%c') AS $fieldName,Sum($sum_index) as sum,Count($fieldName) as num from $tablename group by $fieldName";
    //print $sql;
    $rs = $db->CacheExecute(150, $sql);
    $rs_a = $rs->GetArray();
    for ($i = 0; $i < sizeof($rs_a); $i++) {
        $list = $rs_a[$i];
        $DateValue = $list['Date'];
        $UserValue = $list['USER_Field'];
        $DeptValue = $list['DEPT_Field'];
        $NewArray['USER'][$UserValue][$DateValue] += $list['Number'];
        $NewArray['DEPT'][$DeptValue][$DateValue] += $list['Number'];
        $NewArray['DEPT_YEAR'][$DeptValue][$Year] += $list['Number'];
        $NewArray['USER_YEAR'][$UserValue][$Year] += $list['Number'];
        $NewArray['USER_DEPT'][$UserValue] = $DeptValue;
    }
    //print_R($NewArray['DEPT']);
    table_begin("900");
    $Title_URL .= "<font color=white title='客户信息统计:" . $Year . "年'>客户信息统计:" . $Year . "年</font> ";
    $Title_URL .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\t\t\t\t<a href=\"?Year=" . ($Year - 1) . "&action_model={$action_model_2}\" title=\"点击此按钮,来确定不同的年份进行统计\"><img src=\"../../Framework/images/arrow_l.gif\" border></a>\n\t\t\t\t<a href=\"?Year=" . ($Year + 1) . "&action_model={$action_model_2}\" title=\"点击此按钮,来确定不同的年份进行统计\"><img src=\"../../Framework/images/arrow_r.gif\" border></a>\n\t\t\t\t";
    print_title("<font color=white title='按 \"" . $html_etc[$tablename][$DATE_Field . "_STS"] . "\" 进行信息统计'>[" . $html_etc[$tablename][$DATE_Field . "_STS"] . "]</font>" . $Title_URL, 15);
    //标题栏--用户区域
    print "<TR class=TableContent>\n";
    print "<TD nowrap title='用户列表'>用户列表</TD>\n";
    for ($i = 1; $i <= 12; $i++) {
        $HeaderName = Date("Y-n", mktime(0, 0, 0, $i, Date("d"), $Year));
        print "<TD nowrap title='显示" . $HeaderName . "月份数据统计信息'>{$HeaderName}</TD>\n";
    }
    print "<TD nowrap>" . $Year . "年</TD>\n";
    print "</TR>\n";
    //数据区域--用户区域
    $USER_LIST = @array_keys($NewArray['USER']);
    for ($i = 0; $i < sizeof($USER_LIST); $i++) {
        $USER_TEXT = $USER_LIST[$i];
        $DEPT_TEXT = $NewArray['USER_DEPT'][$USER_TEXT];
        $USER_TEXT_NAME = returntablefield("user", "USER_NAME", $USER_TEXT, "NICK_NAME");
        $DEPT_TEXT_NAME = returntablefield("department", "DEPT_ID", $DEPT_TEXT, "DEPT_NAME");
        print "<TR class=TableContent>\n";
        print "<TD nowrap class=TableData><font color=black title=\"" . $USER_TEXT_NAME . "一年统计数量:" . $NewArray['USER_YEAR'][$USER_TEXT][$Year] . "\">" . $USER_TEXT_NAME . "[" . $DEPT_TEXT_NAME . "]</font>&nbsp;</TD>\n";
        for ($k = 1; $k <= 12; $k++) {
            $HeaderName = Date("Y-n", mktime(0, 0, 0, $k, Date("d"), $Year));
            $HeaderName2 = Date("Y-m", mktime(0, 0, 0, $k, Date("d"), $Year));
            if ($NewArray['USER'][$USER_TEXT][$HeaderName] != "") {
                $base64_string = "action=init_default_search&searchvalue={$HeaderName2}&searchfield={$DATE_Field}&{$USER_Field}={$USER_TEXT}";
                $base64_url = base64_encode($base64_string);
                $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['USER'][$USER_TEXT][$HeaderName] . "</a>";
            } else {
                $Element = "";
            }
            print "<TD nowrap class=TableData>" . $Element . "&nbsp;</TD>\n";
        }
        if ($NewArray['USER_YEAR'][$USER_TEXT][$Year] != "") {
            $base64_string = "action=init_default_search&searchvalue={$Year}&searchfield={$DATE_Field}&{$USER_Field}={$USER_TEXT}";
            $base64_url = base64_encode($base64_string);
            $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['USER_YEAR'][$USER_TEXT][$Year] . "</a>";
        } else {
            $Element = "";
        }
        print "<TD nowrap class=TableData><font color=black title='" . $USER_TEXT_NAME . "用户" . $Year . "年客户数量:" . $NewArray['USER_YEAR'][$USER_TEXT][$Year] . "'>" . $Element . "</font>&nbsp;</TD>\n";
        print "</TR>\n";
    }
    //标题栏--部门区域
    print "<TR class=TableContent>\n";
    print "<TD nowrap title='部门列表'>部门列表</TD>\n";
    for ($i = 1; $i <= 12; $i++) {
        $HeaderName = Date("Y-n", mktime(0, 0, 0, $i, Date("d"), $Year));
        print "<TD nowrap title='显示" . $HeaderName . "月份数据统计信息'>{$HeaderName}</TD>\n";
    }
    print "<TD nowrap>" . $Year . "年</TD>\n";
    print "</TR>\n";
    //数据区域--部门区域
    $DEPT_LIST = @array_keys($NewArray['DEPT']);
    for ($i = 0; $i < sizeof($DEPT_LIST); $i++) {
        $DEPT_TEXT = $DEPT_LIST[$i];
        $DEPT_TEXT_NAME = returntablefield("department", "DEPT_ID", $DEPT_TEXT, "DEPT_NAME");
        print "<TR class=TableContent>\n";
        print "<TD nowrap class=TableData><font color=black title=\"" . $DEPT_TEXT_NAME . "一年统计数量:" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "\">" . $DEPT_TEXT_NAME . "[" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "]</font>&nbsp;</TD>\n";
        for ($k = 1; $k <= 12; $k++) {
            $HeaderName = Date("Y-n", mktime(0, 0, 0, $k, Date("d"), $Year));
            $HeaderName2 = Date("Y-m", mktime(0, 0, 0, $k, Date("d"), $Year));
            if ($NewArray['DEPT'][$DEPT_TEXT][$HeaderName] != "") {
                $base64_string = "action=init_default_search&searchvalue={$HeaderName2}&searchfield={$DATE_Field}&{$DEPT_Field}={$DEPT_TEXT}";
                $base64_url = base64_encode($base64_string);
                $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['DEPT'][$DEPT_TEXT][$HeaderName] . "</a>";
            } else {
                $Element = "";
            }
            print "<TD nowrap class=TableData>" . $Element . "&nbsp;</TD>\n";
        }
        if ($NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] != "") {
            $base64_string = "action=init_default_search&searchvalue={$Year}&searchfield={$DATE_Field}&{$DEPT_Field}={$DEPT_TEXT}";
            $base64_url = base64_encode($base64_string);
            $Element = "<a href=\"crm_customer_newai.php?{$base64_url}\" target=_blank>" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "</a>";
        } else {
            $Element = "";
        }
        print "<TD nowrap class=TableData><font color=black title='" . $DEPT_TEXT_NAME . $Year . "年客户数量:" . $NewArray['DEPT_YEAR'][$DEPT_TEXT][$Year] . "'>" . $Element . "</font>&nbsp;</TD>\n";
        print "</TR>\n";
    }
    //合并说明
    print "<TR class=TableContent>\n";
    print "<TD nowrap colspan=15 title='如果使用浏览器打印不是太方便的话,可以复制表格数据区到MS EXCEL,然后进行排版打印' class=TableData>报表说明:点击标题栏两个黑色三角箭头,即可实现年份之间的切换&nbsp;</TD>\n";
    print "</TR>\n";
    //报表统计主体部分开始
    for ($k = 0; $k < sizeof($showlistfieldlistArray); $k++) {
        $fieldIndex = $showlistfieldlistArray[$k];
        $fieldName = $columns[$fieldIndex];
        $fieldText = $html_etc[$tablename][$fieldName];
        $mode = $showlistfieldfilterArray[$k];
        $modeArray = explode(':', $mode);
        //$rs=$db->CacheExecute(150,$SQL);
        //$rs_array=$rs->GetArray();//print_R($rs_array);
        //父表结构部分
        //本表操作部分--数据处理部分 --形成FLASH要处理的数据类型
        //本表操作部分--FALSH图表显示部分--显示FLASH图表的结果
        //本文信息显示部分
        //print_title($html_etc[$tablename][$tabletitle]."<font color=green>[".$html_etc[$tablename][$fieldName]."]</font>",40);
        print "<TR class=TableData>";
        print "<TD width=30%>名称</TD>";
        print "<TD width=30%>数目</TD>";
        print "<TD width=30%>百分比</TD>";
        print "<TD width=30%>总记录</TD>";
        print "</TR>";
        for ($i = 0; $i < sizeof($rs_array); $i++) {
            $ResultNumber = $rs_array[$i][num];
            $ResultSum = $rs_array[$i][sum];
            $ResultFieldCode = $rs_array[$i][$fieldName];
            $ResultFieldName = returntablefield($tablenameIndex, $WhatIndex, $ResultFieldCode, $ReturnIndex);
            if ($sum_index != "") {
                print "<TD noWrap width=15%>统计额度&nbsp;</TD>";
                print "<TD noWrap width=10%><font color=red>" . $ResultSum . "&nbsp;" . $UserUnitFunctionIndex . "</font></TD>";
            }
            print "<TR class=TableData>";
            print "<TD >{$ResultFieldName}</TD>";
            print "<TD >{$ResultNumber}</TD>";
            //print "<TD >".number_format($ResultNumber/$TotalNumberIndex,2,'.','')."</TD>";
            print "<TD >" . $TotalNumberIndex . "</TD>";
            print "</TR>";
        }
        print "<TR class=TableData>";
        print "<TD noWrap colspan = 40>\n";
        print "&nbsp;";
        print "</TD>";
        print "</TR>";
        table_end();
        print "<BR>";
        break;
    }
}
Example #14
0
@mysql_close();
if ($_POST['connect']) {
    if (@mysql_connect($servername, $dbusername, $dbpassword) && @mysql_select_db($dbname)) {
        echo "数据库连接成功!";
        mysql_close();
    } else {
        echo mysql_error();
    }
} else {
    if ($_POST['dobackup']) {
        $filepath = "../databackup/";
        if (!is_dir($filepath)) {
            mkdir($filepath);
        }
        print "<BR>";
        table_begin(650);
        print_title("数据库备份提示");
        print "<tr class=Tabledata><td align=center><font color=red>";
        if (empty($_POST[table])) {
            print "请选择欲备份的数据表";
        } else {
            if (!mysql_connect($hostname, $userdb_name, $userdb_pwd)) {
                exit("数据库连接失败");
            }
            if (!mysql_select_db($userdb)) {
                exit("选择数据库失败");
            }
            $table = array_flip($_POST['table']);
            $filehandle = @fopen($filepath . $_POST['path'], "w");
            if ($filehandle) {
                $result = mysql_query("SHOW tables");
Example #15
0
function newai_import($fields, $mode = 'table')
{
    global $common_html, $html_etc;
    global $return_sql_line, $db;
    global $columns;
    //print_R($columns);
    global $showlistfieldlist, $showlistfieldlist_key;
    global $foreignkey, $uniquekey, $primarykey;
    $tablename = $fields['table']['name'];
    $SQL = $fields['sql']['SQL'];
    $init = explode('_', $_GET['action']);
    $mark = $init[1];
    if ($uniquekey == '') {
        $uniquekey = $primarykey;
    }
    //print $uniquekey;
    print "<FORM name=form1 action=\"?action=import_" . $mark . "_data\" method=post encType=multipart/form-data>\n";
    print "<input type=hidden name=hidden_str value=''>\n";
    print "<script >";
    print "\nfunction temp_function()\n{\n\n\tvar selectid_str=\"\";\n\t/*\n\tfor(i=0;i<document.all(\"selectid\").length;i++)\n\t\t{\n\n\t\tel=document.all(\"selectid\").item(i);\n\t\tif(el.checked)\n\t\t{  val=el.value;\n         selectid_str+=val + \",\";\n\t\t}\n\t}*/\n\tform1.hidden_str.value=selectid_str;\n\tform1.submit();\n\tvar sbtn=document.getElementsByName('submitbtn');\n\tfor(i=0;i<sbtn.length;i++)\n\t{\n\t\tsbtn[i].value='提交中';\n\t\tsbtn[i].disabled=true;\n\t}\n}\n";
    print "</script>";
    global $tablewidth, $primarykey, $primarykey_index;
    $tablewidth = $tablewidth != "" ? $tablewidth : 450;
    table_begin($tablewidth);
    print_title("数据导入操作,唯一索引限制,多个表示不能同时重复", 3);
    //print_R($common_html['common_html']['contentimport']);
    if ($foreignkey != "") {
        $foreignkey_array = explode(':', $foreignkey);
        $columns_parent = returntablecolumn($foreignkey_array[1]);
        print_R($columns_parent);
        print_select('选择考试名称', $columns[(string) $foreignkey_array[3]], $value, $foreignkey_array[1], $columns_parent[(string) $foreignkey_array[3]], $columns_parent[(string) $foreignkey_array[2]], $colspan = 3, $columns_parent[(string) $foreignkey_array[4]]);
        print_hidden($columns[(string) $foreignkey_array[3]], 'foreignkey');
    }
    print "<TR class=TableData>\n";
    print "<TD noWrap align=middle width=50>唯一索引:</TD>\n";
    print "<TD colspan=2>";
    $uniquekey_array = explode(',', $uniquekey);
    $FieldList = array();
    for ($i = 0; $i < sizeof($uniquekey_array); $i++) {
        $uniquekey_KEY = $uniquekey_array[$i];
        if ($uniquekey_KEY != "") {
            $uniquekey_KEY_ADD = explode(':', $uniquekey_KEY);
            if ($uniquekey_KEY_ADD[1] == "userid") {
                $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)";
            } else {
                if ($uniquekey_KEY_ADD[1] == "username") {
                    $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)";
                } else {
                    if ($uniquekey_KEY_ADD[1] == "datetime") {
                        $FieldList[] = $columns["" . $uniquekey_KEY_ADD[0] . ""] . "(自动生成)";
                    } else {
                        $tablenamelang = returnsystemlang($tablename);
                        $FieldList[] = $tablenamelang[$tablename][$columns["" . $uniquekey_KEY_ADD[0] . ""]];
                    }
                }
            }
        }
    }
    //print_R($uniquekey_array);
    //输出不较验主键时的选择列表
    $唯一字段显示文本 = join(',', $FieldList);
    print $唯一字段显示文本;
    print "</TD>\n";
    print "</TR>\n";
    global $importgroup;
    if ($importgroup != "") {
        //print $importgroup;
        print_title('选择要导入的组', 3);
        $importgroupArray = explode(':', $importgroup);
        $showfieldIndex = $importgroupArray[0];
        $showFieldName = $columns[$showfieldIndex];
        $showfieldTableName = $importgroupArray[1];
        $showfieldColumns = returntablecolumn($showfieldTableName);
        $showfieldIndexValue = $importgroupArray[2];
        $showfieldIndexName = $importgroupArray[3];
        $showfieldIndexValue = $showfieldColumns[$showfieldIndexName];
        $showfieldIndexName = $showfieldColumns[$showfieldIndexName];
        print_select('选择要导入的组:', $showFieldName, $value = '', $showfieldTableName, $showfieldIndexValue, $showfieldIndexName, $colspan = 2, $setfieldname = '', $setfieldvalue = '', $setfieldboolean = '');
    }
    /*
    if($tablename == 'customer'){
    	print_title('请您先<a style="color:red;" href="xls_template/客户信息模板.xls">下载模板</a>,编辑完成再进行导入。',3);
    }elseif($tablename == 'supply'){
    	print_title('请您先<a style="color:red;" href="xls_template/供应商信息模板.xls">下载模板</a>,编辑完成再进行导入。',3);
    }elseif($tablename == 'product'){
    	print_title('请您先<a style="color:red;" href="xls_template/商品信息模板.xls">下载模板</a>,编辑完成再进行导入。',3);
    }else{
    	print_title('导入EXCEL格式数据文件,请您直接从导出功能模块下载导入模板',3);
    }
    */
    print_title('导入EXCEL格式数据文件,请您直接从导出功能模块下载导入模板', 3);
    print "<TR class=TableData height=50>\n";
    print "<TD noWrap align=middle >EXCEL格式文件</TD>\n";
    print "<TD colspan=2><input name='uploadfileXLS' type=file size=25 class=SmallInput></TD>\n";
    print "</TR>\n";
    //print_title('导入CSV格式数据文件',3);
    //print "<TR class=TableData height=50>\n";
    //print "<TD noWrap align=middle >MS CSV文件</TD>\n";
    //print "<TD colspan=2><input name='uploadfile' type=file size=25 class=SmallInput></TD>\n";
    //print "</TR>\n";
    print "<tr align=\"center\" class=\"TableControl\">\n<td colspan=\"3\">\n<div align=\"center\"><input type=\"button\" name='submitbtn' value=\"" . $common_html['common_html']['import'] . "\" class=\"SmallButton\" onClick=\"temp_function();\">  <input type=\"button\" value=\"" . $common_html['common_html']['return'] . "\" class=\"SmallButton\" onClick=\"history.back();\"></div>\n</td></tr>\n";
    table_end();
    form_end();
    print "<BR>";
    table_begin($tablewidth);
    print_title("EXCEL格式数据正确但导入失败时,请按以下方法进行:");
    print "<TR class=TableData height=50>\n";
    print "<TD colspan=3><font color=green>\n\t如何过滤EXCEL里面的格式,转化为纯净的EXCEL数据格式文件:<BR>\n\n\t&nbsp;&nbsp;1 准备好原始格式数据文件<BR>\n\t&nbsp;&nbsp;2 新建一个EXCEL文件,即空白文件<BR>\n\t&nbsp;&nbsp;3 工具栏选择数据->导入外部数据->导入数据,弹出的对话框里面,选择第一步准备好的原始文件<BR>\n\t&nbsp;&nbsp;4 其它不要动,一切按默认的方法进行操作<BR>\n\t&nbsp;&nbsp;5 即可得到纯净的EXCEL数据格式文件,把这个文件进行导入即可<BR>\n\t&nbsp;&nbsp;注意:这种方法只用于解决,数据列数及列名正确,但软件无法识别的情况<BR>\n\t</font>\n\t\n";
    print "</TD></TR>\n";
    table_end();
    form_end();
}
公司地址:河南郑州经济技术开发区第五大街经北三路通信产业园四楼西南;
公司简介:郑州单点科技软件有限公司位于中国中部城市-郑州,成立于2007年1月,致力于把基于先进信息技术(包括通信技术)的最佳管理与业务实践普及到教育行业客户的管理与业务创新活动中,全面提供具有自主知识产权的教育管理软件、服务与解决方案,是中部最优秀的高校教育管理软件及中小学校管理软件提供商。目前己经有多家高职和中职类院校使用通达中部研发中心开发的软件和服务;

软件名称:单点科技软件开发基础性架构平台,以及在其基础之上扩展的任何性软件作品;
发行协议:数字化校园产品为商业软件,发行许可为LICENSE方式;单点CRM系统即SunshineCRM系统为GPLV3协议许可,GPLV3协议许可内容请到百度搜索;
特殊声明:软件所使用的ADODB库,PHPEXCEL库,SMTARY库归原作者所有,余下代码沿用上述声明;
*/
require_once "lib.inc.php";
$GLOBAL_SESSION = returnsession();
$common_html = returnsystemlang("common_html");
page_css("System Setting");
$goalfile = "system_config.ini";
if ($_GET['action'] == "" || $_GET['action'] == "init") {
    @($ini_file = @parse_ini_file($goalfile));
    form_begin("form1", "action=updatedata");
    table_begin();
    print_title($common_html['common_html']['systemconfiginformation']);
    print_tr("横幅栏显示:", "CompanyName", $ini_file[CompanyName], 50, 1, "SmallInput", "");
    print_tr("状态栏显示:", "status_bar", $ini_file[status_bar], 50, 1, "SmallInput", "");
    print_tr("IE标题栏:", "IETitle", $ini_file[IETitle], 50, 1, "SmallInput", "");
    print_tr("登录界面标题栏:", "LoginTitle", $ini_file[LoginTitle], 50, 1, "SmallInput", "");
    print_submit($common_html['common_html']['submit'], 2, 'all', '#');
    table_end();
    form_end();
}
if ($_GET['action'] == "updatedata") {
    if (is_file($goalfile)) {
        unlink($goalfile);
    }
    $goalfile = $goalfile;
    $_POST['status_bar'] = str_replace("(", "(", $_POST['status_bar']);
Example #17
0
	</TD></TR>";
	print "<TR><TD class=TableData align=center colspan=4>(设定好当前学期一次性导入严谨重复导入,请导入规则的课表数据)</TD></TR>";

		print "<TR class=TableData >
		<TD noWrap align=center colspan=4>";
		print "<input type=\"submit\" value=\"点击上传课表文件\" title='先下载班级课表的模板数据,再点击本按钮进行上传' class=\"SmallButton\">&nbsp;&nbsp;";

		print "
		</TD>
		</TR>\n";
table_end();
print "</form><br><br>";

print "<form name=form2 action='?action=ImportXLSFile2' method=post enctype=multipart/form-data>";

table_begin(680);

	print "<TR><TD class=TableData colspan=3>新版课表导入</TD></TR>";
    print "
	<TR><TD class=TableData noWrap colspan=2>Excel文件:</TD>
	<TD class=TableData colspan=2>
	<input type=file class=SmallInput name=ExcelFile size=15> <a class='' href='templates/厦门技师理论课表模板(新).xls'>点击下载导入模板</a>
	</TD></TR>";
	print "<TR><TD class=TableData align=center colspan=4>(设定好当前学期一次性导入严谨重复导入,请导入规则的课表数据)</TD></TR>";

		print "<TR class=TableData >
		<TD noWrap align=center colspan=4>";
		print "<input type=\"submit\" value=\"点击上传课表文件\" title='先下载班级课表的模板数据,再点击本按钮进行上传' class=\"SmallButton\">&nbsp;&nbsp;";

		print "
		</TD>
Example #18
0
            print "<td nowrap><a href=\"?actionAction=phpide&tablename={$list}&action=tablestruct\"><font color=green>数据表结构</font></a></td>";
            print "<td nowrap><a href=\"?actionAction=phpide&tablename={$list}&action=tableData\"><font color=green>返回数据行</font></a></td>";
            //print $list." <a href=\"?tablename=$list&action=init\">初始化文件</a> <a href=\"?tablename=$list&action=tablestruct\"><font color=green>数据表结构</font></a> <a href=\"?tablename=$list&action=tableData\"><font color=green>返回数据行</font></a><BR>";
            print "</Tr>";
        }
        //结束-已知表
    }
    table_end();
    exit;
}
$mode = isset($_GET['mode']) ? $_GET['mode'] : 0;
if ($_GET['action'] == 'init') {
    $content = config_content($tablename);
    global $SYSTEM_MODE_DIR;
    $filename = "../Interface/" . $SYSTEM_MODE_DIR . "/Model/" . $tablename . "_newai.ini";
    table_begin("60%");
    print_title("PHP集成开发环境WEB版--文件写入", 40);
    print "<tr class=TableData><td>";
    inputlanguage($tablename);
    write_newaifile($filename, $content, $mode);
    inputsystemtable($tablename);
    //写入tablename_newai.php文件
    if ($SYSTEM_MODE_DIR == "Teacher") {
        $content = "<?php\n\tini_set('display_errors', 1);\n\tini_set('error_reporting', E_ALL);\n\terror_reporting(E_WARNING | E_ERROR);\n\n\trequire_once('lib.inc.php');\n\tTeacher_Sesssion2();\n\n\tif(\$_GET['班号']==\"\"&&\$_SESSION['sunshine_teacher_banzhuren_class']!=\"\")\t\t{\n\t\t\$_GET['班号'] = \$_SESSION['sunshine_teacher_banzhuren_class'];\n\t}\n\telse if(\$_GET['班号']==\"\")\t{\n\t\t\$_GET['班号'] = \"所属下面没有班级信息\";\n\t}\n\telse\t{\n\t}\n\n\t\$_GET['学生状态'] = \"正常状态\";\n\n\t";
    } else {
        $content = "<?php\n\tini_set('display_errors', 1);\n\tini_set('error_reporting', E_ALL);\n\terror_reporting(E_WARNING | E_ERROR);\n\trequire_once('lib.inc.php');\n\t\$GLOBAL_SESSION=returnsession();\n\t";
    }
    $content .= "\n\t/*\n\tif(\$_GET['action']==\"add_default_data\")\t\t{\n\t\t//print_R(\$_GET);print_R(\$_POST);//exit;\n\t\tglobal \$db;\n\t\t\$入库数量 = (int)\$_POST['入库数量'];\$教材编号 = \$_POST['教材编号'];\n\t\t\$sql = \"update edu_jiaocai set 现有库存=现有库存+\$入库数量 where 教材编号='\".\$教材编号.\"'\";\n\t\t\$rs = \$db->Execute(\$sql);//print \$sql;exit;\n\t\t\$_POST['编作者'] = returntablefield(\"edu_jiaocai\",\"教材编号\",\$教材编号,\"编作者\");\n\t\t\$_POST['出版社'] = returntablefield(\"edu_jiaocai\",\"教材编号\",\$教材编号,\"出版社\");\n\t\t//print  \"<META HTTP-EQUIV=REFRESH CONTENT='0;URL=?'>\";\n\t}\n\t*/\n\n\t//数据表模型文件,对应Model目录下面的" . $tablename . "_newai.ini文件\n\t//如果是需要复制此模块,则需要修改\$parse_filename参数的值,然后对应到Model目录 新文件名_newai.ini文件\n\t\$filetablename\t\t=\t'{$tablename}';\n\t\$parse_filename\t\t=\t'{$tablename}';\n\trequire_once('include.inc.php');\n\t?>";
    $filename = "../Interface/" . $SYSTEM_MODE_DIR . "/" . $tablename . "_newai.php";
    write_newaifile($filename, $content, $mode);
    /*
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
error_reporting(E_WARNING | E_ERROR);
require_once 'lib.inc.php';
$GLOBAL_SESSION = returnsession();
page_css("MYSQL 性能监控");
//自动清除七天以前的历史记录
$sql = "delete from system_logall where datediff(now(),当前时间)>=7";
$db->Execute($sql);
$sql = "select DATE_FORMAT(当前时间,'%Y-%m-%d') AS 当前时间\n\t\tfrom system_logall\n\t\tgroup by DATE_FORMAT(当前时间,'%Y-%m-%d')\n\t\torder by 当前时间 desc\n\t\t";
$rs = $db->CacheExecute(5, $sql);
$rs_a = $rs->GetArray();
for ($i = 0; $i < sizeof($rs_a); $i++) {
    $当前时间TEXT .= "<a href='?" . base64_encode("XX=XX&&当前时间=" . $rs_a[$i]['当前时间'] . "&&XX=XX") . "'>" . $rs_a[$i]['当前时间'] . "</a> ";
}
if ($_GET['当前时间'] != '') {
    $统计时间 = $_GET['当前时间'];
} else {
    $统计时间 = $rs_a[0]['当前时间'];
}
table_begin("100%");
print "<tr class=TableData ><td>MYSQL 运行情况监控 时间:" . $统计时间 . " {$当前时间TEXT}\n\t<input type=\"button\" class=\"SmallButton\" value=\"返回\" onclick=\"location='database_setting.php'\">\n\t<input type=\"button\" class=\"SmallButton\" value=\"明细\" onclick=\"location='system_logall_newai.php'\">\n\t</td></tr>";
table_end();
print "<BR>";
table_begin("780");
print_title("MYSQL 线程运行情况监控[以小时为单位统计] <a href=\"system_logall_mysqlthreads.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&统计单位=秒&XX=XX") . "\" target=_blank>查看以秒为单位的统计图</a>");
print "<tr class=TableData ><td><img src='system_logall_mysqlthreads.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&&XX=XX") . "' width=100% border=0></td></tr>";
print_title("MYSQL 查询缓存运行情况监控[以小时为单位统计] <a href=\"system_logall_querycache.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&统计单位=秒&XX=XX") . "\" target=_blank>查看以秒为单位的统计图</a>");
print "<tr class=TableData ><td><img src='system_logall_querycache.php?" . base64_encode("XX=XX&&统计时间=" . $统计时间 . "&&XX=XX") . "' width=100% border=0></td></tr>";
table_end();
Example #20
0
function print_chart_picture_array($picture)
{
    global $common_html;
    table_begin();
    print "<TR>";
    print "<TD class=TableData noWrap colspan=\"1\">\n";
    if (sizeof($picture) > 0) {
        foreach ($picture as $list) {
            print "<img src=\"{$list}\" border=0/><BR>";
        }
        //end for
    }
    //end if
    print "</TD></TR>\n";
    table_end();
}