Files
dev-chiefworks f76abffdcd first commit
2022-05-31 16:21:53 -04:00

97 lines
3.4 KiB
PHP

<?php
$message = "";
$start_addr = "4198 Defoors Farm Dr, Powder Springs, GA 30127, USA";
$end_addr = "3500 Riverwood Pkwy, Atlanta, GA 30339, USA";
//
if (isset($_POST) && !empty($_POST['start_addr'])) {
//$message = "post was detected";
$start_addr = GetPostVar("start_addr");
$end_addr = GetPostVar("end_addr");
// you can attach your calls here
$message = "Recieved<br>" . $start_addr . "<br>" . $end_addr;
}
//print_r($_POST);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>YellowCab Test</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.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.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="jumbotron text-center">
<h1>Yellow Cab Unit Test</h1>
<p>Some details about the test here!</p>
</div>
<div class="container">
<div class="row">
<div class="col-sm-4">
<h3>Technical Description</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
<div class="col-sm-8">
<h3>Find Ride</h3>
<form method='post' action="#">
<table class="table table-striped">
<tbody>
<tr>
<th scope="row">Start</th>
<td>
<input type="text" class="form-control" name="start_addr" value="<?= $start_addr ?>" placeholder="Enter Start Address" aria-label="Enter Start Address" aria-describedby="basic-addon2" >
</td>
</tr>
<tr>
<th scope="row">End</th>
<td>
<input type="text" class="form-control" name="end_addr" value="<?= $end_addr ?>" placeholder="Enter End Address" aria-label="Enter End Address" aria-describedby="basic-addon2">
</td>
</tr>
<tr>
<th scope="row"></th>
<td style="text-align: right;"><button type="submit" name="foo" class="btn btn-info">Submit</button></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div class="row">
<?= $message ?>
</div>
</div>
</body>
</html>
<?php
function GetPostVar($name, $sDefault = "") {
global $_GET, $_POST;
return (isset($_POST[$name])) ? strip_tags($_POST[$name]) : ((isset($_GET[$name])) ? strip_tags($_GET[$name]) : $sDefault);
}
?>