date_saving=$date_saving;
$this->logid=$logid;
$this->act=$act;
}
function proceed() {
global $msg;
//Actions possibles :
//delete : suppression des jeux cochés
//restore : restoration immédiate des jeux cochés
//chaine vide : affichage
switch ($this->act) {
case "delete":
if (!is_array($this->logid)) {
echo "";
} else {
for ($i=0; $ilogid); $i++) {
$requete="select sauv_log_file from sauv_log where sauv_log_id=".$this->logid[$i];
$resultat=mysql_query($requete) or die(mysql_error());
$file_to_del=mysql_result($resultat,0,0);
@unlink("admin/backup/backups/".$file_to_del);
$requete="delete from sauv_log where sauv_log_id=".$this->logid[$i];
mysql_query($requete) or die(mysql_error());
}
}
break;
default:
//Do nothing
break;
}
return $this->showForm();
}
function read_infos($filename) {
$tInfo=array();
$f=@fopen($filename,"r");
if (!$f) return $tInfo;
$line=fgets($f,4096);
$line=rtrim($line);
while ((!feof($f))&&($line!="#data-section")) {
$tLine=explode(" : ",$line);
$tInfo[substr($tLine[0],1)]=$tLine[1];
$line=fgets($f,4096);
$line=rtrim($line);
}
return $tInfo;
}
function showForm() {
global $form;
global $msg;
//Récupération des dates présentes dans la base
if (!is_array($this->date_saving)) $this->date_saving=array();
$date_list="";
$form=str_replace("!!date_saving!!",$date_list,$form);
$requete="select sauv_log_id,sauv_log_start_date,sauv_log_file,sauv_log_succeed,sauv_log_messages,concat(prenom,' ',nom) as name from sauv_log,users where sauv_log_userid=userid";
if (count($this->date_saving)!=0) {
$dates=implode("','",$this->date_saving);
$dates="'".$dates."'";
$requete.=" and sauv_log_start_date in (".$dates.")";
}
$requete.=" order by sauv_log_start_date desc";
$resultat=mysql_query($requete);
$sty="class='brd' align=center";
$sty0="class='brd2' align=center";
$sauvegarde_list="
\n";
$sauvegarde_list.="
";
$sauvegarde_list.="
".$msg["sauv_list_th_info_set"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_info_file"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_actions"]."
";
$sauvegarde_list.="
";
$sauvegarde_list.="
";
$sauvegarde_list.="
".$msg["sauv_list_th_filename"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_date"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_final_state"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_user"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_set"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_hour"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_compr"]."
";
$sauvegarde_list.="
".$msg["sauv_list_th_crypt"]."
";
$sauvegarde_list.="
\n";
while ($res=mysql_fetch_object($resultat)) {
$sauvegarde_list.="
sauv_log_id."\">
";
$sauvegarde_list.="
";
if ($res->sauv_log_succeed==1) {
$infos=$this->read_infos("admin/backup/backups/".$res->sauv_log_file);
if (count($infos)==0) {
$res->sauv_log_succeed=0;
}
}
if ($res->sauv_log_succeed==1) {
$succeed="sauv_succeed.png";
$succeed_message=$msg["sauv_list_succeed"];
} else {
$succeed="sauv_failed.png";
//Recherche du message d'erreur
$tMessages=explode("\n",$res->sauv_log_messages);
$succeed_message="";
for ($i=0; $i
";
$sauvegarde_list.="
".$res->sauv_log_file."
";
$sauvegarde_list.="
".$res->sauv_log_start_date."
";
$sauvegarde_list.="
".$succeed_message."
";
$sauvegarde_list.="
".$res->name."
";
if ($res->sauv_log_succeed==1) {
$sauvegarde_list.="
".$infos[Name]."
";
$sauvegarde_list.="
".$infos["Start time"]."
";
$sauvegarde_list.="
";
if ($infos[Compress]=="1") $sauvegarde_list.="";
else $sauvegarde_list.=" ";
$sauvegarde_list.="
";
$sauvegarde_list.="
";
if ($infos[Crypt]=="1") $sauvegarde_list.="";
else $sauvegarde_list.="";
$sauvegarde_list.="