<?php

$username = addslashes(trim($_POST['username']));
$password = addslashes(MD5($_POST['password']));
$tahun    = addslashes(trim($_POST['tp']));
$operator = addslashes(trim($_POST['operator']));
$inputcapt = trim($_POST['inputcapt']);
//$sessioncapt = $_SESSION['codecapt'];

require('asset/mod/autoLoad.php');

$log = new log;
//$addTahun = $log->addTahun($tahun);
ob_start(); // Memulai output buffering
session_start();
if ($_SESSION['codecapt'] == $inputcapt) {
	if ($operator == "Operator") {
		$cekLog = $log->cekLogOperator($username, $password);
	} else {
		$cekLog = $log->cekLogSiswa($username, $password);
	}
} else {
	header("location:./?login=errorcapt");
	session_destroy();
}
