Example #1
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function Home()
 {
     $courses = $this->course->getPaginated(6);
     $notification = \Model\Notification\Notification::orderBy('end_date')->where('start_date', '<=', date('Y-m-d 23:59:59'))->where('end_date', '>=', date('Y-m-d 00:00:00'))->first();
     // return redirect()->route('front.courses');
     return view('Front::landing', ['courses' => $courses, 'notification' => $notification]);
 }
Example #2
0
 public function getTotalWeeklyHours()
 {
     $total = 0;
     $selectedCourses = array();
     // Get an array of selected courses
     foreach ($this->getCourses() as $courseId) {
         array_push($selectedCourses, CourseRepository::GetById($courseId));
     }
     // Iterate through the array and sum the weekly hours
     foreach ($selectedCourses as $course) {
         $total += $course->getHours();
     }
     return $total;
 }
Example #3
0
                        </div>
                        <div class="page-header">
                            <h2>Select Courses</h2>
                        </div>
                        <p class="alert alert-info" role="alert">Total weekly hours must be greater than or equal to 10 and less than or equal to 20</p>
                        <?php 
if (isset($_POST["submit"]) && ($totalHours < 10 || $totalHours > 20)) {
    ?>
                            <p class="alert alert-danger" role="alert">Total weekly hours must be between 10 and 20</p>
                        <?php 
}
?>
                        <div class="form-group">
                            <div class="col-sm-12">
                                <?php 
foreach (CourseRepository::GetAll() as $course) {
    ?>
                                <div class="col-sm-4">
                                    <div class="checkbox">
                                        <label style="font-size: 12px;">
                                            <input type="checkbox" name="courses[]" value="<?php 
    echo $course->getId();
    ?>
" <?php 
    if (in_array($course->getId(), $courses)) {
        echo "checked";
    }
    ?>
> <?php 
    echo $course->toString();
    ?>
Example #4
0
<div class="page-header">
  <h1>Course table</small></h1>
</div>

	<table class="table table-bordered table-striped table-hover">
		<tr>
			<th>ID</th>
			<th>NAME</th>
			<th>DURATION</th>
			<th>STATUS</th>
			<th>COURSE</th>
		</tr>

<?php 
$courserepository = new CourseRepository();
foreach ($courserepository->get_all() as $course) {
    ?>

	<tr>
		<td><?php 
    echo $course->get_id();
    ?>
</td>
		<td><?php 
    echo $course->get_course_name();
    ?>
</td>
		<td><?php 
    echo $course->get_duration();
    ?>
Example #5
0
 /**
  * List courses.
  *
  * @return Response
  */
 public function Courses()
 {
     $courses = $this->courseRepository->getCourses();
     return view('Front::course.courses', ['courses' => $courses]);
 }
Example #6
0
<?php

// Include required classes
include_once "inc/Entities/Student.php";
include_once "inc/Data_Access/CourseRepository.php";
// Session
session_start();
$student = $_SESSION["student"];
// Build an array of selected courses
$selectedCourses = array();
foreach ($student->getCourses() as $courseId) {
    array_push($selectedCourses, CourseRepository::GetById($courseId));
}
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Lab 5 - Course Registration System</title>
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
        <!-- Optional theme -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
    </head>
    <body>
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="page-header">
                        <h2>Thank you, <?php 
echo $student->getUsername();
?>
Example #7
0
<?php

require_once ROOT_PATH . "system/dbutil/dbconnection.class.php";
require_once ROOT_PATH . "system/model/course.class.php";
require_once ROOT_PATH . "system/repository/courserepository.class.php";
$courserepository = new CourseRepository();
if (isset($_GET['id']) && isset($_GET['action']) && ($_GET['action'] = "delete")) {
    $courserepository->delete($_GET['id']);
    header('Location: index.php');
}
?>



<?php 
if (isset($_GET['success']) && $_GET['success'] == true) {
    ?>
		
	
		<div class="alert alert-success" role="alert">Succesfully Inserted!</div>

<?php 
}
?>

<div class="page-header">
	<h1> Students Table </h1>
</div>


Example #8
0
<?php

require_once "models/course.class.php";
require_once "repository/courserepository.class.php";
$course1 = new Course();
$course1->initiate(1, "PHP", "2 months", "Ram Shah");
$course2 = new Course();
$course2->initiate(2, ".NET", "2 months", "Shyam Shrestha");
$course3 = new Course();
$course3->initiate(3, "JAVA", "2 months", "Hari Gopal");
$course4 = new Course();
$course4->initiate(4, "Python", "2 months", "Gopal Hari");
$courserepository = new CourseRepository();
$courserepository->add($course1);
$courserepository->add($course2);
$courserepository->add($course3);
$courserepository->add($course4);
$std = $courserepository->get_by_id($_GET['id']);
if (is_null($std)) {
    header("Location:course.php");
}
?>
	

<?php 
include "header.php";
?>

<div class="page-header">
  <h1>EDIT<small> Course list</small></h1>
</div>
Example #9
0
<?php

require_once "models/course.class.php";
require_once "repository/courserepository.class.php";
$course1 = new Course();
$course1->initiate(1, "PHP", "2 months", "Ram Shah");
$course2 = new Course();
$course2->initiate(2, ".NET", "2 months", "Shyam Shrestha");
$course3 = new Course();
$course3->initiate(3, "JAVA", "2 months", "Hari Gopal");
$course4 = new Course();
$course4->initiate(4, "Python", "2 months", "Gopal Hari");
$courserepository = new CourseRepository();
$courserepository->add($course1);
$courserepository->add($course2);
$courserepository->add($course3);
$courserepository->add($course4);
?>
		

<?php 
include "header.php";
?>

	<div class="page-header">
	  <h1>Course List <small> Courses currently involved</small></h1>
	</div>
	<table class="table table-striped table-bordered table-hover">
		<tr>
			<th><input type="checkbox" name="stdcheck"></th>
			<th>ID</th>
Example #10
0
 /**
  * Display a listing of the courses.
  *
  * @return Response
  */
 public function index()
 {
     $courses = $this->courseRepository->getPaginated();
     return view('Teacher::course.index', ['courses' => $courses]);
 }