Пример #1
0
function ceklogin()
{
    if (!$_SESSION['user']) {
        echo '<script language="javascript">alert("Anda Belum Login")</script>';
        return ke('login.php');
    } else {
        true;
    }
}
Пример #2
0
include '../include/header_admin.php';
include '../include/batas.php';
if (isset($_POST['submit'])) {
    $nama = $_POST['nama'];
    $nopol = $_POST['nopol'];
    $jk = $_POST['prdId'];
    $tgl = $_POST['jtempo'];
    $hari = $_POST['hitung'];
    $pajak = $_POST['pajak'];
    $total = $_POST['total'];
    if ($nama == '' || $nopol == '' || $jk == '' || $tgl == '' || $hari == '' || $pajak == '' || $total == '') {
        echo '<script language="javascript">alert("Data Masih Ada Yang Kosong")</script>';
    } else {
        $sql = mysql_query("INSERT INTO pembayaran VALUES ('','{$nama}', '{$nopol}', '{$jk}', '{$tgl}','{$hari}','{$pajak}','{$total}')");
        echo '<script language="javascript">alert("Data Berhasil di Tambah")</script>';
        ke("bayar_tampil.php?");
    }
}
?>
<script type=text/javascript>
function hitungDenda() {
    var tjt = document.getElementsByName('jtempo')[0].value.split('-');
    var thn = tjt[0]; var bln = tjt[1]; var tgl = tjt[2];
    var t_jt = new Date(thn,bln-1,tgl,0,0,0,0);
    var t_by = new Date();
    t_by.setHours(0); t_by.setMinutes(0); t_by.setSeconds(0); t_by.setMilliseconds(0);
    var hari = hitungHari(t_jt,t_by);
    var denda = hari;
	if (denda == 0)
	{
		document.form1.hitung.value = (0);
Пример #3
0
include '../include/batas.php';
if (isset($_POST['submit'])) {
    $id = $_POST['id'];
    $nama = $_POST['nama'];
    $nopol = $_POST['nopol'];
    $jk = $_POST['prdId'];
    $tgl = $_POST['jtempo'];
    $hari = $_POST['hitung'];
    $pajak = $_POST['pajak'];
    $total = $_POST['total'];
    if ($nama == '' || $nopol == '' || $jk == '' || $tgl == '' || $hari == '' || $pajak == '' || $total == '') {
        echo '<script language="javascript">alert("Data Masih Ada Yang Kosong")</script>';
    } else {
        $sql = mysql_query("UPDATE pembayaran SET id='{$id}', nama='{$nama}', nopol='{$nopol}', jk='{$jk}', \n\t\ttgl='{$tgl}', hari='{$hari}',pajak='{$pajak}', total='{$total}' WHERE id = '{$id}'");
        echo '<script language="javascript">alert("Data Berhasil Di Ubah")</script>';
        ke('bayar_tampil.php');
    }
}
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM pembayaran WHERE id = '{$id}'");
$data = mysql_fetch_array($sql);
?>
<script type=text/javascript>
function hitungDenda() {
    var tjt = document.getElementsByName('jtempo')[0].value.split('-');
    var thn = tjt[0]; var bln = tjt[1]; var tgl = tjt[2];
    var t_jt = new Date(thn,bln-1,tgl,0,0,0,0);
    var t_by = new Date();
    t_by.setHours(0); t_by.setMinutes(0); t_by.setSeconds(0); t_by.setMilliseconds(0);
    var hari = hitungHari(t_jt,t_by);
    var denda = hari;
Пример #4
0
<?php

include '../include/header_admin.php';
include '../include/batas.php';
if (isset($_POST['submit'])) {
    $id = $_POST['id'];
    $user = $_POST['user'];
    $pass = $_POST['pass'];
    $level = $_POST['level'];
    if ($user == '' or $pass == '' or $level == '') {
        echo '<script language="javascript">alert("Data Masih Ada Yang Kosong!")</script>';
    } else {
        $sql = mysql_query("UPDATE login SET id='{$id}',user='******', pass=md5('{$pass}'), level='{$level}' WHERE id='{$id}'");
        echo '<script language="javascript">alert("Data Berhasil Di Ubah")</script>';
        ke('manajemen_admin.php');
    }
}
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM login WHERE id = {$id}");
$data = mysql_fetch_array($sql);
?>
<div id="kotak_luar">
	 <img src="../images/head.png"  width="1100" height="250" />		
		<div id="konten">
        	<div id="konten_kiri">
            	<div id="menu">
                	<h2>Menu</h2>
                   <?php 
include '../include/sidebar_admin.php';
?>
                </div>
Пример #5
0
<?php

include '../include/konfigurasi.php';
session_unset();
$_SESSION['username'] = '';
$_SESSION['nama'] = '';
session_destroy();
ke('../index.php');
Пример #6
0
<?php

if (isset($_SESSION['level'])) {
    // jika level admin
    if ($_SESSION['level'] == "1") {
    } else {
        if ($_SESSION['level'] == "2") {
            echo '<script language="javascript">alert("Tidak ada hak akses")</script>';
            return ke('logout.php');
        }
    }
}
if (!isset($_SESSION['level'])) {
    header('location:login.php');
}
Пример #7
0
<?php

include '../include/konfigurasi.php';
if (isset($_POST['submit'])) {
    $user = $_POST['user'];
    $pass = $_POST['pass'];
    if ($user != "" && $pass != "") {
        $sql = "SELECT * FROM login WHERE user='******' AND pass =md5('{$pass}')";
        $query = mysql_query($sql) or die(mysql_error());
        $jumlah = mysql_num_rows($query);
        $row = mysql_fetch_array($query);
        if ($jumlah != 0) {
            $_SESSION['id'] = $row['id'];
            $_SESSION['user'] = $row['user'];
            $_SESSION['level'] = $row['level'];
            ke('admin.php');
        } else {
            echo '<script language="javascript">alert("Username atau password Salah!");</script>';
        }
    } else {
        echo '<script language="javascript">alert("Username atau Password Ada Yang Masih Kosong");</script>';
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login Administrator</title>
<link href="../style.css" rel="stylesheet" type="text/css" />