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"> <label for="firstName">First Name</label> <input type="text" class="form-control" id="firstName" name="first_name" placeholder="First Name" value="<?php echo $std->get_first_name(); ?> "> </div>
<?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(); ?> ">