<?php

/**
 * Created by PhpStorm.
 * Date: 2015.09.28.
 * Time: 23:16
 */
require "model.php";
if (isset($_SESSION['status']) && $_SESSION['status']) {
    $logIn = new LoginTo($_SESSION['code'], $_SESSION['password'], $_SESSION['status']);
    $true = $logIn->logInCheck(true);
} else {
    $true = false;
}
if ($true) {
    $name = $_POST['name'];
    $birth = $_POST['birth'];
    $resi = $_POST['resi'];
    $pass = $_POST['pass'];
    $email = $_POST['email'];
    $ppn = $_POST['ppn'];
    $year = $_POST['year'];
    $class = $_POST['class'];
    $s_hostel = $_POST['s_hostel'];
    $allowance = $_POST['allowance'];
    $sh = $s_hostel ? 1 : 0;
    $a = $allowance ? 1 : 0;
    $logincode = generateRandomString(8) . ".kf";
    if (isset($name) && strlen($name) > 4 && (isset($birth) && strlen($birth) > 4) && (isset($resi) && strlen($resi) > 4) && (isset($pass) && strlen($pass) > 4) && (isset($email) && strlen($email) > 4) && (isset($ppn) && strlen($ppn) > 4) && isset($year) && isset($class) && isset($s_hostel) && isset($allowance)) {
        $t = new TeacherManagement($_SESSION['id']);
        $t->addNewStudent($logincode, $name, $birth, $resi, $pass, $email, $ppn, $year, $class, $s_hostel, $allowance);
Example #2
0
        <meta charset="utf-8"/>

        <link rel="stylesheet" href="../../css/reset.css">
        <link rel="stylesheet" href="../../css/global.css">
        <link rel="stylesheet" href="../../css/login_style.css">
        <link rel="stylesheet" href="../../bootstrap/css/bootstrap.css">
        <link rel="stylesheet" href="../../bootstrap/css/bootstrap-theme.css">
    </head>
    <body>


<?php 
if (isset($_SESSION['status']) && $_SESSION['status']) {
    $logIn = new LoginTo($_SESSION['code'], $_SESSION['password'], $_SESSION['status']);
    $true = $logIn->logInCheck(false);
} else {
    if (isset($_POST['code'])) {
        $code = $_POST['code'];
        $password = $_POST['password'];
        $true = LoginTo::dataCheck($code, $password, false);
    } else {
        $true = false;
    }
}
if ($true) {
    $s = new StudentManagement($_SESSION['id']);
    if (date('n') == 9 or date('n') == 10 or date('n') == 11 or date('n') == 12) {
        $currentYear = date("Y");
    } else {
        $currentYear = date("Y") - 1;