2 /****************************************************************************/
4 /****************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************************/
15 define('AT_INCLUDE_PATH', '../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 authenticate(AT_PRIV_ADMIN);
19 $_SESSION['done'] = 0;
21 require(AT_INCLUDE_PATH.'classes/Backup/Backup.class.php');
22 $Backup = new Backup($db, $_SESSION['course_id']);
24 if (isset($_POST['cancel'])) {
25 $msg->addFeedback('CANCELLED');
26 header('Location: index.php');
28 } else if (isset($_POST['upload']) && ($Backup->getNumAvailable() < AT_COURSE_BACKUPS)) {
29 $Backup->upload($_FILES, $_POST['description']);
31 $_SESSION['done'] = 1;
33 if($msg->containsErrors()) {
34 header('Location: upload.php');
37 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
38 header('Location: index.php');
43 require(AT_INCLUDE_PATH.'header.inc.php');
47 <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" >
48 <div class="input-form">
49 <fieldset class="group_form"><legend class="group_form"><?php echo _AT('upload'); ?></legend>
51 <p><?php echo _AT('restore_upload'); ?></p>
54 <?php if ($Backup->getNumAvailable() >= AT_COURSE_BACKUPS): ?>
56 <p><strong><?php echo _AT('max_backups_reached'); ?></strong></p>
60 <label for="descrip"><?php echo _AT('optional_description'); ?></label><br />
61 <textarea id="descrip" cols="30" rows="2" name="description"></textarea>
65 <label for="file"><div class="required" title="<?php echo _AT('required_field'); ?>">*</div><?php echo _AT('file'); ?></label><br />
66 <input type="file" name="file" id="file" />
69 <div class="row buttons">
70 <input type="submit" name="upload" value="<?php echo _AT('upload_backup'); ?>" onclick="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php');" />
71 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
78 <script language="javascript" type="text/javascript">
79 function openWindow(page) {
80 newWindow = window.open(page, "progWin", "width=400,height=200,toolbar=no,location=no");
85 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>