// Turn on output buffering include "ewcfg7.php"; include "ewmysql7.php"; include "phpfn7.php"; include "userfn7.php"; header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 // Create page object $login = new clogin(); $Page =& $login; // Page init $login->Page_Init(); // Page main $login->Page_Main(); include "header.php"; ?> <script language="JavaScript" type="text/javascript"> <!-- // Write your client script here, no need to add script tags. // To include another .js script, use: // ew_ClientScriptInclude("my_javascript.js"); //-->
// User Login Error event function User_LoginError($usr, $pwd) { //echo "User Login Error"; } // Form Custom Validate event function Form_CustomValidate(&$CustomError) { // Return error message in CustomError return TRUE; } } ew_Header(FALSE); // Create page object if (!isset($login)) { $login = new clogin(); } // Page init $login->Page_Init(); // Page main $login->Page_Main(); // Global Page Rendering event (in userfn*.php) Page_Rendering(); // Page Rendering event $login->Page_Render(); $EW_RELATIVE_PATH_old = $EW_RELATIVE_PATH; $EW_RELATIVE_PATH = "http://" . $_SERVER['HTTP_HOST'] . "/aero/"; include_once "header.php"; ?> <script type="text/javascript">
<?php if (!isset($_SESSION['islogin'])) { $username = $password = $usernameErr = $passwordErr = ""; if (isset($_POST['login'])) { include "clogin.php"; $clogin = new clogin(); $username = $clogin->filterinput($_POST['username']); $password = $clogin->filterinput($_POST['password']); if (empty($username)) { $usernameErr = "Username Kosong"; } if (empty($password)) { $passwordErr = "Password Kosong"; } if (!empty($username and $password)) { $query = mysql_query("select username,password,name_level from user,level where user.level=level.id_level and username='******' and password='******'"); $cek = mysql_num_rows($query); $data = mysql_fetch_array($query); if ($cek == 1) { $_SESSION['username'] = $data['username']; $_SESSION['islogin'] = true; $_SESSION['level'] = $data['name_level']; $_SESSION['password'] = $data['password']; if ($_SESSION['level'] == 'administrator') { header("location:?page=admin"); } else { header("location:../testing_php/"); } } else { echo "User is not Registered";