displayDescription($description); /** * */ set_time_limit(3600); $DEBUG=0; if (isset($_POST['choice-import']) and $_POST['choice-import'] != "---") { $obj = $_POST['choice-import']; } elseif(isset($_GET['obj'])) { $obj = $_GET['obj']; } else { $obj = ""; } if(isset($_GET['validation'])) { $validation = $_GET['validation']; } else { $validation = 0; } if (isset($_POST['choice-field'])){ $field=$_POST['choice-field']; }else{ $field=''; } /** * On liste les tables */ // tab $tab = array(); if (OM_DB_PHPTYPE == "mysql") { $sql = "SHOW TABLES FROM `".OM_DB_SCHEMA.OM_DB_DATABASE."`"; } if($f -> phptype == 'pgsql'){ //***pgsql $sql ="select tablename from pg_tables where schemaname='".$f -> schema. "' UNION select (viewname||' [vue]') from pg_views where schemaname='".$f -> schema."'"; // *** } $res1 = $f -> db -> query ($sql); $f->isDatabaseError($res1); $k=0; while ($row=& $res1->fetchRow()){ if(substr($row[0],-3,3)!= "seq" ){ $k++; array_push($tab, $f->tablebase[$k]= $row[0]); } } asort($tab); echo "\n
\n"; echo "
\n"; echo "
\n"; echo "\t"._("Choix table :")."\n"; echo "\t
"; echo ""; echo ""; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; /** * choix des champs */ if ($obj != "" and $field=='') { // echo "\n
 
\n"; echo "
\n"; echo "
\n"; echo "\t"._("choix des champs").""; echo "Utilisez ctrl key pour choix multiple

"; $sql= "select * from ".DB_PREFIXE.$obj; $res2 = $f -> db -> query ($sql); $info=$res2->tableInfo(); echo ""; echo "

"; echo ""; echo "
"; echo ""; echo ""; echo "\n"; } /** * transfert dans la base */ if ($obj != "" and $field!='') { echo "\n
 "; echo "
\n"; echo "\t Insertion dans la table etat"; // sql $temp=''; $temp1=''; if($field!=array()){ for ($i = 0; $i < sizeof($field); $i++) { $temp2=explode(".",$field[$i]); $temp3=$temp2[1]; $temp.=$field[$i].' as '.$temp3.','; $temp1.="[".$temp3.']'.chr(13).chr(10); } $temp=substr($temp, 0, strlen($temp)-1); } // parametres $variable='&'; $etat['orientation']='P'; $etat['format']='A4'; // footer $etat['footerfont']='helvetica'; $etat['footerattribut']='I'; $etat['footertaille']='8'; // logo $etat['logo']='logopdf.png'; $etat['logoleft']='58'; $etat['logotop']='7'; // titre $etat['titreleft']='41'; $etat['titretop']='36'; $etat['titrelargeur']='130'; $etat['titrehauteur']='10'; $etat['titrefont']='helvetica'; $etat['titreattribut']='B'; $etat['titretaille']='15'; $etat['titrebordure']='0'; $etat['titrealign']='C'; // corps $etat['corpsleft']='7'; $etat['corpstop']='57'; $etat['corpslargeur']='195'; $etat['corpshauteur']='5'; $etat['corpsfont']='helvetica'; $etat['corpsattribut']=''; $etat['corpstaille']='10'; $etat['corpsbordure']='0'; $etat['corpsalign']='J'; // sous etat $etat['se_font']='helvetica'; $etat['se_margeleft']='8'; $etat['se_margetop']='5'; $etat['se_margeright']='5'; $etat['se_couleurtexte']="0-0-0"; if (file_exists ("dyn/etat.inc")) include("dyn/etat.inc"); $etat['om_sql']="select ".$temp." from &DB_PREFIXE".$obj." where ".$obj.".".$obj."='".$variable."idx'"; $etat['titre']="le ".$variable."aujourdhui"; $etat['corps']=$temp1; // id $etat['id']= $obj; $etat['libelle']= $obj." gen le ".date('d/m/Y'); $etat['actif']=''; // contrainte null pgsql $etat['sousetat']=''; // contrainte null pgsql // om_collectivite $etat['om_collectivite']= $_SESSION['collectivite']; // next Id $etat['om_etat']=$f-> db -> nextId(DB_PREFIXE.'om_etat'); if($DEBUG==1) print_r($etat); $res= $f-> db -> autoExecute(DB_PREFIXE.'om_etat',$etat,DB_AUTOQUERY_INSERT); $f->isDatabaseError($res); echo $obj." "._("enregistre"); echo "
"; } ?>