Documentation is available at confirm.php
- <?php
- // ----------------------------------------
- // to check db config and choose table to migrate
- // ----------------------------------------
- include "inc/config_inc.php";
- include "inc/header.html";
- $source_database = $_SESSION['source_database'];
- $source_version = $_SESSION['source_version'];
- $target_database = $_SESSION['target_database'];
- $target_version = $_SESSION['target_version'];
- if (isset($config_encodage)) {$config_encodage_disp = $config_encodage;}
- else {$config_encodage_disp = 'UTF 8';}
- // --------------------------------------------------
- // DISPLAY
- // --------------------------------------------------
- print "<h2>Récapitulatif des paramètres</h2>";
- print "<p><b>Transfert</b> : $source_database → $target_database <br />";
- print "<b>Encodage des caractères</b> : $config_encodage_disp</p>";
- print "<p><b>Tables concernées</b> <br />";
- // --------------------------------------------------
- // form to select
- // --------------------------------------------------
- print "<form name=\"form1\" method=\"post\" action=\"migrate.php\">";
- print "<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">";
- print " <tr valign=\"top\">";
- print " <th align=\"center\">Source => Cible</th>";
- print " <th align=\"center\">Nb fiches</th>";
- print " <th align=\"center\">Temps</th>";
- print " </tr>";
- db_connection('source');
- $total_record = 0;
- for ($i = 1; $i <= count($table_to_migrate); $i++) {
- $from_table_name = $table_to_migrate[$i]['from'];
- $to_table_name = $table_to_migrate[$i]['to'];
- $nb_record = nb_record($from_table_name);
- $nb_record_f = fr_format_number($nb_record);
- $total_record += $nb_record;
- $estimated_time_each = ceil($nb_record / $transfer_rate);
- $estimated_time_each_f = convert_hms($estimated_time_each);
- $total_estimated_time += $estimated_time_each;
- print "<tr>";
- print "<td align=\"left\">";
- print "<input type=\"checkbox\" name=\"selected_source_table_name[]\"
- value=\"$from_table_name\" id=\"$from_table_name\">";
- print "<label for=\"$from_table_name\">$from_table_name => $to_table_name</label>";
- print "</td>";
- print "<td align=\"right\">$nb_record_f</td>";
- print "<td align=\"right\">$estimated_time_each_f</td>";
- print "</tr>";
- }
- $total_record_f = fr_format_number($total_record);
- $total_estimated_time_f = convert_hms($total_estimated_time);
- $total_estimated_time_fl = convert_hms($total_estimated_time, 'long');
- // total
- print "<tr>";
- print " <th>Total</th>";
- print " <th>$total_record_f</th>";
- print " <th>$total_estimated_time_f</th>";
- print " </tr>";
- // submit
- print "<tr>";
- print " <td valign=\"top\" align=\"center\">";
- print " <input colspan=\"3\" type=\"submit\" name=\"Submit\" value=\"Submit\" />";
- print "</td>";
- print " </tr>";
- print "</table>";
- print "</form>";
- // --------------------------------------------------
- // calc
- // --------------------------------------------------
- print "<p>Estimation du temps de traitement <br />";
- print "$total_record_f fiches à transférer <br />";
- print "soit $total_estimated_time_fl au rythme de $transfer_rate fiches/seconde<br />";
- include "inc/footer.html";
- ?>