Ejemplo n.º 1
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') {
Ejemplo n.º 2
0
Archivo: ido.php Proyecto: xuding/gMIS
}
$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]) {
            $hm = $hm[1];
            $lastLinkName = '';
            #print_r($hm);
            foreach ($hm as $k => $v) {
                if ($v['modulename'] != '') {
                    $module_path .= "<a href='./" . $ido . "?sid=" . $sid . "&tbl=" . $v['modulename'] . "'>" . $v['linkname'] . "</a> &rarr;";
                } else {
                    $module_path .= "" . $v['linkname'] . " &rarr;";
                }
Ejemplo n.º 3
0
$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);
            $out .= "<br/>" . $sql;
            # syncfield bgn, Mon Jul  2 16:42:49 CST 2012
            include $appdir . "/act/updateobjectfieldtbl.php";
            # syncfield end, Mon Jul  2 16:42:49 CST 2012
        } else {
            $out .= "<br/> Empty tblname found. k:[{$k}] v:[{$v}].";