diff --git a/Course.class.php b/Course.class.php index a5cf01f..ac2e941 100644 --- a/Course.class.php +++ b/Course.class.php @@ -25,6 +25,8 @@ class Course public static function new_Course($name, $code, $branch = "") { + $code = strtoupper($code); + $c = new Course(); $c->id = sha1($code); $c->registerdate = time(); @@ -85,10 +87,10 @@ class Course $qnode->setAttribute("xml:id", $this->id); $qnode->setAttribute("name", $this->name); - $qnode->setAttribute("code", intval($this->code)); + $qnode->setAttribute("code", $this->code); $qnode->setAttribute("branch", $this->branch); $qnode->setAttribute("registerdate", $this->registerdate); - $qnode->setAttribute("validated", $this->validated); + $qnode->setAttribute("validated", intval($this->validated)); return $qnode; } @@ -108,6 +110,16 @@ class Course return $this->name; } + public function getCode() + { + return $this->code; + } + + public function getBranch() + { + return $this->branch; + } + public function isValidated() { return $this->validated; diff --git a/addCourse.php b/addCourse.php new file mode 100644 index 0000000..34bfad1 --- /dev/null +++ b/addCourse.php @@ -0,0 +1,80 @@ +Vous devez être connecté pour accédé à cette partie"); + +if (isset($_POST["send"])) +{ + if (empty($_POST["fullname"])) + echo "