Skip to content

Commit

Permalink
IDK
Browse files Browse the repository at this point in the history
  • Loading branch information
MFox committed Apr 22, 2017
1 parent 3044a9a commit 4297e16
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 41 deletions.
19 changes: 10 additions & 9 deletions Wello/www/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
WHERE Permit_Number = $Well_ID";
if ($result = $mysqli->query($query)) {
$row = $result->fetch_assoc();
foreach ($row as &$value) {
if ($value == ""){
$value == "Not Specified";
}
}
}
?>
<!doctype html>
Expand Down Expand Up @@ -58,20 +63,16 @@
<label for="well-completion-date">Date well completed</label>
<?php
$W_Completion_Date = date("m/d/Y", strtotime($row['Date_Well_Completed']));
echo'<input type="date" id="well-completion-date" value="'.$W_Completion_Date.'">';
echo'<input id="well-completion-date" value="'.$W_Completion_Date.'">';
?>
</li>


<?php
//Should add ternary operator for nulls and blanks
$W_Completion_Date = date("m/d/Y", strtotime($row['Date_Well_Completed']));
echo'<p id="well-completion-date">'.$W_Completion_Date.'</p>';
?>

<li>
<label for="report-completion-date">Date of report</label>
<input type="date" id="report-completion-date">
<?php
$R_Completion_Date = date("m/d/Y", strtotime($row['Date_of_Report']));
echo'<input id="report-completion-date" value="'.$W_Completion_Date.'">';
?>
</li>

<li>
Expand Down
2 changes: 1 addition & 1 deletion Wello/www/map.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

<script>

function initMap() {
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(41.79947, -72.37209),
zoom: 12
Expand Down
74 changes: 45 additions & 29 deletions Wello/www/search.html → Wello/www/search.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<?php
$mysqli = new mysqli("localhost", "db10e41481317066", "jXLUjNG/cQxm4VJ1SionhDKdcT4BT1Dos7sZMddIapa/8LYDpDNz+3hwGCz8Shon", "db10e41481317066");
?>
<!doctype html>
<html class="no-js" lang="">

Expand All @@ -17,47 +20,60 @@
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>






<?php
if (isset($_GET['search_query'])) {
$Search = '%' . $_GET['search_query'] . '%';
$query = "SELECT CONCAT(Well_Street_Number, ' ', Well_Street_Name) AS 'WellAddress', Well_Town, Permit_Number
FROM well_completion_report
WHERE Well_Town LIKE '$Search'
OR Permit_Number LIKE '$Search'
OR CONCAT(Well_Street_Number, ' ', Well_Street_Name) LIKE '$Search'
LIMIT 500";
}
else{
$query = "SELECT CONCAT(Well_Street_Number, ' ', Well_Street_Name) AS 'WellAddress', Well_Town, Permit_Number
FROM well_completion_report
LIMIT 50";
}
?>

<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->







<nav class="top-nav search">
<input type="search" >
<form action="search.php?<? $_GET['search_query'] ?>" method="GET">
<input type="search" name="search_query">
</form>
<button><a href="map.php"><img src="img/close.svg" alt="close" /></a></button>
</nav>

<main class="search">
<a href="details.php" class="search-result clearfix">
<div class="well-card clearfix">
<div class="well-img"></div>
<div>
<h2>Well Name</h2>
<p>short well description</p>
</div>
</div>
</a>
<?php
if ($result = $mysqli->query($query)) {
/* fetch associative array */
while ($row = $result->fetch_assoc()) {
echo'
<a href="details.php?Well_ID='.$row["Permit_Number"].'">
<div class="well-card clearfix">
<div class="well-img"></div>
<div>
<h2>'.$row["WellAddress"].'</h2>
<h2>'.$row["Well_Town"].'</h2>
<p>Permit Number: '.$row["Permit_Number"].'</p>
</div>
</div>
</a>';
}

/* free result set */
$result->free();
}
?>
</main>









<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')
Expand Down
5 changes: 3 additions & 2 deletions Wello/www/wells-list.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
$mysqli = new mysqli("localhost", "db10e41481317066", "jXLUjNG/cQxm4VJ1SionhDKdcT4BT1Dos7sZMddIapa/8LYDpDNz+3hwGCz8Shon", "db10e41481317066");
<?php
require 'cred.php';
$mysqli = new mysqli("localhost", $username, $password, $database);

/* check connection */
if ($mysqli->connect_errno) {
Expand Down

0 comments on commit 4297e16

Please sign in to comment.