Beispiel #1
0
<?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";
?>

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

<?php 
$id = $_GET['id'];
$studentrepository = new StudentRepository();
$student = $studentrepository->get_by_id($id);
?>
<div class="page-header">
	<h1>Edit Student Details </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 $student->get_first_name();
?>
">
  </div>
  <div class="form-group">
    <label for="last_name">Last Name</label>
    <input type="text" class="form-control" id="first_name" name="last_name" placeholder="First Name" value="<?php 
Beispiel #2
0
<?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_repository = new StudentRepository();
$e = $student_repository->get_by_id($_GET['id']);
if (is_null($e)) {
    header('location:student.php');
}
?>
<h1>Edit Student</h1>
<form class="form-horizontal" action="save.php" method="post">
	<div class="form-group row">
		<div class="col-sm-6">
			<input type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name" value="<?php 
echo $e->get_first_name();
?>
" required>
		</div>
		<div class="col-sm-6">
			<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name" value="<?php 
echo $e->get_last_name();
?>
" required>
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-12">
			<input type="text" class="form-control" id="dob" name="dob" placeholder="DOB - yyyy-mm-dd" value="<?php 
Beispiel #3
0
<?php

require_once 'models/student.class.php';
require_once 'repository/studentrepository.class.php';
$repository = new StudentRepository();
$student = new Student();
$student->initialize(1, "sujan", "malakar", "*****@*****.**");
$repository->add($student);
$student1 = new Student();
$student1->initialize(2, "Pratish", "Shrestha", "*****@*****.**");
$repository->add($student1);
$student2 = new Student();
$student2->initialize(3, "Pratasdfadish", "asdf", "*****@*****.**");
$repository->add($student2);
$std = $repository->get_by_id($_GET['id']);
if (is_null($std)) {
    header("location:student.php");
    exit;
}
include_once "header.php";
?>


<form action="savestudent.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" required="required" 
    value="<?php 
echo $std->get_first_name();
?>
"/>