<?php 
session_start();
include_once('./sidemenu.php');
?>
<!DOCTYPE html>
<html lang="en">

<head>
    <title>Gent World Esxpress</title>
    <link rel="shortcut icon" type="image/x-icon" href="assets/img/logo.png">
    <link type="text/css" href="css/dashboard.css" rel="stylesheet">
    <link href="css/styles.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link
        href="https://fonts.googleapis.com/css2?family=Jacquard+12+Charted&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap"
        rel="stylesheet">
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">

</head>
<style>
body {
    font-family: "Nunito", sans-serif;
}
</style>

<style>
table {
    border-collapse: collapse;
    width: 100%;
}

tr,
td,
th {

    background-color: green;
    color: #fff;
    padding: 10px;


}

td:hover {
    color: black;
}
</style>

<style>
span.lon {
    color: black;
    font-family: "Nunito", sans-serif;
}

span.lon:hover {
    color: #669999;
}
</style>

<body>
    <section class="sticky-top" style="margin:0;box-shadow: 0 1px 2px rgb(0 0 0 / 15%);background:#00004d;">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12" style="margin:0;">
                    <?=mynavbar()?>
                </div>
            </div>
        </div>
    </section>

    <section>
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-1" style="padding:0;background:#EBEAEA;">
                    <?=sidemenu()?>
                </div>
                <div class="col-md-11">
                    <div id="Sign-In" align="center">
                        <?php
include 'connection.php';
if(isset($_GET['updatesubmit']))
{

$ID=$_GET['Cou_ID'];
$Name=$_GET['Name'];
$add_1=$_GET['Sender'];
$add_2=$_GET['Sender_Address'];
$add_3=$_GET['Sender_Email'];
$add_4=$_GET['Sender_Number'];
$add_5=$_GET['Receiver'];
$add_6=$_GET['Receiver_Address'];
$add_7=$_GET['Receiver_Email'];
$add_8=$_GET['Receiver_Number'];
$add_9=$_GET['Name_Item'];
$add_10=$_GET['List_Item'];
$add_11=$_GET['Color_Item'];
$add_12=$_GET['Weight'];
$add_13=$_GET['Sent'];
$add_14=$_GET['Delivery'];
$add_15=$_GET['Amount'];
$add_16=$_GET['Bill'];
$add_17=$_GET['Movement'];
$add_18=$_GET['Dispatched'];
$add_19=$_GET['Arrive'];
$add_20=$_GET['Departs'];
$add_21=$_GET['Transit'];
$add_22=$_GET['Depart_Transit'];
$add_23=$_GET['Arrived'];
$add_24=$_GET['Type'];
$add_25=$_GET['Status'];
$add_26=$_GET['Sender_Current'];
$add_27=$_GET['Destination'];
$add_28=$_GET['Country'];
$add_29=$_GET['Sender_Amount'];
$add_30=$_GET['Current'];




$sql="update dunees set Name='$Name',Sender='$add_1',Sender_Address='$add_2',Sender_Email='$add_3',Sender_Number='$add_4',Receiver='$add_5',Receiver_Address='$add_6',Receiver_Email='$add_7',Receiver_Number='$add_8',Name_Item='$add_9',List_Item='$add_10',Color_Item='$add_11',Weight='$add_12',Sent='$add_13',Delivery='$add_14',Amount='$add_15',Bill='$add_16',Movement='$add_17',Dispatched='$add_18', Arrive='$add_19',Departs='$add_20',Transit='$add_21',Depart_Transit='$add_22',Arrived='$add_23',Type='$add_24',Status='$add_25',Sender_Current='$add_26',Destination='$add_27',Country='$add_28',Sender_Amount='$add_29',Current='$add_30' WHERE Cou_ID=$ID";

if($conn->query($sql))
{
	header('Location:tracking-details.php');
	
}
echo "Your Details Has Been Updated. Thank You.";
}

?>


                        <?php
