<?php
include('security.php');

include('includes/header.php');
include('includes/navbar.php');
?>

<div class="container-fluid">

<!-- DataTales Example -->
<div class="card shadow mb-4">
    <div class="card-header py-3">
        <h6 class="m-0 font-weight-bold text-primary"> EDIT Admin Profile </h6>
    </div>
    <div class="card-body">
<?php 

$connection = mysqli_connect("localhost","root","","mudidelivery");
        
    if(isset($_POST['edit_btn']))   
{
    $id = $_POST['edit_id'];
    
    $query = "SELECT * FROM users WHERE id='$id' ";
    $query_run = mysqli_query($connection, $query);   
    
    foreach($query_run as $row)
    {
        ?>
        
        <form action="code.php"method="POST">
        
        <input type="hidden" name="edit_id"  value="<?php echo $row['id'] ?>">
        <div class="form-group">
            <label>Package Type</label>
                <input type="text" name="edit_Package" value="<?php echo $row['Package']?>" class="form-control" >
                 </div>
        <div class="form-group">
            <label>Origin Service Area</label>
                <input type="text" name="edit_der" value="<?php echo $row['der']?>" class="form-control" >
                    </div>
                <div class="form-group">
                    <label>Destination Service Area</label>
                        <input type="text" name="edit_sarea" value="<?php echo $row['sarea']?>" class="form-control" >
                    </div>
                <div class="form-group">
            <label>Quantity Of Product</label>
                <input type="text" name="edit_quality" value="<?php echo $row['quality']?>" class="form-control" >
                 </div>
        <div class="form-group">
            <label>Weight of Product</label>
                <input type="text" name="edit_weigh" value="<?php echo $row['weigh']?>" class="form-control" >
                    </div>
                <div class="form-group">
                    <label>Item Type</label>
                        <input type="text" name="edit_itype" value="<?php echo $row['itype']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
            <label>Mode Of Transportation</label>
                <input type="text" name="edit_mode" value="<?php echo $row['mode']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
                    <label>Cognsignment</label>
                        <input type="text" name="edit_Cognsignment" value="<?php echo $row['Cognsignment']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
            <label>Estimated Time Of Arrival</label>
                <input type="text" name="edit_time" value="<?php echo $row['time']?>" class="form-control" >
                 </div>
                 
        <div class="form-group">
            <label>Receiver Name</label>
                <input type="text" name="edit_name" value="<?php echo $row['name']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
                    <label>Receiver Address</label>
                        <input type="text" name="edit_address" value="<?php echo $row['address']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
                    <label>Receiver Email</label>
                        <input type="email" name="edit_email" value="<?php echo $row['email']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
            <label>Receiver Phone Number</label>
                <input type="text" name="edit_phone" value="<?php echo $row['phone']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
                    <label>Sender Name</label>
                        <input type="text" name="edit_ame" value="<?php echo $row['ame']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
            <label>Sender Address</label>
                <input type="text" name="edit_saddress" value="<?php echo $row['saddress']?>" class="form-control" >
                 </div>
                 
        <div class="form-group">
            <label>Sender Phone Number</label>
                <input type="text" name="edit_sphone" value="<?php echo $row['sphone']?>" class="form-control" >
                    </div>
                    
                <div class="form-group">
                    <label>Sender Email</label>
                        <input type="email" name="edit_mail" value="<?php echo $row['mail']?>" class="form-control" >
                    </div>
                    <div class="form-group">
                    <label>Status</label>
                        <input type="text" name="edit_status" value="<?php echo $row['status']?>" class="form-control" >
                    </div>
                    <div class="form-group">
                    <label>Message</label>
                        <input type="text" name="edit_Message" value="<?php echo $row['Message']?>" class="form-control" >
                    </div>
                    <div class="form-group">
                    <label>In Transit At</label>
                        <input type="text" name="edit_transit" value="<?php echo $row['transit']?>" class="form-control" >
                    </div>
                    
                    
                    
                
                    
                    
        <a href="register.php" class="btn btn-danger" >CANCEL</a>
        <button  type="submit" name="updatebtn"class="btn btn-primary">Update</button>
        
        </form>
        
        <?php
    }
}
?>
                
    </div>     
    </div>
</div>    

</div>
<!-- /.container-fluid -->


<?php
include('includes/scripts.php');
include('includes/footer.php');
?>