<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Emp_Prod_Benchmark</title>
    <link rel="shortcut icon" href="images/Files_Download.png" type="image/x-icon"/>
    <!-- <link rel="stylesheet" href="style.css"> -->
</head>
<style>
    .split.bor{
            margin-left:5%;
            transition: 1s;  
        }
    #nav-toggle:checked ~ .split.bor
    {
        margin-left:20%;
        transition: 1s;
       
    }
</style>
<body>
    <?php
    include "Nav.php";
    include "Connection.php"; 
    if(isset($_POST['submit'])){
        $Project         = $_POST['Project'];
        // $Database       = $_POST['Database'];
        // $Server_ip       = $_POST['Server_ip'];
        // $username       = $_POST['Username'];
        // $password       = $_POST['Password'];
        date_default_timezone_set('Asia/Kolkata');
        $curdt =  date('Y-m-d h:i:s');

        // $Query = mysqli_query($con, "INSERT INTO epb_tbl (Project,`Database`,Server_ip,Username,`Password`,created_at) VALUES ('$Project','$Database',' $Server_ip','$username','$password','$curdt')");

        $Query = mysqli_query($con, "INSERT INTO epb_tbl (Project,created_at) VALUES ('$Project','$curdt')");
        
        if($Query){            
        //   echo "<script>alert('Record is successfully inserted!')</script>";
          ?>
          <script>
               
          swal("Record is successfully inserted",
                "....",
                   "success",
                   {
                      dangerMode: true,
                      buttons: false,
                      closeOnClickOutside: true,
                      timer:5000,
                            //       })
                            //       .then(function() {
                            // window.location = "Nav.php";
                         
                   });
       </script>
<?php
        }else{
        //   echo "<script>alert('Sorry an error occured!')</script>";?>
 <script>
               
               swal("Sorry an error occured",
                     "....",
                        "error",
                        {
                           dangerMode: true,
                           buttons: false,
                           closeOnClickOutside: true,
                           timer:5000,
                                 //       })
                                 //       .then(function() {
                                 // window.location = "Nav.php";
                                                      });
            </script>

          <?php
        }
        }

        ?>
 
    <br>
    <br><br><br>
<!-- content -->
<div class="container split bor">
    <div class="row">
        <div class="col-md-4">
        <form  role="form" method="POST" enctype="multipart/form-data" action="" onsubmit="return valid_details();">
        
            <div class="form-group">
<label class="col-lg-12 control-label"><b>Add Process:</b></label>
<div class="col-lg-12">
<input  type="text" class="form-control" name="Project" placeholder="Add Process Here" value="">
</div> </div>
<!-- <div class="form-group">
<label class="col-lg-6 control-label"><b>Add Database:</b></label>
<div class="col-lg-8">
<input type="text" class="form-control" name="Database" placeholder="Add Database" value="">
</div> </div>
<div class="form-group">
<label class="col-lg-6 control-label"><b>Add Server:</label>
<div class="col-lg-8">
<input type="text" class="form-control" name="Server_ip" placeholder="Add Server" value="">
</div> </div>
<div class="form-group">
<label class="col-lg-6 control-label"><b>Add Username:</b></label>
<div class="col-lg-8">
<input type="text" class="form-control" name="Username" placeholder="Username" value="">
</div> </div>
<div class="form-group">
<label class="col-lg-6 control-label"><b>Add Password:</b></label>
<div class="col-lg-8">
<input type="text" class="form-control" name="Password" placeholder="password" value="">
</div> </div> -->
        <!-- <div class="container" style="padding: left 60px;"> -->    
            
        </div>
        <div class="col-md-4">
    
        </div>
        
    </div>
    <button class="btn btn-success" type="submit" name="submit" style="border-radius:15px;">Submit</button> 
</form>
<br>
<br>
<div class="form">
<table  class="table table-bordered " id="" style="width:40%">
        <!-- <table id="example" class="table table-striped table-bordered table-sm" width="50%" cellspacing="0"> -->
 <thead>
      <tr>
      <th >Process Name</th>
      </tr>
  <thead>
 <tbody>
  <?php
$Show = mysqli_query($con, "SELECT * FROM epb_tbl");
while($r = mysqli_fetch_array($Show)): ?>
    <tr>
     <td ><?php echo $r['Project']; ?></td>
     <!-- <td><?php echo $r['Process'];?></td>
     <td><?php echo $r['Time']; ?></td> -->
    </tr>
    <?php endwhile; ?>
 </tbody>
 </table>
 </div>
 </body>
</html>