Exemplo n.º 1
0
/* modify it under the terms of the GNU General Public License				*/
/* as published by the Free Software Foundation.							*/
/****************************************************************************/
// $Id$
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
authenticate(AT_PRIV_ADMIN);
$_SESSION['done'] = 0;
require AT_INCLUDE_PATH . '../mods/_core/backups/classes/Backup.class.php';
$Backup = new Backup($db, $_SESSION['course_id']);
if (isset($_POST['cancel'])) {
    $msg->addFeedback('CANCELLED');
    header('Location: index.php');
    exit;
} else {
    if (isset($_POST['upload']) && $Backup->getNumAvailable() < AT_COURSE_BACKUPS) {
        $Backup->upload($_FILES, $_POST['description']);
        $_SESSION['done'] = 1;
        if ($msg->containsErrors()) {
            header('Location: upload.php');
            exit;
        } else {
            $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
            header('Location: index.php');
            exit;
        }
    }
}
require AT_INCLUDE_PATH . 'header.inc.php';
?>
Exemplo n.º 2
0
}

require(AT_INCLUDE_PATH.'header.inc.php');

?>


<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<div class="input-form">
	<div class="row">
		<p><?php echo _AT('create_backup_about', AT_COURSE_BACKUPS); ?></p>
	</div>

	<?php if ($system_courses): ?>
		<?php if (isset($_POST['submit']) && ($Backup->getNumAvailable() >= AT_COURSE_BACKUPS)): ?>
			<div class="row">
				<p><strong><?php echo _AT('max_backups_reached'); ?></strong></p>
			</div>
		<?php else: ?>
			<div class="row">
				<span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="courses"><?php echo _AT('course'); ?></label><br />
				<select name="course" id="courses"><?php
					foreach ($system_courses as $id => $course) {
						echo '<option value="'.$id.'">'.$course['title'].'</option>';
					}
				?>
				</select>
			</div>
			<div class="row">
				<label for="desc"><?php echo _AT('optional_description'); ?></label><br />