V27
This commit is contained in:
parent
acff14d6dc
commit
2d8abe32bb
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
node_modules/
|
||||
*/node_modules/
|
||||
*/build/
|
||||
includes/api_keys.php
|
||||
28
about.php
Normal file
28
about.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
require_once 'header.php';
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT * FROM pages WHERE page_key = :page_key");
|
||||
$stmt->bindValue(':page_key', 'about_us');
|
||||
$stmt->execute();
|
||||
$page = $stmt->fetch();
|
||||
|
||||
?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 offset-lg-2">
|
||||
<?php if ($page): ?>
|
||||
<?php echo $page['content']; ?>
|
||||
<?php else: ?>
|
||||
<h1 class="text-center mb-4">About Us</h1>
|
||||
<p class="lead">Content not found. Please set up the 'About Us' page in the admin dashboard.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once 'footer.php';
|
||||
?>
|
||||
@ -48,6 +48,12 @@ if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== tru
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="system_events.php">System Events</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="pages.php">Pages</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="required_documents.php">Required Documents</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
|
||||
@ -156,17 +156,36 @@ $restaurants = $stmt_restaurants->fetchAll();
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Cuisine</th>
|
||||
<th>Location Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($restaurants as $restaurant): ?>
|
||||
<?php
|
||||
$stmt_restaurants = $pdo->query("SELECT id, name, cuisine, location_status FROM restaurants ORDER BY name");
|
||||
$restaurants = $stmt_restaurants->fetchAll();
|
||||
foreach ($restaurants as $restaurant): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($restaurant['name']); ?></td>
|
||||
<td><?php echo htmlspecialchars($restaurant['cuisine']); ?></td>
|
||||
<td>
|
||||
<a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>" class="btn btn-info btn-sm">Manage Menu</a>
|
||||
<?php
|
||||
$status = $restaurant['location_status'];
|
||||
$badge_class = 'badge bg-secondary';
|
||||
if ($status == 'approved') {
|
||||
$badge_class = 'badge bg-success';
|
||||
} elseif ($status == 'rejected') {
|
||||
$badge_class = 'badge bg-danger';
|
||||
}
|
||||
?>
|
||||
<span class="<?php echo $badge_class; ?>"><?php echo htmlspecialchars(ucfirst($status)); ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="edit_restaurant.php?id=<?php echo $restaurant['id']; ?>" class="btn btn-primary btn-sm">Edit</a>
|
||||
<?php if ($status == 'pending_approval'): ?>
|
||||
<a href="update_location_status.php?id=<?php echo $restaurant['id']; ?>&status=approved" class="btn btn-success btn-sm">Approve</a>
|
||||
<a href="update_location_status.php?id=<?php echo $restaurant['id']; ?>&status=rejected" class="btn btn-warning btn-sm">Reject</a>
|
||||
<?php endif; ?>
|
||||
<a href="delete_restaurant.php?id=<?php echo $restaurant['id']; ?>" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete this restaurant?');">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
55
admin/pages.php
Normal file
55
admin/pages.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../db/config.php';
|
||||
require_once 'header.php';
|
||||
|
||||
$db = db();
|
||||
$message = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['pages']) && is_array($_POST['pages'])) {
|
||||
foreach ($_POST['pages'] as $page_id => $page_data) {
|
||||
$title = $page_data['title'] ?? '';
|
||||
$content = $page_data['content'] ?? '';
|
||||
|
||||
$stmt = $db->prepare("UPDATE pages SET page_title = :title, content = :content WHERE id = :id");
|
||||
$stmt->bindValue(':title', $title);
|
||||
$stmt->bindValue(':content', $content);
|
||||
$stmt->bindValue(':id', $page_id, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
}
|
||||
$message = '<div class="alert alert-success">Pages updated successfully!</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = $db->query("SELECT * FROM pages ORDER BY id");
|
||||
$pages = $stmt->fetchAll();
|
||||
|
||||
?>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h1 class="h3 mb-4 text-gray-800">Manage Pages</h1>
|
||||
<?php echo $message; ?>
|
||||
<form method="POST" action="pages.php">
|
||||
<?php foreach ($pages as $page): ?>
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Edit <?php echo htmlspecialchars($page['page_title']); ?></h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<input type="hidden" name="pages[<?php echo $page['id']; ?>][id]" value="<?php echo $page['id']; ?>">
|
||||
<div class="form-group">
|
||||
<label for="page_title_<?php echo $page['id']; ?>">Page Title</label>
|
||||
<input type="text" class="form-control" id="page_title_<?php echo $page['id']; ?>" name="pages[<?php echo $page['id']; ?>][title]" value="<?php echo htmlspecialchars($page['page_title']); ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="page_content_<?php echo $page['id']; ?>">Content</label>
|
||||
<textarea class="form-control" id="page_content_<?php echo $page['id']; ?>" name="pages[<?php echo $page['id']; ?>][content]" rows="10"><?php echo htmlspecialchars($page['content']); ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php require_once 'footer.php'; ?>
|
||||
93
admin/required_documents.php
Normal file
93
admin/required_documents.php
Normal file
@ -0,0 +1,93 @@
|
||||
<?php
|
||||
require_once '../db/config.php';
|
||||
require_once 'header.php';
|
||||
|
||||
// Handle form submissions
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['add_document'])) {
|
||||
$document_name = trim($_POST['document_name']);
|
||||
$applies_to = trim($_POST['applies_to']);
|
||||
if (!empty($document_name) && !empty($applies_to)) {
|
||||
$db = db();
|
||||
$stmt = $db->prepare("INSERT INTO required_documents (document_name, applies_to) VALUES (?, ?)");
|
||||
$stmt->execute([$document_name, $applies_to]);
|
||||
}
|
||||
} elseif (isset($_POST['delete_document'])) {
|
||||
$document_id = $_POST['document_id'];
|
||||
$db = db();
|
||||
$stmt = $db->prepare("DELETE FROM required_documents WHERE id = ?");
|
||||
$stmt->execute([$document_id]);
|
||||
}
|
||||
header("Location: required_documents.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Fetch all required documents
|
||||
$db = db();
|
||||
$stmt = $db->query("SELECT * FROM required_documents ORDER BY applies_to, document_name");
|
||||
$documents = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
?>
|
||||
|
||||
<div class="container mt-4">
|
||||
<h2>Manage Required Documents</h2>
|
||||
<p>Define which documents are required for driver and restaurant sign-ups.</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h4>Current Requirements</h4>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Document Name</th>
|
||||
<th>Applies To</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (empty($documents)): ?>
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">No required documents have been defined yet.</td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($documents as $doc): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($doc['document_name']); ?></td>
|
||||
<td><?php echo ucfirst(htmlspecialchars($doc['applies_to'])); ?></td>
|
||||
<td>
|
||||
<form method="POST" action="required_documents.php" onsubmit="return confirm('Are you sure you want to delete this document requirement?');">
|
||||
<input type="hidden" name="document_id" value="<?php echo $doc['id']; ?>">
|
||||
<button type="submit" name="delete_document" class="btn btn-danger btn-sm">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h4>Add New Requirement</h4>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form method="POST" action="required_documents.php">
|
||||
<div class="mb-3">
|
||||
<label for="document_name" class="form-label">Document Name</label>
|
||||
<input type="text" class="form-control" id="document_name" name="document_name" placeholder="e.g., Driver's License" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="applies_to" class="form-label">Applies To</label>
|
||||
<select class="form-select" id="applies_to" name="applies_to" required>
|
||||
<option value="" disabled selected>Select one...</option>
|
||||
<option value="driver">Driver</option>
|
||||
<option value="restaurant">Restaurant</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" name="add_document" class="btn btn-primary">Add Requirement</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once 'footer.php'; ?>
|
||||
60
admin/update_location_status.php
Normal file
60
admin/update_location_status.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once '../db/config.php';
|
||||
|
||||
// Check if the user is logged in as an admin
|
||||
if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== true) {
|
||||
header('Location: login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET['id']) && isset($_GET['status'])) {
|
||||
$restaurant_id = $_GET['id'];
|
||||
$status = $_GET['status'];
|
||||
|
||||
// Validate status
|
||||
$allowed_statuses = ['approved', 'rejected', 'pending_approval'];
|
||||
if (!in_array($status, $allowed_statuses)) {
|
||||
// Invalid status, redirect back
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$pdo = db();
|
||||
$sql = "UPDATE restaurants SET location_status = ? WHERE id = ?";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$status, $restaurant_id]);
|
||||
|
||||
// Get restaurant owner's email
|
||||
$stmt_owner = $pdo->prepare("SELECT u.email, r.name FROM users u JOIN restaurants r ON u.id = r.user_id WHERE r.id = ?");
|
||||
$stmt_owner->execute([$restaurant_id]);
|
||||
$owner_info = $stmt_owner->fetch();
|
||||
|
||||
if ($owner_info) {
|
||||
require_once '../mail/MailService.php';
|
||||
$owner_email = $owner_info['email'];
|
||||
$restaurant_name = $owner_info['name'];
|
||||
$subject = '';
|
||||
$body = '';
|
||||
|
||||
if ($status == 'approved') {
|
||||
$subject = "Your Restaurant Location has been Approved";
|
||||
$body = "<p>Congratulations! The location for your restaurant, <strong>" . htmlspecialchars($restaurant_name) . "</strong>, has been approved.</p><p>Your restaurant is now fully visible to customers.</p>";
|
||||
} elseif ($status == 'rejected') {
|
||||
$subject = "Action Required: Your Restaurant Location has been Rejected";
|
||||
$body = "<p>There was an issue with the location provided for your restaurant, <strong>" . htmlspecialchars($restaurant_name) . "</strong>.</p><p>Please log in to your account and update the location pin for our team to review again.</p>";
|
||||
}
|
||||
|
||||
if (!empty($subject)) {
|
||||
MailService::sendMail($owner_email, $subject, $body);
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
} else {
|
||||
// If id or status is not provided, redirect
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
19
api/pexels.php
Normal file
19
api/pexels.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
require_once __DIR__.'/../includes/pexels.php';
|
||||
$q = isset($_GET['query']) ? $_GET['query'] : 'nature';
|
||||
$orientation = isset($_GET['orientation']) ? $_GET['orientation'] : 'portrait';
|
||||
$url = 'https://api.pexels.com/v1/search?query=' . urlencode($q) . '&orientation=' . urlencode($orientation) . '&per_page=1&page=1';
|
||||
$data = pexels_get($url);
|
||||
if (!$data || empty($data['photos'])) { echo json_encode(['error'=>'Failed to fetch image']); exit; }
|
||||
$photo = $data['photos'][0];
|
||||
$src = $photo['src']['large2x'] ?? ($photo['src']['large'] ?? $photo['src']['original']);
|
||||
$target = __DIR__ . '/../assets/images/pexels/' . $photo['id'] . '.jpg';
|
||||
download_to($src, $target);
|
||||
// Return minimal info and local relative path
|
||||
echo json_encode([
|
||||
'id' => $photo['id'],
|
||||
'local' => 'assets/images/pexels/' . $photo['id'] . '.jpg',
|
||||
'photographer' => $photo['photographer'] ?? null,
|
||||
'photographer_url' => $photo['photographer_url'] ?? null,
|
||||
]);
|
||||
@ -1,426 +1,214 @@
|
||||
/*
|
||||
MajuroEats Theme
|
||||
*/
|
||||
|
||||
:root {
|
||||
--coral: #FF6F61;
|
||||
--orange: #FF9A8B;
|
||||
--ocean-blue: #00A7E1;
|
||||
--palm-green: #3D9970;
|
||||
--coconut-white: #FFFFFF;
|
||||
--sand: #F4F1EA;
|
||||
--text-dark: #333333;
|
||||
--text-light: #666666;
|
||||
--border-color: #EAEAEA;
|
||||
|
||||
--font-family: 'Nunito', sans-serif;
|
||||
--border-radius: 12px;
|
||||
--shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.07);
|
||||
--shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
--transition: all 0.3s ease-in-out;
|
||||
--primary-color: #007bff;
|
||||
--secondary-color: #6c757d;
|
||||
--success-color: #28a745;
|
||||
--danger-color: #dc3545;
|
||||
--warning-color: #ffc107;
|
||||
--info-color: #17a2b8;
|
||||
--light-color: #f8f9fa;
|
||||
--dark-color: #343a40;
|
||||
--font-family-sans-serif: 'Inter', sans-serif;
|
||||
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
}
|
||||
|
||||
/* --- Global Styles --- */
|
||||
body {
|
||||
font-family: var(--font-family);
|
||||
background-color: var(--coconut-white);
|
||||
color: var(--text-dark);
|
||||
margin: 0;
|
||||
padding-top: 80px; /* Space for fixed header */
|
||||
font-family: var(--font-family-sans-serif);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
.main-header .navbar-brand {
|
||||
font-weight: 700;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: var(--coral);
|
||||
transition: var(--transition);
|
||||
.main-header .nav-link {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
main {
|
||||
display: block; /* For older browsers */
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 2.8rem;
|
||||
font-weight: 800;
|
||||
.hero-section {
|
||||
background: url('https://images.pexels.com/photos/1640777/pexels-photo-1640-1.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2') no-repeat center center;
|
||||
background-size: cover;
|
||||
height: 60vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
color: var(--text-dark);
|
||||
color: white;
|
||||
position: relative;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.section-title::after {
|
||||
.hero-section::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 80px;
|
||||
height: 4px;
|
||||
background-color: var(--coral);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* --- Navigation Bar --- */
|
||||
.main-header {
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(10px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
box-shadow: var(--shadow-soft);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
height: 80px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.main-nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
font-size: 1.8rem;
|
||||
font-weight: 800;
|
||||
color: var(--text-dark);
|
||||
}
|
||||
|
||||
.logo-icon {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
color: var(--text-light);
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
padding: 10px 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
}
|
||||
|
||||
.nav-links a:hover, .nav-links a.active {
|
||||
color: var(--coral);
|
||||
border-bottom-color: var(--coral);
|
||||
}
|
||||
|
||||
.nav-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.nav-link-button {
|
||||
color: var(--text-light);
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.nav-button {
|
||||
padding: 10px 20px;
|
||||
border-radius: 50px;
|
||||
font-weight: 700;
|
||||
font-size: 1rem;
|
||||
border: 2px solid var(--coral);
|
||||
}
|
||||
|
||||
.nav-button.primary {
|
||||
background-color: var(--coral);
|
||||
color: var(--coconut-white);
|
||||
}
|
||||
|
||||
.nav-button.primary:hover {
|
||||
background-color: transparent;
|
||||
color: var(--coral);
|
||||
}
|
||||
|
||||
.hamburger {
|
||||
display: none;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.hamburger span {
|
||||
display: block;
|
||||
width: 25px;
|
||||
height: 3px;
|
||||
background-color: var(--text-dark);
|
||||
margin: 5px 0;
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
/* --- Hero Section --- */
|
||||
.hero-section {
|
||||
background-color: #f8f9fa;
|
||||
padding: 100px 0;
|
||||
text-align: center;
|
||||
.hero-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.hero-title {
|
||||
font-size: 3.5rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hero-subtitle {
|
||||
font-size: 1.25rem;
|
||||
color: var(--text-light);
|
||||
margin-bottom: 2.5rem;
|
||||
}
|
||||
|
||||
.hero-section .btn-primary {
|
||||
background-color: #ff5a5f;
|
||||
border-color: #ff5a5f;
|
||||
font-size: 1.25rem;
|
||||
padding: 15px 40px;
|
||||
border-radius: 50px;
|
||||
.section-title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.hero-section .btn-primary:hover {
|
||||
background-color: #e04f54;
|
||||
border-color: #e04f54;
|
||||
.feature-card {
|
||||
border: none;
|
||||
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.hero-section .text-muted {
|
||||
color: #6c757d !important;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* --- How It Works Section --- */
|
||||
#how-it-works {
|
||||
padding: 60px 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.step {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.step-icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.step h3 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.step p {
|
||||
color: var(--text-light);
|
||||
}
|
||||
|
||||
/* --- Restaurant & Cuisine Cards --- */
|
||||
.restaurant-card, .cuisine-card {
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--border-radius);
|
||||
transition: var(--transition);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.restaurant-card:hover, .cuisine-card:hover {
|
||||
.feature-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: var(--shadow-medium);
|
||||
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.restaurant-card .card-img-top {
|
||||
border-top-left-radius: var(--border-radius);
|
||||
border-top-right-radius: var(--border-radius);
|
||||
height: 200px;
|
||||
object-fit: cover;
|
||||
.feature-icon {
|
||||
font-size: 3rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.restaurant-card .card-body {
|
||||
padding: 1.5rem;
|
||||
.restaurant-card {
|
||||
border: 1px solid #eee;
|
||||
border-radius: .5rem;
|
||||
transition: transform .2s, box-shadow .2s;
|
||||
}
|
||||
|
||||
.restaurant-card .card-title a {
|
||||
color: var(--text-dark);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.restaurant-card .card-title a:hover {
|
||||
color: var(--coral);
|
||||
.restaurant-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.cuisine-card {
|
||||
display: block;
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: var(--dark-color);
|
||||
display: block;
|
||||
transition: transform .2s;
|
||||
}
|
||||
|
||||
.cuisine-card:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.cuisine-card img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
object-fit: cover;
|
||||
border-radius: 50%;
|
||||
margin-bottom: 1rem;
|
||||
object-fit: cover;
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.cuisine-card h5 {
|
||||
color: var(--text-dark);
|
||||
font-weight: 700;
|
||||
/* Restaurant Page Styles */
|
||||
.restaurant-card-new {
|
||||
border: none;
|
||||
border-radius: .75rem;
|
||||
overflow: hidden;
|
||||
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||
}
|
||||
|
||||
/* --- Modal Styles --- */
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1001;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
.restaurant-card-new:hover {
|
||||
transform: translateY(-8px);
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background-color: #fefefe;
|
||||
margin: 10% auto;
|
||||
padding: 20px;
|
||||
border: 1px solid #888;
|
||||
width: 80%;
|
||||
max-width: 600px;
|
||||
border-radius: var(--border-radius);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
color: #aaa;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 20px;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.close-btn:hover,
|
||||
.close-btn:focus {
|
||||
color: black;
|
||||
.restaurant-card-new .card-link {
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
color: inherit;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#map {
|
||||
height: 400px;
|
||||
.restaurant-card-new .img-container {
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.restaurant-card-new .card-img-top {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: var(--border-radius);
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.5s ease;
|
||||
}
|
||||
|
||||
#confirm-location-btn {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
font-size: 1.1rem;
|
||||
.restaurant-card-new:hover .card-img-top {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
/* --- Responsive Design --- */
|
||||
@media (max-width: 992px) {
|
||||
.nav-links {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 80px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: var(--coconut-white);
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
padding: 20px 0;
|
||||
box-shadow: var(--shadow-medium);
|
||||
}
|
||||
|
||||
.nav-links.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.nav-links li {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
padding: 15px;
|
||||
display: block;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.nav-actions {
|
||||
display: none; /* Simple toggle, for complex logic more JS is needed */
|
||||
}
|
||||
|
||||
.nav-actions.active {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: calc(80px + 250px); /* Adjust based on nav-links height */
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: var(--coconut-white);
|
||||
justify-content: center;
|
||||
padding: 20px 0;
|
||||
box-shadow: var(--shadow-medium);
|
||||
}
|
||||
|
||||
.hamburger {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.hero-title {
|
||||
font-size: 2.8rem;
|
||||
}
|
||||
.restaurant-card-new .card-body {
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
body {
|
||||
padding-top: 70px;
|
||||
}
|
||||
.main-header, .main-nav {
|
||||
height: 70px;
|
||||
}
|
||||
.nav-links {
|
||||
top: 70px;
|
||||
}
|
||||
.hero-title {
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
.hero-subtitle {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
.restaurant-card-new .card-footer {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.restaurant-card-new .btn-sm {
|
||||
font-size: 0.8rem;
|
||||
padding: 0.4rem 0.8rem;
|
||||
}
|
||||
|
||||
/* Menu Page Styles */
|
||||
.restaurant-hero-menu {
|
||||
height: 50vh;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.restaurant-hero-menu::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.restaurant-hero-menu-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.menu-item-card-new {
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
border: none;
|
||||
border-radius: .75rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.menu-item-card-new:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 16px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.menu-item-card-new .img-fluid {
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.reviews-section .review-card:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.reviews-section hr:last-of-type {
|
||||
display: none;
|
||||
}
|
||||
|
||||
BIN
assets/images/pexels/34251952.jpg
Normal file
BIN
assets/images/pexels/34251952.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 417 KiB |
@ -1,87 +1,23 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const mapElement = document.getElementById('map');
|
||||
const modal = document.getElementById('location-modal');
|
||||
const pinLocationBtn = document.getElementById('pin-location-btn');
|
||||
const useLocationBtn = document.getElementById('use-location-btn');
|
||||
const closeBtn = document.querySelector('.close-btn');
|
||||
const confirmLocationBtn = document.getElementById('confirm-location-btn');
|
||||
const findRestaurantsBtn = document.querySelector('.find-restaurants-btn');
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const themeSwitch = document.querySelector('#checkbox');
|
||||
const body = document.body;
|
||||
|
||||
let map, marker;
|
||||
let selectedCoords = null;
|
||||
const currentTheme = localStorage.getItem('theme');
|
||||
|
||||
function initMap(lat, lng) {
|
||||
if (map) map.remove();
|
||||
map = L.map(mapElement).setView([lat, lng], 13);
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© OpenStreetMap contributors'
|
||||
}).addTo(map);
|
||||
marker = L.marker([lat, lng], { draggable: true }).addTo(map);
|
||||
|
||||
map.on('click', function(e) {
|
||||
marker.setLatLng(e.latlng);
|
||||
selectedCoords = e.latlng;
|
||||
});
|
||||
|
||||
marker.on('dragend', function(e) {
|
||||
selectedCoords = marker.getLatLng();
|
||||
});
|
||||
if (currentTheme) {
|
||||
body.classList.add(currentTheme);
|
||||
if (currentTheme === 'dark-mode') {
|
||||
themeSwitch.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (pinLocationBtn) {
|
||||
pinLocationBtn.addEventListener('click', function() {
|
||||
modal.style.display = 'block';
|
||||
// Default to a central Majuro location
|
||||
initMap(7.09, 171.38);
|
||||
});
|
||||
}
|
||||
|
||||
if (useLocationBtn) {
|
||||
useLocationBtn.addEventListener('click', function() {
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(function(position) {
|
||||
const userCoords = { lat: position.coords.latitude, lng: position.coords.longitude };
|
||||
sessionStorage.setItem('userLocation', JSON.stringify(userCoords));
|
||||
findRestaurantsBtn.click();
|
||||
}, function() {
|
||||
alert('Could not get your location. Please pin it on the map.');
|
||||
});
|
||||
} else {
|
||||
alert('Geolocation is not supported by this browser.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (closeBtn) {
|
||||
closeBtn.addEventListener('click', () => modal.style.display = 'none');
|
||||
}
|
||||
|
||||
window.addEventListener('click', (e) => {
|
||||
if (e.target == modal) {
|
||||
modal.style.display = 'none';
|
||||
themeSwitch.addEventListener('change', () => {
|
||||
if (themeSwitch.checked) {
|
||||
body.classList.add('dark-mode');
|
||||
localStorage.setItem('theme', 'dark-mode');
|
||||
} else {
|
||||
body.classList.remove('dark-mode');
|
||||
localStorage.setItem('theme', 'light-mode');
|
||||
}
|
||||
});
|
||||
|
||||
if (confirmLocationBtn) {
|
||||
confirmLocationBtn.addEventListener('click', function() {
|
||||
if (selectedCoords) {
|
||||
sessionStorage.setItem('userLocation', JSON.stringify(selectedCoords));
|
||||
modal.style.display = 'none';
|
||||
findRestaurantsBtn.click();
|
||||
} else {
|
||||
alert('Please select a location on the map.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(findRestaurantsBtn) {
|
||||
findRestaurantsBtn.addEventListener('click', function(e) {
|
||||
const userLocation = sessionStorage.getItem('userLocation');
|
||||
if (!userLocation) {
|
||||
e.preventDefault();
|
||||
alert('Please set your location first to find restaurants near you.');
|
||||
pinLocationBtn.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
BIN
assets/pasted-20251016-204625-3165bcc5.png
Normal file
BIN
assets/pasted-20251016-204625-3165bcc5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
BIN
assets/pasted-20251017-003154-7b32bc9f.png
Normal file
BIN
assets/pasted-20251017-003154-7b32bc9f.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 973 KiB |
BIN
assets/pasted-20251017-003440-ba856bda.png
Normal file
BIN
assets/pasted-20251017-003440-ba856bda.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
200
cart.php
200
cart.php
@ -1,115 +1,125 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
require_once 'header.php';
|
||||
|
||||
// Fetch cart items
|
||||
$cart_items = [];
|
||||
$total_quantity = 0;
|
||||
$subtotal = 0;
|
||||
$total_bill = 0;
|
||||
|
||||
$user_id = $_SESSION['user_id'] ?? null;
|
||||
$session_id = session_id();
|
||||
$pdoconnection = db();
|
||||
|
||||
// Fetch cart items
|
||||
if ($user_id) {
|
||||
$stmt = $pdoconnection->prepare("SELECT c.id, mi.name, mi.price, c.quantity, r.name as restaurant_name FROM cart c JOIN menu_items mi ON c.menu_item_id = mi.id JOIN restaurants r ON mi.restaurant_id = r.id WHERE c.user_id = :user_id");
|
||||
$stmt->bindParam(':user_id', $user_id);
|
||||
$stmt = db()->prepare("
|
||||
SELECT c.menu_item_id, c.quantity, mi.name, mi.price, mi.image_url, r.name as restaurant_name, r.id as restaurant_id
|
||||
FROM cart c
|
||||
JOIN menu_items mi ON c.menu_item_id = mi.id
|
||||
JOIN restaurants r ON c.restaurant_id = r.id
|
||||
WHERE c.user_id = ?
|
||||
");
|
||||
$stmt->execute([$user_id]);
|
||||
$cart_items = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
} else {
|
||||
$stmt = $pdoconnection->prepare("SELECT c.id, mi.name, mi.price, c.quantity, r.name as restaurant_name FROM cart c JOIN menu_items mi ON c.menu_item_id = mi.id JOIN restaurants r ON mi.restaurant_id = r.id WHERE c.session_id = :session_id");
|
||||
$stmt->bindParam(':session_id', $session_id);
|
||||
$stmt = db()->prepare("
|
||||
SELECT c.menu_item_id, c.quantity, mi.name, mi.price, mi.image_url, r.name as restaurant_name, r.id as restaurant_id
|
||||
FROM cart c
|
||||
JOIN menu_items mi ON c.menu_item_id = mi.id
|
||||
JOIN restaurants r ON c.restaurant_id = r.id
|
||||
WHERE c.session_id = ?
|
||||
");
|
||||
$stmt->execute([$session_id]);
|
||||
$cart_items = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
$stmt->execute();
|
||||
$cartItems = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$totalPrice = 0;
|
||||
|
||||
include 'header.php';
|
||||
if ($cart_items) {
|
||||
foreach ($cart_items as $item) {
|
||||
$total_quantity += $item['quantity'];
|
||||
$subtotal += $item['price'] * $item['quantity'];
|
||||
}
|
||||
$total_bill = $subtotal; // For now, total is same as subtotal. Can add taxes/fees later.
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<h2 class="text-center mb-4">Your Shopping Cart</h2>
|
||||
<div class="container my-5">
|
||||
<h1 class="display-5 fw-bold mb-4">Your Shopping Cart</h1>
|
||||
|
||||
<?php if (isset($_SESSION['coupon_error'])): ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<?php echo $_SESSION['coupon_error']; unset($_SESSION['coupon_error']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($cartItems) > 0): ?>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Item</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Quantity</th>
|
||||
<th scope="col">Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($cartItems as $item): ?>
|
||||
<?php
|
||||
$itemTotal = $item['price'] * $item['quantity'];
|
||||
$totalPrice += $itemTotal;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($item['name']); ?></td>
|
||||
<td>$<?php echo number_format($item['price'], 2); ?></td>
|
||||
<td><?php echo $item['quantity']; ?></td>
|
||||
<td>$<?php echo number_format($itemTotal, 2); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-6">
|
||||
<form action="apply_coupon.php" method="POST">
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" placeholder="Coupon Code" name="coupon_code" required>
|
||||
<button class="btn btn-secondary" type="submit">Apply Coupon</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-6 text-end">
|
||||
<h4>Subtotal: $<?php echo number_format($totalPrice, 2); ?></h4>
|
||||
<?php
|
||||
// Fetch settings from the database
|
||||
$settingsStmt = $pdoconnection->query("SELECT name, value FROM settings WHERE name IN ('delivery_fee', 'service_fee_percentage')");
|
||||
$settings = $settingsStmt->fetchAll(PDO::FETCH_KEY_PAIR);
|
||||
|
||||
$delivery_fee = $settings['delivery_fee'] ?? 0;
|
||||
$service_fee_percentage = $settings['service_fee_percentage'] ?? 0;
|
||||
|
||||
$service_fee = ($totalPrice * $service_fee_percentage) / 100;
|
||||
|
||||
$discount_amount = 0;
|
||||
if (isset($_SESSION['coupon_code']) && isset($_SESSION['discount_percentage'])) {
|
||||
$discount_percentage = $_SESSION['discount_percentage'];
|
||||
$discount_amount = ($totalPrice * $discount_percentage) / 100;
|
||||
?>
|
||||
<h5 class="text-success">Discount (<?php echo htmlspecialchars($_SESSION['coupon_code']); ?> @ <?php echo $discount_percentage; ?>%): -$<?php echo number_format($discount_amount, 2); ?></h5>
|
||||
<a href="remove_coupon.php" class="btn btn-danger btn-sm mt-2">Remove Coupon</a>
|
||||
<?php
|
||||
}
|
||||
|
||||
$final_total = $totalPrice - $discount_amount + $delivery_fee + $service_fee;
|
||||
|
||||
?>
|
||||
<h5>Delivery Fee: $<?php echo number_format($delivery_fee, 2); ?></h5>
|
||||
<h5>Service Fee (<?php echo htmlspecialchars($service_fee_percentage); ?>%): $<?php echo number_format($service_fee, 2); ?></h5>
|
||||
<h3>Total: $<?php echo number_format($final_total, 2); ?></h3>
|
||||
<?php
|
||||
|
||||
$_SESSION['total_price'] = $final_total;
|
||||
$_SESSION['discount_amount'] = $discount_amount;
|
||||
$_SESSION['subtotal'] = $totalPrice;
|
||||
?>
|
||||
<a href="checkout.php" class="btn btn-primary mt-3">Proceed to Checkout</a>
|
||||
</div>
|
||||
<?php if (empty($cart_items)): ?>
|
||||
<div class="text-center py-5">
|
||||
<i class="fas fa-shopping-cart fa-4x text-muted mb-3"></i>
|
||||
<h3 class="text-muted">Your cart is empty.</h3>
|
||||
<p class="text-muted">Looks like you haven't added anything to your cart yet.</p>
|
||||
<a href="restaurants.php" class="btn btn-primary mt-3">Continue Shopping</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="text-center">
|
||||
<p>Your cart is empty.</p>
|
||||
<a href="index.php" class="btn btn-primary">Continue Shopping</a>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<?php foreach ($cart_items as $item): ?>
|
||||
<div class="row align-items-center mb-4">
|
||||
<div class="col-md-2">
|
||||
<img src="<?php echo htmlspecialchars($item['image_url'] ?: 'https://via.placeholder.com/150'); ?>" class="img-fluid rounded" alt="<?php echo htmlspecialchars($item['name']); ?>">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h5 class="mb-0"><?php echo htmlspecialchars($item['name']); ?></h5>
|
||||
<small class="text-muted">From: <a href="menu.php?restaurant_id=<?php echo $item['restaurant_id']; ?>"><?php echo htmlspecialchars($item['restaurant_name']); ?></a></small>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<form action="cart_actions.php" method="post" class="d-flex align-items-center">
|
||||
<input type="hidden" name="action" value="update">
|
||||
<input type="hidden" name="menu_item_id" value="<?php echo $item['menu_item_id']; ?>">
|
||||
<button type="submit" name="quantity" value="<?php echo $item['quantity'] - 1; ?>" class="btn btn-outline-secondary btn-sm" <?php echo $item['quantity'] <= 1 ? 'disabled' : ''; ?>>-</button>
|
||||
<input type="text" class="form-control form-control-sm text-center mx-2" value="<?php echo $item['quantity']; ?>" readonly style="width: 50px;">
|
||||
<button type="submit" name="quantity" value="<?php echo $item['quantity'] + 1; ?>" class="btn btn-outline-secondary btn-sm">+</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-2 text-end">
|
||||
<span class="fw-bold">$<?php echo number_format($item['price'] * $item['quantity'], 2); ?></span>
|
||||
</div>
|
||||
<div class="col-md-1 text-end">
|
||||
<form action="cart_actions.php" method="post">
|
||||
<input type="hidden" name="action" value="remove">
|
||||
<input type="hidden" name="menu_item_id" value="<?php echo $item['menu_item_id']; ?>">
|
||||
<button type="submit" class="btn btn-link text-danger p-0"><i class="fas fa-trash"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (next($cart_items)): ?>
|
||||
<hr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title mb-4">Order Summary</h4>
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span>Total Items:</span>
|
||||
<span><?php echo $total_quantity; ?></span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-3">
|
||||
<span>Subtotal:</span>
|
||||
<span>$<?php echo number_format($subtotal, 2); ?></span>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="d-flex justify-content-between fw-bold fs-5">
|
||||
<span>Total Bill:</span>
|
||||
<span>$<?php echo number_format($total_bill, 2); ?></span>
|
||||
</div>
|
||||
<div class="d-grid gap-2 mt-4">
|
||||
<a href="checkout.php" class="btn btn-primary btn-lg">Proceed to Checkout</a>
|
||||
<a href="restaurants.php" class="btn btn-outline-secondary">Continue Shopping</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php require_once 'footer.php'; ?>
|
||||
<?php require_once 'footer.php'; ?>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"require": {
|
||||
"stripe/stripe-php": "^18.0",
|
||||
"google/apiclient": "^2.0"
|
||||
"google/apiclient": "^2.0",
|
||||
"aws/aws-sdk-php": "^2.8"
|
||||
}
|
||||
}
|
||||
|
||||
233
composer.lock
generated
233
composer.lock
generated
@ -4,8 +4,76 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "df0da9e5e532f1a464fa461fd3448463",
|
||||
"content-hash": "c850819d7975dd498ef2e57af1feb1e2",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "2.8.31",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "64fa4b07f056e338a5f0f29eece75babaa83af68"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/64fa4b07f056e338a5f0f29eece75babaa83af68",
|
||||
"reference": "64fa4b07f056e338a5f0f29eece75babaa83af68",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"guzzle/guzzle": "~3.7",
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/cache": "~1.0",
|
||||
"ext-openssl": "*",
|
||||
"monolog/monolog": "~1.4",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"phpunit/phpunit-mock-objects": "2.3.1",
|
||||
"symfony/yaml": "~2.1"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/cache": "Adds support for caching of credentials and responses",
|
||||
"ext-apc": "Allows service description opcode caching, request and response caching, and credentials caching",
|
||||
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
|
||||
"monolog/monolog": "Adds support for logging HTTP requests and responses",
|
||||
"symfony/yaml": "Eases the ability to write manifests for creating jobs in AWS Import/Export"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Aws": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Amazon Web Services",
|
||||
"homepage": "http://aws.amazon.com"
|
||||
}
|
||||
],
|
||||
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
|
||||
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||
"keywords": [
|
||||
"amazon",
|
||||
"aws",
|
||||
"cloud",
|
||||
"dynamodb",
|
||||
"ec2",
|
||||
"glacier",
|
||||
"s3",
|
||||
"sdk"
|
||||
],
|
||||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/2.8.31"
|
||||
},
|
||||
"time": "2016-07-25T18:03:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
"version": "v6.11.1",
|
||||
@ -243,6 +311,106 @@
|
||||
},
|
||||
"time": "2025-09-30T04:22:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzle/guzzle",
|
||||
"version": "v3.9.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle3.git",
|
||||
"reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9",
|
||||
"reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"php": ">=5.3.3",
|
||||
"symfony/event-dispatcher": "~2.1"
|
||||
},
|
||||
"replace": {
|
||||
"guzzle/batch": "self.version",
|
||||
"guzzle/cache": "self.version",
|
||||
"guzzle/common": "self.version",
|
||||
"guzzle/http": "self.version",
|
||||
"guzzle/inflection": "self.version",
|
||||
"guzzle/iterator": "self.version",
|
||||
"guzzle/log": "self.version",
|
||||
"guzzle/parser": "self.version",
|
||||
"guzzle/plugin": "self.version",
|
||||
"guzzle/plugin-async": "self.version",
|
||||
"guzzle/plugin-backoff": "self.version",
|
||||
"guzzle/plugin-cache": "self.version",
|
||||
"guzzle/plugin-cookie": "self.version",
|
||||
"guzzle/plugin-curlauth": "self.version",
|
||||
"guzzle/plugin-error-response": "self.version",
|
||||
"guzzle/plugin-history": "self.version",
|
||||
"guzzle/plugin-log": "self.version",
|
||||
"guzzle/plugin-md5": "self.version",
|
||||
"guzzle/plugin-mock": "self.version",
|
||||
"guzzle/plugin-oauth": "self.version",
|
||||
"guzzle/service": "self.version",
|
||||
"guzzle/stream": "self.version"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/cache": "~1.3",
|
||||
"monolog/monolog": "~1.0",
|
||||
"phpunit/phpunit": "3.7.*",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/class-loader": "~2.1",
|
||||
"zendframework/zend-cache": "2.*,<2.3",
|
||||
"zendframework/zend-log": "2.*,<2.3"
|
||||
},
|
||||
"suggest": {
|
||||
"guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.9-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Guzzle": "src/",
|
||||
"Guzzle\\Tests": "tests/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "Guzzle Community",
|
||||
"homepage": "https://github.com/guzzle/guzzle/contributors"
|
||||
}
|
||||
],
|
||||
"description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle",
|
||||
"homepage": "http://guzzlephp.org/",
|
||||
"keywords": [
|
||||
"client",
|
||||
"curl",
|
||||
"framework",
|
||||
"http",
|
||||
"http client",
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/guzzle3/issues",
|
||||
"source": "https://github.com/guzzle/guzzle3/tree/master"
|
||||
},
|
||||
"abandoned": "guzzlehttp/guzzle",
|
||||
"time": "2015-03-18T18:23:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "7.10.0",
|
||||
@ -1328,6 +1496,69 @@
|
||||
}
|
||||
],
|
||||
"time": "2024-09-25T14:21:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v2.8.52",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0",
|
||||
"reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "^2.0.5|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.6|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0",
|
||||
"symfony/stopwatch": "~2.3|~3.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
"symfony/http-kernel": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\EventDispatcher\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v2.8.50"
|
||||
},
|
||||
"time": "2018-11-21T14:20:20+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
||||
@ -1,4 +1,13 @@
|
||||
<?php include 'header.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT id, document_name FROM required_documents WHERE applies_to = 'driver'");
|
||||
$stmt->execute();
|
||||
$required_documents = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
include 'header.php';
|
||||
?>
|
||||
|
||||
<style>
|
||||
.driver-signup-container {
|
||||
@ -119,7 +128,7 @@
|
||||
<div class="driver-signup-form-container">
|
||||
<div class="driver-signup-form">
|
||||
<h2>Create Your Driver Account</h2>
|
||||
<form action="driver_signup_process.php" method="POST">
|
||||
<form action="driver_signup_process.php" method="POST" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="full_name">Full Name</label>
|
||||
<input type="text" id="full_name" name="full_name" required>
|
||||
@ -140,6 +149,14 @@
|
||||
<label for="vehicle_details">Vehicle Details (e.g., 2023 Toyota Camry, Blue)</label>
|
||||
<input type="text" id="vehicle_details" name="vehicle_details" required>
|
||||
</div>
|
||||
|
||||
<?php foreach ($required_documents as $doc): ?>
|
||||
<div class="form-group">
|
||||
<label for="doc_<?php echo htmlspecialchars($doc['id']); ?>"><?php echo htmlspecialchars($doc['document_name']); ?></label>
|
||||
<input type="file" id="doc_<?php echo htmlspecialchars($doc['id']); ?>" name="documents[<?php echo htmlspecialchars($doc['id']); ?>]" class="form-control" required>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<button type="submit" class="btn-submit">Start Earning</button>
|
||||
</form>
|
||||
<div class="form-footer">
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
require_once 'includes/S3Service.php';
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$full_name = $_POST['full_name'];
|
||||
@ -17,56 +18,81 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
die('Invalid email format.');
|
||||
}
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
$pdo = db();
|
||||
|
||||
// Check if driver already exists
|
||||
$sql = "SELECT id FROM drivers WHERE email = ?";
|
||||
try {
|
||||
$pdo->beginTransaction();
|
||||
|
||||
// Check if user already exists
|
||||
$sql = "SELECT id FROM users WHERE email = ?";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$email]);
|
||||
if ($stmt->fetch()) {
|
||||
die('Email already exists.');
|
||||
throw new Exception('Email already exists.');
|
||||
}
|
||||
|
||||
// Insert into users table
|
||||
$password_hash = password_hash($password, PASSWORD_BCRYPT);
|
||||
$sql = "INSERT INTO users (name, email, password, role) VALUES (?, ?, ?, 'driver')";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$full_name, $email, $password_hash]);
|
||||
$user_id = $pdo->lastInsertId();
|
||||
|
||||
// Insert into drivers table
|
||||
$password_hash = password_hash($password, PASSWORD_BCRYPT);
|
||||
$sql = "INSERT INTO drivers (full_name, email, password_hash, phone_number, vehicle_details, approval_status) VALUES (?, ?, ?, ?, ?, 'pending')";
|
||||
$sql = "INSERT INTO drivers (user_id, full_name, phone_number, vehicle_details, approval_status) VALUES (?, ?, ?, ?, 'pending')";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
|
||||
if ($stmt->execute([$full_name, $email, $password_hash, $phone_number, $vehicle_details])) {
|
||||
// Send email notification to admins
|
||||
require_once __DIR__ . '/mail/MailService.php';
|
||||
$stmt->execute([$user_id, $full_name, $phone_number, $vehicle_details]);
|
||||
|
||||
$stmt_emails = $pdo->prepare("SELECT email FROM email_recipients WHERE form_type = ?");
|
||||
$stmt_emails->execute(['driver_signup']);
|
||||
$recipients = $stmt_emails->fetchAll(PDO::FETCH_COLUMN);
|
||||
// Handle file uploads
|
||||
if (isset($_FILES['documents'])) {
|
||||
foreach ($_FILES['documents']['tmp_name'] as $doc_id => $tmp_path) {
|
||||
if (!empty($tmp_path) && is_uploaded_file($tmp_path)) {
|
||||
$file_name = $_FILES['documents']['name'][$doc_id];
|
||||
$file_error = $_FILES['documents']['error'][$doc_id];
|
||||
|
||||
if (!empty($recipients)) {
|
||||
$subject = 'New Driver Signup: ' . $full_name;
|
||||
$html_content = "<p>A new driver has signed up and is awaiting approval.</p>" .
|
||||
"<p><strong>Name:</strong> {$full_name}</p>" .
|
||||
"<p><strong>Email:</strong> {$email}</p>" .
|
||||
"<p><strong>Phone:</strong> {$phone_number}</p>" .
|
||||
"<p><strong>Vehicle:</strong> {$vehicle_details}</p>" .
|
||||
"<p>Please visit the admin panel to review and approve the application.</p>";
|
||||
$text_content = "A new driver has signed up and is awaiting approval.\n\n" .
|
||||
"Name: {$full_name}\n" .
|
||||
"Email: {$email}\n" .
|
||||
"Phone: {$phone_number}\n" .
|
||||
"Vehicle: {$vehicle_details}\n\n" .
|
||||
"Please visit the admin panel to review and approve the application.";
|
||||
if ($file_error !== UPLOAD_ERR_OK) {
|
||||
throw new Exception("Failed to upload file: " . $file_name);
|
||||
}
|
||||
|
||||
MailService::sendMail($recipients, $subject, $html_content, $text_content);
|
||||
$extension = pathinfo($file_name, PATHINFO_EXTENSION);
|
||||
$key = "documents/drivers/{$user_id}/{$doc_id}_" . time() . "." . $extension;
|
||||
|
||||
$s3_url = S3Service::uploadFile($tmp_path, $key);
|
||||
|
||||
if ($s3_url) {
|
||||
$sql = "INSERT INTO user_documents (user_id, document_id, file_path) VALUES (?, ?, ?)";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$user_id, $doc_id, $s3_url]);
|
||||
} else {
|
||||
throw new Exception("Failed to upload document to S3.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Redirect to a pending approval page
|
||||
header("Location: driver_pending_approval.php");
|
||||
exit;
|
||||
} else {
|
||||
die("Error: Could not execute the query.");
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
die("Could not connect to the database: " . $e->getMessage());
|
||||
|
||||
// Send email notification to admins
|
||||
require_once __DIR__ . '/mail/MailService.php';
|
||||
$stmt_emails = $pdo->prepare("SELECT email FROM email_recipients WHERE form_type = ?");
|
||||
$stmt_emails->execute(['driver_signup']);
|
||||
$recipients = $stmt_emails->fetchAll(PDO::FETCH_COLUMN);
|
||||
|
||||
if (!empty($recipients)) {
|
||||
$subject = 'New Driver Signup: ' . $full_name;
|
||||
$html_content = "<p>A new driver has signed up and is awaiting approval.</p><p><strong>Name:</strong> {$full_name}</p><p><strong>Email:</strong> {$email}</p><p>Please visit the admin panel to review and approve the application.</p>";
|
||||
$text_content = "A new driver has signed up and is awaiting approval.\nName: {$full_name}\nEmail: {$email}\nPlease visit the admin panel to review and approve the application.";
|
||||
MailService::sendMail($recipients, $subject, $html_content, $text_content);
|
||||
}
|
||||
|
||||
$pdo->commit();
|
||||
|
||||
header("Location: driver_pending_approval.php");
|
||||
exit;
|
||||
|
||||
} catch (Exception $e) {
|
||||
if ($pdo->inTransaction()) {
|
||||
$pdo->rollBack();
|
||||
}
|
||||
die("Error: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
?>
|
||||
51
footer.php
51
footer.php
@ -1,9 +1,45 @@
|
||||
<?php require_once 'includes/api_keys.php'; ?>
|
||||
<footer>
|
||||
<div class="container">
|
||||
<p>© <?php echo date("Y"); ?> Majuro Eats. All Rights Reserved. | <a href="/admin/login.php">Admin Login</a></p>
|
||||
</main>
|
||||
<footer class="bg-light pt-5 pb-4">
|
||||
<div class="container text-center text-md-start">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-lg-4 col-xl-3 mx-auto mb-4">
|
||||
<h6 class="text-uppercase fw-bold">MajuroEats</h6>
|
||||
<hr class="mb-4 mt-0 d-inline-block mx-auto" style="width: 60px; background-color: #7c4dff; height: 2px"/>
|
||||
<p>
|
||||
Fast, fresh, and reliable food delivery for the Marshall Islands. Your favorite local restaurants, delivered right to your door.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-2 col-lg-2 col-xl-2 mx-auto mb-4">
|
||||
<h6 class="text-uppercase fw-bold">Links</h6>
|
||||
<hr class="mb-4 mt-0 d-inline-block mx-auto" style="width: 60px; background-color: #7c4dff; height: 2px"/>
|
||||
<p><a href="about.php" class="text-dark">About Us</a></p>
|
||||
<p><a href="restaurants.php" class="text-dark">Restaurants</a></p>
|
||||
<p><a href="driver_signup.php" class="text-dark">Become a Driver</a></p>
|
||||
<p><a href="help.php" class="text-dark">Help</a></p>
|
||||
</div>
|
||||
<div class="col-md-3 col-lg-2 col-xl-2 mx-auto mb-4">
|
||||
<h6 class="text-uppercase fw-bold">Legal</h6>
|
||||
<hr class="mb-4 mt-0 d-inline-block mx-auto" style="width: 60px; background-color: #7c4dff; height: 2px"/>
|
||||
<p><a href="#!" class="text-dark">Terms of Service</a></p>
|
||||
<p><a href="#!" class="text-dark">Privacy Policy</a></p>
|
||||
</div>
|
||||
<div class="col-md-4 col-lg-3 col-xl-3 mx-auto mb-md-0 mb-4">
|
||||
<h6 class="text-uppercase fw-bold">Contact</h6>
|
||||
<hr class="mb-4 mt-0 d-inline-block mx-auto" style="width: 60px; background-color: #7c4dff; height: 2px"/>
|
||||
<p><i class="fas fa-home me-3"></i> Majuro, MH 96960</p>
|
||||
<p><i class="fas fa-envelope me-3"></i> contact@majuroeats.com</p>
|
||||
<p><i class="fas fa-phone me-3"></i> + 692 123 4567</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.05);">
|
||||
© <?php echo date("Y"); ?> Copyright:
|
||||
<a class="text-dark" href="/">MajuroEats.com</a>
|
||||
| <a class="text-dark" href="/admin/login.php">Admin Login</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
|
||||
@ -19,22 +55,19 @@ s1.setAttribute('crossorigin','*');
|
||||
s0.parentNode.insertBefore(s1,s0);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!--End of Tawk.to Script-->
|
||||
|
||||
|
||||
|
||||
<!-- OneSignal Push Notifications -->
|
||||
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script>
|
||||
<script>
|
||||
window.OneSignal = window.OneSignal || [];
|
||||
OneSignal.push(function() {
|
||||
OneSignal.init({
|
||||
appId: "<?php echo ONESIGNAL_APP_ID; ?>",
|
||||
appId: "<?php echo getenv('ONESIGNAL_APP_ID'); ?>",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php if (extension_loaded('newrelic')) { echo newrelic_get_browser_timing_footer(); } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
99
header.php
99
header.php
@ -1,5 +1,18 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// Cart item count
|
||||
$cart_item_count = 0;
|
||||
if (!empty($_SESSION['user_id'])) {
|
||||
$stmt = db()->prepare("SELECT SUM(quantity) FROM cart WHERE user_id = ?");
|
||||
$stmt->execute([$_SESSION['user_id']]);
|
||||
$cart_item_count = $stmt->fetchColumn();
|
||||
} else {
|
||||
$stmt = db()->prepare("SELECT SUM(quantity) FROM cart WHERE session_id = ?");
|
||||
$stmt->execute([session_id()]);
|
||||
$cart_item_count = $stmt->fetchColumn();
|
||||
}
|
||||
$cart_item_count = $cart_item_count ?: 0;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@ -7,61 +20,57 @@ session_start();
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>MajuroEats - Fast Island Delivery</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<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=Nunito:wght@400;700&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Open+Sans:wght@400;600&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
|
||||
<link rel="stylesheet" href="assets/css/main.css?v=<?php echo time(); ?>">
|
||||
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
|
||||
<link rel="stylesheet" href="assets/css/main.css?v=<?php echo uniqid(); ?>">
|
||||
<script src="assets.js" defer></script>
|
||||
<?php if (extension_loaded('newrelic')) { echo newrelic_get_browser_timing_header(); } ?>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<header class="main-header bg-light shadow-sm">
|
||||
<div class="container">
|
||||
<?php
|
||||
$pages_with_back_button = [
|
||||
'/login.php',
|
||||
'/signup.php',
|
||||
'/forgot_password.php',
|
||||
'/reset_password.php',
|
||||
'/restaurant_login.php',
|
||||
'/restaurant_signup.php',
|
||||
'/driver_signup.php',
|
||||
'/driver_login.php',
|
||||
'/admin/login.php',
|
||||
];
|
||||
if (in_array($_SERVER['PHP_SELF'], $pages_with_back_button)):
|
||||
?>
|
||||
<a href="/" class="back-to-home-btn">← Back to Home</a>
|
||||
<?php endif; ?>
|
||||
<nav class="main-nav">
|
||||
<a href="/" class="logo">
|
||||
<span class="logo-icon">🌊</span>
|
||||
<span class="logo-text">MajuroEats</span>
|
||||
<nav class="navbar navbar-expand-lg bg-light">
|
||||
<a href="/" class="navbar-brand fw-bold">
|
||||
<span style="font-size: 1.5rem;">🌊</span>
|
||||
MajuroEats
|
||||
</a>
|
||||
<ul class="nav-links">
|
||||
<li><a href="index.php">Home</a></li>
|
||||
<li><a href="restaurants.php">Restaurants</a></li>
|
||||
<li><a href="rewards.php">Rewards</a></li>
|
||||
<li><a href="driver_signup.php">Driver</a></li>
|
||||
<li><a href="help.php">Help</a></li>
|
||||
</ul>
|
||||
<div class="nav-actions">
|
||||
<?php if (isset($_SESSION['user_id'])): ?>
|
||||
<a href="profile.php" class="nav-link-button">Profile</a>
|
||||
<a href="logout.php" class="nav-button primary">Logout</a>
|
||||
<?php else: ?>
|
||||
<a href="login.php" class="nav-link-button">Sign In</a>
|
||||
<a href="signup.php" class="nav-button primary">Sign Up</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<button class="hamburger">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="mainNav">
|
||||
<ul class="navbar-nav mx-auto">
|
||||
<li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="restaurants.php">Restaurants</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="about.php">About Us</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="how-it-works.php">How It Works</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="rewards.php">Rewards</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="driver_signup.php">Become a Driver</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="help.php">Help</a></li>
|
||||
</ul>
|
||||
<div class="d-flex align-items-center">
|
||||
<a href="cart.php" class="btn btn-outline-primary position-relative me-3">
|
||||
<i class="fas fa-shopping-cart"></i>
|
||||
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
|
||||
<?php echo $cart_item_count; ?>
|
||||
<span class="visually-hidden">items in cart</span>
|
||||
</span>
|
||||
</a>
|
||||
<?php if (isset($_SESSION['user_id'])): ?>
|
||||
<a href="profile.php" class="btn btn-outline-secondary me-2">Profile</a>
|
||||
<a href="logout.php" class="btn btn-primary">Logout</a>
|
||||
<?php else: ?>
|
||||
<a href="login.php" class="btn btn-outline-secondary me-2">Sign In</a>
|
||||
<a href="signup.php" class="btn btn-primary">Sign Up</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<main class="container mt-4">
|
||||
|
||||
77
hero.php
77
hero.php
@ -1,31 +1,48 @@
|
||||
<!-- hero.php -->
|
||||
<div class="hero-section">
|
||||
<div class="container text-center">
|
||||
<h1 class="hero-title">Your Favorite Food, Delivered</h1>
|
||||
<p class="hero-subtitle">Enter your location to see which restaurants deliver to you.</p>
|
||||
<a href="#" class="btn btn-primary btn-lg" id="pin-location-btn">Pin a Location on Map</a>
|
||||
<div class="mt-3">
|
||||
<a href="#" class="text-muted" id="use-location-btn">or use my current location</a>
|
||||
<div class="hero-content">
|
||||
<h1 class="hero-title">Your Island, Your Food, Delivered</h1>
|
||||
<p class="hero-subtitle">The best local restaurants and stores delivered to your door.</p>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" id="location-input" class="form-control form-control-lg" placeholder="Enter your address or pin a location" readonly>
|
||||
<button id="location-submit-btn" class="btn btn-primary btn-lg">Find Food</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center gap-3">
|
||||
<button id="pin-location-btn" class="btn btn-secondary">Pin a location on the map</button>
|
||||
<button id="use-location-btn" class="btn btn-secondary">Use my current location</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Location Modal -->
|
||||
<div id="location-modal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="close-btn">×</span>
|
||||
<h2>Pin Your Delivery Location</h2>
|
||||
<div id="map" style="height: 400px; width: 100%;"></div>
|
||||
<button id="confirm-location-btn" class="btn btn-primary mt-3" disabled>Confirm Location</button>
|
||||
<div id="location-modal" class="modal fade" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Pin Your Delivery Location</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="map" style="height: 50vh; width: 100%;"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button id="confirm-location-btn" type="button" class="btn btn-primary" disabled>Confirm Location</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const modal = document.getElementById('location-modal');
|
||||
const pinBtn = document.getElementById('pin-location-btn');
|
||||
const locationModal = new bootstrap.Modal(document.getElementById('location-modal'));
|
||||
const locationInput = document.getElementById('location-input');
|
||||
const locationSubmitBtn = document.getElementById('location-submit-btn');
|
||||
const useLocationBtn = document.getElementById('use-location-btn');
|
||||
const closeBtn = document.querySelector('.close-btn');
|
||||
const pinLocationBtn = document.getElementById('pin-location-btn');
|
||||
const confirmBtn = document.getElementById('confirm-location-btn');
|
||||
|
||||
let map;
|
||||
@ -53,11 +70,17 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
});
|
||||
}
|
||||
|
||||
pinBtn.onclick = function(e) {
|
||||
e.preventDefault();
|
||||
modal.style.display = 'block';
|
||||
setTimeout(() => initMap(majuroCenter, 13), 100);
|
||||
};
|
||||
function openModal() {
|
||||
locationModal.show();
|
||||
}
|
||||
|
||||
document.getElementById('location-modal').addEventListener('shown.bs.modal', function () {
|
||||
initMap(majuroCenter, 13);
|
||||
});
|
||||
|
||||
locationInput.onclick = openModal;
|
||||
locationSubmitBtn.onclick = openModal;
|
||||
pinLocationBtn.onclick = openModal;
|
||||
|
||||
useLocationBtn.onclick = function(e) {
|
||||
e.preventDefault();
|
||||
@ -76,21 +99,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
};
|
||||
|
||||
closeBtn.onclick = function() {
|
||||
modal.style.display = 'none';
|
||||
};
|
||||
|
||||
confirmBtn.onclick = function() {
|
||||
if (selectedLocation) {
|
||||
window.location.href = `restaurants.php?lat=${selectedLocation.lat}&lng=${selectedLocation.lng}`;
|
||||
}
|
||||
modal.style.display = 'none';
|
||||
};
|
||||
|
||||
window.onclick = function(event) {
|
||||
if (event.target == modal) {
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
locationModal.hide();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
28
how-it-works.php
Normal file
28
how-it-works.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
require_once 'header.php';
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT * FROM pages WHERE page_key = :page_key");
|
||||
$stmt->bindValue(':page_key', 'how_it_works');
|
||||
$stmt->execute();
|
||||
$page = $stmt->fetch();
|
||||
|
||||
?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 offset-lg-2">
|
||||
<?php if ($page): ?>
|
||||
<?php echo $page['content']; ?>
|
||||
<?php else: ?>
|
||||
<h1 class="text-center mb-4">How It Works</h1>
|
||||
<p class="lead">Content not found. Please set up the 'How It Works' page in the admin dashboard.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require_once 'footer.php';
|
||||
?>
|
||||
44
includes/S3Service.php
Normal file
44
includes/S3Service.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
require_once __DIR__ . '/aws_config.php';
|
||||
|
||||
use Aws\S3\S3Client;
|
||||
use Aws\S3\Exception\S3Exception;
|
||||
|
||||
class S3Service {
|
||||
private static $s3Client;
|
||||
|
||||
private static function getS3Client() {
|
||||
if (!self::$s3Client) {
|
||||
self::$s3Client = new S3Client([
|
||||
'version' => 'latest',
|
||||
'region' => AWS_REGION,
|
||||
'credentials' => [
|
||||
'key' => AWS_ACCESS_KEY_ID,
|
||||
'secret' => AWS_SECRET_ACCESS_KEY,
|
||||
],
|
||||
]);
|
||||
}
|
||||
return self::$s3Client;
|
||||
}
|
||||
|
||||
public static function uploadFile($filePath, $key, $bucket = null) {
|
||||
$bucket = $bucket ?: AWS_S3_BUCKET;
|
||||
$s3 = self::getS3Client();
|
||||
|
||||
try {
|
||||
$result = $s3->putObject([
|
||||
'Bucket' => $bucket,
|
||||
'Key' => $key,
|
||||
'SourceFile' => $filePath,
|
||||
'ACL' => 'public-read', // Make file publicly readable
|
||||
]);
|
||||
return $result['ObjectURL'];
|
||||
} catch (S3Exception $e) {
|
||||
// Handle exception
|
||||
error_log($e->getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -1,12 +1,18 @@
|
||||
<?php
|
||||
// For demonstration purposes, it's okay to have keys here.
|
||||
// In a real-world application, these should be stored securely in environment variables.
|
||||
// Store all API keys in this file.
|
||||
// This file should be excluded from version control.
|
||||
|
||||
define('STRIPE_PUBLIC_KEY', 'pk_test_51P4pA2Rpc52y31alA53xvt2gih3jAg2yJ23pQ32y2p5y2y2p5y2y2p5y2y2p5y2y2p5y2y2p5y2y2p5y2y2p');
|
||||
define('STRIPE_SECRET_KEY', 'sk_test_51P4pA2Rpc52y31alA53xvt2gih3jAg2yJ23pQ32y2p5y2y2p5y2y2p5y2y2p5y2y2p5y2y2p5y2y2p5y2y2p');
|
||||
define('GOOGLE_CLIENT_ID', 'YOUR_GOOGLE_CLIENT_ID');
|
||||
define('GOOGLE_CLIENT_SECRET', 'YOUR_GOOGLE_CLIENT_SECRET');
|
||||
define('PAYPAL_CLIENT_ID', 'YOUR_PAYPAL_CLIENT_ID');
|
||||
define('PAYPAL_CLIENT_SECRET', 'YOUR_PAYPAL_CLIENT_SECRET');
|
||||
define('OPENWEATHERMAP_API_KEY', 'd32bb14b5483bc76851d4237fa882624');
|
||||
define('MAPBOX_API_KEY', 'sk.eyJ1IjoiZGFkZHl0aW5lIiwiYSI6ImNtZ3EzMnJzMDAya3Eya3M4anR2NHJtdjMifQ.zGEqYuffAbWgZMPjwRwqUQ');
|
||||
|
||||
// SendGrid
|
||||
define('SENDGRID_API_KEY', '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');
|
||||
|
||||
// PayPal
|
||||
define('PAYPAL_CLIENT_ID', 'AVDnoNaRDnJkqCHwm7jOMl9Vbrt1ZLxdauuTo0sqprqOBhkCnwWI72pQeMs1aNYQCk0iZKoncQvQCDwS');
|
||||
define('PAYPAL_SECRET', 'EDE5TwL0lnTFvLwpr1QCIhK2LN5SYIWAlLc7OPrngfBP2XNX9L0InrQ7L4kXQlCa49RlGyflZVlAYBZF');
|
||||
|
||||
// Stripe (placeholder)
|
||||
define('STRIPE_API_KEY', 'YOUR_STRIPE_API_KEY');
|
||||
define('STRIPE_PUBLISHABLE_KEY', 'YOUR_STRIPE_PUBLISHABLE_KEY');
|
||||
|
||||
?>
|
||||
9
includes/aws_config.php
Normal file
9
includes/aws_config.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
// It is strongly recommended to use environment variables for credentials.
|
||||
// This file is used as a fallback for simplicity.
|
||||
|
||||
define('AWS_ACCESS_KEY_ID', 'AKIASHPCTJXIEDP36UMY');
|
||||
define('AWS_SECRET_ACCESS_KEY', 'GfVqDFM5RUHX9ZwmbsqRQxySLIEWehhGDh1M2Bxl');
|
||||
define('AWS_REGION', 'ap-southeast-2');
|
||||
define('AWS_S3_BUCKET', 'majuroeats-backup-s3');
|
||||
?>
|
||||
83
index.php
83
index.php
@ -3,43 +3,51 @@ require_once 'header.php';
|
||||
require_once 'hero.php';
|
||||
require_once 'db/config.php';
|
||||
|
||||
// Fetch top-rated restaurants
|
||||
// Fetch featured restaurants and their cuisines
|
||||
$stmt = $pdo->query("
|
||||
SELECT r.*, AVG(ra.rating) as avg_rating
|
||||
SELECT
|
||||
r.id,
|
||||
r.name,
|
||||
r.description,
|
||||
r.image_url,
|
||||
GROUP_CONCAT(c.name SEPARATOR ', ') as cuisines
|
||||
FROM restaurants r
|
||||
LEFT JOIN ratings ra ON r.id = ra.restaurant_id
|
||||
LEFT JOIN restaurant_cuisines rc ON r.id = rc.restaurant_id
|
||||
LEFT JOIN cuisines c ON rc.cuisine_id = c.id
|
||||
WHERE r.is_active = 1
|
||||
GROUP BY r.id
|
||||
ORDER BY avg_rating DESC
|
||||
ORDER BY r.id DESC
|
||||
LIMIT 6
|
||||
");
|
||||
$top_restaurants = $stmt->fetchAll();
|
||||
$featured_restaurants = $stmt->fetchAll();
|
||||
|
||||
// Fetch featured cuisines
|
||||
$stmt = $pdo->query("SELECT * FROM cuisines ORDER BY name ASC LIMIT 6");
|
||||
// Fetch featured cuisines for the filter section
|
||||
$stmt = $pdo->query("SELECT * FROM cuisines ORDER BY name ASC LIMIT 12");
|
||||
$cuisines = $stmt->fetchAll();
|
||||
?>
|
||||
|
||||
<div class="container mt-5 mb-5">
|
||||
<section id="how-it-works" class="text-center">
|
||||
<div class="container my-5">
|
||||
<!-- How It Works Section -->
|
||||
<section id="how-it-works" class="text-center py-5">
|
||||
<h2 class="section-title">How It Works</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="step">
|
||||
<img src="assets/images/step1.svg" alt="Step 1: Choose a restaurant" class="step-icon">
|
||||
<h3>Choose A Restaurant</h3>
|
||||
<p>Browse from our extensive list of local restaurants.</p>
|
||||
<div class="feature-card card h-100 p-4">
|
||||
<div class="feature-icon mb-3"><i class="fas fa-store"></i></div>
|
||||
<h3>Choose a Restaurant</h3>
|
||||
<p>Browse our extensive list of local restaurants and stores.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="step">
|
||||
<img src="assets/images/step2.svg" alt="Step 2: Pick your meal" class="step-icon">
|
||||
<div class="feature-card card h-100 p-4">
|
||||
<div class="feature-icon mb-3"><i class="fas fa-utensils"></i></div>
|
||||
<h3>Pick Your Meal</h3>
|
||||
<p>Select your favorite dishes and add them to your cart.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="step">
|
||||
<img src="assets/images/step3.svg" alt="Step 3: Fast delivery" class="step-icon">
|
||||
<div class="feature-card card h-100 p-4">
|
||||
<div class="feature-icon mb-3"><i class="fas fa-shipping-fast"></i></div>
|
||||
<h3>Fast Delivery</h3>
|
||||
<p>Get your food delivered right to your doorstep, fast!</p>
|
||||
</div>
|
||||
@ -47,47 +55,52 @@ $cuisines = $stmt->fetchAll();
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="restaurants" class="mt-5">
|
||||
<h2 class="section-title text-center">Top-Rated Restaurants</h2>
|
||||
<!-- Featured Restaurants Section -->
|
||||
<section id="restaurants" class="py-5">
|
||||
<h2 class="section-title text-center">Featured Restaurants</h2>
|
||||
<div class="row">
|
||||
<?php if (count($top_restaurants) > 0): ?>
|
||||
<?php foreach ($top_restaurants as $restaurant): ?>
|
||||
<?php if (count($featured_restaurants) > 0): ?>
|
||||
<?php foreach ($featured_restaurants as $restaurant): ?>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card restaurant-card">
|
||||
<div class="restaurant-card card h-100">
|
||||
<a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>">
|
||||
<img src="<?php echo htmlspecialchars($restaurant['image_url']); ?>" class="card-img-top" alt="<?php echo htmlspecialchars($restaurant['name']); ?>">
|
||||
<img src="<?php echo htmlspecialchars($restaurant['image_url']); ?>" class="card-img-top" alt="<?php echo htmlspecialchars($restaurant['name']); ?>" style="height: 200px; object-fit: cover;">
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>"><?php echo htmlspecialchars($restaurant['name']); ?></a></h5>
|
||||
<p class="card-text text-muted"><?php echo htmlspecialchars(substr($restaurant['description'], 0, 80)); ?>...</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="badge bg-success"><?php echo number_format($restaurant['avg_rating'], 1); ?> ★</span>
|
||||
<a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>" class="btn btn-sm btn-outline-primary">View Menu</a>
|
||||
</div>
|
||||
<h5 class="card-title"><a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>" class="text-dark text-decoration-none"><?php echo htmlspecialchars($restaurant['name']); ?></a></h5>
|
||||
<p class="card-text text-muted"><?php echo htmlspecialchars($restaurant['cuisines']); ?></p>
|
||||
</div>
|
||||
<div class="card-footer bg-white border-top-0">
|
||||
<a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>" class="btn btn-primary">View Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<p class="text-center">No restaurants found.</p>
|
||||
<div class="col">
|
||||
<p class="text-center">No featured restaurants available at the moment.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="cuisines" class="mt-5">
|
||||
<h2 class="section-title text-center">Featured Cuisines</h2>
|
||||
<!-- Cuisines Section -->
|
||||
<section id="cuisines" class="py-5 bg-light">
|
||||
<h2 class="section-title text-center">Explore by Cuisine</h2>
|
||||
<div class="row justify-content-center">
|
||||
<?php if (count($cuisines) > 0): ?>
|
||||
<?php foreach ($cuisines as $cuisine): ?>
|
||||
<div class="col-md-2 col-sm-4 col-6 text-center mb-4">
|
||||
<div class="col-lg-2 col-md-3 col-sm-4 col-6 mb-4">
|
||||
<a href="restaurants.php?cuisine_id=<?php echo $cuisine['id']; ?>" class="cuisine-card">
|
||||
<img src="<?php echo htmlspecialchars($cuisine['image_url']); ?>" alt="<?php echo htmlspecialchars($cuisine['name']); ?>" class="img-fluid">
|
||||
<img src="<?php echo htmlspecialchars($cuisine['image_url']); ?>" alt="<?php echo htmlspecialchars($cuisine['name']); ?>">
|
||||
<h5 class="mt-2"><?php echo htmlspecialchars($cuisine['name']); ?></h5>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<p class="text-center">No cuisines found.</p>
|
||||
<div class="col">
|
||||
<p class="text-center">No cuisines found.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
123
menu.php
123
menu.php
@ -18,28 +18,22 @@ require_once 'header.php';
|
||||
|
||||
try {
|
||||
// Fetch restaurant details
|
||||
$stmt = db()->prepare("SELECT r.id, r.name, r.image_url, c.name as cuisine_name
|
||||
$stmt = db()->prepare("SELECT r.id, r.name, r.image_url, STRING_AGG(c.name, ', ') as cuisines
|
||||
FROM restaurants r
|
||||
LEFT JOIN restaurant_cuisines rc ON r.id = rc.restaurant_id
|
||||
LEFT JOIN cuisines c ON rc.cuisine_id = c.id
|
||||
WHERE r.id = :id");
|
||||
WHERE r.id = :id
|
||||
GROUP BY r.id");
|
||||
$stmt->bindParam(':id', $restaurant_id, PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
$restaurant_data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$restaurant = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!$restaurant_data) {
|
||||
if (!$restaurant) {
|
||||
throw new Exception("Restaurant not found.");
|
||||
}
|
||||
|
||||
$restaurant = [
|
||||
'id' => $restaurant_data[0]['id'],
|
||||
'name' => $restaurant_data[0]['name'],
|
||||
'image_url' => $restaurant_data[0]['image_url'],
|
||||
'cuisines' => array_column($restaurant_data, 'cuisine_name')
|
||||
];
|
||||
|
||||
// Fetch menu items
|
||||
$menu_stmt = db()->prepare("SELECT id, name, description, price, image_url FROM menu_items WHERE restaurant_id = :restaurant_id");
|
||||
$menu_stmt = db()->prepare("SELECT id, name, description, price, image_url FROM menu_items WHERE restaurant_id = :restaurant_id ORDER BY name ASC");
|
||||
$menu_stmt->bindParam(':restaurant_id', $restaurant_id, PDO::PARAM_INT);
|
||||
$menu_stmt->execute();
|
||||
$menu_items = $menu_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
@ -68,24 +62,25 @@ try {
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "<div class='container'><p class='alert alert-danger'>" . $e->getMessage() . "</p></div>";
|
||||
echo "<div class='container my-5'><p class='alert alert-danger'>" . $e->getMessage() . "</p></div>";
|
||||
require_once 'footer.php';
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="restaurant-hero-menu" style="background-image: url('<?php echo htmlspecialchars($restaurant['image_url']); ?>');">
|
||||
<!-- Restaurant Hero Section -->
|
||||
<div class="restaurant-hero-menu" style="background-image: url('<?php echo htmlspecialchars($restaurant['image_url'] ?: 'https://via.placeholder.com/1600x500/dee2e6/6c757d.text=Restaurant+Image'); ?>');">
|
||||
<div class="restaurant-hero-menu-content">
|
||||
<h1><?php echo htmlspecialchars($restaurant['name']); ?></h1>
|
||||
<p><?php echo htmlspecialchars(implode(', ', $restaurant['cuisines'])); ?></p>
|
||||
<div class="d-flex align-items-center">
|
||||
<span class="h4 text-warning me-2"><?php echo $average_rating; ?> ★</span>
|
||||
<span class="text-white">(<?php echo count($ratings); ?> reviews)</span>
|
||||
<h1 class="display-4 fw-bold"><?php echo htmlspecialchars($restaurant['name']); ?></h1>
|
||||
<p class="lead"><?php echo htmlspecialchars($restaurant['cuisines']); ?></p>
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<span class="h4 text-warning me-2 fw-bold"><?php echo number_format($average_rating, 1); ?> <i class="fas fa-star"></i></span>
|
||||
<span class="text-white">(<?php echo $rating_count; ?> reviews)</span>
|
||||
<?php if (isset($_SESSION['user_id'])) : ?>
|
||||
<form action="toggle_favorite.php" method="post" class="ms-4">
|
||||
<input type="hidden" name="restaurant_id" value="<?php echo $restaurant_id; ?>">
|
||||
<button type="submit" class="btn <?php echo $is_favorite ? 'btn-danger' : 'btn-outline-light'; ?>">
|
||||
<?php echo $is_favorite ? '♥ Favorited' : '♡ Add to Favorites'; ?>
|
||||
<button type="submit" class="btn <?php echo $is_favorite ? 'btn-danger' : 'btn-outline-light'; ?> btn-sm">
|
||||
<i class="fas fa-heart"></i> <?php echo $is_favorite ? 'Favorited' : 'Favorite'; ?>
|
||||
</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
@ -93,79 +88,85 @@ try {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="container my-5">
|
||||
<?php if ($shutdown_active): ?>
|
||||
<div class="alert alert-danger text-center" role="alert">
|
||||
<h4 class="alert-heading">Ordering Temporarily Disabled</h4>
|
||||
<p>Due to severe weather conditions, we have temporarily suspended all delivery services. The safety of our drivers and customers is our top priority.</p>
|
||||
<hr>
|
||||
<p class="mb-0">We apologize for any inconvenience and will resume operations as soon as it is safe to do so.</p>
|
||||
<p>We have temporarily suspended all delivery services for safety reasons. We apologize for any inconvenience.</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<h2 class="mb-4">Menu</h2>
|
||||
<div class="menu-grid">
|
||||
<h2 class="mb-4 fw-bold">Menu</h2>
|
||||
<div class="row row-cols-1 row-cols-md-2 g-4">
|
||||
<?php if ($menu_items): ?>
|
||||
<?php foreach ($menu_items as $item): ?>
|
||||
<div class="menu-item-card">
|
||||
<div class="menu-item-card-content">
|
||||
<h3><?php echo htmlspecialchars($item['name']); ?></h3>
|
||||
<p class="description"><?php echo htmlspecialchars($item['description']); ?></p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="price">$<?php echo htmlspecialchars(number_format($item['price'], 2)); ?></span>
|
||||
<?php if ($shutdown_active): ?>
|
||||
<button type="button" class="btn btn-danger disabled">Ordering Disabled</button>
|
||||
<?php else: ?>
|
||||
<form action="cart_actions.php" method="post" class="add-to-cart-form">
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="restaurant_id" value="<?php echo $restaurant_id; ?>">
|
||||
<input type="hidden" name="menu_item_id" value="<?php echo $item['id']; ?>">
|
||||
<div class="input-group">
|
||||
<input type="number" name="quantity" class="form-control quantity-input" value="1" min="1">
|
||||
<button type="submit" class="btn btn-primary add-to-cart-btn">Add</button>
|
||||
<div class="col">
|
||||
<div class="card menu-item-card-new h-100 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img src="<?php echo htmlspecialchars($item['image_url'] ?: 'https://via.placeholder.com/300x300/dee2e6/6c757d.text=No+Image'); ?>" class="img-fluid rounded-start" alt="<?php echo htmlspecialchars($item['name']); ?>">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body d-flex flex-column h-100">
|
||||
<h5 class="card-title fw-bold"><?php echo htmlspecialchars($item['name']); ?></h5>
|
||||
<p class="card-text text-muted flex-grow-1"><?php echo htmlspecialchars($item['description']); ?></p>
|
||||
<div class="d-flex justify-content-between align-items-center mt-auto">
|
||||
<span class="price fs-5 fw-bold text-primary">$<?php echo htmlspecialchars(number_format($item['price'], 2)); ?></span>
|
||||
<?php if (!$shutdown_active): ?>
|
||||
<form action="cart_actions.php" method="post" class="add-to-cart-form">
|
||||
<input type="hidden" name="action" value="add">
|
||||
<input type="hidden" name="restaurant_id" value="<?php echo $restaurant_id; ?>">
|
||||
<input type="hidden" name="menu_item_id" value="<?php echo $item['id']; ?>">
|
||||
<input type="hidden" name="quantity" value="1">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Add <i class="fas fa-cart-plus"></i></button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!empty($item['image_url'])): ?>
|
||||
<img src="<?php echo htmlspecialchars($item['image_url']); ?>" class="menu-item-image" alt="<?php echo htmlspecialchars($item['name']); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<p class="alert alert-info">This restaurant has no menu items yet.</p>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-info text-center">
|
||||
<i class="fas fa-info-circle fa-2x mb-2"></i><br>
|
||||
This restaurant has no menu items yet.
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="reviews-section">
|
||||
<h2 class="mb-4">Reviews</h2>
|
||||
<div class="reviews-section bg-light p-4 rounded-3">
|
||||
<h2 class="mb-4 fw-bold">Reviews</h2>
|
||||
<?php if ($ratings): ?>
|
||||
<?php foreach (array_slice($ratings, 0, 3) as $rating): ?>
|
||||
<div class="review-card">
|
||||
<div class="review-header">
|
||||
<strong><?php echo htmlspecialchars($rating['user_name']); ?></strong>
|
||||
<span class="text-warning"><?php echo str_repeat('★', $rating['rating']) . str_repeat('☆', 5 - $rating['rating']); ?></span>
|
||||
<?php foreach (array_slice($ratings, 0, 5) as $rating): ?>
|
||||
<div class="review-card mb-3">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<strong class="me-auto"><?php echo htmlspecialchars($rating['user_name']); ?></strong>
|
||||
<span class="text-warning small"><?php echo str_repeat('★', $rating['rating']) . str_repeat('☆', 5 - $rating['rating']); ?></span>
|
||||
</div>
|
||||
<p class="review-text">"<?php echo nl2br(htmlspecialchars($rating['review'])); ?>"</p>
|
||||
<small class="text-muted"><?php echo date('F Y', strtotime($rating['created_at'])); ?></small>
|
||||
<p class="review-text fst-italic text-muted">"<?php echo nl2br(htmlspecialchars($rating['review'])); ?>"</p>
|
||||
<small class="text-muted"><?php echo date('F j, Y', strtotime($rating['created_at'])); ?></small>
|
||||
</div>
|
||||
<hr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<p>This restaurant has no reviews yet.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_SESSION['user_id'])): ?>
|
||||
<a href="leave_review.php?restaurant_id=<?php echo $restaurant_id; ?>" class="btn btn-outline-primary mt-3">Leave a Review</a>
|
||||
<a href="leave_review.php?restaurant_id=<?php echo $restaurant_id; ?>" class="btn btn-outline-primary mt-3 w-100">Leave a Review</a>
|
||||
<?php else: ?>
|
||||
<p class="mt-3"><a href="login.php?redirect_url=<?php echo urlencode($_SERVER['REQUEST_URI']); ?>">Log in</a> to leave a review.</p>
|
||||
<p class="mt-3 text-center"><a href="login.php?redirect_url=<?php echo urlencode($_SERVER['REQUEST_URI']); ?>">Log in</a> to leave a review.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once 'footer.php'; ?>
|
||||
<?php require_once 'footer.php'; ?>
|
||||
|
||||
3
migrations/20251016_add_label_notes_to_restaurants.sql
Normal file
3
migrations/20251016_add_label_notes_to_restaurants.sql
Normal file
@ -0,0 +1,3 @@
|
||||
ALTER TABLE restaurants
|
||||
ADD COLUMN location_label VARCHAR(255) NULL,
|
||||
ADD COLUMN location_notes TEXT NULL;
|
||||
5
migrations/20251016_add_location_fields_to_users.sql
Normal file
5
migrations/20251016_add_location_fields_to_users.sql
Normal file
@ -0,0 +1,5 @@
|
||||
ALTER TABLE users
|
||||
ADD COLUMN lat DECIMAL(10, 8) NULL,
|
||||
ADD COLUMN lng DECIMAL(11, 8) NULL,
|
||||
ADD COLUMN location_label VARCHAR(255) NULL,
|
||||
ADD COLUMN location_notes TEXT NULL;
|
||||
@ -0,0 +1 @@
|
||||
ALTER TABLE restaurants ADD COLUMN location_status VARCHAR(255) DEFAULT 'pending_approval';
|
||||
36
migrations/20251017_create_pages_table.sql
Normal file
36
migrations/20251017_create_pages_table.sql
Normal file
@ -0,0 +1,36 @@
|
||||
CREATE TABLE IF NOT EXISTS pages (
|
||||
id SERIAL PRIMARY KEY,
|
||||
page_key VARCHAR(255) NOT NULL UNIQUE,
|
||||
page_title VARCHAR(255) NOT NULL,
|
||||
content TEXT,
|
||||
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE OR REPLACE FUNCTION update_updated_at_column()
|
||||
RETURNS TRIGGER AS $$
|
||||
BEGIN
|
||||
NEW.updated_at = NOW();
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ language 'plpgsql';
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM pg_trigger
|
||||
WHERE tgname = 'update_pages_updated_at'
|
||||
) THEN
|
||||
CREATE TRIGGER update_pages_updated_at
|
||||
BEFORE UPDATE ON pages
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION update_updated_at_column();
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
|
||||
INSERT INTO pages (page_key, page_title, content) VALUES
|
||||
('about_us', 'About Us', '<h1>About Us</h1><p>Welcome to our website. This is the about us page. You can edit this content from the admin dashboard.</p>'),
|
||||
('how_it_works', 'How It Works', '<h1>How It Works</h1><p>This is the how it works page. You can edit this content from the admin dashboard.</p>')
|
||||
ON CONFLICT (page_key) DO NOTHING;
|
||||
6
migrations/20251017_create_required_documents_table.sql
Normal file
6
migrations/20251017_create_required_documents_table.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE TABLE IF NOT EXISTS required_documents (
|
||||
id SERIAL PRIMARY KEY,
|
||||
document_name VARCHAR(255) NOT NULL,
|
||||
applies_to VARCHAR(10) NOT NULL CHECK (applies_to IN ('driver', 'restaurant')),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
9
migrations/20251017_create_user_documents_table.sql
Normal file
9
migrations/20251017_create_user_documents_table.sql
Normal file
@ -0,0 +1,9 @@
|
||||
CREATE TABLE IF NOT EXISTS user_documents (
|
||||
id SERIAL PRIMARY KEY,
|
||||
user_id INT NOT NULL,
|
||||
document_id INT NOT NULL,
|
||||
file_path VARCHAR(255) NOT NULL,
|
||||
uploaded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (document_id) REFERENCES required_documents(id) ON DELETE CASCADE
|
||||
);
|
||||
119
order_status.php
119
order_status.php
@ -15,8 +15,12 @@ if (!$order_id) {
|
||||
$pdo = db();
|
||||
$order = null;
|
||||
|
||||
// Fetch order details along with restaurant location
|
||||
$sql = "SELECT o.*, r.name as restaurant_name, r.lat as restaurant_lat, r.lng as restaurant_lng FROM orders o JOIN restaurants r ON o.restaurant_id = r.id WHERE o.id = ?";
|
||||
// Fetch order details along with restaurant and user location
|
||||
$sql = "SELECT o.*, r.name as restaurant_name, r.lat as restaurant_lat, r.lng as restaurant_lng, u.address as user_address
|
||||
FROM orders o
|
||||
JOIN restaurants r ON o.restaurant_id = r.id
|
||||
LEFT JOIN users u ON o.user_id = u.id
|
||||
WHERE o.id = ?";
|
||||
$params = [$order_id];
|
||||
|
||||
if ($user_id) {
|
||||
@ -61,13 +65,14 @@ include 'header.php';
|
||||
<h1 class="card-title fw-bold">Thank You For Your Order!</h1>
|
||||
<p class="text-muted">Order #<?php echo $order['id']; ?></p>
|
||||
<p><strong>Restaurant:</strong> <?php echo htmlspecialchars($order['restaurant_name']); ?></p>
|
||||
<p><strong>Delivering To:</strong> <?php echo htmlspecialchars($order['user_address'] ?: 'Guest (Address not available)'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title text-center mb-4">Live Order Tracking</h4>
|
||||
<div id="map" style="height: 400px; border-radius: .25rem;"></div>
|
||||
<div id="map" style="height: 400px; border-radius: .25rem; background-color: #e9ecef;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -109,7 +114,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const orderId = <?php echo $order_id; ?>;
|
||||
const token = '<?php echo $token; ?>';
|
||||
const timelineContainer = document.getElementById('order-status-timeline');
|
||||
const currentStatus = '<?php echo $order['status']; ?>';
|
||||
let clientSideStatus = '<?php echo $order['status']; ?>';
|
||||
|
||||
const statuses = [
|
||||
{ name: 'Pending', desc: 'Your order has been placed and is waiting for the restaurant to accept it.' },
|
||||
@ -138,7 +143,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
statuses.forEach((s, index) => {
|
||||
const item = document.createElement('div');
|
||||
let itemClass = 'timeline-item';
|
||||
@ -164,45 +168,24 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
});
|
||||
}
|
||||
|
||||
function fetchStatus() {
|
||||
let url = `api/get_order_status.php?order_id=${orderId}`;
|
||||
if (token) {
|
||||
url += `&token=${token}`;
|
||||
}
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status) {
|
||||
renderTimeline(data.status);
|
||||
} else if(data.error) {
|
||||
console.error('Error fetching status:', data.error);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Fetch error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
renderTimeline(currentStatus);
|
||||
setInterval(fetchStatus, 10000); // Poll every 10 seconds
|
||||
|
||||
// --- New Map Logic ---
|
||||
// --- Map Logic ---
|
||||
let map = null;
|
||||
let driverMarker = null;
|
||||
let driverLocationInterval = null;
|
||||
const restaurantLocation = {
|
||||
lat: <?php echo $order['restaurant_lat'] ?? 'null'; ?>,
|
||||
lng: <?php echo $order['restaurant_lng'] ?? 'null'; ?>
|
||||
};
|
||||
|
||||
const driverIcon = L.icon({
|
||||
iconUrl: 'assets/images/driver-icon.svg', // Custom driver icon
|
||||
iconUrl: 'assets/images/driver-icon.svg',
|
||||
iconSize: [38, 38],
|
||||
iconAnchor: [19, 38],
|
||||
popupAnchor: [0, -38]
|
||||
});
|
||||
|
||||
const restaurantIcon = L.icon({
|
||||
iconUrl: 'assets/images/restaurant-icon.svg', // Custom restaurant icon
|
||||
iconUrl: 'assets/images/restaurant-icon.svg',
|
||||
iconSize: [38, 38],
|
||||
iconAnchor: [19, 38],
|
||||
popupAnchor: [0, -38]
|
||||
@ -210,30 +193,19 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
function initializeMap() {
|
||||
if (map || !restaurantLocation.lat) return;
|
||||
|
||||
map = L.map('map').setView([restaurantLocation.lat, restaurantLocation.lng], 14);
|
||||
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© OpenStreetMap contributors'
|
||||
}).addTo(map);
|
||||
|
||||
L.marker([restaurantLocation.lat, restaurantLocation.lng], { icon: restaurantIcon })
|
||||
.addTo(map)
|
||||
.bindPopup('<b><?php echo htmlspecialchars($order['restaurant_name']); ?></b>');
|
||||
.bindPopup('<b><?php echo htmlspecialchars(addslashes($order['restaurant_name'])); ?></b>');
|
||||
}
|
||||
|
||||
function fetchDriverLocation() {
|
||||
// Only start fetching if the order is 'Out For Delivery'
|
||||
if (currentStatus.toLowerCase() !== 'out for delivery') {
|
||||
// You might want to hide the map or show a message until the driver is on the way
|
||||
// For now, we just won't fetch the location.
|
||||
return;
|
||||
}
|
||||
|
||||
let url = `api/get_driver_location.php?order_id=${orderId}`;
|
||||
if (token) {
|
||||
url += `&token=${token}`;
|
||||
}
|
||||
if (token) url += `&token=${token}`;
|
||||
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
@ -247,11 +219,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
} else {
|
||||
driverMarker.setLatLng(driverLatLng);
|
||||
}
|
||||
// Optional: Adjust map bounds to show both restaurant and driver
|
||||
if (driverMarker) {
|
||||
const bounds = L.latLngBounds([restaurantLocation.lat, restaurantLocation.lng], driverMarker.getLatLng());
|
||||
map.fitBounds(bounds.pad(0.3));
|
||||
}
|
||||
|
||||
const bounds = L.latLngBounds([restaurantLocation.lat, restaurantLocation.lng], driverMarker.getLatLng());
|
||||
map.fitBounds(bounds.pad(0.3));
|
||||
|
||||
} else {
|
||||
console.warn('Driver location not available yet.');
|
||||
}
|
||||
@ -259,11 +230,53 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
.catch(error => console.error('Error fetching driver location:', error));
|
||||
}
|
||||
|
||||
initializeMap();
|
||||
// Start polling for driver location immediately and repeat every 5 seconds
|
||||
fetchDriverLocation();
|
||||
setInterval(fetchDriverLocation, 5000);
|
||||
function startDriverTracking() {
|
||||
if (driverLocationInterval) return; // Already running
|
||||
initializeMap();
|
||||
fetchDriverLocation(); // Fetch immediately
|
||||
driverLocationInterval = setInterval(fetchDriverLocation, 5000); // Then poll every 5 seconds
|
||||
}
|
||||
|
||||
function stopDriverTracking() {
|
||||
if (driverLocationInterval) {
|
||||
clearInterval(driverLocationInterval);
|
||||
driverLocationInterval = null;
|
||||
}
|
||||
}
|
||||
|
||||
function fetchStatus() {
|
||||
let url = `api/get_order_status.php?order_id=${orderId}`;
|
||||
if (token) url += `&token=${token}`;
|
||||
|
||||
fetch(url)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status && data.status !== clientSideStatus) {
|
||||
clientSideStatus = data.status;
|
||||
renderTimeline(clientSideStatus);
|
||||
|
||||
if (clientSideStatus.toLowerCase() === 'out for delivery') {
|
||||
startDriverTracking();
|
||||
} else if (['delivered', 'cancelled'].includes(clientSideStatus.toLowerCase())) {
|
||||
stopDriverTracking();
|
||||
}
|
||||
} else if(data.error) {
|
||||
console.error('Error fetching status:', data.error);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Fetch error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
// Initial setup
|
||||
renderTimeline(clientSideStatus);
|
||||
if (clientSideStatus.toLowerCase() === 'out for delivery') {
|
||||
startDriverTracking();
|
||||
}
|
||||
|
||||
setInterval(fetchStatus, 10000); // Poll for status updates every 10 seconds
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<?php include 'footer.php'; ?>
|
||||
|
||||
220
profile.php
220
profile.php
@ -1,165 +1,99 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
include 'header.php';
|
||||
require_once 'includes/api_keys.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
include 'header.php';
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$db = db();
|
||||
|
||||
// Handle profile update
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['update_profile'])) {
|
||||
$name = trim($_POST['name']);
|
||||
$email = trim($_POST['email']);
|
||||
$address = trim($_POST['address']);
|
||||
|
||||
if (empty($name) || empty($email)) {
|
||||
$profile_error = "Name and email are required.";
|
||||
} else {
|
||||
$p_update = $db->prepare("UPDATE users SET name = ?, email = ?, address = ? WHERE id = ?");
|
||||
$p_update->execute([$name, $email, $address, $user_id]);
|
||||
$profile_success = "Profile updated successfully!";
|
||||
}
|
||||
}
|
||||
|
||||
// Handle password change
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
|
||||
$current_password = $_POST['current_password'];
|
||||
$new_password = $_POST['new_password'];
|
||||
$confirm_password = $_POST['confirm_password'];
|
||||
|
||||
$p_user = $db->prepare("SELECT password FROM users WHERE id = ?");
|
||||
$p_user->execute([$user_id]);
|
||||
$user_data = $p_user->fetch();
|
||||
|
||||
if (empty($current_password) || empty($new_password) || empty($confirm_password)) {
|
||||
$password_error = "All password fields are required.";
|
||||
} elseif (!password_verify($current_password, $user_data['password'])) {
|
||||
$password_error = "Incorrect current password.";
|
||||
} elseif ($new_password !== $confirm_password) {
|
||||
$password_error = "New passwords do not match.";
|
||||
} else {
|
||||
$hashed_password = password_hash($new_password, PASSWORD_DEFAULT);
|
||||
$p_pass_update = $db->prepare("UPDATE users SET password = ? WHERE id = ?");
|
||||
$p_pass_update->execute([$hashed_password, $user_id]);
|
||||
$password_success = "Password changed successfully!";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Fetch user data
|
||||
$p_user = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$p_user->execute([$user_id]);
|
||||
$user = $p_user->fetch();
|
||||
|
||||
// Fetch favorite restaurants
|
||||
$fav_stmt = $db->prepare("
|
||||
SELECT r.id, r.name, r.image_url, c.name as cuisine_name
|
||||
FROM favorite_restaurants fr
|
||||
JOIN restaurants r ON fr.restaurant_id = r.id
|
||||
LEFT JOIN restaurant_cuisines rc ON r.id = rc.restaurant_id
|
||||
LEFT JOIN cuisines c ON rc.cuisine_id = c.id
|
||||
WHERE fr.user_id = ?
|
||||
GROUP BY r.id
|
||||
");
|
||||
$fav_stmt->execute([$user_id]);
|
||||
$favorite_restaurants = $fav_stmt->fetchAll();
|
||||
// Fetch user's data
|
||||
$stmt = $db->prepare("SELECT * FROM users WHERE id = ?");
|
||||
$stmt->execute([$user_id]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>My Profile</h2>
|
||||
<hr>
|
||||
<h2>Account Settings</h2>
|
||||
<hr>
|
||||
|
||||
<?php if (isset($profile_success)): ?>
|
||||
<div class="alert alert-success"><?php echo $profile_success; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($profile_error)): ?>
|
||||
<div class="alert alert-danger"><?php echo $profile_error; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST" action="profile.php">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="<?php echo htmlspecialchars($user['name']); ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="<?php echo htmlspecialchars($user['email']); ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="address" class="form-label">Address</label>
|
||||
<textarea class="form-control" id="address" name="address" rows="3"><?php echo htmlspecialchars($user['address']); ?></textarea>
|
||||
</div>
|
||||
<button type="submit" name="update_profile" class="btn btn-primary">Update Profile</button>
|
||||
</form>
|
||||
<form action="profile_update.php" method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="<?php echo htmlspecialchars($user['email']); ?>" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2>Change Password</h2>
|
||||
<hr>
|
||||
|
||||
<?php if (isset($password_success)): ?>
|
||||
<div class="alert alert-success"><?php echo $password_success; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($password_error)): ?>
|
||||
<div class="alert alert-danger"><?php echo $password_error; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST" action="profile.php">
|
||||
<div class="mb-3">
|
||||
<label for="current_password" class="form-label">Current Password</label>
|
||||
<input type="password" class="form-control" id="current_password" name="current_password" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="new_password" class="form-label">New Password</label>
|
||||
<input type="password" class="form-control" id="new_password" name="new_password" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="confirm_password" class="form-label">Confirm New Password</label>
|
||||
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
|
||||
</div>
|
||||
<button type="submit" name="change_password" class="btn btn-primary">Change Password</button>
|
||||
</form>
|
||||
<div class="mb-3">
|
||||
<label for="phone" class="form-label">Phone Number</label>
|
||||
<input type="text" class="form-control" id="phone" name="phone" value="<?php echo htmlspecialchars($user['phone_number']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-5">
|
||||
<a href="order_history.php" class="btn btn-secondary">View Order History</a>
|
||||
</div>
|
||||
|
||||
<div class="row mt-5">
|
||||
<div class="col-12">
|
||||
<h2>My Favorite Restaurants</h2>
|
||||
<hr>
|
||||
<?php if ($favorite_restaurants): ?>
|
||||
<div class="row">
|
||||
<?php foreach ($favorite_restaurants as $fav_restaurant): ?>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100">
|
||||
<a href="menu.php?restaurant_id=<?php echo $fav_restaurant['id']; ?>">
|
||||
<img src="<?php echo htmlspecialchars($fav_restaurant['image_url'] ? $fav_restaurant['image_url'] : 'https://via.placeholder.com/300x200'); ?>" class="card-img-top" alt="<?php echo htmlspecialchars($fav_restaurant['name']); ?>" style="height: 200px; object-fit: cover;">
|
||||
</a>
|
||||
<div class="card-body d-flex flex-column">
|
||||
<h5 class="card-title"><?php echo htmlspecialchars($fav_restaurant['name']); ?></h5>
|
||||
<p class="card-text text-muted"><?php echo htmlspecialchars($fav_restaurant['cuisine_name']); ?></p>
|
||||
<a href="menu.php?restaurant_id=<?php echo $fav_restaurant['id']; ?>" class="btn btn-primary mt-auto">View Menu</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<p>You haven't added any favorite restaurants yet. <a href="index.php">Explore restaurants</a> to find some!</p>
|
||||
<?php endif; ?>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">New Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password">
|
||||
<small class="form-text text-muted">Leave blank if you don't want to change it.</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password_confirm" class="form-label">Confirm New Password</label>
|
||||
<input type="password" class="form-control" id="password_confirm" name="password_confirm">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h4>Location</h4>
|
||||
<div class="mb-3">
|
||||
<label for="location_label" class="form-label">Location Label</label>
|
||||
<input type="text" class="form-control" id="location_label" name="location_label" value="<?php echo htmlspecialchars($user['location_label']); ?>" placeholder="e.g., 'Near Majuro Hospital'">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="location_notes" class="form-label">Location Notes</label>
|
||||
<textarea class="form-control" id="location_notes" name="location_notes" rows="3" placeholder="e.g., 'Red roof building'"><?php echo htmlspecialchars($user['location_notes']); ?></textarea>
|
||||
</div>
|
||||
|
||||
<div id='map' style='width: 100%; height: 400px;'></div>
|
||||
<input type="hidden" id="lat" name="lat" value="<?php echo htmlspecialchars($user['lat']); ?>">
|
||||
<input type="hidden" id="lng" name="lng" value="<?php echo htmlspecialchars($user['lng']); ?>">
|
||||
|
||||
<hr>
|
||||
<h4>Payment Methods</h4>
|
||||
<div class="mb-3">
|
||||
<p>Connect your payment methods to receive payments.</p>
|
||||
<a href="#" class="btn btn-primary">Connect with Stripe</a>
|
||||
<a href="#" class="btn btn-info">Connect with PayPal</a>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary mt-3">Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
<script src='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js'></script>
|
||||
<link href='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css' rel='stylesheet' />
|
||||
<script>
|
||||
mapboxgl.accessToken = '<?php echo MAPBOX_API_KEY; ?>';
|
||||
const lat = document.getElementById('lat');
|
||||
const lng = document.getElementById('lng');
|
||||
|
||||
const map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
style: 'mapbox://styles/mapbox/streets-v11',
|
||||
center: [<?php echo $user['lng'] ? htmlspecialchars($user['lng']) : 171.380; ?>, <?php echo $user['lat'] ? htmlspecialchars($user['lat']) : 7.135; ?>],
|
||||
zoom: 13
|
||||
});
|
||||
|
||||
let marker = new mapboxgl.Marker()
|
||||
.setLngLat([<?php echo $user['lng'] ? htmlspecialchars($user['lng']) : 171.380; ?>, <?php echo $user['lat'] ? htmlspecialchars($user['lat']) : 7.135; ?>])
|
||||
.addTo(map);
|
||||
|
||||
map.on('click', (e) => {
|
||||
const coordinates = e.lngLat;
|
||||
lat.value = coordinates.lat;
|
||||
lng.value = coordinates.lng;
|
||||
marker.setLngLat(coordinates).addTo(map);
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php include 'footer.php'; ?>
|
||||
|
||||
68
profile_update.php
Normal file
68
profile_update.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header("Location: login.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$db = db();
|
||||
|
||||
// Get form data
|
||||
$email = $_POST['email'];
|
||||
$phone = $_POST['phone'];
|
||||
$password = $_POST['password'];
|
||||
$password_confirm = $_POST['password_confirm'];
|
||||
$location_label = $_POST['location_label'];
|
||||
$location_notes = $_POST['location_notes'];
|
||||
$lat = $_POST['lat'];
|
||||
$lng = $_POST['lng'];
|
||||
|
||||
// --- Validation ---
|
||||
if (empty($email)) {
|
||||
$_SESSION['error_message'] = "Email is required.";
|
||||
header("Location: profile.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Check if email is already taken by another user
|
||||
$stmt = $db->prepare("SELECT id FROM users WHERE email = ? AND id != ?");
|
||||
$stmt->execute([$email, $user_id]);
|
||||
if ($stmt->fetch()) {
|
||||
$_SESSION['error_message'] = "Email is already in use by another account.";
|
||||
header("Location: profile.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Update basic info
|
||||
$sql = "UPDATE users SET email = ?, phone_number = ?, location_label = ?, location_notes = ?, lat = ?, lng = ? WHERE id = ?";
|
||||
$params = [$email, $phone, $location_label, $location_notes, $lat, $lng, $user_id];
|
||||
$stmt = $db->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
|
||||
// Update password if provided and matches confirmation
|
||||
if (!empty($password)) {
|
||||
if ($password !== $password_confirm) {
|
||||
$_SESSION['error_message'] = "Passwords do not match.";
|
||||
header("Location: profile.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
|
||||
$stmt = $db->prepare("UPDATE users SET password = ? WHERE id = ?");
|
||||
$stmt->execute([$hashed_password, $user_id]);
|
||||
}
|
||||
|
||||
$_SESSION['success_message'] = "Your profile has been updated successfully.";
|
||||
header("Location: profile.php");
|
||||
exit();
|
||||
|
||||
} else {
|
||||
// Redirect if not a POST request
|
||||
header("Location: profile.php");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
@ -27,12 +27,33 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$description = $_POST['description'] ?? '';
|
||||
$price = $_POST['price'] ?? '';
|
||||
$promotion_id = $_POST['promotion_id'] ?? null;
|
||||
$image_url = null;
|
||||
|
||||
if ($name && $price) {
|
||||
$stmt = $pdo->prepare("INSERT INTO menu_items (restaurant_id, name, description, price, promotion_id) VALUES (?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$restaurant_id, $name, $description, $price, $promotion_id]);
|
||||
header('Location: menu.php');
|
||||
exit;
|
||||
try {
|
||||
if (isset($_FILES['image']) && $_FILES['image']['error'] === UPLOAD_ERR_OK) {
|
||||
require_once '../includes/S3Service.php';
|
||||
$tmp_path = $_FILES['image']['tmp_name'];
|
||||
$file_name = $_FILES['image']['name'];
|
||||
$file_type = $_FILES['image']['type'];
|
||||
|
||||
$extension = pathinfo($file_name, PATHINFO_EXTENSION);
|
||||
$key = "menu_items/{$restaurant_id}/" . uniqid() . "." . $extension;
|
||||
|
||||
$image_url = S3Service::uploadFile($tmp_path, $key);
|
||||
|
||||
if (!$image_url) {
|
||||
throw new Exception("Failed to upload image to S3.");
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = $pdo->prepare("INSERT INTO menu_items (restaurant_id, name, description, price, promotion_id, image_url) VALUES (?, ?, ?, ?, ?, ?)");
|
||||
$stmt->execute([$restaurant_id, $name, $description, $price, $promotion_id, $image_url]);
|
||||
header('Location: menu.php');
|
||||
exit;
|
||||
} catch (Exception $e) {
|
||||
$error = "Error: " . $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
$error = "Name and price are required.";
|
||||
}
|
||||
@ -51,7 +72,7 @@ $promotions = $stmt->fetchAll();
|
||||
<div class="alert alert-danger"><?php echo $error; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="add_menu_item.php" method="POST">
|
||||
<form action="add_menu_item.php" method="POST" enctype="multipart/form-data">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" required>
|
||||
@ -64,6 +85,10 @@ $promotions = $stmt->fetchAll();
|
||||
<label for="price" class="form-label">Price</label>
|
||||
<input type="number" step="0.01" class="form-control" id="price" name="price" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="image" class="form-label">Image</label>
|
||||
<input type="file" class="form-control" id="image" name="image">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="promotion_id" class="form-label">Promotion</label>
|
||||
<select class="form-control" id="promotion_id" name="promotion_id">
|
||||
|
||||
@ -43,12 +43,35 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$description = $_POST['description'] ?? '';
|
||||
$price = $_POST['price'] ?? '';
|
||||
$promotion_id = $_POST['promotion_id'] ?? null;
|
||||
$image_url = $item['image_url']; // Keep old image by default
|
||||
|
||||
if ($name && $price) {
|
||||
$stmt = $pdo->prepare("UPDATE menu_items SET name = ?, description = ?, price = ?, promotion_id = ? WHERE id = ? AND restaurant_id = ?");
|
||||
$stmt->execute([$name, $description, $price, $promotion_id, $menu_item_id, $restaurant_id]);
|
||||
header('Location: menu.php');
|
||||
exit;
|
||||
try {
|
||||
// Handle new image upload
|
||||
if (isset($_FILES['image']) && $_FILES['image']['error'] === UPLOAD_ERR_OK) {
|
||||
require_once '../includes/S3Service.php';
|
||||
$tmp_path = $_FILES['image']['tmp_name'];
|
||||
$file_name = $_FILES['image']['name'];
|
||||
|
||||
$extension = pathinfo($file_name, PATHINFO_EXTENSION);
|
||||
$key = "menu_items/{$restaurant_id}/" . uniqid() . "." . $extension;
|
||||
|
||||
$new_image_url = S3Service::uploadFile($tmp_path, $key);
|
||||
|
||||
if ($new_image_url) {
|
||||
$image_url = $new_image_url; // Set new image URL
|
||||
} else {
|
||||
throw new Exception("Failed to upload new image to S3.");
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = $pdo->prepare("UPDATE menu_items SET name = ?, description = ?, price = ?, promotion_id = ?, image_url = ? WHERE id = ? AND restaurant_id = ?");
|
||||
$stmt->execute([$name, $description, $price, $promotion_id, $image_url, $menu_item_id, $restaurant_id]);
|
||||
header('Location: menu.php');
|
||||
exit;
|
||||
} catch (Exception $e) {
|
||||
$error = "Error: " . $e->getMessage();
|
||||
}
|
||||
} else {
|
||||
$error = "Name and price are required.";
|
||||
}
|
||||
@ -67,7 +90,7 @@ $promotions = $stmt->fetchAll();
|
||||
<div class="alert alert-danger"><?php echo $error; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="edit_menu_item.php?id=<?php echo $item['id']; ?>" method="POST">
|
||||
<form action="edit_menu_item.php?id=<?php echo $item['id']; ?>" method="POST" enctype="multipart/form-data">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="<?php echo htmlspecialchars($item['name']); ?>" required>
|
||||
@ -80,6 +103,15 @@ $promotions = $stmt->fetchAll();
|
||||
<label for="price" class="form-label">Price</label>
|
||||
<input type="number" step="0.01" class="form-control" id="price" name="price" value="<?php echo htmlspecialchars($item['price']); ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="image" class="form-label">Image</label>
|
||||
<input type="file" class="form-control" id="image" name="image">
|
||||
<?php if ($item['image_url']): ?>
|
||||
<div class="mt-2">
|
||||
<img src="<?php echo htmlspecialchars($item['image_url']); ?>" alt="Current Image" style="max-width: 200px; height: auto;">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="promotion_id" class="form-label">Promotion</label>
|
||||
<select class="form-control" id="promotion_id" name="promotion_id">
|
||||
|
||||
@ -1,10 +1,19 @@
|
||||
<?php include 'header.php'; ?>
|
||||
<?php
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
$db = db();
|
||||
$stmt = $db->prepare("SELECT id, document_name FROM required_documents WHERE applies_to = 'restaurant'");
|
||||
$stmt->execute();
|
||||
$required_documents = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
include 'header.php';
|
||||
?>
|
||||
|
||||
<main>
|
||||
<div class="auth-container">
|
||||
<h1>Create a Restaurant Account</h1>
|
||||
<p>Sign up to list your restaurant on our platform.</p>
|
||||
<form action="restaurant_signup_process.php" method="POST">
|
||||
<form action="restaurant_signup_process.php" method="POST" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="name">Your Name</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
@ -31,8 +40,75 @@
|
||||
<label for="restaurant_phone">Restaurant Phone</label>
|
||||
<input type="text" id="restaurant_phone" name="restaurant_phone" required>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h4>Required Documents</h4>
|
||||
<?php foreach ($required_documents as $doc): ?>
|
||||
<div class="form-group">
|
||||
<label for="doc_<?php echo htmlspecialchars($doc['id']); ?>"><?php echo htmlspecialchars($doc['document_name']); ?></label>
|
||||
<input type="file" id="doc_<?php echo htmlspecialchars($doc['id']); ?>" name="documents[<?php echo htmlspecialchars($doc['id']); ?>]" class="form-control" required>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<hr>
|
||||
<h4>Set Your Restaurant's Location</h4>
|
||||
<p><small>Pin your location on the map to help drivers find you.</small></p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location_label">Location Label</label>
|
||||
<input type="text" class="form-control" id="location_label" name="location_label" placeholder="e.g., 'Across from the post office'">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location_notes">Location Notes</label>
|
||||
<textarea class="form-control" id="location_notes" name="location_notes" rows="2" placeholder="e.g., 'Entrance is on the side street'"></textarea>
|
||||
</div>
|
||||
|
||||
<div id='map' style='width: 100%; height: 300px; margin-bottom: 15px;'></div>
|
||||
<input type="hidden" id="lat" name="lat">
|
||||
<input type="hidden" id="lng" name="lng">
|
||||
|
||||
<button type="submit" class="btn-submit">Sign Up</button>
|
||||
</form>
|
||||
<script src='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js'></script>
|
||||
<link href='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css' rel='stylesheet' />
|
||||
<script>
|
||||
mapboxgl.accessToken = '<?php require_once 'includes/api_keys.php'; echo MAPBOX_API_KEY; ?>';
|
||||
const lat_input = document.getElementById('lat');
|
||||
const lng_input = document.getElementById('lng');
|
||||
|
||||
const map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
style: 'mapbox://styles/mapbox/streets-v11',
|
||||
center: [171.380, 7.135], // Default to Majuro
|
||||
zoom: 12
|
||||
});
|
||||
|
||||
let marker = new mapboxgl.Marker({
|
||||
draggable: true
|
||||
})
|
||||
.setLngLat([171.380, 7.135])
|
||||
.addTo(map);
|
||||
|
||||
function onDragEnd() {
|
||||
const lngLat = marker.getLngLat();
|
||||
lat_input.value = lngLat.lat;
|
||||
lng_input.value = lngLat.lng;
|
||||
}
|
||||
|
||||
marker.on('dragend', onDragEnd);
|
||||
|
||||
map.on('click', (e) => {
|
||||
const coordinates = e.lngLat;
|
||||
lat_input.value = coordinates.lat;
|
||||
lng_input.value = coordinates.lng;
|
||||
marker.setLngLat(coordinates).addTo(map);
|
||||
});
|
||||
|
||||
// Set initial values
|
||||
lat_input.value = 7.135;
|
||||
lng_input.value = 171.380;
|
||||
</script>
|
||||
<div class="form-footer">
|
||||
<p>Already have an account? <a href="restaurant_login.php">Log in</a></p>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
require_once 'includes/S3Service.php';
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
// User details
|
||||
@ -12,6 +13,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$restaurant_name = $_POST['restaurant_name'];
|
||||
$restaurant_address = $_POST['restaurant_address'];
|
||||
$restaurant_phone = $_POST['restaurant_phone'];
|
||||
$lat = $_POST['lat'];
|
||||
$lng = $_POST['lng'];
|
||||
$location_label = $_POST['location_label'];
|
||||
$location_notes = $_POST['location_notes'];
|
||||
|
||||
if (empty($name) || empty($email) || empty($password) || empty($restaurant_name) || empty($restaurant_address) || empty($restaurant_phone)) {
|
||||
die('Please fill all required fields.');
|
||||
@ -21,18 +26,24 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
die('Invalid email format.');
|
||||
}
|
||||
|
||||
if (!is_numeric($lat) || !is_numeric($lng)) {
|
||||
die('Invalid location data.');
|
||||
}
|
||||
|
||||
$pdo = db();
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
$pdo->beginTransaction();
|
||||
|
||||
// Check if email already exists
|
||||
$sql = "SELECT id FROM users WHERE email = ?";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$email]);
|
||||
if ($stmt->fetch()) {
|
||||
die('Email already exists.');
|
||||
throw new Exception('Email already exists.');
|
||||
}
|
||||
|
||||
// Create the user with 'restaurant_owner' role
|
||||
// Create the user with 'restaurant' role
|
||||
$password_hash = password_hash($password, PASSWORD_BCRYPT);
|
||||
$sql = "INSERT INTO users (name, email, password, role) VALUES (?, ?, ?, 'restaurant_owner')";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
@ -40,23 +51,55 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$user_id = $pdo->lastInsertId();
|
||||
|
||||
// Create the restaurant
|
||||
$sql = "INSERT INTO restaurants (name, address, phone_number, user_id) VALUES (?, ?, ?, ?)";
|
||||
$sql = "INSERT INTO restaurants (name, address, phone_number, user_id, lat, lng, location_label, location_notes) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$restaurant_name, $restaurant_address, $restaurant_phone, $user_id]);
|
||||
$stmt->execute([$restaurant_name, $restaurant_address, $restaurant_phone, $user_id, $lat, $lng, $location_label, $location_notes]);
|
||||
$restaurant_id = $pdo->lastInsertId();
|
||||
|
||||
// Handle file uploads
|
||||
if (isset($_FILES['documents'])) {
|
||||
foreach ($_FILES['documents']['tmp_name'] as $doc_id => $tmp_path) {
|
||||
if (!empty($tmp_path) && is_uploaded_file($tmp_path)) {
|
||||
$file_name = $_FILES['documents']['name'][$doc_id];
|
||||
$file_error = $_FILES['documents']['error'][$doc_id];
|
||||
|
||||
if ($file_error !== UPLOAD_ERR_OK) {
|
||||
throw new Exception("Failed to upload file: " . $file_name);
|
||||
}
|
||||
|
||||
$extension = pathinfo($file_name, PATHINFO_EXTENSION);
|
||||
$key = "documents/restaurants/{$user_id}/{$doc_id}_" . time() . "." . $extension;
|
||||
|
||||
$s3_url = S3Service::uploadFile($tmp_path, $key);
|
||||
|
||||
if ($s3_url) {
|
||||
$sql = "INSERT INTO user_documents (user_id, document_id, file_path) VALUES (?, ?, ?)";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$user_id, $doc_id, $s3_url]);
|
||||
} else {
|
||||
throw new Exception("Failed to upload document to S3.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pdo->commit();
|
||||
|
||||
// Log the user in
|
||||
$_SESSION['user_id'] = $user_id;
|
||||
$_SESSION['user_name'] = $name;
|
||||
$_SESSION['user_role'] = 'restaurant_owner';
|
||||
$_SESSION['user_role'] = 'restaurant';
|
||||
$_SESSION['restaurant_id'] = $restaurant_id;
|
||||
|
||||
// Redirect to the restaurant dashboard
|
||||
header("Location: restaurant/index.php");
|
||||
exit;
|
||||
|
||||
} catch (PDOException $e) {
|
||||
die("Could not connect to the database: " . $e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
if ($pdo->inTransaction()) {
|
||||
$pdo->rollBack();
|
||||
}
|
||||
die("Error: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
?>
|
||||
113
restaurants.php
113
restaurants.php
@ -13,7 +13,8 @@ $cuisines_stmt = db()->query("SELECT * FROM cuisines ORDER BY name");
|
||||
$cuisines = $cuisines_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// Base query
|
||||
$sql = "SELECT r.id, r.name, r.image_url, GROUP_CONCAT(c.name SEPARATOR ', ') as cuisines, AVG(ra.rating) as average_rating
|
||||
// Corrected GROUP_CONCAT for PostgreSQL
|
||||
$sql = "SELECT r.id, r.name, r.image_url, STRING_AGG(c.name, ', ') as cuisines, AVG(ra.rating) as average_rating
|
||||
FROM restaurants r
|
||||
LEFT JOIN restaurant_cuisines rc ON r.id = rc.restaurant_id
|
||||
LEFT JOIN cuisines c ON rc.cuisine_id = c.id
|
||||
@ -24,7 +25,7 @@ $params = [];
|
||||
|
||||
// Search functionality
|
||||
if (!empty($_GET['search'])) {
|
||||
$where_clauses[] = "r.name LIKE :search";
|
||||
$where_clauses[] = "r.name ILIKE :search"; // ILIKE for case-insensitive search in PostgreSQL
|
||||
$params[':search'] = '%' . $_GET['search'] . '%';
|
||||
}
|
||||
|
||||
@ -44,7 +45,7 @@ $sql .= " GROUP BY r.id";
|
||||
$sort_order = $_GET['sort'] ?? 'name_asc';
|
||||
switch ($sort_order) {
|
||||
case 'rating_desc':
|
||||
$sql .= " ORDER BY average_rating DESC";
|
||||
$sql .= " ORDER BY average_rating DESC NULLS LAST";
|
||||
break;
|
||||
case 'name_desc':
|
||||
$sql .= " ORDER BY r.name DESC";
|
||||
@ -59,7 +60,7 @@ $stmt->execute($params);
|
||||
$restaurants = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
?>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="container my-5">
|
||||
<?php if ($shutdown_active): ?>
|
||||
<div class="alert alert-danger text-center" role="alert">
|
||||
<h4 class="alert-heading">Ordering Temporarily Disabled</h4>
|
||||
@ -69,67 +70,85 @@ $restaurants = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h1 class="text-center mb-5">Our Restaurants</h1>
|
||||
<div class="row mb-4 align-items-center">
|
||||
<div class="col-lg-6">
|
||||
<h1 class="display-5 fw-bold">Our Restaurants</h1>
|
||||
<p class="text-muted">Explore a variety of cuisines from the best local restaurants.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filters and Sorting -->
|
||||
<form action="restaurants.php" method="get" class="row g-3 mb-5 align-items-center">
|
||||
<div class="col-md-5">
|
||||
<input type="text" name="search" class="form-control" placeholder="Search for a restaurant..." value="<?php echo htmlspecialchars($_GET['search'] ?? ''); ?>">
|
||||
<form action="restaurants.php" method="get" class="row g-3 mb-5 align-items-center bg-light p-3 rounded-3">
|
||||
<div class="col-lg-5 col-md-12">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
||||
<input type="text" name="search" class="form-control" placeholder="Search for a restaurant..." value="<?php echo htmlspecialchars($_GET['search'] ?? ''); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select name="cuisine" class="form-select">
|
||||
<option value="">All Cuisines</option>
|
||||
<?php foreach ($cuisines as $cuisine): ?>
|
||||
<option value="<?php echo $cuisine['id']; ?>" <?php echo (($_GET['cuisine'] ?? '') == $cuisine['id']) ? 'selected' : ''; ?>>
|
||||
<?php echo htmlspecialchars($cuisine['name']); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fas fa-utensils"></i></span>
|
||||
<select name="cuisine" class="form-select">
|
||||
<option value="">All Cuisines</option>
|
||||
<?php foreach ($cuisines as $cuisine): ?>
|
||||
<option value="<?php echo $cuisine['id']; ?>" <?php echo (($_GET['cuisine'] ?? '') == $cuisine['id']) ? 'selected' : ''; ?>>
|
||||
<?php echo htmlspecialchars($cuisine['name']); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select name="sort" class="form-select">
|
||||
<option value="name_asc" <?php echo ($sort_order == 'name_asc') ? 'selected' : ''; ?>>Sort by Name (A-Z)</option>
|
||||
<option value="name_desc" <?php echo ($sort_order == 'name_desc') ? 'selected' : ''; ?>>Sort by Name (Z-A)</option>
|
||||
<option value="rating_desc" <?php echo ($sort_order == 'rating_desc') ? 'selected' : ''; ?>>Sort by Rating</option>
|
||||
</select>
|
||||
<div class="col-lg-2 col-md-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fas fa-sort-alpha-down"></i></span>
|
||||
<select name="sort" class="form-select">
|
||||
<option value="name_asc" <?php echo ($sort_order == 'name_asc') ? 'selected' : ''; ?>>Name (A-Z)</option>
|
||||
<option value="name_desc" <?php echo ($sort_order == 'name_desc') ? 'selected' : ''; ?>>Name (Z-A)</option>
|
||||
<option value="rating_desc" <?php echo ($sort_order == 'rating_desc') ? 'selected' : ''; ?>>Rating</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary w-100">Apply</button>
|
||||
<div class="col-lg-2 col-md-12">
|
||||
<button type="submit" class="btn btn-primary w-100">Apply Filters</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Restaurant Grid -->
|
||||
<div class="row">
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-4">
|
||||
<?php if ($restaurants): ?>
|
||||
<?php foreach ($restaurants as $restaurant): ?>
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card restaurant-card h-100">
|
||||
<a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>">
|
||||
<img src="<?php echo htmlspecialchars($restaurant['image_url'] ?: 'assets/images/hero.jpg'); ?>" class="card-img-top" alt="<?php echo htmlspecialchars($restaurant['name']); ?>">
|
||||
</a>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><?php echo htmlspecialchars($restaurant['name']); ?></h5>
|
||||
<p class="card-text text-muted"><?php echo htmlspecialchars($restaurant['cuisines']); ?></p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-warning"><?php echo $restaurant['average_rating'] ? round($restaurant['average_rating'], 1) . ' ★' : 'No ratings'; ?></span>
|
||||
<?php if ($shutdown_active): ?>
|
||||
<a href="#" class="btn btn-outline-danger disabled">Ordering Disabled</a>
|
||||
<?php else: ?>
|
||||
<a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>" class="btn btn-outline-primary">View Menu</a>
|
||||
<?php endif; ?>
|
||||
<div class="col">
|
||||
<div class="card h-100 restaurant-card-new shadow-sm">
|
||||
<a href="menu.php?restaurant_id=<?php echo $restaurant['id']; ?>" class="card-link">
|
||||
<div class="img-container">
|
||||
<img src="<?php echo htmlspecialchars($restaurant['image_url'] ?: 'https://via.placeholder.com/400x250/dee2e6/6c757d.text=No+Image'); ?>" class="card-img-top" alt="<?php echo htmlspecialchars($restaurant['name']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h5 class="card-title fw-bold"><?php echo htmlspecialchars($restaurant['name']); ?></h5>
|
||||
<p class="card-text text-muted small"><?php echo htmlspecialchars($restaurant['cuisines']); ?></p>
|
||||
</div>
|
||||
<div class="card-footer bg-white border-0 pb-3">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="text-warning fw-bold">
|
||||
<?php echo $restaurant['average_rating'] ? number_format($restaurant['average_rating'], 1) . ' <i class="fas fa-star"></i>' : 'No ratings'; ?>
|
||||
</span>
|
||||
<span class="btn btn-sm btn-primary">View Menu <i class="fas fa-arrow-right"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<div class='col-12 text-center empty-state'>
|
||||
<i class='fas fa-store-slash fa-4x mb-3 text-muted'></i>
|
||||
<h3 class='mt-4'>No Restaurants Found</h3>
|
||||
<p>Try adjusting your search or filters to find what you're looking for.</p>
|
||||
<div class="col-12">
|
||||
<div class="text-center py-5">
|
||||
<i class="fas fa-store-slash fa-4x mb-3 text-muted"></i>
|
||||
<h3 class="mt-4">No Restaurants Found</h3>
|
||||
<p class="text-muted">Try adjusting your search or filters to find what you're looking for.</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php require_once 'footer.php'; ?>
|
||||
<?php require_once 'footer.php'; ?>
|
||||
58
signup.php
58
signup.php
@ -100,8 +100,66 @@ include 'header.php';
|
||||
<label for="password">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h4>Set Your Location</h4>
|
||||
<p><small>Pin your location on the map to help drivers find you.</small></p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location_label">Location Label</label>
|
||||
<input type="text" class="form-control" id="location_label" name="location_label" placeholder="e.g., 'Near the big mango tree'">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location_notes">Location Notes</label>
|
||||
<textarea class="form-control" id="location_notes" name="location_notes" rows="2" placeholder="e.g., 'Blue house, 2nd floor'"></textarea>
|
||||
</div>
|
||||
|
||||
<div id='map' style='width: 100%; height: 300px; margin-bottom: 15px;'></div>
|
||||
<input type="hidden" id="lat" name="lat">
|
||||
<input type="hidden" id="lng" name="lng">
|
||||
|
||||
<button type="submit" class="btn btn-primary">Sign Up</button>
|
||||
</form>
|
||||
<script src='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js'></script>
|
||||
<link href='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css' rel='stylesheet' />
|
||||
<script>
|
||||
mapboxgl.accessToken = '<?php require_once 'includes/api_keys.php'; echo MAPBOX_API_KEY; ?>';
|
||||
const lat_input = document.getElementById('lat');
|
||||
const lng_input = document.getElementById('lng');
|
||||
|
||||
const map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
style: 'mapbox://styles/mapbox/streets-v11',
|
||||
center: [171.380, 7.135], // Default to Majuro
|
||||
zoom: 12
|
||||
});
|
||||
|
||||
let marker = new mapboxgl.Marker({
|
||||
draggable: true
|
||||
})
|
||||
.setLngLat([171.380, 7.135])
|
||||
.addTo(map);
|
||||
|
||||
function onDragEnd() {
|
||||
const lngLat = marker.getLngLat();
|
||||
lat_input.value = lngLat.lat;
|
||||
lng_input.value = lngLat.lng;
|
||||
}
|
||||
|
||||
marker.on('dragend', onDragEnd);
|
||||
|
||||
map.on('click', (e) => {
|
||||
const coordinates = e.lngLat;
|
||||
lat_input.value = coordinates.lat;
|
||||
lng_input.value = coordinates.lng;
|
||||
marker.setLngLat(coordinates).addTo(map);
|
||||
});
|
||||
|
||||
// Set initial values
|
||||
lat_input.value = 7.135;
|
||||
lng_input.value = 171.380;
|
||||
</script>
|
||||
<div class="social-login">
|
||||
<p>Or sign up with</p>
|
||||
<a href="auth_google.php" class="btn btn-google"><i class="fab fa-google"></i> Sign up with Google</a>
|
||||
|
||||
@ -6,13 +6,24 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$name = $_POST['name'];
|
||||
$email = $_POST['email'];
|
||||
$password = $_POST['password'];
|
||||
$lat = $_POST['lat'];
|
||||
$lng = $_POST['lng'];
|
||||
$location_label = $_POST['location_label'];
|
||||
$location_notes = $_POST['location_notes'];
|
||||
|
||||
if (empty($name) || empty($email) || empty($password)) {
|
||||
die('Please fill all required fields.');
|
||||
header("Location: signup.php?error=Please fill all required fields.");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
die('Invalid email format.');
|
||||
header("Location: signup.php?error=Invalid email format.");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!is_numeric($lat) || !is_numeric($lng)) {
|
||||
header("Location: signup.php?error=Invalid location data.");
|
||||
exit();
|
||||
}
|
||||
|
||||
try {
|
||||
@ -22,15 +33,16 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$email]);
|
||||
if ($stmt->fetch()) {
|
||||
die('Email already exists.');
|
||||
header("Location: signup.php?error=Email already exists.");
|
||||
exit();
|
||||
}
|
||||
|
||||
$password_hash = password_hash($password, PASSWORD_BCRYPT);
|
||||
|
||||
$sql = "INSERT INTO users (name, email, password) VALUES (?, ?, ?)";
|
||||
$sql = "INSERT INTO users (name, email, password, lat, lng, location_label, location_notes) VALUES (?, ?, ?, ?, ?, ?, ?)";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
|
||||
if ($stmt->execute([$name, $email, $password_hash])) {
|
||||
if ($stmt->execute([$name, $email, $password_hash, $lat, $lng, $location_label, $location_notes])) {
|
||||
$user_id = $pdo->lastInsertId();
|
||||
$_SESSION['user_id'] = $user_id;
|
||||
$_SESSION['user_name'] = $name;
|
||||
|
||||
141
vendor/aws/aws-sdk-php/LICENSE.md
vendored
Normal file
141
vendor/aws/aws-sdk-php/LICENSE.md
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
# Apache License
|
||||
Version 2.0, January 2004
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
## 1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1
|
||||
through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the
|
||||
License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled
|
||||
by, or are under common control with that entity. For the purposes of this definition, "control" means
|
||||
(i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract
|
||||
or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
||||
ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software
|
||||
source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form,
|
||||
including but not limited to compiled object code, generated documentation, and conversions to other media
|
||||
types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License,
|
||||
as indicated by a copyright notice that is included in or attached to the work (an example is provided in the
|
||||
Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from)
|
||||
the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent,
|
||||
as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not
|
||||
include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work
|
||||
and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any
|
||||
modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to
|
||||
Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to
|
||||
submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of
|
||||
electronic, verbal, or written communication sent to the Licensor or its representatives, including but not
|
||||
limited to communication on electronic mailing lists, source code control systems, and issue tracking systems
|
||||
that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been
|
||||
received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
## 2. Grant of Copyright License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
|
||||
Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||
Derivative Works in Source or Object form.
|
||||
|
||||
## 3. Grant of Patent License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
||||
license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such
|
||||
license applies only to those patent claims licensable by such Contributor that are necessarily infringed by
|
||||
their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such
|
||||
Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim
|
||||
or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
||||
constitutes direct or contributory patent infringement, then any patent licenses granted to You under this
|
||||
License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
## 4. Redistribution.
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent,
|
||||
trademark, and attribution notices from the Source form of the Work, excluding those notices that do
|
||||
not pertain to any part of the Derivative Works; and
|
||||
|
||||
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that
|
||||
You distribute must include a readable copy of the attribution notices contained within such NOTICE
|
||||
file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed as part of the Derivative Works; within
|
||||
the Source form or documentation, if provided along with the Derivative Works; or, within a display
|
||||
generated by the Derivative Works, if and wherever such third-party notices normally appear. The
|
||||
contents of the NOTICE file are for informational purposes only and do not modify the License. You may
|
||||
add Your own attribution notices within Derivative Works that You distribute, alongside or as an
|
||||
addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be
|
||||
construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license
|
||||
terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative
|
||||
Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the
|
||||
conditions stated in this License.
|
||||
|
||||
## 5. Submission of Contributions.
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by
|
||||
You to the Licensor shall be under the terms and conditions of this License, without any additional terms or
|
||||
conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate
|
||||
license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
## 6. Trademarks.
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks, service marks, or product names of
|
||||
the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
|
||||
reproducing the content of the NOTICE file.
|
||||
|
||||
## 7. Disclaimer of Warranty.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor
|
||||
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of
|
||||
permissions under this License.
|
||||
|
||||
## 8. Limitation of Liability.
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless
|
||||
required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any
|
||||
Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential
|
||||
damages of any character arising as a result of this License or out of the use or inability to use the Work
|
||||
(including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||
any and all other commercial damages or losses), even if such Contributor has been advised of the possibility
|
||||
of such damages.
|
||||
|
||||
## 9. Accepting Warranty or Additional Liability.
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
||||
acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole
|
||||
responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold
|
||||
each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
112
vendor/aws/aws-sdk-php/NOTICE.md
vendored
Normal file
112
vendor/aws/aws-sdk-php/NOTICE.md
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
# AWS SDK for PHP
|
||||
|
||||
<http://aws.amazon.com/php>
|
||||
|
||||
Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License").
|
||||
You may not use this file except in compliance with the License.
|
||||
A copy of the License is located at
|
||||
|
||||
<http://aws.amazon.com/apache2.0>
|
||||
|
||||
or in the "license" file accompanying this file. This file is distributed
|
||||
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
|
||||
# Guzzle
|
||||
|
||||
<https://github.com/guzzle/guzzle>
|
||||
|
||||
Copyright (c) 2011 Michael Dowling, https://github.com/mtdowling
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
# Symfony
|
||||
|
||||
<https://github.com/symfony/symfony>
|
||||
|
||||
Copyright (c) 2004-2012 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
# Doctrine Common
|
||||
|
||||
<https://github.com/doctrine/common>
|
||||
|
||||
Copyright (c) 2006-2012 Doctrine Project
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
# Monolog
|
||||
|
||||
<https://github.com/Seldaek/monolog>
|
||||
|
||||
Copyright (c) Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
42
vendor/aws/aws-sdk-php/composer.json
vendored
Normal file
42
vendor/aws/aws-sdk-php/composer.json
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
|
||||
"keywords": ["aws","amazon","sdk","s3","ec2","dynamodb","cloud","glacier"],
|
||||
"type": "library",
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Amazon Web Services",
|
||||
"homepage": "http://aws.amazon.com"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"guzzle/guzzle": "~3.7"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/cache": "Adds support for caching of credentials and responses",
|
||||
"ext-apc": "Allows service description opcode caching, request and response caching, and credentials caching",
|
||||
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
|
||||
"monolog/monolog": "Adds support for logging HTTP requests and responses",
|
||||
"symfony/yaml": "Eases the ability to write manifests for creating jobs in AWS Import/Export"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-openssl": "*",
|
||||
"doctrine/cache": "~1.0",
|
||||
"monolog/monolog": "~1.4",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"phpunit/phpunit-mock-objects": "2.3.1",
|
||||
"symfony/yaml": "~2.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Aws": "src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
112
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/AutoScalingClient.php
vendored
Normal file
112
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/AutoScalingClient.php
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling;
|
||||
|
||||
use Aws\Common\Client\AbstractClient;
|
||||
use Aws\Common\Client\ClientBuilder;
|
||||
use Aws\Common\Enum\ClientOptions as Options;
|
||||
use Guzzle\Common\Collection;
|
||||
use Guzzle\Service\Resource\Model;
|
||||
use Guzzle\Service\Resource\ResourceIteratorInterface;
|
||||
|
||||
/**
|
||||
* Client to interact with Auto Scaling
|
||||
*
|
||||
* @method Model createAutoScalingGroup(array $args = array()) {@command AutoScaling CreateAutoScalingGroup}
|
||||
* @method Model attachInstances(array $args = array()) {@command AutoScaling AttachInstances}
|
||||
* @method Model detachInstances(array $args = array()) {@command AutoScaling DetachInstances}
|
||||
* @method Model enterStandby(array $args = array()) {@command AutoScaling EnterStandby}
|
||||
* @method Model exitStandby(array $args = array()) {@command AutoScaling ExitStandby}
|
||||
* @method Model deleteAutoScalingGroup(array $args = array()) {@command AutoScaling DeleteAutoScalingGroup}
|
||||
* @method Model describeAutoScalingGroups(array $args = array()) {@command AutoScaling DescribeAutoScalingGroups}
|
||||
* @method Model updateAutoScalingGroup(array $args = array()) {@command AutoScaling UpdateAutoScalingGroup}
|
||||
* @method Model describeAutoScalingInstances(array $args = array()) {@command AutoScaling DescribeAutoScalingInstances}
|
||||
* @method Model describeScalingProcessTypes(array $args = array()) {@command AutoScaling DescribeScalingProcessTypes}
|
||||
* @method Model suspendProcesses(array $args = array()) {@command AutoScaling SuspendProcesses}
|
||||
* @method Model resumeProcesses(array $args = array()) {@command AutoScaling ResumeProcesses}
|
||||
* @method Model setDesiredCapacity(array $args = array()) {@command AutoScaling SetDesiredCapacity}
|
||||
* @method Model setInstanceHealth(array $args = array()) {@command AutoScaling SetInstanceHealth}
|
||||
* @method Model attachLoadBalancers(array $args = array()) {@command AutoScaling AttachLoadBalancers}
|
||||
* @method Model detachLoadBalancers(array $args = array()) {@command AutoScaling DetachLoadBalancers}
|
||||
* @method Model putScheduledUpdateGroupAction(array $args = array()) {@command AutoScaling PutScheduledUpdateGroupAction}
|
||||
* @method Model describeScheduledActions(array $args = array()) {@command AutoScaling DescribeScheduledActions}
|
||||
* @method Model deleteScheduledAction(array $args = array()) {@command AutoScaling DeleteScheduledAction}
|
||||
* @method Model describeAdjustmentTypes(array $args = array()) {@command AutoScaling DescribeAdjustmentTypes}
|
||||
* @method Model putScalingPolicy(array $args = array()) {@command AutoScaling PutScalingPolicy}
|
||||
* @method Model describePolicies(array $args = array()) {@command AutoScaling DescribePolicies}
|
||||
* @method Model deletePolicy(array $args = array()) {@command AutoScaling DeletePolicy}
|
||||
* @method Model executePolicy(array $args = array()) {@command AutoScaling ExecutePolicy}
|
||||
* @method Model describeMetricCollectionTypes(array $args = array()) {@command AutoScaling DescribeMetricCollectionTypes}
|
||||
* @method Model enableMetricsCollection(array $args = array()) {@command AutoScaling EnableMetricsCollection}
|
||||
* @method Model disableMetricsCollection(array $args = array()) {@command AutoScaling DisableMetricsCollection}
|
||||
* @method Model createLaunchConfiguration(array $args = array()) {@command AutoScaling CreateLaunchConfiguration}
|
||||
* @method Model describeLaunchConfigurations(array $args = array()) {@command AutoScaling DescribeLaunchConfigurations}
|
||||
* @method Model deleteLaunchConfiguration(array $args = array()) {@command AutoScaling DeleteLaunchConfiguration}
|
||||
* @method Model describeScalingActivities(array $args = array()) {@command AutoScaling DescribeScalingActivities}
|
||||
* @method Model terminateInstanceInAutoScalingGroup(array $args = array()) {@command AutoScaling TerminateInstanceInAutoScalingGroup}
|
||||
* @method Model setInstanceProtection(array $args = array()) {@command AutoScaling SetInstanceProtection}
|
||||
* @method Model putNotificationConfiguration(array $args = array()) {@command AutoScaling PutNotificationConfiguration}
|
||||
* @method Model deleteNotificationConfiguration(array $args = array()) {@command AutoScaling DeleteNotificationConfiguration}
|
||||
* @method Model describeNotificationConfigurations(array $args = array()) {@command AutoScaling DescribeNotificationConfigurations}
|
||||
* @method Model describeAutoScalingNotificationTypes(array $args = array()) {@command AutoScaling DescribeAutoScalingNotificationTypes}
|
||||
* @method Model createOrUpdateTags(array $args = array()) {@command AutoScaling CreateOrUpdateTags}
|
||||
* @method Model deleteTags(array $args = array()) {@command AutoScaling DeleteTags}
|
||||
* @method Model describeTags(array $args = array()) {@command AutoScaling DescribeTags}
|
||||
* @method Model describeTerminationPolicyTypes(array $args = array()) {@command AutoScaling DescribeTerminationPolicyTypes}
|
||||
* @method Model describeAccountLimits(array $args = array()) {@command AutoScaling DescribeAccountLimits}
|
||||
* @method Model putLifecycleHook(array $args = array()) {@command AutoScaling PutLifecycleHook}
|
||||
* @method Model deleteLifecycleHook(array $args = array()) {@command AutoScaling DeleteLifecycleHook}
|
||||
* @method Model describeLifecycleHooks(array $args = array()) {@command AutoScaling DescribeLifecycleHooks}
|
||||
* @method Model describeLifecycleHookTypes(array $args = array()) {@command AutoScaling DescribeLifecycleHookTypes}
|
||||
* @method Model completeLifecycleAction(array $args = array()) {@command AutoScaling CompleteLifecycleAction}
|
||||
* @method Model recordLifecycleActionHeartbeat(array $args = array()) {@command AutoScaling RecordLifecycleActionHeartbeat}
|
||||
* @method Model describeLoadBalancers(array $args = array()) {@command AutoScaling DescribeLoadBalancers}
|
||||
* @method ResourceIteratorInterface getDescribeAutoScalingGroupsIterator(array $args = array()) The input array uses the parameters of the DescribeAutoScalingGroups operation
|
||||
* @method ResourceIteratorInterface getDescribeAutoScalingInstancesIterator(array $args = array()) The input array uses the parameters of the DescribeAutoScalingInstances operation
|
||||
* @method ResourceIteratorInterface getDescribeLaunchConfigurationsIterator(array $args = array()) The input array uses the parameters of the DescribeLaunchConfigurations operation
|
||||
* @method ResourceIteratorInterface getDescribeNotificationConfigurationsIterator(array $args = array()) The input array uses the parameters of the DescribeNotificationConfigurations operation
|
||||
* @method ResourceIteratorInterface getDescribePoliciesIterator(array $args = array()) The input array uses the parameters of the DescribePolicies operation
|
||||
* @method ResourceIteratorInterface getDescribeScalingActivitiesIterator(array $args = array()) The input array uses the parameters of the DescribeScalingActivities operation
|
||||
* @method ResourceIteratorInterface getDescribeScheduledActionsIterator(array $args = array()) The input array uses the parameters of the DescribeScheduledActions operation
|
||||
* @method ResourceIteratorInterface getDescribeTagsIterator(array $args = array()) The input array uses the parameters of the DescribeTags operation
|
||||
*
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-autoscaling.html User guide
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/api/class-Aws.AutoScaling.AutoScalingClient.html API docs
|
||||
*/
|
||||
class AutoScalingClient extends AbstractClient
|
||||
{
|
||||
const LATEST_API_VERSION = '2011-01-01';
|
||||
|
||||
/**
|
||||
* Factory method to create a new Auto Scaling client using an array of configuration options.
|
||||
*
|
||||
* @param array|Collection $config Client configuration data
|
||||
*
|
||||
* @return self
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
|
||||
*/
|
||||
public static function factory($config = array())
|
||||
{
|
||||
return ClientBuilder::factory(__NAMESPACE__)
|
||||
->setConfig($config)
|
||||
->setConfigDefaults(array(
|
||||
Options::VERSION => self::LATEST_API_VERSION,
|
||||
Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/autoscaling-%s.php'
|
||||
))
|
||||
->build();
|
||||
}
|
||||
}
|
||||
31
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Enum/LifecycleState.php
vendored
Normal file
31
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Enum/LifecycleState.php
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable LifecycleState values
|
||||
*/
|
||||
class LifecycleState extends Enum
|
||||
{
|
||||
const PENDING = 'Pending';
|
||||
const QUARANTINED = 'Quarantined';
|
||||
const IN_SERVICE = 'InService';
|
||||
const TERMINATING = 'Terminating';
|
||||
const TERMINATED = 'Terminated';
|
||||
}
|
||||
34
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Enum/ScalingActivityStatusCode.php
vendored
Normal file
34
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Enum/ScalingActivityStatusCode.php
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable ScalingActivityStatusCode values
|
||||
*/
|
||||
class ScalingActivityStatusCode extends Enum
|
||||
{
|
||||
const WAITING_FOR_SPOT_INSTANCE_REQUEST_ID = 'WaitingForSpotInstanceRequestId';
|
||||
const WAITING_FOR_SPOT_INSTANCE_ID = 'WaitingForSpotInstanceId';
|
||||
const WAITING_FOR_INSTANCE_ID = 'WaitingForInstanceId';
|
||||
const PRE_IN_SERVICE = 'PreInService';
|
||||
const IN_PROGRESS = 'InProgress';
|
||||
const SUCCESSFUL = 'Successful';
|
||||
const FAILED = 'Failed';
|
||||
const CANCELLED = 'Cancelled';
|
||||
}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/AlreadyExistsException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/AlreadyExistsException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Exception;
|
||||
|
||||
/**
|
||||
* The named Auto Scaling group or launch configuration already exists.
|
||||
*/
|
||||
class AlreadyExistsException extends AutoScalingException {}
|
||||
24
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/AutoScalingException.php
vendored
Normal file
24
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/AutoScalingException.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Exception;
|
||||
|
||||
use Aws\Common\Exception\ServiceResponseException;
|
||||
|
||||
/**
|
||||
* Default service exception class
|
||||
*/
|
||||
class AutoScalingException extends ServiceResponseException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/InvalidNextTokenException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/InvalidNextTokenException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Exception;
|
||||
|
||||
/**
|
||||
* The NextToken value is invalid.
|
||||
*/
|
||||
class InvalidNextTokenException extends AutoScalingException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/LimitExceededException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/LimitExceededException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Exception;
|
||||
|
||||
/**
|
||||
* The quota for capacity groups or launch configurations for this customer has already been reached.
|
||||
*/
|
||||
class LimitExceededException extends AutoScalingException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/ResourceInUseException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/ResourceInUseException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Exception;
|
||||
|
||||
/**
|
||||
* This is returned when you cannot delete a launch configuration or Auto Scaling group because it is being used.
|
||||
*/
|
||||
class ResourceInUseException extends AutoScalingException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/ScalingActivityInProgressException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Exception/ScalingActivityInProgressException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\AutoScaling\Exception;
|
||||
|
||||
/**
|
||||
* You cannot delete an Auto Scaling group while there are scaling activities in progress for that group.
|
||||
*/
|
||||
class ScalingActivityInProgressException extends AutoScalingException {}
|
||||
3683
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Resources/autoscaling-2011-01-01.php
vendored
Normal file
3683
vendor/aws/aws-sdk-php/src/Aws/AutoScaling/Resources/autoscaling-2011-01-01.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
78
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/CloudFormationClient.php
vendored
Normal file
78
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/CloudFormationClient.php
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation;
|
||||
|
||||
use Aws\Common\Client\AbstractClient;
|
||||
use Aws\Common\Client\ClientBuilder;
|
||||
use Aws\Common\Enum\ClientOptions as Options;
|
||||
use Guzzle\Common\Collection;
|
||||
use Guzzle\Service\Resource\Model;
|
||||
use Guzzle\Service\Resource\ResourceIteratorInterface;
|
||||
|
||||
/**
|
||||
* Client to interact with AWS CloudFormation
|
||||
*
|
||||
* @method Model cancelUpdateStack(array $args = array()) {@command CloudFormation CancelUpdateStack}
|
||||
* @method Model createStack(array $args = array()) {@command CloudFormation CreateStack}
|
||||
* @method Model deleteStack(array $args = array()) {@command CloudFormation DeleteStack}
|
||||
* @method Model describeAccountLimits(array $args = array()) {@command CloudFormation DescribeAccountLimits}
|
||||
* @method Model describeStackEvents(array $args = array()) {@command CloudFormation DescribeStackEvents}
|
||||
* @method Model describeStackResource(array $args = array()) {@command CloudFormation DescribeStackResource}
|
||||
* @method Model describeStackResources(array $args = array()) {@command CloudFormation DescribeStackResources}
|
||||
* @method Model describeStacks(array $args = array()) {@command CloudFormation DescribeStacks}
|
||||
* @method Model estimateTemplateCost(array $args = array()) {@command CloudFormation EstimateTemplateCost}
|
||||
* @method Model getStackPolicy(array $args = array()) {@command CloudFormation GetStackPolicy}
|
||||
* @method Model getTemplate(array $args = array()) {@command CloudFormation GetTemplate}
|
||||
* @method Model getTemplateSummary(array $args = array()) {@command CloudFormation GetTemplateSummary}
|
||||
* @method Model listStackResources(array $args = array()) {@command CloudFormation ListStackResources}
|
||||
* @method Model listStacks(array $args = array()) {@command CloudFormation ListStacks}
|
||||
* @method Model setStackPolicy(array $args = array()) {@command CloudFormation SetStackPolicy}
|
||||
* @method Model signalResource(array $args = array()) {@command CloudFormation SignalResource}
|
||||
* @method Model updateStack(array $args = array()) {@command CloudFormation UpdateStack}
|
||||
* @method Model validateTemplate(array $args = array()) {@command CloudFormation ValidateTemplate}
|
||||
* @method ResourceIteratorInterface getDescribeStackEventsIterator(array $args = array()) The input array uses the parameters of the DescribeStackEvents operation
|
||||
* @method ResourceIteratorInterface getDescribeStackResourcesIterator(array $args = array()) The input array uses the parameters of the DescribeStackResources operation
|
||||
* @method ResourceIteratorInterface getDescribeStacksIterator(array $args = array()) The input array uses the parameters of the DescribeStacks operation
|
||||
* @method ResourceIteratorInterface getListStackResourcesIterator(array $args = array()) The input array uses the parameters of the ListStackResources operation
|
||||
* @method ResourceIteratorInterface getListStacksIterator(array $args = array()) The input array uses the parameters of the ListStacks operation
|
||||
*
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-cloudformation.html User guide
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/api/class-Aws.CloudFormation.CloudFormationClient.html API docs
|
||||
*/
|
||||
class CloudFormationClient extends AbstractClient
|
||||
{
|
||||
const LATEST_API_VERSION = '2010-05-15';
|
||||
|
||||
/**
|
||||
* Factory method to create a new AWS CloudFormation client using an array of configuration options.
|
||||
*
|
||||
* @param array|Collection $config Client configuration data
|
||||
*
|
||||
* @return self
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
|
||||
*/
|
||||
public static function factory($config = array())
|
||||
{
|
||||
return ClientBuilder::factory(__NAMESPACE__)
|
||||
->setConfig($config)
|
||||
->setConfigDefaults(array(
|
||||
Options::VERSION => self::LATEST_API_VERSION,
|
||||
Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudformation-%s.php'
|
||||
))
|
||||
->build();
|
||||
}
|
||||
}
|
||||
27
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/Capability.php
vendored
Normal file
27
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/Capability.php
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable Capability values
|
||||
*/
|
||||
class Capability extends Enum
|
||||
{
|
||||
const CAPABILITY_IAM = 'CAPABILITY_IAM';
|
||||
}
|
||||
29
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/OnFailure.php
vendored
Normal file
29
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/OnFailure.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable OnFailure values
|
||||
*/
|
||||
class OnFailure extends Enum
|
||||
{
|
||||
const DO_NOTHING = 'DO_NOTHING';
|
||||
const ROLLBACK = 'ROLLBACK';
|
||||
const DELETE = 'DELETE';
|
||||
}
|
||||
35
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/ResourceStatus.php
vendored
Normal file
35
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/ResourceStatus.php
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable ResourceStatus values
|
||||
*/
|
||||
class ResourceStatus extends Enum
|
||||
{
|
||||
const CREATE_IN_PROGRESS = 'CREATE_IN_PROGRESS';
|
||||
const CREATE_FAILED = 'CREATE_FAILED';
|
||||
const CREATE_COMPLETE = 'CREATE_COMPLETE';
|
||||
const DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS';
|
||||
const DELETE_FAILED = 'DELETE_FAILED';
|
||||
const DELETE_COMPLETE = 'DELETE_COMPLETE';
|
||||
const UPDATE_IN_PROGRESS = 'UPDATE_IN_PROGRESS';
|
||||
const UPDATE_FAILED = 'UPDATE_FAILED';
|
||||
const UPDATE_COMPLETE = 'UPDATE_COMPLETE';
|
||||
}
|
||||
42
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/StackStatus.php
vendored
Normal file
42
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Enum/StackStatus.php
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable StackStatus values
|
||||
*/
|
||||
class StackStatus extends Enum
|
||||
{
|
||||
const CREATE_IN_PROGRESS = 'CREATE_IN_PROGRESS';
|
||||
const CREATE_FAILED = 'CREATE_FAILED';
|
||||
const CREATE_COMPLETE = 'CREATE_COMPLETE';
|
||||
const ROLLBACK_IN_PROGRESS = 'ROLLBACK_IN_PROGRESS';
|
||||
const ROLLBACK_FAILED = 'ROLLBACK_FAILED';
|
||||
const ROLLBACK_COMPLETE = 'ROLLBACK_COMPLETE';
|
||||
const DELETE_IN_PROGRESS = 'DELETE_IN_PROGRESS';
|
||||
const DELETE_FAILED = 'DELETE_FAILED';
|
||||
const DELETE_COMPLETE = 'DELETE_COMPLETE';
|
||||
const UPDATE_IN_PROGRESS = 'UPDATE_IN_PROGRESS';
|
||||
const UPDATE_COMPLETE_CLEANUP_IN_PROGRESS = 'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS';
|
||||
const UPDATE_COMPLETE = 'UPDATE_COMPLETE';
|
||||
const UPDATE_ROLLBACK_IN_PROGRESS = 'UPDATE_ROLLBACK_IN_PROGRESS';
|
||||
const UPDATE_ROLLBACK_FAILED = 'UPDATE_ROLLBACK_FAILED';
|
||||
const UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS = 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS';
|
||||
const UPDATE_ROLLBACK_COMPLETE = 'UPDATE_ROLLBACK_COMPLETE';
|
||||
}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/AlreadyExistsException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/AlreadyExistsException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Exception;
|
||||
|
||||
/**
|
||||
* Resource with the name requested already exists.
|
||||
*/
|
||||
class AlreadyExistsException extends CloudFormationException {}
|
||||
24
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/CloudFormationException.php
vendored
Normal file
24
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/CloudFormationException.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Exception;
|
||||
|
||||
use Aws\Common\Exception\ServiceResponseException;
|
||||
|
||||
/**
|
||||
* Default service exception class
|
||||
*/
|
||||
class CloudFormationException extends ServiceResponseException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/InsufficientCapabilitiesException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/InsufficientCapabilitiesException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Exception;
|
||||
|
||||
/**
|
||||
* The template contains resources with capabilities that were not specified in the Capabilities parameter.
|
||||
*/
|
||||
class InsufficientCapabilitiesException extends CloudFormationException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/LimitExceededException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Exception/LimitExceededException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFormation\Exception;
|
||||
|
||||
/**
|
||||
* Quota for the resource has already been reached.
|
||||
*/
|
||||
class LimitExceededException extends CloudFormationException {}
|
||||
1389
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Resources/cloudformation-2010-05-15.php
vendored
Normal file
1389
vendor/aws/aws-sdk-php/src/Aws/CloudFormation/Resources/cloudformation-2010-05-15.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
235
vendor/aws/aws-sdk-php/src/Aws/CloudFront/CloudFrontClient.php
vendored
Normal file
235
vendor/aws/aws-sdk-php/src/Aws/CloudFront/CloudFrontClient.php
vendored
Normal file
@ -0,0 +1,235 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront;
|
||||
|
||||
use Aws\Common\Client\AbstractClient;
|
||||
use Aws\Common\Client\ClientBuilder;
|
||||
use Aws\Common\Enum\ClientOptions as Options;
|
||||
use Aws\Common\Exception\InvalidArgumentException;
|
||||
use Aws\Common\Exception\Parser\DefaultXmlExceptionParser;
|
||||
use Aws\Common\Exception\RequiredExtensionNotLoadedException;
|
||||
use Guzzle\Common\Collection;
|
||||
use Guzzle\Http\Url;
|
||||
use Guzzle\Service\Resource\Model;
|
||||
use Guzzle\Service\Resource\ResourceIteratorInterface;
|
||||
|
||||
/**
|
||||
* Client to interact with Amazon CloudFront
|
||||
*
|
||||
* @method Model createDistribution(array $args = array()) {@command CloudFront CreateDistribution}
|
||||
* @method Model deleteDistribution(array $args = array()) {@command CloudFront DeleteDistribution}
|
||||
* @method Model getDistribution(array $args = array()) {@command CloudFront GetDistribution}
|
||||
* @method Model updateDistribution(array $args = array()) {@command CloudFront UpdateDistribution}
|
||||
* @method Model getDistributionConfig(array $args = array()) {@command CloudFront GetDistributionConfig}
|
||||
* @method Model listDistributions(array $args = array()) {@command CloudFront ListDistributions}
|
||||
* @method Model listDistributionsByWebACLId(array $args = array()) {@command CloudFront ListDistributionsByWebACLId}
|
||||
* @method Model createCloudFrontOriginAccessIdentity(array $args = array()) {@command CloudFront CreateCloudFrontOriginAccessIdentity}
|
||||
* @method Model deleteCloudFrontOriginAccessIdentity(array $args = array()) {@command CloudFront DeleteCloudFrontOriginAccessIdentity}
|
||||
* @method Model getCloudFrontOriginAccessIdentity(array $args = array()) {@command CloudFront GetCloudFrontOriginAccessIdentity}
|
||||
* @method Model getCloudFrontOriginAccessIdentityConfig(array $args = array()) {@command CloudFront GetCloudFrontOriginAccessIdentityConfig}
|
||||
* @method Model updateCloudFrontOriginAccessIdentity(array $args = array()) {@command CloudFront UpdateCloudFrontOriginAccessIdentity}
|
||||
* @method Model listCloudFrontOriginAccessIdentities(array $args = array()) {@command CloudFront ListCloudFrontOriginAccessIdentities}
|
||||
* @method Model createStreamingDistribution(array $args = array()) {@command CloudFront CreateStreamingDistribution}
|
||||
* @method Model deleteStreamingDistribution(array $args = array()) {@command CloudFront DeleteStreamingDistribution}
|
||||
* @method Model getStreamingDistribution(array $args = array()) {@command CloudFront GetStreamingDistribution}
|
||||
* @method Model updateStreamingDistribution(array $args = array()) {@command CloudFront UpdateStreamingDistribution}
|
||||
* @method Model getStreamingDistributionConfig(array $args = array()) {@command CloudFront GetStreamingDistributionConfig}
|
||||
* @method Model listStreamingDistributions(array $args = array()) {@command CloudFront ListStreamingDistributions}
|
||||
* @method Model createInvalidation(array $args = array()) {@command CloudFront CreateInvalidation}
|
||||
* @method Model getInvalidation(array $args = array()) {@command CloudFront GetInvalidation}
|
||||
* @method Model listInvalidations(array $args = array()) {@command CloudFront ListInvalidations}
|
||||
* @method waitUntilStreamingDistributionDeployed(array $input) The input array uses the parameters of the GetStreamingDistribution operation and waiter specific settings
|
||||
* @method waitUntilDistributionDeployed(array $input) The input array uses the parameters of the GetDistribution operation and waiter specific settings
|
||||
* @method waitUntilInvalidationCompleted(array $input) The input array uses the parameters of the GetInvalidation operation and waiter specific settings
|
||||
* @method ResourceIteratorInterface getListCloudFrontOriginAccessIdentitiesIterator(array $args = array()) The input array uses the parameters of the ListCloudFrontOriginAccessIdentities operation
|
||||
* @method ResourceIteratorInterface getListDistributionsIterator(array $args = array()) The input array uses the parameters of the ListDistributions operation
|
||||
* @method ResourceIteratorInterface getListInvalidationsIterator(array $args = array()) The input array uses the parameters of the ListInvalidations operation
|
||||
* @method ResourceIteratorInterface getListStreamingDistributionsIterator(array $args = array()) The input array uses the parameters of the ListStreamingDistributions operation
|
||||
*
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-cloudfront.html User guide
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/api/class-Aws.CloudFront.CloudFrontClient.html API docs
|
||||
*/
|
||||
class CloudFrontClient extends AbstractClient
|
||||
{
|
||||
const LATEST_API_VERSION = '2016-01-28';
|
||||
|
||||
/**
|
||||
* Factory method to create a new Amazon CloudFront client using an array of configuration options.
|
||||
*
|
||||
* CloudFront specific options (in addition to the default client configuration options):
|
||||
* - key_pair_id: The ID of the key pair used to sign CloudFront URLs for private distributions.
|
||||
* - private_key: The filepath ot the private key used to sign CloudFront URLs for private distributions.
|
||||
*
|
||||
* @param array|Collection $config Client configuration data
|
||||
*
|
||||
* @return self
|
||||
* @link http://docs.aws.amazon.com/aws-sdk-php/v2/guide/configuration.html#client-configuration-options
|
||||
*/
|
||||
public static function factory($config = array())
|
||||
{
|
||||
// Decide which signature to use
|
||||
if (isset($config[Options::VERSION]) && $config[Options::VERSION] < self::LATEST_API_VERSION) {
|
||||
$config[Options::SIGNATURE] = new CloudFrontSignature();
|
||||
}
|
||||
|
||||
// Instantiate the CloudFront client
|
||||
return ClientBuilder::factory(__NAMESPACE__)
|
||||
->setConfig($config)
|
||||
->setConfigDefaults(array(
|
||||
Options::VERSION => self::LATEST_API_VERSION,
|
||||
Options::SERVICE_DESCRIPTION => __DIR__ . '/Resources/cloudfront-%s.php',
|
||||
))
|
||||
->setExceptionParser(new DefaultXmlExceptionParser())
|
||||
->build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a signed URL. Keep in mind that URLs meant for use in media/flash players may have different requirements
|
||||
* for URL formats (e.g. some require that the extension be removed, some require the file name to be prefixed -
|
||||
* mp4:<path>, some require you to add "/cfx/st" into your URL). See
|
||||
* http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html for
|
||||
* additional details and help.
|
||||
*
|
||||
* This method accepts an array of configuration options:
|
||||
* - url: (string) URL of the resource being signed (can include query string and wildcards). For example:
|
||||
* rtmp://s5c39gqb8ow64r.cloudfront.net/videos/mp3_name.mp3
|
||||
* http://d111111abcdef8.cloudfront.net/images/horizon.jpg?size=large&license=yes
|
||||
* - policy: (string) JSON policy. Use this option when creating a signed URL for a custom policy.
|
||||
* - expires: (int) UTC Unix timestamp used when signing with a canned policy. Not required when passing a
|
||||
* custom 'policy' option.
|
||||
* - key_pair_id: (string) The ID of the key pair used to sign CloudFront URLs for private distributions.
|
||||
* - private_key: (string) The filepath ot the private key used to sign CloudFront URLs for private distributions.
|
||||
*
|
||||
* @param array $options Array of configuration options used when signing
|
||||
*
|
||||
* @return string The file URL with authentication parameters
|
||||
* @throws InvalidArgumentException if key_pair_id and private_key have not been configured on the client
|
||||
* @throws RequiredExtensionNotLoadedException if the openssl extension is not installed
|
||||
* @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/WorkingWithStreamingDistributions.html
|
||||
*/
|
||||
public function getSignedUrl(array $options)
|
||||
{
|
||||
if (!extension_loaded('openssl')) {
|
||||
//@codeCoverageIgnoreStart
|
||||
throw new RequiredExtensionNotLoadedException('The openssl extension is required to sign CloudFront urls.');
|
||||
//@codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
// Initialize the configuration data and ensure that the url was specified
|
||||
$options = Collection::fromConfig($options, array_filter(array(
|
||||
'key_pair_id' => $this->getConfig('key_pair_id'),
|
||||
'private_key' => $this->getConfig('private_key'),
|
||||
)), array('url', 'key_pair_id', 'private_key'));
|
||||
|
||||
// Determine the scheme of the url
|
||||
$urlSections = explode('://', $options['url']);
|
||||
if (count($urlSections) < 2) {
|
||||
throw new InvalidArgumentException('Invalid URL: ' . $options['url']);
|
||||
}
|
||||
|
||||
// Get the real scheme by removing wildcards from the scheme
|
||||
$scheme = str_replace('*', '', $urlSections[0]);
|
||||
$policy = $options['policy'] ?: $this->createCannedPolicy($scheme, $options['url'], $options['expires']);
|
||||
// Strip whitespace from the policy
|
||||
$policy = str_replace(' ', '', $policy);
|
||||
|
||||
$url = Url::factory($scheme . '://' . $urlSections[1]);
|
||||
if ($options['policy']) {
|
||||
// Custom policies require that the encoded policy be specified in the URL
|
||||
$url->getQuery()->set('Policy', strtr(base64_encode($policy), '+=/', '-_~'));
|
||||
} else {
|
||||
// Canned policies require that the Expires parameter be set in the URL
|
||||
$url->getQuery()->set('Expires', $options['expires']);
|
||||
}
|
||||
|
||||
// Sign the policy using the CloudFront private key
|
||||
$signedPolicy = $this->rsaSha1Sign($policy, $options['private_key']);
|
||||
// Remove whitespace, base64 encode the policy, and replace special characters
|
||||
$signedPolicy = strtr(base64_encode($signedPolicy), '+=/', '-_~');
|
||||
|
||||
$url->getQuery()
|
||||
->set('Signature', $signedPolicy)
|
||||
->set('Key-Pair-Id', $options['key_pair_id']);
|
||||
|
||||
if ($scheme != 'rtmp') {
|
||||
// HTTP and HTTPS signed URLs include the full URL
|
||||
return (string) $url;
|
||||
} else {
|
||||
// Use a relative URL when creating Flash player URLs
|
||||
$url->getQuery()->useUrlEncoding(false);
|
||||
$url->setScheme(null)->setHost(null);
|
||||
return substr($url, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign a policy string using OpenSSL RSA SHA1
|
||||
*
|
||||
* @param string $policy Policy to sign
|
||||
* @param string $privateKeyFilename File containing the OpenSSL private key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function rsaSha1Sign($policy, $privateKeyFilename)
|
||||
{
|
||||
$signature = '';
|
||||
openssl_sign($policy, $signature, file_get_contents($privateKeyFilename));
|
||||
|
||||
return $signature;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a canned policy for a particular URL and expiration
|
||||
*
|
||||
* @param string $scheme Parsed scheme without wildcards
|
||||
* @param string $url URL that is being signed
|
||||
* @param int $expires Time in which the signature expires
|
||||
*
|
||||
* @return string
|
||||
* @throws InvalidArgumentException if the expiration is not set
|
||||
*/
|
||||
protected function createCannedPolicy($scheme, $url, $expires)
|
||||
{
|
||||
if (!$expires) {
|
||||
throw new InvalidArgumentException('An expires option is required when using a canned policy');
|
||||
}
|
||||
|
||||
// Generate a canned policy
|
||||
if ($scheme == 'http' || $scheme == 'https') {
|
||||
$resource = $url;
|
||||
} elseif ($scheme == 'rtmp') {
|
||||
$parts = parse_url($url);
|
||||
$pathParts = pathinfo($parts['path']);
|
||||
// Add path leading to file, strip file extension, and add a query
|
||||
// string if present.
|
||||
$resource = ltrim($pathParts['dirname']
|
||||
. '/'
|
||||
. $pathParts['basename'], '/\\');
|
||||
if (isset($parts['query'])) {
|
||||
$resource .= "?{$parts['query']}";
|
||||
}
|
||||
} else {
|
||||
throw new InvalidArgumentException("Invalid URI scheme: {$scheme}. Must be one of http or rtmp.");
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'{"Statement":[{"Resource":"%s","Condition":{"DateLessThan":{"AWS:EpochTime":%d}}}]}',
|
||||
$resource,
|
||||
$expires
|
||||
);
|
||||
}
|
||||
}
|
||||
61
vendor/aws/aws-sdk-php/src/Aws/CloudFront/CloudFrontSignature.php
vendored
Normal file
61
vendor/aws/aws-sdk-php/src/Aws/CloudFront/CloudFrontSignature.php
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront;
|
||||
|
||||
use Aws\Common\Credentials\CredentialsInterface;
|
||||
use Aws\Common\Enum\DateFormat;
|
||||
use Aws\Common\Signature\AbstractSignature;
|
||||
use Guzzle\Http\Message\RequestInterface;
|
||||
|
||||
/**
|
||||
* Amazon CloudFront signature implementation
|
||||
* @link http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RESTAuthentication.html
|
||||
*/
|
||||
class CloudFrontSignature extends AbstractSignature
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function signRequest(RequestInterface $request, CredentialsInterface $credentials)
|
||||
{
|
||||
// Add a date header if one is not set
|
||||
if (!$request->hasHeader('date') && !$request->hasHeader('x-amz-date')) {
|
||||
$request->setHeader('Date', gmdate(DateFormat::RFC2822));
|
||||
}
|
||||
|
||||
$stringToSign = (string) $request->getHeader('Date') ?: (string) $request->getHeader('x-amz-date');
|
||||
$request->getParams()->set('aws.string_to_sign', $stringToSign);
|
||||
|
||||
$request->setHeader(
|
||||
'Authorization',
|
||||
'AWS ' . $credentials->getAccessKeyId() . ':' . $this->signString($stringToSign, $credentials)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign a signature string by applying SHA-1 HMAC hashing.
|
||||
*
|
||||
* @param string $string The signature string to hash.
|
||||
* @param CredentialsInterface $credentials Signing credentials.
|
||||
*
|
||||
* @return string The hashed signature string.
|
||||
*/
|
||||
public function signString($string, CredentialsInterface $credentials)
|
||||
{
|
||||
return base64_encode(hash_hmac('sha1', $string, $credentials->getSecretKey(), true));
|
||||
}
|
||||
}
|
||||
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/GeoRestrictionType.php
vendored
Normal file
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/GeoRestrictionType.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable GeoRestrictionType values
|
||||
*/
|
||||
class GeoRestrictionType extends Enum
|
||||
{
|
||||
const BLACKLIST = 'blacklist';
|
||||
const WHITELIST = 'whitelist';
|
||||
const NONE = 'none';
|
||||
}
|
||||
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/ItemSelection.php
vendored
Normal file
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/ItemSelection.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable ItemSelection values
|
||||
*/
|
||||
class ItemSelection extends Enum
|
||||
{
|
||||
const NONE = 'none';
|
||||
const WHITELIST = 'whitelist';
|
||||
const ALL = 'all';
|
||||
}
|
||||
33
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/Method.php
vendored
Normal file
33
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/Method.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable Method values
|
||||
*/
|
||||
class Method extends Enum
|
||||
{
|
||||
const GET = 'GET';
|
||||
const HEAD = 'HEAD';
|
||||
const POST = 'POST';
|
||||
const PUT = 'PUT';
|
||||
const PATCH = 'PATCH';
|
||||
const OPTIONS = 'OPTIONS';
|
||||
const DELETE = 'DELETE';
|
||||
}
|
||||
28
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/OriginProtocolPolicy.php
vendored
Normal file
28
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/OriginProtocolPolicy.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable OriginProtocolPolicy values
|
||||
*/
|
||||
class OriginProtocolPolicy extends Enum
|
||||
{
|
||||
const HTTP_ONLY = 'http-only';
|
||||
const MATCH_VIEWER = 'match-viewer';
|
||||
}
|
||||
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/PriceClass.php
vendored
Normal file
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/PriceClass.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable PriceClass values
|
||||
*/
|
||||
class PriceClass extends Enum
|
||||
{
|
||||
const PRICE_CLASS_100 = 'PriceClass_100';
|
||||
const PRICE_CLASS_200 = 'PriceClass_200';
|
||||
const PRICE_CLASS_ALL = 'PriceClass_All';
|
||||
}
|
||||
28
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/SSLSupportMethod.php
vendored
Normal file
28
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/SSLSupportMethod.php
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable SSLSupportMethod values
|
||||
*/
|
||||
class SSLSupportMethod extends Enum
|
||||
{
|
||||
const SNI_ONLY = 'sni-only';
|
||||
const VIP = 'vip';
|
||||
}
|
||||
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/ViewerProtocolPolicy.php
vendored
Normal file
29
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Enum/ViewerProtocolPolicy.php
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Enum;
|
||||
|
||||
use Aws\Common\Enum;
|
||||
|
||||
/**
|
||||
* Contains enumerable ViewerProtocolPolicy values
|
||||
*/
|
||||
class ViewerProtocolPolicy extends Enum
|
||||
{
|
||||
const ALLOW_ALL = 'allow-all';
|
||||
const HTTPS_ONLY = 'https-only';
|
||||
const REDIRECT_TO_HTTPS = 'redirect-to-https';
|
||||
}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/AccessDeniedException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/AccessDeniedException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Access denied.
|
||||
*/
|
||||
class AccessDeniedException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/BatchTooLargeException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/BatchTooLargeException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a BatchTooLargeException error is encountered
|
||||
*/
|
||||
class BatchTooLargeException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/CNAMEAlreadyExistsException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/CNAMEAlreadyExistsException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a CNAMEAlreadyExistsException error is encountered
|
||||
*/
|
||||
class CNAMEAlreadyExistsException extends CloudFrontException {}
|
||||
24
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/CloudFrontException.php
vendored
Normal file
24
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/CloudFrontException.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
use Aws\Common\Exception\ServiceResponseException;
|
||||
|
||||
/**
|
||||
* Default service exception class
|
||||
*/
|
||||
class CloudFrontException extends ServiceResponseException {}
|
||||
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* If the CallerReference is a value you already sent in a previous request to create an identity but the content of the CloudFrontOriginAccessIdentityConfig is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists error.
|
||||
*/
|
||||
class CloudFrontOriginAccessIdentityAlreadyExistsException extends CloudFrontException {}
|
||||
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a CloudFrontOriginAccessIdentityInUseException error is encountered
|
||||
*/
|
||||
class CloudFrontOriginAccessIdentityInUseException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/DistributionAlreadyExistsException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/DistributionAlreadyExistsException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The caller reference you attempted to create the distribution with is associated with another distribution.
|
||||
*/
|
||||
class DistributionAlreadyExistsException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/DistributionNotDisabledException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/DistributionNotDisabledException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a DistributionNotDisabledException error is encountered
|
||||
*/
|
||||
class DistributionNotDisabledException extends CloudFrontException {}
|
||||
24
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/Exception.php
vendored
Normal file
24
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/Exception.php
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
use Aws\Common\Exception\ServiceResponseException;
|
||||
|
||||
/**
|
||||
* Default service exception class
|
||||
*/
|
||||
class Exception extends ServiceResponseException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/IllegalUpdateException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/IllegalUpdateException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Origin and CallerReference cannot be updated.
|
||||
*/
|
||||
class IllegalUpdateException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InconsistentQuantitiesException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InconsistentQuantitiesException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The value of Quantity and the size of Items do not match.
|
||||
*/
|
||||
class InconsistentQuantitiesException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidArgumentException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidArgumentException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The argument is invalid.
|
||||
*/
|
||||
class InvalidArgumentException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidDefaultRootObjectException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidDefaultRootObjectException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The default root object file name is too big or contains an invalid character.
|
||||
*/
|
||||
class InvalidDefaultRootObjectException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidErrorCodeException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidErrorCodeException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a InvalidErrorCodeException error is encountered
|
||||
*/
|
||||
class InvalidErrorCodeException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidForwardCookiesException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidForwardCookiesException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Your request contains forward cookies option which doesn't match with the expectation for the whitelisted list of cookie names. Either list of cookie names has been specified when not allowed or list of cookie names is missing when expected.
|
||||
*/
|
||||
class InvalidForwardCookiesException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidGeoRestrictionParameterException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidGeoRestrictionParameterException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a InvalidGeoRestrictionParameterException error is encountered
|
||||
*/
|
||||
class InvalidGeoRestrictionParameterException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidIfMatchVersionException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidIfMatchVersionException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The If-Match version is missing or not valid for the distribution.
|
||||
*/
|
||||
class InvalidIfMatchVersionException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidLocationCodeException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidLocationCodeException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a InvalidLocationCodeException error is encountered
|
||||
*/
|
||||
class InvalidLocationCodeException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidOriginAccessIdentityException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidOriginAccessIdentityException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The origin access identity is not valid or doesn't exist.
|
||||
*/
|
||||
class InvalidOriginAccessIdentityException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidOriginException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidOriginException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The Amazon S3 origin server specified does not refer to a valid Amazon S3 bucket.
|
||||
*/
|
||||
class InvalidOriginException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidRelativePathException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidRelativePathException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* The relative path is too big, is not URL-encoded, or does not begin with a slash (/).
|
||||
*/
|
||||
class InvalidRelativePathException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidRequiredProtocolException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidRequiredProtocolException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* This operation requires the HTTPS protocol. Ensure that you specify the HTTPS protocol in your request, or omit the RequiredProtocols element from your distribution configuration.
|
||||
*/
|
||||
class InvalidRequiredProtocolException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidResponseCodeException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidResponseCodeException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a InvalidResponseCodeException error is encountered
|
||||
*/
|
||||
class InvalidResponseCodeException extends CloudFrontException {}
|
||||
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidViewerCertificateException.php
vendored
Normal file
22
vendor/aws/aws-sdk-php/src/Aws/CloudFront/Exception/InvalidViewerCertificateException.php
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
* A copy of the License is located at
|
||||
*
|
||||
* http://aws.amazon.com/apache2.0
|
||||
*
|
||||
* or in the "license" file accompanying this file. This file is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Aws\CloudFront\Exception;
|
||||
|
||||
/**
|
||||
* Exception that occurs when a InvalidViewerCertificateException error is encountered
|
||||
*/
|
||||
class InvalidViewerCertificateException extends CloudFrontException {}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user