Rabu, 02 April 2014

Buku Tutorial CorelDRAW x5


actionAddAdmin

<?PHP
ob_start();
include "konek.php";

 $kode=$_POST['kode'];
 $waktu=$_POST['waktu'];


$sql = "insert into booking values('$kode','$waktu','username','id_show','invoiceNumber')";
$insert=mysql_query($sql);

header("location:addPlane.php");

?>

actionAddPlane
<?PHP
ob_start();
include "konek.php";

 $id_plane=$_POST['id_plane'];
 $plane=$_POST['plane'];
 $seat=$_POST['seat'];

$sql = "insert into plane values('$id_plane','$plane','$seat')";
$insert=mysql_query($sql);

header("location:addVenueUkom.php");

?>

actionAddseat
<?PHP
ob_start();
include "konek.php";

 $seatNumber=$_POST['seat_number'];


$sql = "insert into seat values('$seatNumber')";
$insert=mysql_query($sql);

header("location:login.php");

?>

actionAddVenue

<?PHP
ob_start();
include "konek.php";
 $id_venue=$_POST['id_venue'];
 $venueName=$_POST['venueName'];
 $dTime=$_POST['dTime'];
 $venueLocation=$_POST['venueLocation'];
 $aTime=$_POST['aTime'];

$sql = "insert into venue values('$id_venue','$venueName','$venueLocation','$dTime','$aTime')";
$insert=mysql_query($sql);

header("location:show-jadwal.php");

?>

actionDate

<?php ob_start(); ?>
<?php 
include"konek.php";
$id_plane=$_POST['id_plane'];
$id_venue=$_POST['id_venue'];
$departure_time=$_POST['departure_time'];
$arrived_time=$_POST['arrived_time'];
$seatName=$_POST['seatName'];

echo $id_plane;
echo $id_venue;
echo $departure_time;
echo $arrived_time;
echo $seatName;
$query = "INSERT INTO `show` (`id_plane`,`id_venue`,`departure_time`,`arrived_time`,`seatName`)VALUES('$id_plane','$id_venue','$departure_time','$arrived_time','$seatName')"; 
if(mysql_query($query)){
 header('location:showDaftar.php');

}
else
{
echo mysql_error(); 
}


?>


actionEdit

<?PHP
ob_start();
include 'konek.php';
 $id=$_GET['id'];
 $username=$_POST['username'];
 $password=$_POST['password'];
 $namaAwal=$_POST['firstname'];
 $namaAkhir=$_POST['lastname'];
 $alamat=$_POST['address'];
 $kota=$_POST['town'];
 $negara=$_POST['country'];
 $kodePos=$_POST['postcode'];
 $email=$_POST['email'];

$sql="update user SET username='$username',password='$password',firstname='$namaAwal',lastname='$namaAkhir',address='$alamat',town='$kota',country='$negara',postcode='$kodePos',email='$email' where username='$username'";
$insert=mysql_query($sql);


if($sql){
header("location:profil.php");
}
else
{
echo "gagal";
}

actionEditAddUkom

<?PHP
ob_start();
include 'konek.php';
 $id_booking=$_GET['id_booking'];
 $kode_booking=$_POST['kode_booking'];
 $time_booking=$_POST['time_booking'];


$sql="update booking set kode_booking,='$kode_booking',time_booking='$time_booking' from booking where kode_booking='$kode_booking'";
$insert=mysql_query($sql);


if($sql){
header("location:profil.php");
}
else
{
echo "gagal";
}

actionEditShow
<?php ob_start(); ?>
<?php 
include"konek.php";
$id_plane=$_POST['id_plane'];
$id_venue=$_POST['id_venue'];
$departure_time=$_POST['departure_time'];
$arrived_time=$_POST['arrived_time'];
$seatName=$_POST['seatName'];

echo $id_plane;
echo $id_venue;
echo $departure_time;
echo $arrived_time;
echo $seatName;
$query = "UPDATE`plane`,`venue`,`show`,`seat` SET id_plane='$id_plane',id_venue='$id_venue',departure_time='$departure_time',arrived_time='$arrived_time',seatName='$' "; 
if(mysql_query($query)){
 header('location:showDaftar.php');

}
else
{
echo mysql_error(); 
}

?>

actionShow

<?php

include "konek.php";
$query =mysql_query("SELECT venue.venueName, venue.venueLocation,`show`.`id_plane`, `show`.`departure_time`, `seat`.`seatName`, `show`.`id_show`, `show`.`arrived_time`, FROM `show` INNER JOIN `venue` ON `venue`.`id_venue` = `show`.`id_venue` INNER JOIN `seat` ON `seat`.`seatName` = `show`.`seatName` LIKE `venue`.`venueName` LIKE '$venueName' AND `venue`.`venueLocation` LIKE '$venueLocation' AND `show`.`departure_time` LIKE'$departure_time%' AND `show`.`arrived_time` LIKE '$arrived_time%'");
echo "<table border =1 width=100%>
<tr>
<td>ID</td>
<td>Name</td>
<td>Plane</td>
<td>Departure - Arrived</td>
<td>Time</td>
</tr>
";

while($hasil=mysql_fetch_array($query)) 
{
"<tr>
<td>$hasil[id_show]</td>
<td>$hasil[showName]</td>
<td>$hasil[id_plane]</td>
<td>$hasil[id_venue]</td>
<td>$hasil[time_booking]</td>
<td><a href ='edit.php?nim=$hasil[NIM]'>Edit</a>  </td>
</tr>
";
}
echo"</table>";

?>

</body>
</html>

addPlane

