<?php
/*
This file is part of EdLite.
Copyright (C) 2005 Philip Spears and Philip Allen
Edlite is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Edlite is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with EdLite; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Version: 2005081900
*/
if (file_exists("./header.html")) { include ("./header.html"); }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>AddStudent Form</title>
<meta http="" equiv="Content-Type" content="text/html; charset=" iso-8895-1="">
<link rel="stylesheet" type="text/css" href="../../css/addstudent.css" />
</head>
<body>
<br /><br />
<?php
if ($HTTP_POST_VARS['post'] == "true") {
/* Copy Recursive function */
function copyr($source, $dest)
{
// Simple copy for a file
if (is_file($source)) {
return copy($source, $dest);
}
// Make destination directory
if (!is_dir($dest)) {
mkdir($dest);
}
// Loop through the folder
$dir = dir($source);
while (false !== $entry = $dir->read()) {
// Skip pointers
if ($entry == '.' || $entry == '..') {
continue;
}
// Deep copy directories
if ($dest !== "$source/$entry") {
copyr("$source/$entry", "$dest/$entry");
}
}
// Clean up
$dir->close();
return true;
}// end recursive copy function
$name = $HTTP_POST_VARS['name'];
copyr ("../../templates/student_template/", $name);
?>
<div id="body">
<div class="box">
Successfully Added Student.<br />
<a href="index.php">Return to Course</a>
</div>
</div>
<?php
exit;
} // end if post check
?>
<form action="addstudent.php" method="post">
<div id="body">
<div class="box">
<h3>New Student Add Form</h3>
New Student Name:<br />
(please use either first or last name only; no caps)<br /><br />
<input type="text" name="name" value="">
<input name="post" type="hidden" value="true">
<input value="Add Student" type="submit">
</div>
</div>
</form>
</body>
</html>