Alternc  latest
Alternc logiel libre pour l'hébergement
sql_dorestore.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * restore (do it) a MySQL database
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 include_once("head.php");
29 $fields = array (
30  "id" => array ("post", "string", ""),
31  "restfile" => array ("post", "string", ""),
32 );
34 ?>
35 
36 <h3><?php __("MySQL Databases"); ?></h3>
37 <hr id="topbar"/>
38 <br />
39 
40 <?php
41 
42 $r=$mysql->get_mysql_details($id);
43 
44 if (! $r["enabled"]) {
45  echo "<p class=\"alert alert-danger\">"._("You currently have no database defined")."</p>";
46  include_once("foot.php");
47  die();
48 }
49 ?>
50 
51 <h3><?php __("Restore a SQL backup"); ?></h3>
52 
53 <p>
54 <?php
55 if ($mysql->restore($restfile,true,$id)) {
56  $msg->raise("INFO", "mysql", _("Your database have been restored, check out the previous text for error messages."));
57 }
58 
59 echo $msg->msg_html_all();
60 ?>
61 </p>
62 <?php include_once("foot.php"); ?>
$msg
Definition: bootstrap.php:75
__($str)
Definition: functions.php:404
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
$fields
restore (do it) a MySQL database
if(!isset($is_include)) if(! $key &&! $crt) $id