metsdrapeaux ('http://www.iefc.net/?page=bdd/essais/essais_import_fichier.php&mode=$mode&langue=','php','dp',1.5,0,0,0,3);"; }?>

Manage your data in FORESTRIALS database

"`", "\"" => "");//characters from the file that we want to replace $trans_value = array( "''"=>"NULL");//characters to replace in the mysql queries //echo $latin_names; //$latin_names="Pinus pinea, Pinus radiata"; //$obsolete_latin_names="Q. robur var dalechampii, Q. lanuginosa subsp. Dalechampii, Q. petraea var. dalechampii, Q. × kanitziana f. apatini, Q. robur var. aurea, Q. aurea, Q. robur var. cuneata, Q. sessiliflora var. macroloba, Q. sessilis var. macroloba, Q. dalechampii var. Angulata, Q. dalechampii var. Breviloba, Q. dalechampii var. cochleata , Q. dalechampii var. grandifolia, Q. dalechampii var. mecrobalana, Q. dalechampii var. pallida, Q. dalechampii var. pulchella, Q. dalechampii subf. acutilobata, Q. dalechampii var. aurea, Q. dalechampii subf. aureoacutilobata, Q. dalechampii subf. crispatolobata, Q. dalechampii f. lancifolia, Q. dalechampii subf. lobulada, Q. dalechampii subf. lobulosa, Q. dalechampii subf. lobulosissima, Q. dalechampii f. macroloba, Q. dalechampii f. piersii, Q. dalechampii f. rubens, Q. dalechampii subf. semiaurea, Q. dalechampii f. apatini "; //$fp = fopen('/home/orazio/Documents/stats4031_test.csv', 'r'); include_once ("/usr/local/apache/htdocs/IEFC/bdd/fonctions_communes.php"); include_once ("/usr/local/apache/htdocs/IEFC/bdd/essais/essais_fonctions.php"); include ("/usr/local/apache/htdocs/IEFC/util/mdp/connexion_essais.php"); $pass= $password; /* Mot de passe */ $dossier = '/tmp/'; $taille_maxi = 10000000; //$extensions = array('.txt', '.csv'); $extensions = array('.ods', '.xls', '.xlsx', '.csv'); #$table = $_POST["table"]; #$Ruser = $_POST["Ruser"]; #$action = $_POST["action"]; #$Rpassword = $_POST["Rpassword"]; $separator = ";"; if ($char==""){$char="utf8";}; @mysql_connect($host,$user,$pass) or die("cannot connect to database. Contact webmestre!"); @mysql_select_db($bdd); mysql_query("SET NAMES $char"); //print_r ($users); //echo "
action: $action
"; //echo $host,$user,$pass, $bdd, "
"; if ($Ruser!="" && $Ruser!=NULL && $users[$Ruser]==$Rpassword ){ $_SESSION['treedata_user']=$Ruser; $_SESSION['treedata_password']=$Rpassword; $_SESSION['treedata_project']=$project; $_SESSION['session_user']=$_SESSION['treedata_user'];//generic user for any time password requiered $_SESSION['session_context']="Treedata";//generic session info } //echo $action, $button_pressed; if($action!="" && $Ruser!="" && $Ruser!=NULL && $users[$Ruser]==$Rpassword && $button_pressed!='logout'){ if ($button_pressed=='upload'){ //echo $_FILES['fichier']; import_file_in_table2 ($host,$user,$pass, $bdd, $Ruser,$char, $_FILES['fichier'], "", $extensions, $taille_maxi,$separator, $trans,$trans_value, $dossier, $table, $action, "http://www.iefc.net/?page_seule=bdd/essais/essais_liste.php"); //echo "

Log during data processing :
"; //break; } if ($button_pressed=='download_ods'){ $tables_list=array("plot"=>"", "species"=>" LEFT JOIN plot USING (plot_id) ", "data"=>" LEFT JOIN species USING(species_id) LEFT JOIN plot USING(plot_id)"); $temp_file="/usr/local/apache/htdocs/IEFC/util/temp/dump_essai_table_$Ruser.ods";// voir avec /usr/local/apache/htdocs/IEFC ?? //$temp_file=try_get_tmp_dir()."dump_treedata_table.ods"; if (file_exists($temp_file)) unlink ($temp_file); //On supprime le fichier généré précedemment $where_download=" where plot.Data_owner = '$Ruser' "; //export_to_csv("*", $table_download, $where_download , $temp_file, ";"); //export_table_csv ($table_download, $where_download , $temp_file); //echo export_tables_ods($tables_list, $where_download, $temp_file); echo export_tables_spreadsheet($tables_list, $where_download, $temp_file); echo "Export done : Download the ods file here"; echo "
Back to the tool"; } } else { if ($button_pressed=='logout'){ session_unset (); } /* FORMULAIRE DE CHOIX D'IMPORTATION */ echo "You can upload information in the database FORESTRIALS by creating a cvs file (a text file in which on each line data are separated by a single ;). If you are not sure about the names of the various fields in the database, you can check them here"; echo "
If you wish to make any comments about this database, to add a modality in ENUM type fields or to acquire a password to upload your own data, you can do so at webmestre"; echo "
Column order does not matter. Unmatching columns are ignored.Field names are case sensitive. Dates must be formated like this: 1999-02-27. Latitude and longitude (WGS84) must be in decimals with a dot as a separator. You must not have any columns labeled 'Last_update' and 'owner', they exist for internal purposes only.To update field of type SET (list of option), you can separate the various options with a coma: 1,5,25."; echo "
IF YOU UPLOAD A SPREADSHEET, the sheet names must match the table names and the column names must be on first row."; echo "
IF YOU UPLOAD A CSV FILES, you must specify the character set and the column separator has to be '".$separator."'"; echo "
When you delete lines from plot table, all the related data in other tables (species and stand data) will be deleted! "; echo "
To help you to prepare csv files, you can download this calcsheet
.

"; ?>
Data owner/ ID : you must provide an user name!
"; } ?>
Password : you must provide a password!
"; } if ( $users[$Ruser]!=$Rpassword) { echo "Wrong Password!"; } ?>

Table to update :
File for upload (