<?php require_once('../../php/connect.php'); ?>
<?php require ("../php/secure.php");?>
<?php include ("php/nav.php");?>
<?php include ("php/today.php");?>
<?php
date_default_timezone_set("America/Chicago");
$todaydate = date("Y-m-d");
$colname_Promos = $_GET['id'];
$query_EditPromo = "SELECT * FROM SMBDU_Notifications WHERE id = $colname_Promos";
$EditPromo = mysqli_query($SMB, $query_EditPromo);
$row_EditPromo = mysqli_fetch_assoc($EditPromo);
$totalRows_EditPromo = mysqli_num_rows($EditPromo);
// Notifications
$query_Notifications = "SELECT * FROM SMBDU_Notifications ORDER BY id ASC";
$Notifications = mysqli_query($SMB, $query_Notifications);
$totalRows_Notifications = mysqli_num_rows($Notifications);
if($totalRows_Notifications > 0){
while($row_Notifications = mysqli_fetch_assoc($Notifications)){
$Notifications_ID = $row_Notifications['id'];
$Notifications_title = $row_Notifications['name'];
$Notifications_Output .='<tr>
<td align="left" valign="middle">'.$Notifications_title.'</td>
<td align="center" valign="middle"><a href="notification-edit.php?id='.$Notifications_ID.'"><img src="assets/edit-icon.png" alt="" width="30" height="32" title="Edit Notification"/></a></td>
</tr>';
}
}
else {
$Notifications_Output = '<tr>
<td colspan="2" align="left" valign="middle">No Notifications</td>
</tr>';
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Dashboard</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="https://cdn.tiny.cloud/1/znxig3ypa8s92l5po9mh8sjo9qm1tkx67rkavrg3r1kc3xx0/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
<script>
tinymce.init({
selector: 'textarea',
height: 300,
plugins: 'advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code fullscreen insertdatetime media table paste imagetools wordcount',
toolbar_mode: 'floating',
tinycomments_mode: 'embedded',
image_advtab: true,
convert_urls:false,
content_css: [
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tinymce.com/css/codepen.min.css']
});
</script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
</head>
<body>
<div id="Container">
<div id="Header"><img src="assets/SavvyLogo.png" alt="" height="35" align="absbottom"/>SAVVY SITE DESIGNS
<div class="HeaderRight">WELCOME, <?php echo $UserName; ?>! <img src="assets/active-user-icon.png" alt="" height="22" align="absbottom"/></div>
</div>
<?php echo $Nav_Output; ?>
<div id="ContentCtn">
<div class="ContentHeader"><img src="assets/logo.png" height="75" alt=""/></div>
<div class="pageTitle">
<h3><img src="assets/content-icon.png" alt="" width="41" height="40" align="absmiddle"/> Manage Notification: <?php echo $row_EditPromo['name']; ?></h3></div>
<div class="Content">
<div class="container">
<ul class="tabs">
<li class="tab-link current" data-tab="tab-1">Edit Notification Content</li>
<li class="tab-link" data-tab="tab-2">All Notifications</li>
</ul>
<div id="tab-1" class="tab-content current">
<form action="php/edit.php" method="post" name="form1" id="form1">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td align="left" valign="middle" nowrap="nowrap"><strong>Subject Line:</strong></td>
<td><input type="text" name="subject" id="subject" value="<?php echo $row_EditPromo['subject']; ?>"></td>
</tr>
<tr>
<td align="left" valign="middle" nowrap="nowrap"><strong>Header Line: </strong></td>
<td><input name="header" type="text" id="header" value="<?php echo $row_EditPromo['header']; ?>"></td>
</tr>
<tr>
<td width="22%" align="left" valign="top" nowrap="nowrap"><strong>Top Content:</strong></td>
<td width="78%"><textarea name="top_text" id="top_text"><?php echo $row_EditPromo['top_text']; ?></textarea></td>
</tr>
<tr>
<td align="left" valign="top" nowrap="nowrap"><strong>Code Content:</strong></td>
<td><?php echo $row_EditPromo['code_text']; ?></td>
</tr>
<tr>
<td align="left" valign="top" nowrap="nowrap"><strong>Bottom Content:</strong></td>
<td><textarea name="end_text" id="end_text"><?php echo $row_EditPromo['end_text']; ?></textarea></td>
</tr>
<tr>
<td><input name="Notify" type="hidden" id="Notify" value="Edit">
<input name="id" type="hidden" id="id" value="<?php echo $row_EditPromo['id']; ?>"></td>
<td><input type="submit" name="submit" id="submit" value="Save Changes"></td>
</tr>
</tbody>
</table>
</form>
</div>
<div id="tab-2" class="tab-content">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td width="89%" align="left" valign="middle"><strong>Notifications</strong></td>
<td width="5%" align="center" valign="middle"> </td>
</tr>
<?php echo $Notifications_Output; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('ul.tabs li').click(function(){
var tab_id = $(this).attr('data-tab');
$('ul.tabs li').removeClass('current');
$('.tab-content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
})
})
</script>
<script>
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = null;
}
return date;
}
} );
</script>
</body>
</html> |