".I_SQL_ERROR."
"; // check if a db or directory was posted if (isset($_POST['dirs'])) { if (is_array($_POST['db']) || is_array($_POST['dirs']) || $_POST['man_dirs']) $selection_ok=TRUE; else $selection_ok=FALSE; } elseif($_POST['man_dirs']) { $selection_ok=TRUE; } elseif(isset($_POST['db'])) { if (is_array($_POST['db'])) $selection_ok=TRUE; else $selection_ok=FALSE; } elseif(isset($_POST)) { $selection_ok=FALSE; } // generate and print php script if ($selection_ok) { // create path to run_scheduled.php $path_back=""; if (strstr($_SERVER['SCRIPT_NAME'],"\\")) $delimiter="\\"; else $delimiter="/"; $script_path=explode($delimiter,$_SERVER['SCRIPT_NAME']); $path_d=count(explode("..",$_POST['path']))-1; $path_u=count(explode($delimiter,$_POST['path']))-$path_d-1; for ($i=0;$i<$path_u;$i++) $path_back.="../"; for ($i=count($script_path)-$path_d-1;$i$value) { $value=str_replace("\"","'",$value); if ($key!="period" && $key!="path" && $key!="db" && $key!="dirs" && $key!="filename" && $value!='') $result.="\$_POST['".$key."']=\"".$value."\";\n"; } // print the current working database (but always only once) if(isset($_SESSION['wss']) && !isset($_POST['mysql_host'])) $result.="\$_POST['mysql_host']=\"".$_SESSION['wss']."\";\n"; // add include(backup.php) to do all the work $result.="\$period=(3600*24)".$_POST['period'].";\n"; $result.="\$security_key=\"".($PMBP_SYS_VAR['security_key'])."\";\n"; $result.="// This is the relative path to the phpMyBackupPro ".PMBP_VERSION." directory\n"; if ($path_back) $result.="@chdir(\"".$path_back."\");\n"; $result.="@include(\"backup.php\");\n"; $result.="?>"; // show the generated php script printf(PMBP_EXS_INCL,$_POST['path']."???.php"); echo ":\n
\n

"; echo "
\n"; // list all post variables as hidden fields foreach($_POST as $key=>$value) { if ($key!="db" && $key!="dirs") echo "\n"; elseif(is_array($_POST[$key])) foreach($value as $dbname) echo "\n"; } // save file including the backup script if (isset($_POST['filename'])) { if (PMBP_save_to_file($_POST['path'].$_POST['filename'],"",$result,"w")) { echo "".EX_SAVED." ".PMBP_pop_up($_POST['path'].$_POST['filename'],$_POST['path'].$_POST['filename'],"scheduled")."
\n"; // save specific settings for scheduled backups if ($PMBP_SYS_VAR['EXS_scheduled_file']!=$_POST['filename']) { $PMBP_SYS_VAR['EXS_scheduled_file']=$_POST['filename']; } } else { echo "".C_WRITE." ".$_POST['path'].$_POST['filename']."
\n"; } } echo PMBP_EXS_SAVE.":
\n"; echo $_POST['path']." "; echo ""; if ($PMBP_SYS_VAR['EXS_scheduled_file']!="???.php") echo " (".PMBP_pop_up("get_file.php?view=".$_POST['path'].$PMBP_SYS_VAR['EXS_scheduled_file'],B_VIEW,"view").")"; echo "
"; echo "\n <- ".EXS_BACK."\n"; // update specific settings for scheduled backups if ($_POST['path']!=$PMBP_SYS_VAR['EXS_scheduled_dir'] OR $_POST['period']!=$PMBP_SYS_VAR['EXS_period']) { $PMBP_SYS_VAR['EXS_scheduled_dir']=$_POST['path']; $PMBP_SYS_VAR['EXS_period']=$_POST['period']; } // save PMBP_SYS_VARS PMBP_save_export_settings(); // print instructions and export form } else { if (isset($selection_ok) && isset($_POST['period'])) echo "
".EX_NO_DB."!
"; echo "
\n
\n"; echo EXS_PERIOD.":
\n"; echo "\n

"; // get content of these directories (I know, it's partly redundant - but I think this is necessary) if ($_SESSION['multi_user_mode']) { $search_path1=$PMBP_MU_CONF['user_export_dir']; $search_path2=$PMBP_MU_CONF['user_scheduled_dir']; } else { $search_path1="../"; $search_path2="../../"; } if ($PMBP_SYS_VAR['dir_lists']>=1) { $dirs1=PMBP_get_dirs($search_path1); } if ($PMBP_SYS_VAR['dir_lists']>=2) { $dirs2=PMBP_get_dirs($search_path2); } echo EXS_PATH.": (".PMBP_EXS_UPDATE_DIRS.")
\n"; echo "\n

"; // include the export form (known from the export page) and submitt the file list if (isset($dirs1)) PMBP_print_export_form($dirs1); else PMBP_print_export_form(); echo "\n\n
\n
"; } PMBP_print_footer(); ?>