bantu aku kerrjakan tugas reservation meeting room ku nah ..sudah PUSING NI

<?php
session_start();

$username = $_SESSION['username'];

if($username == null){
    echo "<meta http-equiv='refresh' content='0;url=/web/index.php'>";
}
include "konek.php";
extract($_GET);
extract($_POST);


if( $User_Name == "" || $Password == "" || $Address == "" || $Email == "" || $role == "") {

}else{
    if (isset($simpan)){
        $sql="INSERT INTO `user`(`user_ID`,`User_Name`,`Password`,`Address`,`Email`,`department`,`role`)
        VALUES('$user_ID','$User_Name','$Password','$Address','$Email','$department_name','$role')";
      
        $query=mysql_query($sql);
        //input berhasil
        if($query) echo "<meta http-equiv='refresh' content='0;url=http://localhost/web/tampil_user.php'>";
        else echo "<meta http-equiv='refresh' content='0;url=http://localhost/web/create_user.php'>";  
        exit;
    }
}
?>
<!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>Create Meeting Schedule</title>
<style type="text/css">
<!--
.unnamed1 {
    border: 0.5px ridge;
}
-->
</style>
</head>
<body background="new.JPG">
<form name="form1" method="post" action="">
  <font face="Maiandra GD">Please fill in data below if You want to create a new
  Meeting Schedule</font>
<div style="border: 3px ridge black;">
  <table width="42%" height="214" border="0" align="center" class="unnamed1">
    <tr>
      <td height="24">User ID</td>
      <td width="15%"><input name="user_ID" type="text" id="user_ID2" readonly = "true"/></td>
    </tr>
    <tr>
      <td height="24">User Name</td>
      <td><input name="User_Name" type="text" id="User_Name" /></td>
    </tr>
    <tr>
      <td height="24">Password</td>
      <td><input name="Password" type="password" id="Password" /></td>
    </tr>
    <tr>
      <td height="24">Address</td>
      <td><input name="Address" type="text" id="Address" /></td>
    </tr>
    <tr>
      <td height="24">Email</td>
      <td><input name="Email" type="text" id="Email" /></td>
    </tr>
  
    <td height="26">Department</td>
        <td><select id="select" name="department_name"onchange="department_name.php">
            <option value="$sis[0]" selected="$sis[1]"></option>
            <?php
                $query_limit=mysql_query("select * from department");
                while($row=mysql_fetch_array($query_limit))
                {
            ?>
            <option value="
                <?php  echo $row['department_id']; ?>">
            <?php
                echo $row['department_name']; ?>
            </option>
            <?php
                }
                ?>
          </select> </td>
    </tr>
    <tr>
      <td height="26">Role</td>
      <td><select id="select2" name="role">
          <option value="1" id="admin">Admin</option>
          <option value="2" id="user">User</option>
        </select></td>
    </tr>
    <tr>
      <td height="26">&nbsp;</td>
      <td><input name="simpan" type="submit" id="SIMPAN" value="Save" /></td>
    </tr>
  </table>
  <font color="#000000"> </font><font color="#000000"> </font>
</form>
</body>
</html>

Rabu, 30 Maret 2011

bantu aku kerrjakan tugas reservation meeting room ku nah ..sudah PUSING NI

Diposting oleh dinaseuta di 18.21
<?php
session_start();

$username = $_SESSION['username'];

if($username == null){
    echo "<meta http-equiv='refresh' content='0;url=/web/index.php'>";
}
include "konek.php";
extract($_GET);
extract($_POST);


if( $User_Name == "" || $Password == "" || $Address == "" || $Email == "" || $role == "") {

}else{
    if (isset($simpan)){
        $sql="INSERT INTO `user`(`user_ID`,`User_Name`,`Password`,`Address`,`Email`,`department`,`role`)
        VALUES('$user_ID','$User_Name','$Password','$Address','$Email','$department_name','$role')";
      
        $query=mysql_query($sql);
        //input berhasil
        if($query) echo "<meta http-equiv='refresh' content='0;url=http://localhost/web/tampil_user.php'>";
        else echo "<meta http-equiv='refresh' content='0;url=http://localhost/web/create_user.php'>";  
        exit;
    }
}
?>
<!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>Create Meeting Schedule</title>
<style type="text/css">
<!--
.unnamed1 {
    border: 0.5px ridge;
}
-->
</style>
</head>
<body background="new.JPG">
<form name="form1" method="post" action="">
  <font face="Maiandra GD">Please fill in data below if You want to create a new
  Meeting Schedule</font>
<div style="border: 3px ridge black;">
  <table width="42%" height="214" border="0" align="center" class="unnamed1">
    <tr>
      <td height="24">User ID</td>
      <td width="15%"><input name="user_ID" type="text" id="user_ID2" readonly = "true"/></td>
    </tr>
    <tr>
      <td height="24">User Name</td>
      <td><input name="User_Name" type="text" id="User_Name" /></td>
    </tr>
    <tr>
      <td height="24">Password</td>
      <td><input name="Password" type="password" id="Password" /></td>
    </tr>
    <tr>
      <td height="24">Address</td>
      <td><input name="Address" type="text" id="Address" /></td>
    </tr>
    <tr>
      <td height="24">Email</td>
      <td><input name="Email" type="text" id="Email" /></td>
    </tr>
  
    <td height="26">Department</td>
        <td><select id="select" name="department_name"onchange="department_name.php">
            <option value="$sis[0]" selected="$sis[1]"></option>
            <?php
                $query_limit=mysql_query("select * from department");
                while($row=mysql_fetch_array($query_limit))
                {
            ?>
            <option value="
                <?php  echo $row['department_id']; ?>">
            <?php
                echo $row['department_name']; ?>
            </option>
            <?php
                }
                ?>
          </select> </td>
    </tr>
    <tr>
      <td height="26">Role</td>
      <td><select id="select2" name="role">
          <option value="1" id="admin">Admin</option>
          <option value="2" id="user">User</option>
        </select></td>
    </tr>
    <tr>
      <td height="26">&nbsp;</td>
      <td><input name="simpan" type="submit" id="SIMPAN" value="Save" /></td>
    </tr>
  </table>
  <font color="#000000"> </font><font color="#000000"> </font>
</form>
</body>
</html>