本文整理汇总了PHP中Courses::addCourses方法的典型用法代码示例。如果您正苦于以下问题:PHP Courses::addCourses方法的具体用法?PHP Courses::addCourses怎么用?PHP Courses::addCourses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Courses
的用法示例。
在下文中一共展示了Courses::addCourses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCourses
public function actionCourses()
{
$tasks = ['Добавить' => 'add', 'Изменить' => 'edit', 'Удалить' => 'del'];
$task = $_GET['task'];
$id = $_GET['id'];
$view = new View();
$view->tasks = $tasks;
if (!isset($task)) {
} elseif ('add' == $task) {
if (!empty($_POST)) {
$id = Courses::addCourses($_POST);
header('Location: /?ctrl=Admin&act=Courses&task=edit&id=' . $id);
}
$courses = Courses::getCourses();
$view->courses = $courses;
$view->display('admin/header.php');
$view->display('admin/courses/add.php');
$view->display('admin/footer.php');
} elseif ('edit' == $task && isset($id)) {
if (!empty($_POST)) {
Courses::updateCourse($_POST);
}
$course = Courses::getCourse($id);
$courses = Courses::getCourses();
$view->courses = $courses;
$view->course = $course;
$view->display('admin/header.php');
$view->display('admin/courses/edit.php');
$view->display('admin/footer.php');
} elseif ('del' == $task) {
Courses::delCourse($id);
header('Location: /?ctrl=Admin&act=Courses');
} else {
$view->display('header.php');
$view->display('404.php');
$view->display('footer.php');
}
}
示例2: Courses
} else {
if ($testType == 'Assessment') {
$testType = 'Assessment';
}
}
$course = new Courses();
$json = $course->checkforTestDone($userId, $courseId, $testType);
echo $json;
} else {
if ($action == 'AddNewCourses') {
$courseName = $_GET["courseName"];
$courseNum = $_GET["courseNumber"];
echo $courseName;
echo $courseNum;
$course = new Courses();
$course->addCourses($courseName, $courseNum, 'images/courses/course-2.jpg');
} else {
if ($action == 'EditNewCourses') {
$idCourses = $_GET["idCourses"];
$courseName = $_GET["courseName"];
$courseNum = $_GET["courseNumber"];
echo $courseName;
echo $courseNum;
$course = new Courses();
$course->updateCourses($idCourses, $courseName, $courseNum, 'images/courses/course-2.jpg');
} else {
if ($action == 'DeleteCourse') {
$idCourses = $_GET["idCourses"];
$course = new Courses();
$course->deleteCourses($idCourses);
} else {