<?php
include "konek.php";
?>
<style>
#header1{background-color:#FFFFFF;font-size:45px;color:#95A5A6;width:100%;height:1px;}
#header2{background-color:#FFFFFF;padding:20px 0px 30px 0px;}
input[type="text"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;border-top:none;border-left:none;border-right:none;}
input[type="text"]:focus{border-color:#000000}
input[type="password"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="password"]:focus{border-color:#000000}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
body{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;}
</style>
<body>
<center>

<div id="header1"><center>REGISTER</center></div>


<div id="header2">
<center>
<form action="actionAddPlane.php" method="post" >

<table border="0" cellpadding="5" cellspacing="5">
<tr>

<tr>
<td width="150px">Kode Plane</td><td><input type="text" name="id_plane" >
<tr></td><br />
<tr>
<td width="150px">Plane</td><td><input type="text" name="plane" >
<tr></td><br />
<tr>
<td width="150px">Seat</td><td><input type="text" name="seat" >
<tr></td><br />


<td colspan="2" style="padding-top:50px"><center><input type="submit" name="submit" value="SUBMIT" /></center></td>
<br />
<br />

</tr>


</table>

</form>


</div>
</body>

</html>

addSeat

<?php
include "konek.php";
?>
<style>
#header1{background-color:#FFFFFF;font-size:45px;color:#95A5A6;width:100%;height:1px;}
#header2{background-color:#FFFFFF;padding:20px 0px 30px 0px;}
input[type="text"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;border-top:none;border-left:none;border-right:none;}
input[type="text"]:focus{border-color:#000000}
input[type="password"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="password"]:focus{border-color:#000000}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
body{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;}
</style>
<body>
<center>

<div id="header1"><center>REGISTER</center></div>


<div id="header2">
<center>
<form action="actionAddSeat.php" method="post" >

<table border="0" cellpadding="5" cellspacing="5">
<tr>

<tr>
<td width="150px">Seat Number</td><td><input type="text" name="seat_number" >
<tr></td><br />




<td colspan="2" style="padding-top:50px"><center><input type="submit" name="submit" value="SUBMIT" /></center></td>
<br />
<br />

</tr>


</table>

</form>


</div>
</body>

</html>

addUkom

<?php
include "konek.php";
?>
<style>
#header1{background-color:#FFFFFF;font-size:45px;color:#95A5A6;width:100%;height:1px;}
#header2{background-color:#FFFFFF;padding:20px 0px 30px 0px;}
input[type="text"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;border-top:none;border-left:none;border-right:none;}
input[type="text"]:focus{border-color:#000000}
input[type="password"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="password"]:focus{border-color:#000000}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
body{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;}
</style>
<body>
<center>

<div id="header1"><center>REGISTER</center></div>


<div id="header2">
<center>
<form action="actionAddAdmin.php" method="post" >

<table border="0" cellpadding="5" cellspacing="5">
<tr>

<tr>
<td width="150px">Kode Booking</td><td><input type="text" name="kode" >
<tr></td><br />


<tr>
<td>Time</td><td><input type="datetime-local" name="waktu"/></td>
</tr>
<tr>
<tr>
<br>
<br>

<td colspan="2" style="padding-top:50px"><center><input type="submit" name="submit" value="SUBMIT" /></center></td>
<br />
<br />

</tr>


</table>

</form>


</div>
</body>

</html>

addVenueUkom

<?php
include "konek.php";
?>
<style>
#header1{background-color:#FFFFFF;font-size:45px;color:#95A5A6;width:100%;height:1px;}
#header2{background-color:#FFFFFF;padding:20px 0px 30px 0px;}
input[type="text"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;border-top:none;border-left:none;border-right:none;}
input[type="text"]:focus{border-color:#000000}
input[type="password"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="password"]:focus{border-color:#000000}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
body{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;}
</style>
<body>
<center>

<div id="header1"><center>REGISTER</center></div>


<div id="header2">
<center>
<form action="actionAddVenue.php" method="post" >

<table border="0" cellpadding="5" cellspacing="5">
<tr>
<tr>
<td width="150px">Kode</td><td><input type="text" name="id_venue" >
<tr></td><br />

<tr>
<td width="150px">Departure</td><td><input type="text" name="venueName" >
<tr></td><br />
<tr>
<td width="150px">Departure Time</td><td><input type="datetime-local" name="dTime" >
<tr></td><br />
<tr>

<tr>
<td width="150px">Arrived</td><td><input type="text" name="venueLocation" >
<tr></td><br />

<td width="150px">Arrived Time</td><td><input type="datetime-local" name="aTime" >
<tr></td><br />


<td colspan="2" style="padding-top:50px"><center><input type="submit" name="submit" value="SUBMIT" /></center></td>
<br />
<br />

</tr>


</table>

</form>


</div>
</body>

</html>

ajax
<?php
include "konek.php";
if(isset($_GET['seat'])){
$id_plane=$_GET['plane'];
$query="select seat from plane where id_plane='$id_plane'";
$query_tampilkan=mysql_query($query);
$fetch=mysql_fetch_array($query_tampilkan);
echo $fetch[0];
}
if(isset($_GET['nama'])){
$id_plane=$_GET['plane'];
$query="select plane from plane where id_plane='$id_plane'";
$query_tampilkan=mysql_query($query);
$fetch=mysql_fetch_array($query_tampilkan);
echo $fetch[0];
}
if(isset($_GET['venueLocation'])){
$id_venue=$_GET['venue'];
$query="select venueLocation from venue where id_venue='$id_venue'";
$query_tampilkan=mysql_query($query);
$fetch=mysql_fetch_array($query_tampilkan);
echo $fetch[0];
}
if(isset($_GET['venueName'])){
$id_venue=$_GET['venue'];
$query="select venueName from venue where id_venue='$id_venue'";
$query_tampilkan=mysql_query($query);
$fetch=mysql_fetch_array($query_tampilkan);
echo $fetch[0];
}

?>

edit

<?php
include('session.php');
?>
<html>
<style>
#sheader1{background-color:#FFFFFF;font-size:45px;color:#95A5A6;width:100%;height:1px;}
#padHeader{padding:10px 0px 0px 10px;}
#sheader2{background-color:#FFFFFF;}
input[type="text"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="text"]:focus{border-color:#000000}
input[type="password"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="password"]:focus{border-color:#000000}
#header1{width:100%;height:100px;background-color:#6BB9F0;}
#header2{width:100%;height:30px;background-color:#34495E;}
input[type="submit"]{border:none;background-color:#F9690E;;width:100px;height:30px;color:#FFFFFF;padding:0px 0px 0px 0px;}
input[type="submit"]:hover{background-color:#96281B}
#linkHeader{border:none;background-color:#34495E;width:30px;height:50px;color:#34495E;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#samping{width:20%;height:50%;background-color:#F2F1EF;}
#sampingFoto{padding-top:10px;}
#isiSamping{padding:5px 5px 780px 5px;font-family:Verdana, Arial, Helvetica, sans-serif;color:#333333;}
#utama{background-color:#FFFFFF;width:100%;height:100%}
#hUtama1{color:#990000;padding:0px 0px 0px 50px;}
#judulHome{width:80%;color:#990033;padding:0px 0px 0px 500px;}
#booking{width:100%;height:100px;padding:0px 0px 0px 25px;}
#booking:hover{background-color:#ECF0F1;}
#bodyLink{font-size:22px;color:#333333;font-weight:bold;font:Verdana, Arial, Helvetica, sans-serif;text-decoration:none;}
#tdBooking{padding:0px 0px 700px 0px;}
#footer{width:100%;height:100px;background-color:#F9690E}
#header1{width:100%;height:100px;background-color:#F4D03F;;}
#header2{width:100%;height:30px;background-color:#34495E;}
#samping{width:24%;height:100%;background-color:#F2F1EF;}
#sampingFoto{padding-top:10px;}
#isiSamping{padding:5px 5px 780px 5px;font-family:Verdana, Arial, Helvetica, sans-serif;color:#333333;}
#utama{background-color:#FFFFFF;width:100%;height:100%}
#hUtama1{color:#990000;padding:0px 0px 0px 50px;}
#judulHome{width:80%;color:#990033;padding:0px 0px 0px 50px;}
#booking{width:100%;height:100px;padding:0px 0px 0px 25px;}
#booking:hover{background-color:#ECF0F1;}
#bodyLink{font-size:22px;color:#333333;font-weight:bold;font:Verdana, Arial, Helvetica, sans-serif;text-decoration:none;}
#tdBooking{padding:0px 0px 700px 0px;}

#username{border:none;background-color:#34495E;width:30px;height:30px;color:#FFFFFF;padding:0px 0px 0px 100px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#outBut{border:none;background-color:#F9690E;;color:#FFFFFF;padding:0px 0px 0px 10px;}
#usernames{border:none;background-color:#F9690E;color:#FFFFFF;padding:0px 0px 15px 0px;font:Verdana, Arial, Helvetica, sans-serif;width:100%}
#linkHeader{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#but{border:none;background-color:#2ABB9B;width:150px;height:40px;color:#FFFFFF;border-radius:2px;padding:0px 130px 0px 50px;}
#but:hover{background-color:#2C3E50;transition:1s;}
#but2{border:none;background-color:#2ABB9B;width:150px;height:40px;color:#FFFFFF;border-radius:6px;padding:0px 0px 0px px;}
#tdbut2{border:none;width:200px;height:40px;color:#FFFFFF;border-right-radius:2px;padding:0px 50px 0px 0px;}
#tdbut2:hover{border:none;background-color:#C8F7C5;color:#FFFFFF;border-right-radius:2px;padding:0px 0px 0px 0px;}
#but2:hover{background-color:#2C3E50;transition:1s;}
#padder{padding:0px 30px 0px 650px;border-bottom:medium;border-bottom-color:#FF0000}
#padder:hover{background-color:#C8F7C5}
#gamBut{background:none;border:none;width:20px;height:20px;background-image:url(exUkom.png);background-repeat:no-repeat;padding:10px 0px 0px 0px;}
tdBg{background-color:#CCCCCC}
#font{font-family:Verdana, Arial, Helvetica, sans-serif;float:right}
</style>
<?php
include "konek.php";
$id=$_GET['id'];
$query =mysql_query("select username,password,firstname,lastname,address,town,country,postcode,email from user where username='$username'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);
?>
<body>
<div id="header1"> <img id="padHeader" src="logoukomes2.png"> </div>
<div id="header2">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<form action="home.php">
<input type="submit" name="home" value="HOME">
</form>
<td>
<form action="profil.php">
<input type="submit" name="profil" value="PROFIL">
</form>
<td id="usernames">
<?php 
$query = mysql_query("select username,password,firstname,lastname,address,town,country,postcode,email from user where username='$username'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);
$username=$row['username'];
echo "<font id='font'>Hello,$username</font>";
?>
</td>
<td id="outBut">
<form action="logout.php">
<input type="submit" value="Logout" src="logout.php">
</form>
</td>
</form>
</td>
 </tr>
 </table>

</div>

  <div id="sheader1">Change Account Profil</div>
<div id="sheader2">

<form action="actionEdit.php" method="post" >

<table border="0" cellpadding="5" cellspacing="5">
<tr>

<tr>
<td width="150px">Username</td><td><input type="text" style="border:none;font:Verdana, Arial, Helvetica, sans-serif;font-size:20px;" readonly value="<?php $username=$row['username'];echo $username; ?>"><br />
</tr>
<tr>
<td>Password</td><td><input type="password" name="password" value="<?php $password=$row['password']; echo $password; ?>"></td><br />
</tr>

<tr>
<td>Firstname</td><td><input type="text" name="firstname" value="<?php $firstname=$row['firstname'];echo $firstname; ?>" /></td><br />
</tr>
<tr>
<td>Lastname</td><td><input type="text" name="lastname" value="<?php $lastname=$row['lastname'];echo $lastname; ?>"  /></td><br />
</tr>
<tr>
<td>Address</td><td><input type="text" name="address" value="<?php $address=$row['address'];echo $address; ?>" /></td><br />
</tr>
<tr>
<td>Town</td><td><input type="text" name="town" value="<?php $town=$row['town'];echo $town; ?>"  /></td><br />
</tr>

<tr>
<td>Country</td><td><input type="text" name="country" value="<?php $country=$row['country'];echo $country; ?>" /></td><br />
</tr>
<tr>
<td>Postcode</td><td><input type="text" name="postcode" value="<?php $postcode=$row['postcode'];echo $postcode; ?>"  /></td><br />
</tr>
<tr>
<td>Email</td><td><input type="text" name="email" value="<?php $email=$row['email'];echo $email; ?>"  /></td><br />
</tr>

<tr>

<td colspan="2"><center><input type="submit" name="submit" value="tampilkan" /></center></td>
<br />
<br />

</tr>
</table>
</form>


</div>
</body>



</div>

<div id="footer">

</div>
</body>
</html>

editAddUkom

<?php 
include('sessionAdmin.php'); 
?>
<style>
#header1{background-color:#FFFFFF;font-size:45px;color:#95A5A6;width:100%;height:1px;}
#header2{background-color:#FFFFFF;padding:20px 0px 30px 0px;}
input[type="text"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;border-top:none;border-left:none;border-right:none;}
input[type="text"]:focus{border-color:#000000}
input[type="password"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="password"]:focus{border-color:#000000}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
body{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;}
</style>
<?PHP 
include "konek.php";
$id_booking=$_GET['id_booking'];
$query =mysql_query("select kode_booking,time_booking from booking where kode_booking='$kode_booking'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);

?>

<body>
<center>

<div id="header1"><center>REGISTER</center></div>


<div id="header2">
<center>
<form action="actionEditAddUkom.php" method="post" >

<table border="0" cellpadding="5" cellspacing="5">
<tr>

<tr>
<td width="150px">Kode Booking</td><td><input type="text" name="kode" value="<?php $kode_booking=$row['kode_booking'];echo $kode_booking; ?>" >
<tr></td><br />


<tr>
<td>Time</td><td><input type="datetime-local" name="waktu"/></td>
</tr>
<tr>
<tr>
<br>
<br>

<td colspan="2" style="padding-top:50px"><center><input type="submit" name="submit" value="SUBMIT" /></center></td>
<br />
<br />

</tr>


</table>

</form>


</div>
</body>

</html>

editShow

<style>
input[type="text"]{border-top:none;border-left:none;border-right:none;border-color:#333333}
select{border-top:none;border-right:none;border-left:none;border-color:#333333;border-bottom:10px}
</style>

<?php
include'konek.php';

?>
<form action="actionDate.php" method="post">

<select id="plane" name="id_plane">
<option disabled="disabled" selected="selected">Kode Plane...</option>
<?php $query = mysql_query("select*from plane"); 
$num = mysql_num_rows($query); 
while($row= mysql_fetch_array($query)){
?>
<option value="<?php $id_plane=$row[0]; echo $id_plane; ?>"> <?php $id_plane=$row[0]; echo $id_plane; ?> 
</option>
<input id="namaPlane" type="text" placeholder="Plane Name" readonly/>
<input id="seat" type="text" placeholder="Total Seat" readonly/>

<?php } ?>
</select>
<script src="js/jquery-2.1.1.min.js"></script>
<script>
$("#plane").change(function() {                

        $.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax2.php?seat=&plane="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#seat").val(response);
          }
        });
$.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax2.php?nama=&plane="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#namaPlane").val(response);
          }
        });
});
</script>
<select id="venue" name="id_venue">
<option disabled="disabled" selected="selected">Kode venue...</option>
<?php $query = mysql_query("select*from venue"); 
$num = mysql_num_rows($query); 
while($row= mysql_fetch_array($query)){
?>
<option value="<?php $id_venue=$row[0]; echo $id_venue; ?>"> <?php $id_plane=$row[0]; echo $id_venue; ?> 
</option>
<input id="venueName" type="text" placeholder="From" readonly/>
<input id="venueLocation" type="text" placeholder="To" readonly/>
<?php } ?>
</select>
<script src="js/jquery-2.1.1.min.js"></script>
<script>
$("#venue").change(function() {                

        $.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax2.php?venueName=&venue="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#venueName").val(response);
          }
        });
$.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax2.php?venueLocation=&venue="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#venueLocation").val(response);
          }
        });
});

 </script>
 

<br />
<input type="datetime-local" name="departure_time" />    -    <input type="datetime-local" name="arrived_time" />
<select name="seatName">
<?php
 $query="SELECT *FROM seat";
 $query_tampilkan=mysql_query($query);
 while($result=mysql_fetch_array($query_tampilkan)){
 ?>
<option value="<?php $seatName=$result[0]; echo $seatName; ?>"><?php $seatName=$result[0]; echo $seatName; ?></option>
<?php } ?>
</select>
<input type="submit" id="submit">
</form>


home

<?php
include('session.php');
?>
<html>
<style>
#header1{width:100%;height:100px;background-color:#F4D03F;}
    #padHeader{padding:10px 0px 0px 10px;}
#header2{width:100%;height:30px;}
input[type="submit"]{border:none;background-color:#F9690E;width:100px;height:30px;color:#FFFFFF;padding:0px 0px 0px 0px;}
input[type="submit"]:hover{background-color:#96281B;}
#samping{width:24%;height:100%;background-color:#F2F1EF;}
#sampingFoto{padding-top:10px;}
#isiSamping{padding:5px 5px 780px 5px;font-family:Verdana, Arial, Helvetica, sans-serif;color:#333333;}
#utama{background-color:#FFFFFF;width:100%;height:100%}
#hUtama1{color:#990000;padding:0px 0px 0px 50px;}
#judulHome{width:80%;color:#990033;padding:0px 0px 0px 50px;}
#booking{width:100%;height:100px;padding:0px 0px 0px 25px;}
#booking:hover{background-color:#ECF0F1;}
#bodyLink{font-size:22px;color:#333333;font-weight:bold;font:Verdana, Arial, Helvetica, sans-serif;text-decoration:none;}
#tdBooking{padding:0px 0px 700px 0px;}
#footer{width:100%;height:100px;background-color:34495E;}
#username{border:none;background-color:#34495E;width:30px;height:30px;color:#FFFFFF;padding:0px 0px 0px 100px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#outBut{border:none;background-color:#F9690E;color:#FFFFFF;padding:0px 0px 0px 10px;}
#usernames{border:none;background-color:#F9690E;color:#FFFFFF;padding:0px 0px 15px 0px;font:Verdana, Arial, Helvetica, sans-serif;width:100%;}

#linkHeader{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#but{border:none;background-color:#2ABB9B;width:150px;height:40px;color:#FFFFFF;border-radius:2px;padding:0px 130px 0px 50px;}
#but:hover{background-color:#2C3E50;transition:1s;}
#but2{border:none;background-color:#F9690E;width:150px;height:40px;color:#FFFFFF;border-radius:6px;padding:0px 0px 0px px;}
#tdbut2{border:none;width:200px;height:40px;color:#FFFFFF;border-right-radius:2px;padding:0px 50px 0px 0px;}
#tdbut2:hover{border:none;background-color:#C8F7C5;color:#FFFFFF;border-right-radius:2px;padding:0px 0px 0px 0px;}
#but2:hover{background-color:#96281B;transition:1s;}
#padder{padding:0px 30px 0px 650px;border-bottom:medium;border-bottom-color:#FF0000}
#padder:hover{background-color:#C8F7C5}
#gamBut{background:none;border:none;width:20px;height:20px;background-image:url(exUkom.png);background-repeat:no-repeat;padding:10px 0px 0px 0px;}
tdBg{background-color:#CCCCCC}
#font{font-family:Verdana, Arial, Helvetica, sans-serif;float:right}
</style>
<body>
<div id="header1"> <img id="padHeader" src="logoUkomes2.png">  </div>
<div id="header2">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<form action="home.php">
<input type="submit" name="home" value="HOME">
</form>
<td>
<form action="profil.php">
<input type="submit" name="profil" value="PROFIL">
</form>
<td id="usernames">
<?php 
$query = mysql_query("select username from user where username='$username'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);
$username=$row['username'];
echo "<font id='font'>Hello,$username</font>";
?>
</td>
<td id="outBut">
<form action="logout.php">
<input type="submit" value="Logout" src="logout.php">
</form>
</td>
</form>
</td>
 </tr>
 </table>

</div>


<div id="utama">
<center><img id="noBg" src="todayMatch.png"></center>
<div id="judulHome">
<table width="100%" cellspacing="0" >
<tr id="padder">
<td bgcolor="#ECF0F1">
<center><font size="+2" color="#999999">1</font></center>
</td>
<td colspan="2">
<a style="text-decoration:none" href=""><font face="Verdana, Arial, Helvetica, sans-serif" color="#D64541" size="+2" >Jakarta - Bali</font></a><br>
<font face="Verdana, Arial, Helvetica, sans-serif" color="#34495E" size="+1">Gonorhea Air</font><br>
<font face="Verdana, Arial, Helvetica, sans-serif" color="#34495E">Ticket Status : Available</font><br>
</td>
<td id="tdbut2">
<form action="" method="post">
<input type="submit" id="but2" name="submit" value="Book Now"></form>
</td>
</tr>
<tr id="padder">
<td bgcolor="#ECF0F1">
<center><font size="+2" color="#999999">1</font></center>
</td>
<td colspan="2">
<a style="text-decoration:none" href=""><font face="Verdana, Arial, Helvetica, sans-serif" color="#D64541" size="+2" >Jakarta - Bali</font></a><br>
<font face="Verdana, Arial, Helvetica, sans-serif" color="#34495E" size="+1">Gonorhea Air</font><br>
<font face="Verdana, Arial, Helvetica, sans-serif" color="#34495E">Ticket Status : Available</font><br>
</td>
<td id="tdbut2">
<form action="" method="post">
<input type="submit" id="but2" name="submit" value="Book Now"></form>
</td>
</tr>
</table>
</div>
</div>



</form>
<?php 
/*

$query = mysql_query("select firstname,lastname,address,town,country,postcode,email from user where username='$username'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);
$namaAwal=$row['firstname'];
$namaAkhir=$row['lastname'];
$alamat=$row['address'];
$kota=$row['town'];
$negara=$row['country'];
$kodePos=$row['postcode'];
$email=$row['email'];

echo "<b><br>Nama Awal</b><br>";
echo "$namaAwal<br>";
echo "<B>Nama Akhir </b><br>";
echo "$namaAkhir<br>";
echo "<b>Alamat</b><br>";
echo "$alamat<br>";
echo "<b>Kota</b><br>";
echo "$kota<br>";
echo "<b><font id='padders'>Negara</font></b><br>";
echo "$negara<br>";
echo "<b>Kode Pos</b><br>";
echo "$kodePos<br>";
echo "<b>Email</b><br>";
echo "$email<br>";
*/
?>


</div>

</div>

<div id="footer">

</div>
</body>
</html>


homeAdmin

<head>
<style>
#bodyCrud{background-color:#CC9900;height:310px;}
</style>
</head>
<div id="bodyCrud"><center>
<a href="addPlane.php"><img src="addAdminUkom.png" /></a>
<a href=""><img src="updateAdminUkom.png"/></a>
<a href=""><img src="deleteAdminUkom.png"/></a>
</center>
</div>
<?php /*
<?php
include "konek.php"
?>
<head>
<style>
#books{background-color:#F7CA18;height:30px;padding:10px 0px 0px 0px;}
#border{border:none;background:none}
#border:focus{border:none;background:none}
</style>
</head>
<?php

$query = mysql_query("select venueName,venueLocation from venue where id_venue='p0001'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);
$venueName=$row['venueName'];
$venueLocation=$row['venueLocation'];
?>
<body>
<div id="books">

<select id="border">
<option id="border"><?php $venueName=$row['venueName'];echo $venueName; ?></option>
<option id="border">adadawda</option>
</select>
<img src="pergiUkom.png" />
<select id="border">
<option id="border"><?php $venueLocation=$row['venueLocation'];echo $venueLocation; ?></option>
<option id="border">adadawda</option>
</select>
<img src="waktuUkom.png" />
<select id="border">
<option id="border"><?php $venueLocation=$row['venueLocation'];echo $venueLocation; ?></option>
<option id="border">adadawda</option>
</select>

</div>
</body>
*/
?>

konek

<?php
$host = "127.0.0.1";
$user = "root";
$pass = "";
$db = "ukom";

$koneksi = mysql_connect($host, $user, $pass);
$pilihdb = mysql_select_db($db, $koneksi);
?>

logAdmin

<?php
ob_start();
session_start();
include 'konek.php';
 
if(!empty($_POST)){
     
    $username = $_POST['username'];
    $password = $_POST['password'];
 
    $sql = "SELECT * from admin where username='".$username."' and password='".$password."'";
    #echo $sql."<br />";
    $query = mysql_query($sql) or die (mysql_error());
 
    // pengecekan query valid atau tidak
    if($query){
        $row = mysql_num_rows($query);
         
        // jika $row > 0 atau username dan password ditemukan
        if($row > 0){
            $_SESSION['isLoggedIn']=1;
            $_SESSION['username']=$username;
            header('Location: homeAdmin.php');
        }else{
            echo "username atau password salah";
        }
    }
}
?>
 
<form action="" method="post">
<html>
<style>#header{width:100%;
  height:10%;
  background-image:url(Night-Wallpapers5.jpg)}
#heder{width:100%;
  height:40%;
  background-color:#FFFFFF;}
   #herder{width:100%;
      height:5%;}
   #reg{padding:10px 245px 2px 2px;}
   body{color:#F2F1EF;}
#regButton{background:none;width:220px;font-size:12px;color:#FFFFFF;font-style:normal;text-decoration:none;font-size:12}
table{width:35%; height:20%;background:none;}
#tableBack{width:30%;height:40%;background:none;padding:280px 1px 150px 10px;border-radius:20px;}
#paddings{padding:1px 20px 100px 20px;}
input[type="text"]{width:200px;height:30;border-radius:2px;border-color:#FFFFFF;background:none;border-style:solid;color:#FFFFFF;}
input[type="text"]:focus{border-color:#660033;}
input[type="password"]{width:200px;height:30;border-radius:2px;border-color:#FFFFFF;background:none;border-style:solid;color:#FFFFFF;}
input[type="password"]:focus{border-color:#660033;}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
#usAdmin{border:none;background-color:#2ABB9B;width:100px;height:20px;color:#FFFFFF;border-radius:2px;}
#usAdmin:hover{background-color:#2C3E50;transition:1s;}
#usAdmin2{border:none;background-color:#22313F;width:100px;height:20px;color:#FFFFFF;border-radius:2px;}
body{font-family:Verdana, Arial, Helvetica, sans-serif; background-image:url(logAdmin.png);background-repeat:no-repeat; background-size:100%;}
#userButt{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;padding:0px 0px 0px 0px;font-size:24px;font-weight:bold;border-sharp:5px}
#UserButt:hover{background-color:#2C3E50;transition:1s;}
#loginText{font-size:24px;font-weight:bold;}
</style>


<body>
<div id="header">
</div>
<div id="herder">
</div>
<center>

<div id="tableBack">
<div>

</div>
    <table border="0">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td>Username </td>
<td><input type="text" name="username" placeholder="Your username"></td>
</tr>
<tr>
<td>Password      </td>
<td><input type="password" name="password" placeholder="Your username"></td>
</tr>
<tr>
<td colspan="2" >
<br>
<br>

<form action="proses-loginAdmin.php" method="post">
<center>
<input id="loginText" type="submit" name="login" value="Login">
</center>
</form>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
<form action="">
<center><br>
<div id="reg">
<a id="regButton" href="register.php">Dont have account ? </a>
</center>
<a id="regButton" style="padding:0px 277px 0px 0px" href="login.php">No,I am Client</a>
</form>
</div>
</div>
</center>
</form>
</body>
</html>

login

<?php
ob_start();
session_start();
include 'konek.php';
 
if(!empty($_POST)){
     
    $username = $_POST['username'];
    $password = $_POST['password'];
 
    $sql = "SELECT * from user where username='".$username."' and password='".$password."'";
    #echo $sql."<br />";
    $query = mysql_query($sql) or die (mysql_error());
 
    // pengecekan query valid atau tidak
    if($query){
        $row = mysql_num_rows($query);
         
        // jika $row > 0 atau username dan password ditemukan
        if($row > 0){
            $_SESSION['isLoggedIn']=1;
            $_SESSION['username']=$username;
            header('Location: home.php');
        }else{
            echo "username atau password salah";
        }
    }
}
?>
 
<form action="" method="post">
<html>
<style media="all">#header{width:100%;
  height:25%;
  background:none}
#footer{width:100%;
  height:15%;
  background-color:fdd229;}
   #herder{width:100%;
      height:5%;}
   #reg{padding:10px 245px 2px 2px;}
   body{color:#F2F1EF;}
#regButton{background:none;width:220px;font-size:12px;color:#D35400;font-style:normal;text-decoration:none;font-size:12}
table{width:35%; height:20%;background:none;}
#tableBack{width:30%;height:40%;background:none;padding:80px 1px 150px 10px;border-radius:20px;}
#paddings{padding:1px 20px 40px 20px;}
input[type="text"]{width:200px;height:30;border-radius:2px;border-color:#FFFFFF;background:none;border-style:solid;color:#FFFFFF;}
input[type="text"]:focus{border-color:#660033;}
input[type="password"]{width:200px;height:30;border-radius:2px;border-color:#FFFFFF;background:none;border-style:solid;color:#FFFFFF;}
input[type="password"]:focus{border-color:#660033;}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
#usAdmin{border:none;background-color:#22313F;width:100px;height:20px;color:#FFFFFF;border-radius:2px;}
#usAdmin:hover{background-color:#2C3E50;transition:1s;}
#usAdmin2{border:none;background-color:#2ABB9B;width:100px;height:20px;color:#FFFFFF;border-radius:2px;}

body{font-family:Verdana, Arial, Helvetica, sans-serif; background-image:url(bgUkom2.png); background-repeat:no-repeat; background-width:100%;background-height:1500px;}
#userButt{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;padding:0px 0px 0px 0px;font-size:24px;font-weight:bold;border-sharp:5px}
#UserButt:hover{background-color:#2C3E50;transition:1s;}
#loginText{font-size:24px;font-weight:bold;}
</style>


<body><br>
</br>
<div id="header">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="logoUkomes.png">
</td>
<td>
<img src="sloganUkom.png">
</td>
</tr>
</table>
</div>

<center>

<div id="tableBack">
<div>
<center>
 <img id="paddings" src="login.png" vspace="0">
</center>
</div>
    <table border="0">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td>Username </td>
<td><input type="text" name="username" placeholder="Your username"></td>
</tr>
<tr>
<td>Password      </td>
<td><input type="password" name="password" placeholder="Your password"></td>
</tr>
<tr>
<td colspan="2" >
<br>
<br>

<form action="proses-login.php" method="post">
<center>
<input id="loginText" type="submit" name="login" value="Login">
</center>
</form>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
<form action="">
<center><br>
<div id="reg">
<a id="regButton" href="register.php">Dont have account ? </a>
</div></center>
 </form>
</form>
  </div>
</div>


</body>
</html>


profil

<?php
include('session.php');
?>
<html>
<style>
input[type="submit"]{border:none;background-color:#F9690E;width:100px;height:30px;color:#FFFFFF;padding:0px 0px 0px 0px;}
input[type="submit"]:hover{background-color:#96281B;}
#samping{width:24%;height:100%;background-color:#F2F1EF;}
#sampingFoto{padding-top:10px;}
#isiSamping{padding:5px 5px 780px 5px;font-family:Verdana, Arial, Helvetica, sans-serif;color:#333333;}
#utama{background-color:#FFFFFF;width:100%;height:100%;padding-left:50px;}
#hUtama1{color:#990000;padding:0px 0px 0px 50px;}
#judulHome{width:80%;color:#990033;padding:0px 0px 0px 500px;}
#booking{width:100%;height:100px;padding:0px 0px 0px 25px;}
#booking:hover{background-color:#ECF0F1;}
#bodyLink{font-size:22px;color:#333333;font-weight:bold;font:Verdana, Arial, Helvetica, sans-serif;text-decoration:none;}
#tdBooking{padding:0px 0px 700px 0px;}
#footer{width:100%;height:100px;background-color:34495E;}
#username{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 1000px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#linkHeader{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#fontPHP{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:30px;color:#336E7B;}
#fontPHP2{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:25px;color:##95A5A6;}
#but{border:none;background-color:#F9690E;width:150px;height:40px;color:#FFFFFF;border-radius:2px;padding:0px 130px 0px 50px;}
#but:hover{background-color:#96281B;transition:1s;}
#settBut{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:5px 0px 0px 100px;}
#header1{width:100%;height:100px;background-color:#F4D03F;}
#padHeader{padding:10px 0px 0px 10px;}
#header2{width:100%;height:30px;background-color:#34495E;}

#samping{width:24%;height:100%;background-color:#F2F1EF;}
#sampingFoto{padding-top:10px;}
#isiSamping{padding:5px 5px 780px 5px;font-family:Verdana, Arial, Helvetica, sans-serif;color:#333333;}
#utama{background-color:#FFFFFF;width:100%;height:100%}
#hUtama1{color:#990000;padding:0px 0px 0px 50px;}
#judulHome{width:80%;color:#990033;padding:0px 0px 0px 50px;}
#booking{width:100%;height:100px;padding:0px 0px 0px 25px;}
#booking:hover{background-color:#ECF0F1;}
#bodyLink{font-size:22px;color:#333333;font-weight:bold;font:Verdana, Arial, Helvetica, sans-serif;text-decoration:none;}
#tdBooking{padding:0px 0px 700px 0px;}
#footer{width:100%;height:100px;background-color:#F9690E;}
#username{border:none;background-color:#34495E;width:30px;height:30px;color:#FFFFFF;padding:0px 0px 0px 100px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#outBut{border:none;background-color:#F9690E;color:#FFFFFF;padding:0px 0px 0px 10px;}
#usernames{border:none;background-color:#F9690E;color:#FFFFFF;padding:0px 0px 15px 0px;font:Verdana, Arial, Helvetica, sans-serif;width:100%}

#linkHeader{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
{border:none;background-color:#34495E;width:30px;height:50px;color:#FFFFFF;padding:3px 0px 0px 10px;
           text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;}
#but2{border:none;background-color:#2ABB9B;width:150px;height:40px;color:#FFFFFF;border-radius:6px;padding:0px 0px 0px px;}
#tdbut2{border:none;width:200px;height:40px;color:#FFFFFF;border-right-radius:2px;padding:0px 50px 0px 0px;}
#tdbut2:hover{border:none;background-color:#C8F7C5;color:#FFFFFF;border-right-radius:2px;padding:0px 0px 0px 0px;}
#but2:hover{background-color:#2C3E50;transition:1s;}
#padder{padding:0px 30px 0px 650px;border-bottom:medium;border-bottom-color:#FF0000}
#padder:hover{background-color:#C8F7C5}
#gamBut{background:none;border:none;width:20px;height:20px;background-image:url(exUkom.png);background-repeat:no-repeat;padding:10px 0px 0px 0px;}
tdBg{background-color:#CCCCCC}
#font{font-family:Verdana, Arial, Helvetica, sans-serif;float:right}
</style>
<body>
<div id="header1"> <img id="padHeader" src="logoUkomes2.png">  </div>
<div id="header2">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<form action="home.php">
<input type="submit" name="home" value="HOME">
</form>
<td>
<form action="profil.php">
<input type="submit" name="profil" value="PROFIL">
</form>
<td id="usernames">
<?php 
$query = mysql_query("select username from user where username='$username'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);
$username=$row['username'];
echo "<font id='font'>Hello,$username</font>";
?>
</td>
<td id="outBut">
<form action="logout.php">
<input type="submit" value="Logout" src="logout.php">
</form>
</td>
</form>
</td>
 </tr>
 </table>

</div>


<div id="utama">


<br>
<br>
<center><img src="profTitle.png"></center>
<br>
<br>

<?php 


$query = mysql_query("select firstname,lastname,address,town,country,postcode,email from user where username='$username'"); 
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);
$namaAwal=$row['firstname'];
$namaAkhir=$row['lastname'];
$alamat=$row['address'];
$kota=$row['town'];
$negara=$row['country'];
$kodePos=$row['postcode'];
$email=$row['email'];

echo "<b><br><font id='fontPHP'>Nama Awal</font></b><br>";
echo "<font id='fontPHP2'>$namaAwal</font><br>";
echo "<B><font id='fontPHP'>Nama Akhir</font> </b><br>";
echo "<font id='fontPHP2'>$namaAkhir<br>";
echo "<b><font id='fontPHP'>Alamat</font></b><br>";
echo "<font id='fontPHP2'>$alamat<br>";
echo "<b><font id='fontPHP'>Kota</font></b><br>";
echo "<font id='fontPHP2'>$kota<br>";
echo "<b><font id='fontPHP'>Negara</font></b><br>";
echo "<font id='fontPHP2'>$negara<br>";
echo "<b><font id='fontPHP'>Kode Pos</font></b><br>";
echo "<font id='fontPHP2'>$kodePos<br>";
echo "<b><font id='fontPHP'>Email</font></b><br>";
echo "<font id='fontPHP2'>$email</font><br>";

?>
<br>


<form action="edit.php" method="post">
<input type="submit" id="but" name="submit" value="Change Profil"></form>
</div>

</div>

<div id="footer">

</div>
</body>
</html>

logout

<?php
session_start();
{
session_destroy();
}
header("location:login.php");
?>

proses-login

<?php session_start();

include "konek.php"; 

$username=$_POST['user']; 
$password=$_POST['pass']; 
$query=mysql_query("select * from user where username='$username' and password='$password'"); 
$check=mysql_num_rows($query); 

if($check){ 
$_SESSION['username']=$username; 
$_SESSION['password']=$password; 

?>
Anda berhasil login. silahkan menuju <a href="home.php">Halaman HOME</a>
<?php 
}
else{ 
?>
Anda gagal login. silahkan <a href="login.php">Login kembali</a><?php 
echo mysql_error(); 
?> 


proses-loginAdmin

<?php session_start();

include "konek.php"; 

$username=$_POST['user']; 
$password=$_POST['pass']; 
$query=mysql_query("select * from admin where username='$username' and password='$password'"); 
$check=mysql_num_rows($query); 

if($check){ 
$_SESSION['username']=$username; 
$_SESSION['password']=$password; 

?>
Anda berhasil login. silahkan menuju <a href="home.php">Halaman HOME</a>
<?php 
}
else{ 
?>
Anda gagal login. silahkan <a href="logAdmin.php">Login kembali</a><?php 
echo mysql_error(); 
?> 

regAction

<?PHP
ob_start();
include "konek.php";
 
 $username=$_POST['username'];
 $password=$_POST['password'];
 $namaAwal=$_POST['firstname'];
 $namaAkhir=$_POST['lastname'];
 $alamat=$_POST['address'];
 $kota=$_POST['town'];
 $negara=$_POST['country'];
 $kodePos=$_POST['postcode'];
 $email=$_POST['email'];

$sql = "insert into user values('$username','$password','$namaAwal','$namaAkhir','$alamat','$kota','$negara','$kodePos','$email')";
$insert=mysql_query($sql);

header("location:login.php");
?>

register

<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<style>
#header1{background-color:#FFFFFF;font-size:45px;color:#95A5A6;width:100%;height:1px;}
#header2{background-color:#FFFFFF;padding:20px 0px 30px 0px;}
input[type="text"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="text"]:focus{border-color:#000000}
input[type="password"]{width:200px;height:20px;border-radius:2px;border-color:#999999;border-style:solid;}
input[type="password"]:focus{border-color:#000000}
input[type="submit"]{border:none;background-color:#2ABB9B;width:285px;height:40px;color:#FFFFFF;border-radius:2px;}
input[type="submit"]:hover{background-color:#2C3E50;transition:1s;}
body{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;}
</style>
<body>
<center>

<div id="header1"><center>REGISTER</center></div>


<div id="header2">
<center>
<form action="regAction.php" method="post" >

<table border="0" cellpadding="5" cellspacing="5">
<tr>

<tr>
<td width="150px">Username</td><td><input type="text" name="username" /></td><br />
</tr>
<tr>
<td>Password</td><td><input type="password" name="password"  /></td>
</tr>

<tr>
<td>Firstname</td><td><input type="text" name="firstname" /></td>
</tr>
<tr>
<td>Lastname</td><td><input type="text" name="lastname"  /></td>
</tr>
<tr>
<td>Address</td><td><input type="text" name="address" style="width:300px;height:90px;"></td>
</tr>
<tr>
<td>Town</td><td><input type="text" name="town"  /></td>
</tr>

<tr>
<td>Country</td><td><input type="text" name="country" /></td>
</tr>
<tr>
<td>Postcode</td><td><input type="text" name="postcode"  /></td>
</tr>
<tr>
<td>Email</td><td><input type="text" name="email"  /></td>
</tr>

<tr>

<td colspan="2"><center><input type="submit" name="submit" value="SUBMIT" /></center></td>
<br />
<br />

</tr>


</table>
</center>
</form>
</center>

</div>
</body>

</html>


session

<?php
session_start();
include("konek.php");
$username=$_SESSION['username'];
$password=$_SESSION['password'];

$query= mysql_query("select username,password,name from admin where username='$username' and password='$password'");
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);

if($num>0){
$username=$row['username'];
$password=$row['password'];
}


?>


sessionAdmin

<?php
session_start();
include("konek.php");
$kode_booking=$_SESSION['kode_booking'];
$time_booking=$_SESSION['time_booking'];

$query= mysql_query("select kode_booking,time_booking from booking where kode_booking='$kode_booking'");
$row= mysql_fetch_array($query);
$num = mysql_num_rows($query);

if($num>0){
$kode_booking=$row['kode'];
$time_booking=$row['waktu'];
}


?>

show


<?php

include "konek.php" ;

echo"<table border =1 width=100%>
<tr>
<td>Kode Plane</td>
<td>Plane</td>
<td>Plane</td>
<td>Departure - Arrived</td>
<td>Time</td>
</tr>
";
 $query = mysql_query("SELECT venue.venueName, venue.venueLocation,show.id_plane, show.departure_time, seat.seatname, show.id_show, show.arrived_time, FROM `show` INNER JOIN `venue` ON venue.id_venue = show.id_venue INNER JOIN `seat` ON seat.seatname = show.seatname LIKE venue.venueName LIKE '$venuename' AND venue.venueLocation LIKE '$venueLocation' AND show.departure_time LIKE'$departure_time%' AND show.arrived_time LIKE '$arrived_time%'";);
                        $jumlah = mysql_num_rows($query);
if($jumlah > 0)
                        {
                            while($data=mysql_fetch_array($query)) {
while($hasil= mysql_fetch_array($query_tampilkan)) 
{
"<tr>
<td>$hasil[id_show]</td>
<td>$hasil[showName]</td>
<td>$hasil[id_plane]</td>
<td>$hasil[id_venue]</td>
<td>$hasil[time_booking]</td>
<td><a href ='edit.php?nim=$hasil[NIM]'>Edit</a>  </td>
</tr>
";
}
echo"</tble>";
?>

</body>
</html>

showDaftar

<?php include"konek.php"; ?>
<table border="1">
<tr>
<td>Plane Code</td>
<td>Plane</td>
<td>Total seat</td>
<td>Venue Code</td>
<td>Departure</td>
<td>Arrived</td>
<td>Departure Time</td>
<td>Arrived Time</td>
</tr>
<?php 
$query="SELECT 
`show`.`id_plane`, 
`plane`.`plane`, 
`plane`.`seat`, 
`show`.`id_venue`,
`venue`.`venueName`,
`venue`.`venueLocation`,
`show`.`departure_time`,
`show`.`arrived_time`
FROM `show`
INNER JOIN `plane` ON `plane`.`id_plane` = `show`.`id_plane`
INNER JOIN `venue` ON `venue`.`id_venue` = `show`.`id_venue`";
$query_tampilkan=mysql_query($query);
while($row=mysql_fetch_array($query_tampilkan)){

echo "<tr>
<td>$row[0]</td>
<td>$row[1]</td>
   <td>$row[2]</td>
<td>$row[3]</td>
<td>$row[4]</td>
<td>$row[5]</td>
<td>$row[6]</td>
<td>$row[7]</td>

</tr>";
}
?>
</table>


show-jadwal

<style>
input[type="text"]{border-top:none;border-left:none;border-right:none;border-color:#333333}
select{border-top:none;border-right:none;border-left:none;border-color:#333333;border-bottom:10px}
</style>

<?php
include'konek.php';

?>
<form action="actionDate.php" method="post">

<select id="plane" name="id_plane">
<option disabled="disabled" selected="selected">Kode Plane...</option>
<?php $query = mysql_query("select*from plane"); 
$num = mysql_num_rows($query); 
while($row= mysql_fetch_array($query)){
?>
<option value="<?php $id_plane=$row[0]; echo $id_plane; ?>"> <?php $id_plane=$row[0]; echo $id_plane; ?> 
</option>
<input id="namaPlane" type="text" placeholder="Plane Name" readonly/>
<input id="seat" type="text" placeholder="Total Seat" readonly/>

<?php } ?>
</select>
<script src="js/jquery-2.1.1.min.js"></script>
<script>
$("#plane").change(function() {                

        $.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax.php?seat=&plane="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#seat").val(response);
          }
        });
$.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax.php?nama=&plane="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#namaPlane").val(response);
          }
        });
});
</script>
<select id="venue" name="id_venue">
<option disabled="disabled" selected="selected">Kode venue...</option>
<?php $query = mysql_query("select*from venue"); 
$num = mysql_num_rows($query); 
while($row= mysql_fetch_array($query)){
?>
<option value="<?php $id_venue=$row[0]; echo $id_venue; ?>"> <?php $id_plane=$row[0]; echo $id_venue; ?> 
</option>
<input id="venueName" type="text" placeholder="From" readonly/>
<input id="venueLocation" type="text" placeholder="To" readonly/>
<?php } ?>
</select>
<script src="js/jquery-2.1.1.min.js"></script>
<script>
$("#venue").change(function() {                

        $.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax.php?venueName=&venue="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#venueName").val(response);
          }
        });
$.ajax({    //create an ajax request to load_page.php
          type: "GET",
          url: "ajax.php?venueLocation=&venue="+$(this).val(), 
          dataType: "html",   //expect html to be returned                
          success: function(response){                    
            $("#venueLocation").val(response);
          }
        });
});

 </script>
 

<br />
<input type="datetime-local" name="departure_time" />    -    <input type="datetime-local" name="arrived_time" />
<select name="seatName">
<?php
 $query="SELECT *FROM seat";
 $query_tampilkan=mysql_query($query);
 while($result=mysql_fetch_array($query_tampilkan)){
 ?>
<option value="<?php $seatName=$result[0]; echo $seatName; ?>"><?php $seatName=$result[0]; echo $seatName; ?></option>
<?php } ?>
</select>
<input type="submit">
</form>

0 komentar:

Posting Komentar