<?php require_once "models/teacher.class.php"; require_once "repository/teacherrepository.class.php"; $teacher1 = new Teacher(); $teacher1->initiate(1, "Dixanta", "Shrestha", "*****@*****.**", "PHP"); $teacher2 = new Teacher(); $teacher2->initiate(2, "Ram", "Shrestha", "*****@*****.**", ".NET"); $teacher3 = new Teacher(); $teacher3->initiate(3, "Shyam", "Shrestha", "*****@*****.**", "JAVA"); $teacher4 = new Teacher(); $teacher4->initiate(4, "Hari", "Shrestha", "*****@*****.**", "Python"); $teacherrepository = new TeacherRepository(); $teacherrepository->add($teacher1); $teacherrepository->add($teacher2); $teacherrepository->add($teacher3); $teacherrepository->add($teacher4); ?> <?php include "header.php"; ?> <div class="page-header"> <h1>Student List <small> Students 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> <th>Name</th> <th>Email</th>
<?php require_once "models/teacher.class.php"; require_once "repository/teacherrepository.class.php"; ?> <?php $teacher1 = new Teacher(); $teacher2 = new Teacher(); $teacher3 = new Teacher(); $teacher4 = new Teacher(); $teacherrepository = new TeacherRepository(); $teacher1->initialize(1, "dixanta", "shrestha", "*****@*****.**", "php"); $teacher2->initialize(2, "ram", "shah", "*****@*****.**", ".net"); $teacher3->initialize(3, "shyam", "malakar", "*****@*****.**", "java"); $teacher4->initialize(4, "hari", "shrestha", "*****@*****.**", "ruby"); $teacherrepository->add_teacher($teacher1); $teacherrepository->add_teacher($teacher2); $teacherrepository->add_teacher($teacher3); $teacherrepository->add_teacher($teacher4); ?> <?php include_once "header.php"; ?> <table class="table table-bordered table-hover table-striped"> <tr> <th><input type="checkbox" name="checkbox" id="checkall"></th> <th>ID</th>
require_once "config.php"; require_once ROOT_PATH . "system/model/teachers.class.php"; require_once ROOT_PATH . "system/repository/teacherrepository.class.php"; require_once ROOT_PATH . "system/dbutil/dbconnection2.class.php"; ?> <?php include_once ROOT_PATH . "teachers/header.php"; ?> <?php if (!isset($_POST['submit'])) { header("Location: index.php"); exit; } $teacher = new Teachers(); $teacher->set_first_name($_POST['first_name']); $teacher->set_last_name($_POST['last_name']); $teacher->set_email($_POST['email']); $teacher->set_contact_no($_POST['contact_no']); $teacher->set_faculty($_POST['faculty']); $teacherrepository = new TeacherRepository(); if (isset($_POST['id']) && $_POST['id'] == "") { $result = $teacherrepository->insert($teacher); } else { $teacher->set_id($_POST['id']); $result = $teacherrepository->update($teacher); } if ($result > 0) { header("Location: index.php/?success=true"); }
<?php require_once "config.php"; require_once ROOT_PATH . "system/model/teachers.class.php"; require_once ROOT_PATH . "system/repository/teacherrepository.class.php"; require_once ROOT_PATH . "system/dbutil/dbconnection2.class.php"; ?> <?php include_once ROOT_PATH . "teachers/header.php"; $teacherrepository = new TeacherRepository(); if (isset($_GET['id']) && isset($_GET['action']) && $_GET['action'] == "delete") { $teacherrepository->delete($_GET['id']); } ?> <div class="page-header"> <h1>Teachers Table</h1> </div> <?php if (isset($_POST['order'])) { $sort = $_POST['sort']; } else { $sort = null; } if (isset($_GET['success']) && $_GET['success'] == true) { ?> <div class="alert alert-success"> Successfull! </div> <?php
<?php require_once "models/teacher.class.php"; require_once "repository/teacherrepository.class.php"; $teacher1 = new Teacher(); $teacher2 = new Teacher(); $teacher3 = new Teacher(); $teacher4 = new Teacher(); $teacherrepository = new TeacherRepository(); $teacher1->initialize(1, "dixanta", "shrestha", "*****@*****.**", "php"); $teacher2->initialize(2, "ram", "shah", "*****@*****.**", ".net"); $teacher3->initialize(3, "shyam", "malakar", "*****@*****.**", "java"); $teacher4->initialize(4, "hari", "shrestha", "*****@*****.**", "ruby"); $teacherrepository->add_teacher($teacher1); $teacherrepository->add_teacher($teacher2); $teacherrepository->add_teacher($teacher3); $teacherrepository->add_teacher($teacher4); $std = $teacherrepository->get_by_id($_GET['id']); if (is_null($std)) { header("Location:teacher.php"); exit; } include_once "header.php"; ?> <form action="teachersave.php" method="post"> <div class="form-group">
<?php require_once "config.php"; require_once ROOT_PATH . "system/model/teachers.class.php"; require_once ROOT_PATH . "system/repository/teacherrepository.class.php"; require_once ROOT_PATH . "system/dbutil/dbconnection2.class.php"; ?> <?php include_once ROOT_PATH . "teachers/header.php"; ?> <?php $teacherrepository = new TeacherRepository(); $id = $_GET['id']; $teacher = $teacherrepository->get_by_id($id); ?> <div class="page-header"> <h1> Edit Teacher </h1> </div> <form action="save.php" method="post"> <div class="form-group"> <label for="first_name">First Name</label> <input type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name" value="<?php echo $teacher->get_first_name(); ?> ">
<div class="page-header"> <h1>Teachers table</small></h1> </div> <table class="table table-bordered table-striped table-hover"> <tr> <th>ID</th> <th>NAME</th> <th>EMAIL</th> <th>CONTACT NO</th> <th>FACULTY</th> <th>ACTION</th> </tr> <?php $teacherrepository = new TeacherRepository(); foreach ($teacherrepository->get_all() as $teach) { ?> <tr> <td><?php echo $teach->get_id(); ?> </td> <td><?php echo $teach->get_first_name(); ?> <?php echo $teach->get_last_name(); ?> </td> <td><?php
<?php require_once 'models/teacher.class.php'; require_once 'repository/teacherrepository.class.php'; $repository = new TeacherRepository(); $teacher1 = new Teacher(); $teacher1->initialize(1, "Surendra", "Shakya", "*****@*****.**", "Pulchowk", 23423432); $repository->add($teacher1); $teacher2 = new Teacher(); $teacher2->initialize(2, "Sajan", "Thapa", "*****@*****.**", "Bhaktapur", 3242342); $repository->add($teacher2); $teacher3 = new Teacher(); $teacher3->initialize(3, "Rajiv", "Shah", "*****@*****.**", "Satdobato", 32432423); $repository->add($teacher3); include_once 'includes/formvalidation.php'; ?> <?php include_once 'includes/header.php'; ?> <tr> <th colspan="7" class="text-center">Teacher Info<button class="btn btn-xs btn-primary pull-right" data-toggle="modal" data-target="#add_teacher"><span class="glyphicon glyphicon-plus"></span></button></th> </tr> <tr> <th><input type="checkbox" id="select_all"/></th> <th>Id</th> <th>Full Name</th> <th>Email</th> <th>Address</th> <th>Contact</th> <th>Action</th>
<table class="table table-bordered table-striped table-hover"> <tr> <th colspan="6" class="text-center">TEACHERS<button role="button" class="btn btn-xs btn-success pull-right"><span class="glyphicon glyphicon-plus"></span></button></th> </tr> <tr> <th>Id</th> <th>Full Name</th> <th>Contact</th> <th>Salary</th> <th>Department</th> <th>Action</th> </tr> <?php $teacher_info = new TeacherRepository(); foreach ($teacher_info->get_all() as $tch) { ?> <tr> <td><?php echo $tch->get_id(); ?> </td> <td><?php echo $tch->get_first_name() . " " . $tch->get_last_name(); ?> </td> <td><?php echo $tch->get_contact(); ?> </td>