Commit 944203fb authored by Daniel Messer's avatar Daniel Messer

Added web slide feature. Bug fixes.

parent 0091dff4
......@@ -14,6 +14,10 @@ Supports JPG, PNG, GIF. Slides display for 10 seconds before cycling to the next
Signbrary also supports MP4 for video or animated slides.
### Web Site Display
You can add a website into the slide deck and it will display along with your slides for the same period of time as your slides. This is useful for displaying live content or system wide content across multiple displays.
### Content Display
You can offer various types of content for download. eBooks, MP3s, and more. The content listing will show up at the end of the slide deck.
......
......@@ -22,10 +22,10 @@
<form action="../content-add.php" method="post" enctype="multipart/form-data" id="addcontent">
Title:<br />
<input type="text" name="cont_title" placeholder="Ex: Dubliners" /><br /><br />
<input type="text" name="cont_title" placeholder="Ex: Dubliners" required /><br /><br />
Author:<br />
<input type="text" name="cont_author" placeholder="Ex: James Joyce" /><br /><br />
<input type="text" name="cont_author" placeholder="Ex: James Joyce" required /><br /><br />
Format<br />
<input type="radio" name="format" value="mobi" checked="checked">Mobi eBook<br />
......@@ -52,10 +52,10 @@
Brief Summary (Max 250 characters)<br />
<textarea rows="3" cols="80" maxlength="250" name="bsum" form="addcontent"></textarea><br /><br />
<textarea rows="3" cols="80" maxlength="250" name="bsum" form="addcontent" required></textarea><br /><br />
Full Summary<br />
<textarea rows="8" cols="80" name="fsum" form="addcontent"></textarea><br /><br />
<textarea rows="8" cols="80" name="fsum" form="addcontent" required></textarea><br /><br />
Set content to Active/Inactive<br />
<input type="radio" name="activecontent" value="active" checked="checked">Active<br />
......@@ -63,10 +63,10 @@
Select content for upload (Max size = 20 MB):
<input type="file" name="fileToUpload" id="fileToUpload"><br /><br />
<input type="file" name="fileToUpload" id="fileToUpload" required><br /><br />
Select cover image for upload (Max size = 10 MB):
<input type="file" name="coverToUpload" id="coverToUpload"><br /><br />
<input type="file" name="coverToUpload" id="coverToUpload" required><br /><br />
<input type="submit" value="Add Content" name="submit">
</form>
......
......@@ -23,22 +23,22 @@
<form action="../slide-add.php" method="post" enctype="multipart/form-data">
Image Title:<br />
<input type="text" name="img_title" placeholder="Name your slide" /><br /><br />
<input type="text" name="img_title" placeholder="Name your slide" required /><br /><br />
Start Date / Time:<br />
<input id="start_dt" name="start_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker ->" />
<input id="start_tm" name="start_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" /><br /><br />
<input id="start_dt" name="start_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker -> " required />
<input id="start_tm" name="start_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required/><br /><br />
End Date / Time:<br />
<input id="end_dt" name="end_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker ->" />
<input id="end_tm" name="end_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" /><br /><br />
<input id="end_dt" name="end_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker ->" required />
<input id="end_tm" name="end_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required /><br /><br />
Set Slide to Active/Inactive<br />
<input type="radio" name="activeslide" value="active" checked="checked">Active<br />
<input type="radio" name="activeslide" value="inactive">Inactive<br /><br />
Select media for upload (Max size = 10 MB):
<input type="file" name="fileToUpload" id="fileToUpload"><br /><br />
<input type="file" name="fileToUpload" id="fileToUpload" required><br /><br />
<input type="submit" value="Add Slide" name="submit">
</form>
......
<?php require('login.php');?>
<!DOCTYPE html>
<html>
<head>
<title>Signbrary - Add Website Based Slide</title>
<link rel="stylesheet" type="text/css" href="../css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="../css/layout.css" />
<script type="text/javascript" src="../js/datepicker.js"></script>
<script type="text/javascript" src="../js/timepicker.js"></script>
<script type="text/javascript" src="../js/w3.js"></script>
</head>
<body>
<div id="pagewidth">
<div id="header"><h1>Signbrary &ndash; Digital Signage. Digital Content.</h1></div>
<div id="wrapper" class="clearfix">
<div id="maincol"><h1>Add Web Based Slide</h1>
<p>Accepted formats include: A URL</p>
<p style = "color:#ff0000;">All fields are required.</p>
<hr>
<form action="../webslide-add.php" method="post" enctype="multipart/form-data">
Web Slide Title:<br />
<input type="text" name="web_title" placeholder="Name your slide" required /><br /><br />
Start Date / Time:<br />
<input id="start_dt" name="start_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker -> " required />
<input id="start_tm" name="start_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required/><br /><br />
End Date / Time:<br />
<input id="end_dt" name="end_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker ->" required />
<input id="end_tm" name="end_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required /><br /><br />
Set Slide to Active/Inactive<br />
<input type="radio" name="activeslide" value="active" checked="checked">Active<br />
<input type="radio" name="activeslide" value="inactive">Inactive<br /><br />
URL for the Web Slide<br />
<input type="text" name="url" placeholder="https://archive.org" required /><br/><br/>
<input type="submit" value="Add Web Slide" name="submit">
</form>
</div> <!-- End maincol -->
<div id="leftcol">
<p w3-include-html="admin-nav.html"></p>
<script>
w3.includeHTML();
</script>
</div> <!-- End leftcol -->
</div> <!-- End wrapper -->
</div> <!-- End pagewidth -->
</body>
</html>
......@@ -7,6 +7,11 @@
<h3 style="color:#fff; font-variant:small-caps;">Slides</h3>
<li><a href="addslide.php">Add Slide</a></li>
<li><a href="slide-manage.php">Manage Slides</a></li>
<h3 style="color:#fff; font-variant: small-caps;">Web Slides</h3>
<li><a href="addwebslide.php">Add Web Slide</a></li>
<li><a href="webslide-manage.php">Manage Web Slides</a></li>
<h3 style="color:#fff; font-variant:small-caps;">Content</h3>
<li><a href="addcontent.php">Add Content</a></li>
<li><a href="content-manage.php">Manage Content</a></li>
......
......@@ -4,11 +4,11 @@
<head>
<title>Edit Content</title>
<link rel="stylesheet" type="text/css" href="css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="css/layout.css" />
<script type="text/javascript" src="js/w3.js"></script>
<script type="text/javascript" src="js/datepicker.js"></script>
<script type="text/javascript" src="js/timepicker.js"></script>
<link rel="stylesheet" type="text/css" href="../css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="../css/layout.css" />
<script type="text/javascript" src="../js/w3.js"></script>
<script type="text/javascript" src="../js/datepicker.js"></script>
<script type="text/javascript" src="../js/timepicker.js"></script>
</head>
<body>
......@@ -22,7 +22,7 @@
<?php
$editid = htmlspecialchars($_GET["id"]);
include 'creds.php';
include '../creds.php';
$result = mysqli_query($conn,"SELECT * from content WHERE ContentID = '$editid'");
$getgenre = mysqli_query($conn,"SELECT Description from genre order by Description");
......@@ -34,13 +34,13 @@ while($row = mysqli_fetch_array($result))
<form action="content-update.php" method="post" enctype="multipart/form-data" id="updatecontent">
Item ID:<br />
<input type="text" name="ItemID" value="<?php echo(htmlspecialchars($row['ItemID'])); ?>" /><br /><br />
<input type="text" name="ItemID" value="<?php echo(htmlspecialchars($row['ItemID'])); ?>" required /><br /><br />
Title:<br />
<input type="text" name="cont_title" value="<?php echo(htmlspecialchars($row['Title'])); ?>" /><br /><br />
<input type="text" name="cont_title" value="<?php echo(htmlspecialchars($row['Title'])); ?>" required /><br /><br />
Author:<br />
<input type="text" name="cont_author" value="<?php echo(htmlspecialchars($row['Author'])); ?>" /><br /><br />
<input type="text" name="cont_author" value="<?php echo(htmlspecialchars($row['Author'])); ?>" required /><br /><br />
Format:<br />
<input type="radio" name="format" value="mobi" checked="checked">Mobi eBook<br />
......@@ -50,10 +50,10 @@ while($row = mysqli_fetch_array($result))
<input type="radio" name="format" value="ePub">MP4 video<br /><br />
Brief Summary (Max 250 characters)<br />
<textarea rows="3" cols="80" maxlength="250" name="bSum" form="updatecontent"><?php echo(htmlspecialchars($row['SummaryBrief'])); ?></textarea><br /><br />
<textarea rows="3" cols="80" maxlength="250" name="bSum" form="updatecontent" required><?php echo(htmlspecialchars($row['SummaryBrief'])); ?></textarea><br /><br />
Full Summary<br />
<textarea rows="8" cols="80" name="fSum" form="updatecontent"><?php echo(htmlspecialchars($row['SummaryFull'])); ?></textarea><br /><br />
<textarea rows="8" cols="80" name="fSum" form="updatecontent" required><?php echo(htmlspecialchars($row['SummaryFull'])); ?></textarea><br /><br />
Set Content to Active/Inactive<br />
<input type="radio" name="activecontent" value="active" checked="checked">Active<br />
......@@ -74,10 +74,10 @@ while($row = mysqli_fetch_array($result))
echo "</select><br /><br />"; ?>
Select content for upload (Max size = 20 MB):
<input type="file" name="fileToUpload" id="fileToUpload"><br /><br />
<input type="file" name="fileToUpload" id="fileToUpload" required><br /><br />
Select cover image for upload (Max size = 10 MB):
<input type="file" name="coverToUpload" id="coverToUpload"><br /><br />
<input type="file" name="coverToUpload" id="coverToUpload" required><br /><br />
<input type="hidden" name="editID" value="<?php echo $editid; ?>" />
......
......@@ -29,7 +29,7 @@ while($row = mysqli_fetch_array($result))
<form action="genre-update.php" method="post" enctype="multipart/form-data">
Genre Description:<br />
<input type="text" name="genre" value="<?php echo(htmlspecialchars($row['Description'])); ?>" /><br /><br />
<input type="text" name="genre" required value="<?php echo(htmlspecialchars($row['Description'])); ?>" /><br /><br />
<input type="hidden" name="GenreID" value="<?php echo $editid; ?>" />
......
......@@ -32,15 +32,15 @@ while($row = mysqli_fetch_array($result))
<form action="../slide-update.php" method="post" enctype="multipart/form-data">
Image Title:<br />
<input type="text" name="img_title" value="<?php echo(htmlspecialchars($row['SlideName'])); ?>" /><br /><br />
<input type="text" name="img_title" value="<?php echo(htmlspecialchars($row['SlideName'])); ?>" required /><br /><br />
Start Date / Time:<br />
<input id="start_dt" name="start_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker" />
<input id="start_tm" name="start_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" /><br /><br />
<input id="start_dt" name="start_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker" required />
<input id="start_tm" name="start_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required /><br /><br />
End Date / Time:<br />
<input id="end_dt" name="end_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker" />
<input id="end_tm" name="end_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" /><br /><br />
<input id="end_dt" name="end_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker" required />
<input id="end_tm" name="end_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required /><br /><br />
Set Slide to Active/Inactive<br />
<input type="radio" name="activeslide" value="active" checked="checked">Active<br />
......@@ -62,7 +62,7 @@ while($row = mysqli_fetch_array($result))
<input type="hidden" name="slidenumber" value="<?php echo $editid; ?>" />
Select media for upload (Max size = 10 MB):
<input type="file" name="fileToUpload" id="fileToUpload"><br /><br />
<input type="file" name="fileToUpload" id="fileToUpload" required><br /><br />
<input type="submit" value="Edit Slide" name="submit">
</form>
<?php
......
<?php require('login.php');?>
<?php
include '../creds.php';
$deleteid = htmlspecialchars($_GET["id"]);
mysqli_query($conn,"DELETE FROM websites WHERE WebID = '$deleteid'");
// Close database connection
mysqli_close($conn);
header("Location: webslide-manage.php"); // Slide deleted - return to management
?>
<?php require('login.php');?>
<!DOCTYPE html>
<html>
<head>
<title>Edit Web Slide</title>
<link rel="stylesheet" type="text/css" href="../css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="../css/layout.css" />
<script type="text/javascript" src="../js/datepicker.js"></script>
<script type="text/javascript" src="../js/timepicker.js"></script>
<script type="text/javascript" src="../js/w3.js"></script>
</head>
<body>
<div id="pagewidth">
<div id="header"><h2>Signbrary &ndash; Digital Signage. Digital Content.</h2></div>
<div id="wrapper" class="clearfix">
<div id="maincol"><h1>Edit Web Slide</h1>
<p>Accepted formats include: URL</p>
<p style = "color:#ff0000;">All fields are required.</p>
<hr>
<?php
$editid = htmlspecialchars($_GET["id"]);
include '../creds.php';
$result = mysqli_query($conn,"SELECT * from websites WHERE WebID = '$editid'");
while($row = mysqli_fetch_array($result))
{
?>
<form action="../webslide-update.php" method="post" enctype="multipart/form-data">
Image Title:<br />
<input type="text" name="web_title" value="<?php echo(htmlspecialchars($row['WebName'])); ?>" required /><br /><br />
Start Date / Time:<br />
<input id="start_dt" name="start_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker" required />
<input id="start_tm" name="start_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required /><br /><br />
End Date / Time:<br />
<input id="end_dt" name="end_dt" class='datepicker' size='11' title='D-MMM-YYYY' placeholder="Use date picker" required />
<input id="end_tm" name="end_tm" class='timepicker' size='5' title='HH:MM' placeholder="HH:MM" required /><br /><br />
Set Slide to Active/Inactive<br />
<input type="radio" name="activeslide" value="active" checked="checked">Active<br />
<input type="radio" name="activeslide" value="inactive">Inactive<br /><br />
<input type="hidden" name="webslidenumber" value="<?php echo $editid; ?>" />
<input type="text" name="url" size="50" value="<?php echo(htmlspecialchars($row['WebURL'])); ?>" required /><br /><br />
<input type="submit" value="Edit Slide" name="submit">
</form>
<?php
}
?>
</div> <!-- End maincol -->
<div id="leftcol">
<p w3-include-html="admin-nav.html"></p>
<script>
w3.includeHTML();
</script>
</div> <!-- End leftcol -->
</div> <!-- End wrapper -->
</div> <!-- End pagewidth -->
</body>
</html>
<?php require('login.php');?>
<html>
<head>
<title>Signbrary - Manage Web Slides</title>
<link rel="stylesheet" type="text/css" href="../css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="../css/layout.css" />
<script type="text/javascript" src="../js/datepicker.js"></script>
<script type="text/javascript" src="../js/timepicker.js"></script>
<script type="text/javascript" src="../js/w3.js"></script>
<style>
#slides {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 90%;
}
#slides td, #slides th {
border: 1px solid #ddd;
padding: 8px;
}
#slides tr:nth-child(even){background-color: #f2f2f2;}
#slides tr:hover {background-color: #ddd;}
#slides th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #0000ff;
color: white;
}
</style>
</head>
<body>
<div id="pagewidth">
<div id="header"><h2>Signbrary &ndash; Digital Signage. Digital Content.</h2></div>
<div id="wrapper" class="clearfix">
<div id="maincol"><h1>Manage Web Slides</h1>
<?php include '../creds.php';?>
<table id="slides">
<tr>
<th><strong>Name</strong></th>
<th><strong>Displays</strong></th>
<th><strong>Expires</strong></th>
<th><strong>URL</strong></th>
<th><strong>Active</strong></th>
<th><strong>Edit</strong></th>
<th><strong>Delete</strong></th>
</tr>
<?php
$result = mysqli_query($conn,"SELECT * FROM websites ORDER BY WebName");
while($row = mysqli_fetch_array($result))
{
$row_webslideID = $row['WebID'];
$row_webname = $row['WebName'];
$row_displays = $row['WebUp'];
$row_expires = $row['WebDown'];
$row_active = $row['WebActive'];
$row_url = $row['WebURL'];
echo '<tr>';
echo '<td>' . $row_webname . '</td>';
echo '<td>' . $row_displays . '</td>';
echo '<td>' . $row_expires . '</td>';
echo '<td><a href="'.$row_url.'">'. $row_url . '</a></td>';
echo '<td><a href="webslide-toggleactive.php?id=' . $row_webslideID . '">'.$row_active.'</a></td>';
echo '<td><a href="webslide-edit.php?id=' . $row_webslideID . '">Edit</a></td>';
echo '<td><a href="webslide-delete.php?id=' . $row_webslideID . '" onclick="return confirm(\'Are you sure you want to delete this web slide?\');">Delete</a></td>';
echo '</tr>';
}
mysqli_close($conn);
?>
</table>
</div> <!-- End maincol -->
<div id="leftcol">
<p w3-include-html="admin-nav.html"></p>
<script>
w3.includeHTML();
</script>
</div> <!-- End leftcol -->
</div> <!-- End wrapper -->
</div> <!-- End pagewidth -->
</body>
</html>
<?php require('login.php');?>
<?php
include '../creds.php';
$toggleid = htmlspecialchars($_GET["id"]);
// Updating the database
$result = mysqli_query($conn,"SELECT WebActive FROM websites WHERE WebID = '$toggleid'");
while($row = mysqli_fetch_array($result))
{
$active = $row['WebActive'];
if($active != "active") {
mysqli_query($conn,"UPDATE websites SET WebActive = 'active' WHERE WebID = '$toggleid'");
} else {
mysqli_query($conn,"UPDATE websites SET WebActive = 'inactive' WHERE WebID = '$toggleid'");
}
}
// Close database connection
mysqli_close($conn);
header("Location: webslide-manage.php"); // Slide deleted - return to management
?>
......@@ -3,9 +3,9 @@
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 07, 2019 at 09:23 AM
-- Server version: 10.1.34-MariaDB-0ubuntu0.18.04.1
-- PHP Version: 7.2.10-0ubuntu0.18.04.1
-- Generation Time: Apr 17, 2019 at 12:33 PM
-- Server version: 10.1.38-MariaDB-0ubuntu0.18.04.1
-- PHP Version: 7.2.15-0ubuntu0.18.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
......@@ -77,7 +77,8 @@ INSERT INTO `downloads` (`DownloadID`, `ContentID`, `DownloadDate`) VALUES
(2, 16, '2019-02-07 08:48:27'),
(3, 16, '2019-02-07 08:54:05'),
(4, 16, '2019-02-07 08:55:25'),
(5, 25, '2019-02-07 09:00:19');
(5, 25, '2019-02-07 09:00:19'),
(6, 16, '2019-02-07 09:37:55');
-- --------------------------------------------------------
......@@ -135,6 +136,29 @@ INSERT INTO `slides` (`SlideID`, `SlideName`, `SlideUp`, `SlideDown`, `SlideActi
(28, 'Teddy Bear Storytime', '2019-02-05 12:00:00', '2020-02-12 12:00:00', 'active', 'uploads/slide-TeddyBearStorytime.png'),
(29, 'Learn to Code', '2019-02-05 12:00:00', '2020-02-28 12:00:00', 'active', 'uploads/slide-Coding.png');
-- --------------------------------------------------------
--
-- Table structure for table `websites`
--
CREATE TABLE `websites` (
`WebID` int(11) NOT NULL COMMENT 'Primary key.',
`WebName` text NOT NULL COMMENT 'Name of the web slide.',
`WebUp` datetime NOT NULL COMMENT 'When the slide goes up.',
`WebDown` datetime NOT NULL COMMENT 'When the slide comes down.',
`WebActive` tinytext NOT NULL COMMENT 'Active/Inactive slide.',
`WebURL` text NOT NULL COMMENT 'The URL for the web slide.'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Web/URL based slides.';
--
-- Dumping data for table `websites`
--
INSERT INTO `websites` (`WebID`, `WebName`, `WebUp`, `WebDown`, `WebActive`, `WebURL`) VALUES
(1, 'QC Weather', '2019-04-16 12:00:00', '2020-04-17 12:00:00', 'active', 'https://darksky.net/forecast/33.2329,-111.6344/us12/en'),
(2, 'Archive', '2019-04-16 12:00:00', '2020-04-17 12:00:00', 'active', 'https://archive.org');
--
-- Indexes for dumped tables
--
......@@ -163,6 +187,12 @@ ALTER TABLE `genre`
ALTER TABLE `slides`
ADD PRIMARY KEY (`SlideID`);
--
-- Indexes for table `websites`
--
ALTER TABLE `websites`
ADD PRIMARY KEY (`WebID`);
--
-- AUTO_INCREMENT for dumped tables
--
......@@ -176,7 +206,7 @@ ALTER TABLE `content`
-- AUTO_INCREMENT for table `downloads`
--
ALTER TABLE `downloads`
MODIFY `DownloadID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
MODIFY `DownloadID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `genre`
--
......@@ -187,6 +217,11 @@ ALTER TABLE `genre`
--
ALTER TABLE `slides`
MODIFY `SlideID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary key.', AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT for table `websites`
--
ALTER TABLE `websites`
MODIFY `WebID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Primary key.', AUTO_INCREMENT=4;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
......@@ -7,6 +7,11 @@
<h3 style="color:#fff; font-variant:small-caps;">Slides</h3>
<li><a href="admin/addslide.php">Add Slide</a></li>
<li><a href="admin/slide-manage.php">Manage Slides</a></li>
<h3 style="color:#fff; font-variant:small-caps;">Web Slides</h3>
<li><a href="admin/addwebslide.php">Add Web Slide</a></li>
<li><a href="admin/webslide-manage.php">Manage Web Slides</a></li>
<h3 style="color:#fff; font-variant:small-caps;">Content</h3>
<li><a href="admin/addcontent.php">Add Content</a></li>
<li><a href="admin/content-manage.php">Manage Content</a></li>
......
......@@ -14,6 +14,7 @@ body {overflow:hidden; background-color: #000;}
<?php
// Get the latest slides from the database
$result = mysqli_query($conn,"SELECT SlideFile from slides WHERE NOW() BETWEEN SlideUp AND SlideDown AND SlideActive = 'active'");
$webslides = mysqli_query($conn,"SELECT WebURL from websites WHERE NOW() BETWEEN WebUp and WebDown AND WebActive = 'active'");
while($row = mysqli_fetch_array($result))
{
......@@ -32,6 +33,13 @@ while($row = mysqli_fetch_array($result))
}
}
while($row = mysqli_fetch_array($webslides))
{
$row_url = $row['WebURL'];
echo '<iframe class="mySlides" src="'.$row_url.'" style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;"></iframe>';
}
echo '<iframe class="mySlides" src="display/content.php" style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;"></iframe>';
?>
......
......@@ -97,7 +97,7 @@ mysqli_close($conn);
?>
</div> <!-- End maincol -->
<<div id="leftcol">
<div id="leftcol">
<p w3-include-html="side-nav.html"></p>
<script>
......
<?php require('admin/login.php');?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/layout.css" />
<script type="text/javascript" src="js/w3.js"></script>
</head>
<body>
<div id="pagewidth">
<div id="header"><h1>Signbrary &ndash; Digital Signage. Digital Content.</h1></div>
<div id="wrapper" class="clearfix">
<div id="maincol"><h1>Slide Added</h1>
<?php
include 'creds.php';
$web_title = $_POST["web_title"];
$start_dt = $_POST["start_dt"];
$start_tm = $_POST["start_tm"];
$end_dt = $_POST["end_dt"];
$end_tm = $_POST["end_tm"];
$activeslide = $_POST["activeslide"];
$url = $_POST["url"];
// Converting dates to SQL standards
$date = new DateTime();
$newDisplayDate = $date->createFromFormat('j-M-Y', $start_dt);
$displaydate = $newDisplayDate->format('Y-m-d');
$newExpireDate = $date->createFromFormat('j-M-Y', $end_dt);
$expiredate = $newExpireDate->format('Y-m-d');
$time = new DateTime();
$newDisplayTime = $time->createFromFormat('G:i', $start_tm);
$displaytime = $newDisplayTime->format('H:i:s');
$newExpireTime = $time->createFromFormat('G:i', $end_tm);
$expiretime = $newExpireTime->format('H:i:s');
echo "<strong>Slide display starts:</strong> " . $SlideUp = $displaydate . " " . $displaytime;
echo "<br /><br />";
echo "<strong>Slide expires on:</strong> " . $SlideDown = $expiredate . " " . $expiretime;
echo "<br /><br />";
echo "Slide URL: ".$url;
echo '<hr>';
echo '<a href="admin/addwebslide.php">Add another slide</a> | <a href="admin/webslide-manage.php">Manage webslides</a>';
// Updating the database
mysqli_query($conn,"INSERT INTO websites (WebID,WebName,WebUp,WebDown,WebActive,WebURL) VALUES (NULL,'$web_title','$SlideUp','$SlideDown','$activeslide','$url')");
// Close database connection
mysqli_close($conn);
?>
</div> <!-- End maincol -->
<div id="leftcol">
<p w3-include-html="side-nav.html"></p>
<script>
w3.includeHTML();
</script>
</div> <!-- End leftcol -->
</div> <!-- End wrapper -->
</div> <!-- End pagewidth -->
</body>
</html>
<?php require('admin/login.php');?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/layout.css" />
<script type="text/javascript" src="js/w3.js"></script>
</head>
<body>
<div id="pagewidth">
<div id="header"><h1>Signbrary &ndash; Digital Signage. Digital Content.</h1></div>
<div id="wrapper" class="clearfix">
<div id="maincol"><h1>Web Slide Edit Complete</h1>
<?php
include 'creds.php';
$web_title = $_POST["web_title"];
$start_dt = $_POST["start_dt"];
$start_tm = $_POST["start_tm"];
$end_dt = $_POST["end_dt"];
$end_tm = $_POST["end_tm"];
$activeslide = $_POST["activeslide"];
$url = $_POST["url"];
$editid = $_POST["webslidenumber"];
// DEBUGGING
/*
echo $img_title.'<br />';
echo $start_dt.'<br />';
echo $start_tm.'<br />';
echo $end_dt.'<br />';
echo $end_tm.'<br />';
echo $activeslide.'<br />';
echo $editid.'<br />';
*/
// Converting dates to SQL standards