<?php include_once '../config.php'; include_once ROOT_PATH . 'system/models/student.class.php'; include_once ROOT_PATH . 'system/repository/student_repository.class.php'; include_once 'header.php'; $student_info = new StudentRepository(); if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "delete") { $student_info->delete($_GET['id']); header('location:student.php'); } if (isset($_GET['success']) && $_GET['success'] == "true") { ?> <div class="alert alert-success alert-dismissible fade in" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <strong>Success!</strong> New record added. </div> <?php } if (isset($_GET['error']) && $_GET['error'] == "true") { ?> <div class="alert alert-danger alert-dismissible fade in" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <strong>Oh Snap!</strong> Failure in adding record. </div> <?php } if (isset($_GET['error']) && $_GET['error'] == "nopage") { ?> <div class="alert alert-danger alert-dismissible fade in" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<?php require_once "config.php"; require_once ROOT_PATH . "system/dbutil/dbconnection.class.php"; require_once ROOT_PATH . "system/model/students.class.php"; require_once ROOT_PATH . "system/repository/studentrepository.class.php"; $studentrepository = new StudentRepository(); if (isset($_GET['id']) && isset($_GET['action']) && ($_GET['action'] = "delete")) { $studentrepository->delete($_GET['id']); header('Location: index.php'); } ?> <?php include_once "header.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>
$student2->initialize(3, "Pratasdfadish", "asdf", "*****@*****.**"); $repository->add($student2); include_once "header.php"; ?> <table class="table table-bordered table-hover table-striped"> <tr> <th><input type="checkbox" id="select-all"/></th> <th>Id</th> <th>Name</th> <th>Email</th> <th>Action</th> </tr> <?php $repository->delete(3); foreach ($repository->get_all() as $s) { ?> <tr> <td><input type="checkbox" name="id[]" value="<?php echo $s->get_id(); ?> "/></td> <td><?php echo $s->get_id(); ?> </td> <td><?php echo $s->get_first_name(); ?> <?php