Add a page to manage (add and delete) courses
This commit is contained in:
parent
b2be4613f2
commit
0d084a69e3
3 changed files with 99 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Reference in a new issue