displayDescription($description); /** * */ $DEBUG=0; set_time_limit(3600); 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='&'; // nouveau $lettretype['orientation']='P'; $lettretype['format']='A4'; // logo $lettretype['logo']='logopdf.png'; $lettretype['logoleft']='58'; $lettretype['logotop']='7'; // titre $lettretype['titreleft']='41'; $lettretype['titretop']='36'; $lettretype['titrelargeur']='130'; $lettretype['titrehauteur']='10'; $lettretype['titrefont']='helvetica'; $lettretype['titreattribut']='B'; $lettretype['titretaille']='15'; $lettretype['titrebordure']='0'; $lettretype['titrealign']='C'; // corps $lettretype['corpsleft']='7'; $lettretype['corpstop']='57'; $lettretype['corpslargeur']='195'; $lettretype['corpshauteur']='5'; $lettretype['corpsfont']='helvetica'; $lettretype['corpsattribut']=''; $lettretype['corpstaille']='10'; $lettretype['corpsbordure']='0'; $lettretype['corpsalign']='J'; if (file_exists ("../gen/dyn/lettretype.inc")) include("../gen/dyn/lettretype.inc"); $lettretype['om_sql']="select ".$temp." from &DB_PREFIXE".$obj." where ".$obj.".".$obj."='".$variable."idx'"; $lettretype['titre']="le ".$variable."aujourdhui"; $lettretype['corps']=$temp1; // id $lettretype['id']= $obj; $lettretype['libelle']= $obj." gen le ".date('d/m/Y'); $lettretype['actif']=''; // contrainte null pgsql // om_collectivite $lettretype['om_collectivite']= $_SESSION['collectivite']; // parametre standard / custom // next Id $lettretype['om_lettretype']=$f-> db -> nextId(DB_PREFIXE.'om_lettretype'); if($DEBUG==1) print_r($lettretype); $res= $f-> db -> autoExecute(DB_PREFIXE.'om_lettretype',$lettretype,DB_AUTOQUERY_INSERT); $f->isDatabaseError($res); echo $obj." "._("enregistre"); echo "
"; } ?>