Example #1
0
File: ido.php Project: xuding/gMIS
        $tbl = $_CONFIG['welcometbl'];
        $_REQUEST['tbl'] = $tbl;
    } else {
        $out .= __FILE__ . ": a table name should be given. [1201231050]\n";
        $out .= "<br/><a href=\"" . $_CONFIG['rtvdir'] . "\">=Home</a>";
        $isgo = false;
    }
} else {
    $out .= "<script type=\"text/javascript\">currenttbl='" . $tbl . "';\ncurrentdb='" . $mydb . "';\n currentlistid= {};\n userinfo={'id':'" . $userid . "','email':'" . $user->getEmail() . "','group':'" . $user->getGroup() . "','branch':'" . $user->get('branchoffice') . "'};\n </script>\n";
}
$out_header = $out;
$out = "";
# re-init it
if ($isgo) {
    $hmconf = GTbl::xml2hash($xmlpathpre, $elementsep, $db, $tbl);
    $gtbl = new GTbl($tbl, $hmconf[0], $elementsep);
    #print __FILE__.": hmconf:".print_r($hmconf);
    if ($_REQUEST['tit'] == '') {
        $tit = $gtbl->getTblCHN();
    }
    # get detail path
    $module_path = '';
    $levelcode = '';
    $codelist = '';
    $hm = $gtbl->execBy("select levelcode, linkname, modulename from " . $_CONFIG['tblpre'] . "info_menulist where modulename='" . str_replace($_CONFIG['tblpre'], "", $tbl) . "'", null);
    if ($hm[0]) {
        $levelcode = $hm[1][0]['levelcode'];
        $codelist = substr($levelcode, 0, 2) . "','" . substr($levelcode, 0, 4) . "','" . substr($levelcode, 0, 6) . "','" . substr($levelcode, 0, 8);
        # max 4 levels allowed
        $hm = $gtbl->execBy("select levelcode, linkname, modulename from " . $_CONFIG['tblpre'] . "info_menulist where levelcode in ('" . $codelist . "') order by levelcode", null);
        if ($hm[0]) {
Example #2
0
<?php

# be part of /jdo.php
$isadmin = false;
$hlcolor = '#afc4e2';
$form_cols = 6;
$hashiddenfield = false;
$hmconf = GTbl::xml2hash($xmlpathpre, $elementsep, $db, $tbl);
$gtbl = new GTbl($tbl, $hmconf[0], $elementsep, $tblrotate);
$hmfield = $hmfieldsort = array();
$hmfieldsortinxml = $hmconf[1];
$sql = "desc {$tbl}";
$hm = $gtbl->execBy($sql, null);
$max_idx = $hmi = 99;
# max number of fields count
$min_idx = 0;
$dispi = 0;
$max_disp_cols = $gtbl->getListFieldCount();
# display field count
$hasid = false;
$hmj = count($hmfieldsortinxml);
#1; remedy Sun Jul 22 22:26:09 CST 2012
if ($hm[0]) {
    $hm = $hm[1];
    foreach ($hm as $k => $v) {
        $field = $v['Field'];
        $fieldv = "fieldtype=" . $v['Type'];
        if (strtolower($field) == 'id') {
            $field = strtolower($field);
        } else {
            if (strtolower($field) == 'name' || strtolower($field) == 'type') {
Example #3
0
$objecttbl = $_CONFIG['tblpre'] . "info_objecttbl";
$hmconf = GTbl::xml2hash($xmlpathpre, $elementsep, $db, $tbl);
$gtbl = new GTbl($tbl, $hmconf[0], $elementsep);
$out = "";
# no more output is needed, Mon Jul  2 17:57:35 CST 2012
$sql = "show tables";
$hm = $gtbl->execBy($sql, null);
if ($hm[0]) {
    $hm = $hm[1];
    #print_r($hm);
    foreach ($hm as $k => $v) {
        $tbl = $v['Tables_in_' . strtolower($db)];
        #print "$k => ".$tbl."\n";
        if ($tbl != "") {
            $tmpconf = GTbl::xml2hash($xmlpathpre, $elementsep, $db, $tbl);
            $tmpgtbl = new GTbl($tbl, $tmpconf[0], $elementsep);
            $tblchn = $tmpgtbl->getTblCHN();
            #print "tbl:$tbl, chnname:".$tblchn;
            if ($tblchn == '') {
                $tblchn = $tbl;
            }
            $tmphm = $tmpgtbl->execBy("select id from {$objecttbl} where tblname='" . $tbl . "'", null);
            #print_r($tmphm);
            $objectid = $tmphm[1][0]['id'];
            if ($objectid > 0) {
                $sql = "update {$objecttbl} set objname='" . $tblchn . "',operator='sysop',updatetime=NOW() where tblname='" . $tbl . "'";
            } else {
                $sql = "insert into {$objecttbl} set objname='" . $tblchn . "', tblname='" . $tbl . "',operator='sysop',updatetime=NOW()";
            }
            #print "sql:$sql\n";
            $tmpgtbl->execBy($sql, null);
Example #4
0
#print_r($_REQUEST);
$out = "";
$objectid = $_REQUEST['objectid'];
$tbl = $_CONFIG['tblpre'] . "info_objecttbl";
if (isset($_REQUEST['tbl'])) {
    $tbl = $_CONFIG['tblpre'] . $_REQUEST['tbl'];
}
$objArr = array();
if ($logicid == 'mingcheng' || startsWith($objectid, "fromtable")) {
    $objArr = explode("__", $objectid);
    # <selectoption>hss_tuanduitbl__mingcheng:团款|hss_info_gouwudiantbl__mingcheng:商店流水|2:导游人头|3:摄像|4:其他</selectoption>
    $tbl = $objArr[0];
    $_REQUEST['tbl'] = $tbl;
    #print_r($objArr);
}
$gtbl = new GTbl($tbl, array(), $elementsep);
$hm = null;
if ($logicid == 'mingcheng') {
    #
} else {
    if ($logicid == 'xiane') {
        $hm = $gtbl->getBy("*", "id='" . $objectid . "'");
        if ($hm[0]) {
            $hm = $hm[1];
            $tbl = $hm[0]['tblname'];
            $_REQUEST['tbl'] = $tbl;
        }
    } else {
        if ($logicid == "leibie") {
            $tbl = $_REQUEST['tbl'];
            if (strpos($tbl, $_CONFIG['tblpre']) !== 0) {
Example #5
0
$tbl = $_REQUEST['tbl'];
$mydb = $_CONFIG['appname'] . 'db';
$db = $_REQUEST['db'] == '' ? $mydb : $_REQUEST['db'];
$field = $_REQUEST['field'];
$url = $rtvdir . "/ido.php";
$url = mkUrl($url, $_REQUEST);
$maintbl_sanke = "hss_sanke_tuanduitbl";
$otbl = $_REQUEST['otbl'];
$oid = $_REQUEST['oid'];
$lfield = $_REQUEST['linkfield'];
#if($oid == ''  && $otbl != $_CONFIG['maintbl']){
if ($_REQUEST['linkfieldval'] != '') {
    # added on Mon Mar 19 21:09:43 CST 2012
    $linkfv = $_REQUEST['linkfieldval'];
    $hmconf = GTbl::xml2hash($xmlpathpre, $elementsep, $db, $otbl);
    $gtbl = new GTbl($otbl, $hmconf[0], $elementsep);
    $gtbl->setId($oid);
    $hm = $gtbl->getBy($linkfv, "id=?");
    if ($hm[0]) {
        $hm = $hm[1][0];
        $id = $hm[$linkfv];
    }
} else {
    $id = $oid;
}
$url = preg_replace("/linkfield=([0-9a-zA-Z]*)/", "pnsk\$1=" . $id, $url);
$url = preg_replace("/&id=([0-9]*)/", "", $url);
if (strpos($url, "linkfield2") > 1) {
    $url = preg_replace("/linkfield2=([0-9a-z]*)/", "pnsk\$1=" . $otbl, $url);
    $url .= "&pnsm=1";
    # page navigator search mode, see in class/pagenavi.class.php