foreach ($a as $arr) {
                echo "<tr><td>{$arr->log_id}</td><td>{$arr->log_time}</td><td>{$arr->log_uname}</td><td>{$arr->log_ip}</td><td>{$arr->log_desc}</td></tr>";
            }
            echo "</table>";
        }
        break;
    case "all":
        $a = site_log::getAllLog();
        if ($a === 1) {
            die("No logs ");
        } else {
            echo "<table><tr><th>ID</th><th>Time</th><th>User name</th><th>IP</th><th>Description</th></tr>";
            foreach ($a as $arr) {
                echo "<tr><td>{$arr->log_id}</td><td>{$arr->log_time}</td><td>{$arr->log_uname}</td><td>{$arr->log_ip}</td><td>{$arr->log_desc}</td></tr>";
            }
            echo "</table>";
        }
        break;
    case "date":
        $a = site_log::getAllLogdate($_GET['value']);
        if ($a == 0) {
            die("No logs ");
        } else {
            echo "<table><tr><th>ID</th><th>Time</th><th>User name</th><th>IP</th><th>Description</th></tr>";
            foreach ($a as $arr) {
                echo "<tr><td>{$arr->log_id}</td><td>{$arr->log_time}</td><td>{$arr->log_uname}</td><td>{$arr->log_ip}</td><td>{$arr->log_desc}</td></tr>";
            }
            echo "</table>";
        }
        break;
}
Beispiel #2
0
}
if ($_FILES["cfile"]["name"]) {
    if ($_FILES["cfile"]["type"] == "application/pdf") {
        if ($_FILES["cfile"]["size"] < 2048000) {
            $tempr = explode(".", $_FILES["cfile"]["name"]);
            $extension = end($tempr);
            //  echo "Upload: " . $_FILES["cfile"]["name"] . "<br />";
            // echo "Type: " . $_FILES["cfile"]["type"] . "<br />";
            // echo "Size: " . ($_FILES["cfile"]["size"] / 1024) . " Kb<br />";
            //  echo "Temp file: " . $_FILES["cfile"]["tmp_name"] . "<br />";
            //  echo "Stored in: " . "../resumes/" . $_FILES["cfile"]["name"];
            $url = "CoursePDF/" . $_POST['programme'] . "/" . $id . "." . $extension;
        } else {
            die("Invalid file extension or file size grater then 2MB. ");
        }
    } else {
        die("Invalid file");
    }
} else {
    $url = NULL;
}
$course = new course($id, $name, $credit, $pro, $semester, $url);
$status = $course->insertCourse();
if ($_FILES["cfile"]["name"]) {
    if ($status === 1) {
        move_uploaded_file($_FILES["cfile"]["tmp_name"], "../../CoursePDF/" . $_POST['programme'] . "/" . $id . "." . $extension);
    }
}
echo $status;
$l = new site_log(NULL, NULL, $_SESSION['user']->username, $_SERVER['REMOTE_ADDR'], $id . " Course added");
$l->insertlog();
<?php

if (!isset($_SERVER['HTTP_REFERER'])) {
    header("location: ../../access_denied.php?data=You don't have direct access to this page");
}
require_once '../../db/credit_system_detaill_class.php';
require_once '../../db/site_log_class.php';
require_once '../../db/user_class.php';
session_start();
if (!isset($_GET['title']) || !isset($_GET['pro'])) {
    die("go to admission management page");
}
$ti = $_GET['title'];
$pro = $_GET['pro'];
session_start();
$a = credit_system::deleteDetail($ti, $pro);
$_SESSION['answer'] = $a;
$l = new site_log(NULL, NULL, $_SESSION['user']->username, $_SERVER['REMOTE_ADDR'], $ti . " credit sytem details deleted");
echo $l->insertlog();
header('Location: ../../credit_system_manage_detail.php');