Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Wello/Wello/www/admin.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
119 lines (98 sloc)
3.92 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'cred.php'; | |
$mysqli = new mysqli("localhost", $username, $password, $database); | |
/* check connection */ | |
if ($mysqli->connect_errno) { | |
printf("Connect failed: %s\n", $mysqli->connect_error); | |
exit(); | |
} | |
function moveWell() { | |
$PermitNumber = $mysqli->real_escape_string(trim($_GET['move'])); | |
$copyquery = "INSERT INTO well_completion_report SELECT * FROM well_pending WHERE Permit_Number = '".$PermitNumber."'"; | |
$mysqli->query($copyquery); | |
$deletequery = "DELETE FROM well_pending WHERE Permit_Number = '".$PermitNumber."'"; | |
$mysqli->query($deletequery); | |
} | |
if (isset($_GET['move'])) { | |
moveWell(); | |
} | |
$query = "SELECT CONCAT(Well_Street_Number, ' ', Well_Street_Name) AS 'WellAddress', Well_Town, Permit_Number | |
FROM well_pending | |
LIMIT 10"; | |
?> | |
<!doctype html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="apple-touch-icon" href="apple-touch-icon.png"> | |
<!-- Place favicon.ico in the root directory --> | |
<link rel="stylesheet" href="css/normalize.css"> | |
<link rel="stylesheet" href="css/main.css"> | |
<link rel="stylesheet" href="css/well-card.css"> | |
<link rel="stylesheet" href="css/map-desktop.css"> | |
<link rel="stylesheet" href="css/desktop.css"> | |
<script src="js/vendor/modernizr-2.8.3.min.js"></script> | |
</head> | |
<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 --> | |
<main class="list admin"> | |
<h1 class="title">Pending Wells</h1> | |
<?php | |
if ($result = $mysqli->query($query)) { | |
/* fetch associative array */ | |
while ($row = $result->fetch_assoc()) { | |
echo' | |
<div class="pending"> | |
<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> | |
<div class="actions"> | |
<a href="http://wellreportapp.uconn.edu/admin.php?move='.$row["Permit_Number"].'">Approve</a> | |
<a href="http://wellreportapp.uconn.edu/form.php?Admin=1?Well_ID='.$row["Permit_Number"].'">Edit</a> | |
</div> | |
</div> | |
'; | |
} | |
/* 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>') | |
</script> | |
<script src="js/plugins.js"></script> | |
<script src="js/main.js"></script> | |
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> | |
<script> | |
(function (b, o, i, l, e, r) { | |
b.GoogleAnalyticsObject = l; | |
b[l] || (b[l] = function () { | |
(b[l].q = b[l].q || []).push(arguments) | |
}); | |
b[l].l = +new Date; | |
e = o.createElement(i); | |
r = o.getElementsByTagName(i)[0]; | |
e.src = 'https://www.google-analytics.com/analytics.js'; | |
r.parentNode.insertBefore(e, r) | |
}(window, document, 'script', 'ga')); | |
ga('create', 'UA-XXXXX-X', 'auto'); | |
ga('send', 'pageview'); | |
</script> | |
</body> | |
</html> |