<?php 
include "koneksi.php";
//if (!isset($_SESSION["UserID"]))
//{
	//header("location:login.php?p=3");
//}
//required
?>
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="style.css">
<html>
  <head>
	<title> PT MULTI HYDRACHROM BALIKPAPAN </title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<?php
		include "part/jss.php";
	?>
  </head>
  <body>
	
<div style="width:1280px; height:100px" class="container">
	
			<div class="alert alert-info" style='background-color:#F8F8FF' href="#">
            <div style="display: block; margin-left: auto; margin-right: auto; width: 1000px;  height:100px;"><img style="width: 1000px;  height:180px;" src="images/hd.jpg"></div>
            <div>
                <center>
                    <h1>PT. MULTI HIDRACHROM BALIKPAPAN</h1>
                </center>
            </div>
            <div>
                <center>
                    <h4>PROFESIONAL INFORMATION SYSTEM</h4>
                </center>
            </div>
        </div>
					
					<?php
						include "part/menu.php";
					?>
			
			
		<div class="alert alert-info" align='center'>
				<center><h2>REGISTRASI</h2></center>
			 <h4></h4>
			 <form method="POST" action="prosesregis.php">
			 
		<?php
		if (isset($_GET["p"]))
		{
			$p=$_GET["p"];
			if ($p=="1")
			{
			   ?>
				<div class="alert alert-warning">
					Username dan password harus terisi semua!
				</div>
				<?php
			}
		}
		if (isset($_GET["p"]))
		{
			$p=$_GET["p"];
			if ($p=="2")
			{
			   ?>
				<div class="alert alert-warning">
					password harus terisi!
				</div>
				<?php
			}
		}
        if (isset($_GET["error"]))
        {
         ?>
            <div class="alert alert-warning" role="alert">
            <?php
           echo $_GET["error"];
            ?>
          </div>
         <?php
        }
        else if (isset($_GET["berhasil"]))
        {
         ?>
            <div class="alert alert-success" role="alert">
            <?php
           echo $_GET["berhasil"];
            ?>
          </div>
         <?php
        }
       ?>
			 
			 <table border=0 align="center" cellpadding=5 cellspacing=0>
				  <tr>
				    <td>
						<label for="exampleInputPassword1">Username</label>
					</td>
					<td>
						<input type="text" class="form-control" name="username1" id="username2" placeholder="">
					</td>
				  </tr>
				  <tr>
				    <td>
						<label for="exampleInputPassword1">Password </label>
					</td>
					<td>
						<input type="password" class="form-control" name="password1" id="password2" placeholder="">
					</td>
				  </tr>
				   <tr>
				    <td>
						<label for="exampleInputPassword1">Jenis User</label>
					</td>
					<td>
						<select name="jenisuser1" id="jenis" class="form-control">
						<?php
							$q="SELECT * FROM jenis_user WHERE id !='1'";
							$res=mysqli_query($conn,$q);
							while ($row=mysqli_fetch_assoc($res))
							{
								?>
								  <option value="<?php echo $row["id"];?>">
									<?php
									if ($row["nama"])
										echo $row["nama"];
									?>
								  </option>
								<?php
							}
						?>
					</select>
					</td>
				  </tr>
				  <tr id="calamat" style="display:none">
				    <td>
						 <label style="align-center" for="exampleInputPassword1">Alamat</label>
					</td>
					<td>
						<textarea placeholder="Contoh : Surabaya, Tenggilis Mejoyo Blok Kc1" name="alamat"></textarea>
					</td>
				  </tr>
				  <tr id="cnamabengkel" style="display:none">
				    <td>
						 <label  for="exampleInputPassword1">Nama Bengkel</label>
					</td>
					<td>
						 <textarea placeholder="Motor Tri" name="namabengkel"></textarea>
					</td>
				  </tr>
				  <tr>
				    <td></td>
					<td>
						 <button type="submit" class="btn btn-primary">OK</button> | <a href="index.html"><button type="button" class="btn btn-info">Kembali</button></a> 
					</td>
				  </tr>
				 
				 
				</table>
			</form>
		</div>		
	</div>
	
  
  </body>
  
  <script>
    $(document).ready(function()
	{
		$("#jenis").change(function()
		{
			$("#calamat").hide();
			var val=$("#jenis").val();
			if (val=="3")
			{
				$("#calamat").show();
			}
		});
	});
  </script>
  <script>
    $(document).ready(function()
	{
		$("#jenis").change(function()
		{
			$("#cnamabengkel").hide();
			var val=$("#jenis").val();
			if (val=="3")
			{
				$("#cnamabengkel").show();
			}
		});
	});
  </script>
</html>