if(isset($_GET['update']))
{
	$ID=$_GET['update'];
$sql="select * from dunees WHERE Cou_ID=$ID";
$row=$conn->query($sql);
if($row->num_rows>0)
{
	while($data=$row->fetch_assoc())
	{
		?>
                        <form action="update.php">

                            <div class="controls">
                                <p style>Tracking Information</p>
                                <div class="row">
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label for="form_name">Way Bill Number *</label>
                                            <input id="form_name" type="text" name="Bill"
                                                value="<?php  echo $data['Bill'];?>">
                                        </div>
                                    </div>
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label for="form_name">Tracking Number*</label>
                                            <input id="form_name" type="text" name="Cour_No"
                                                value="<?php  echo $data['Cour_No'];?>">
                                        </div>
                                    </div>
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label for="form_name">Name of Diplomat*</label>
                                            <input id="form_name" type="text" name="Name"
                                                value="<?php  echo $data['Name'];?>">
                                        </div>
                                    </div>

                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label for="form_name">Currency Paid By Sender*</label>
                                            <input id="form_name" type="text" name="Sender_Current"
                                                value="<?php  echo $data['Sender_Current'];?>">
                                        </div>
                                    </div>


                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label for="form_name">Amount Paid By Sender*</label>
                                            <input id="form_name" type="text" name="Sender_Amount"
                                                value="<?php  echo $data['Sender_Amount'];?>">
                                        </div>
                                    </div>

                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <input type="hidden" name="Cou_ID" value="<?php  echo $data['Cou_ID'];?>">
                                    </div>
                                </div>
                            </div>
                            <hr class="new3">
                            <button type="button" class="btn btn-primary">Sender Information</button><br><br>
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Sender Name *</label>
                                        <input id="form_name" type="text" name="Sender"
                                            value="<?php  echo $data['Sender'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Sender Email *</label>
                                        <input id="form_name" type="text" name="Sender_Email"
                                            value="<?php  echo $data['Sender_Email'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Sender Number *</label>
                                        <input id="form_name" type="text" name="Sender_Number"
                                            value="<?php  echo $data['Sender_Number'];?>">

                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Country Of Sender*</label>
                                        <input id="form_name" type="text" name="Country"
                                            value="<?php  echo $data['Country'];?>">

                                    </div>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="Address">Sender Address *</label>
                                        <input id="addess" type="text" name="Sender_Address"
                                            value="<?php  echo $data['Sender_Address'];?>" style="width:900px">

                                    </div>
                                </div>
                            </div>




                            <hr class="new3">
                            <button type="button" class="btn btn-primary">Receiver Information</button><br><br>
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Receiver Name *</label>
                                        <input id="form_name" type="text" name="Receiver"
                                            value="<?php  echo $data['Receiver'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Receiver Email *</label>
                                        <input id="form_name" type="text" name="Receiver_Email"
                                            value="<?php  echo $data['Receiver_Email'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Receiver Number *</label>
                                        <input id="form_name" type="text" name="Receiver_Number"
                                            value="<?php  echo $data['Receiver_Number'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Destination Country of Receiver *</label>
                                        <input id="form_name" type="text" name="Destination"
                                            value="<?php  echo $data['Destination'];?>">

                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_email">Receiver Address *</label>
                                        <input id="form_email" type="text" name="Receiver_Address"
                                            value="<?php  echo $data['Receiver_Address'];?>" style="width:900px">
                                    </div>
                                </div>
                            </div>

                            <hr class="new3">
                            <button type="button" class="btn btn-primary">Other Information</button><br><br>
                            <div class="row">
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label for="form_need">Type of Item*</label>
                                        <input id="form_email" type="text" name="Name_Item"
                                            value="<?php  echo $data['Name_Item'];?>">
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Color of Item *</label>
                                        <input id="form_name" type="text" name="Color_Item"
                                            value="<?php  echo $data['Color_Item'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Number of Items *</label>
                                        <input id="form_name" type="text" name="List_Item"
                                            value="<?php  echo $data['List_Item'];?>">

                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label for="form_name">Departure Date *</label><br>
                                        <input type="date" id="birthday" name="Sent"
                                            value="<?php  echo $data['Sent'];?>">
                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label for="form_name">Arrival Date *</label><br>
                                        <input type="date" id="birthday" name="Delivery"
                                            value="<?php  echo $data['Delivery'];?>">

                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label for="form_name">Weight*</label><br>
                                        <input id="form_name" type="text" name="Weight"
                                            value="<?php  echo $data['Weight'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_need">Type of Charges*</label>
                                        <input id="form_name" type="text" name="Type"
                                            value="<?php  echo $data['Type'];?>">

                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label for="form_name">Currency To Be Paid*</label>
                                        <input id="form_name" type="text" name="Current"
                                            value="<?php  echo $data['Current'];?>">

                                    </div>
                                </div>
                                <div class="col-md-2">
                                    <div class="form-group">
                                        <label for="form_name">Amount To Be Paid*</label>
                                        <input id="form_name" type="text" name="Amount"
                                            value="<?php  echo $data['Amount'];?>">

                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label for="form_name">Payment Status *</label>
                                        <input id="form_name" type="text" name="Status"
                                            value="<?php  echo $data['Status'];?>">
                                    </div>
                                </div>
                            </div>
                            <hr class="new3">
                            <button type="button" class="btn btn-primary">Movement of Consignment /
                                Parcel</button><br><br>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_name">Dispatched At</label>
                                        <input id="form_name" type="text" name="Dispatched" style="width:800px"
                                            value="<?php  echo $data['Dispatched'];?>">

                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_name">Arrives At</label>
                                        <input id="form_name" type="text" name="Arrive" style="width:800px"
                                            value="<?php  echo $data['Arrive'];?>">

                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_name">Departs</label>
                                        <input id="form_name" type="text" name="Departs" style="width:800px"
                                            value="<?php  echo $data['Departs'];?>">

                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_name">On Transit</label>
                                        <input id="form_name" type="text" name="Transit" style="width:800px"
                                            value="<?php  echo $data['Transit'];?>">

                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_name">Departs From Transit</label>
                                        <input id="form_name" type="text" name="Depart_Transit" style="width:800px"
                                            value="<?php  echo $data['Depart_Transit'];?>">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_name">Arrives</label>
                                        <input id="form_name" type="text" name="Arrived" style="width:800px"
                                            value="<?php  echo $data['Arrived'];?>">

                                    </div>
                                </div>
                            </div>
                            <hr class="new3">
                            <button type="button" class="btn btn-primary">Remarks</button><br><br>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label for="form_name">Payments / Remarks *</label>
                                        <input id="form_name" type="text" name="Movement" style="width:800px"
                                            value="<?php  echo $data['Movement'];?>">

                                    </div>
                                </div>
                            </div>
                            <div class="submit"><input name="updatesubmit" value="UPDATE INFORMATION DETAILS"
                                    onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$SUBMIT", "", true, "chk", "", false, false))'
                                    id="ctl00_ContentPlaceHolder1=SUBMIT" class="btn btn-block bg-default btn-flat "
                                    style="width:500px; color:#fff;  margin-bottom:30px; background:#D4090C; "
                                    type="submit">
                            </div>

                    </div>
                    <?php
		
		
	}
}
	
}

?>
                </div>
            </div>
    </section>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
    <script>
    document.getElementsByClassName('list-group-item')[2].style.backgroundColor = "#046469";
    document.getElementsByClassName('menu-list')[2].style.color = "#fff";
    </script>
</body>