Beispiel #1
0
//require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/model/admin.php");
//require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/model/database.php");
//require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/model/employer.php");
//require_once($_SERVER['DOCUMENT_ROOT'] . "/kenneth/cs2102_admin/controller/admin/authentication/index.php");
require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/model/admin.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/model/database.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/model/employer.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/cs2102/controller/admin/authentication/index.php";
use model\Admin;
use model\Database;
use model\Employer;
session_start();
AuthenticationController::authenticate();
$database = new Database();
$connection = $database->get_connection();
$employers = Employer::get_all_employer($connection);
?>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Management System</title>

		<!-- stylesheets -->
		<link href="../../../stylesheet/reset.css" rel="stylesheet" type="text/css">
		<link href="../../../stylesheet/icon.css" rel="stylesheet" type="text/css">
		<link href="../../../stylesheet/default.css" rel="stylesheet" type="text/css">
		<link href="../../../stylesheet/content.css" rel="stylesheet" type="text/css">

		<!-- javascript -->
		<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
Beispiel #2
0
 public static function get_all_employer($connection)
 {
     $statement = $connection->prepare("SELECT * FROM employer");
     $statement->execute();
     $result = $statement->get_result();
     $employers = array();
     while ($row = $result->fetch_assoc()) {
         $employer = new Employer();
         $employer->set_email($row["email"]);
         $employer->set_password($row["password"]);
         $employer->set_address($row["address"]);
         $employer->set_contact($row["contact"]);
         $employer->set_industry($row["industry"]);
         $employer->set_about($row["about"]);
         $employer->set_company_name($row["company_name"]);
         $employer->set_license_no($row["licence_no"]);
         $employer->set_logo($row["logo"]);
         array_push($employers, $employer);
     }
     return $employers;
 }
Beispiel #3
0
 public function delete()
 {
     $email = $_GET["email"];
     Employer::delete_employer($email, $this->connection);
     header("Location: " . $_SERVER["HTTP_REFERER"]);
 }