<?php

include('views/_header.tpl.php');
$timenow = date('Y/m/d h:i:s', time());
$displaytime = date('m/d/Y h:i:s a', time());
//date('m/d/Y h:i:s a', time());
// 2021-07-23 12:12:47

if (isset($_GET['saved'])) {
	//$msg = htmlentities(strip_tags($_GET['msg']));
	$saved = "Saved Successfully!";
}
?>

<style>
	div.spacer { padding-top:40px; }
	button, html input[type="button"], input[type="reset"], input[type="submit"] {
		padding:15px 35px;
	}
	.form .row-item .btn {
	    padding: 5px 10px;
		margin-top:0px;
	    margin-bottom: 0px;
	    margin-left: 0px;
		font-size:14px; 
		font-weight:300;
	}
	.form .row-item .lbl {
		float: left;
		padding-top: 11px;
		width: 100px;
		min-width:100px;
		text-align: right;
		background:none;
	}	
	/* INPUT FIELDS */
	.form .txt, input.datepicker {
		border: 1px solid #fafafa;
		margin-bottom: 15px;
		font-size:17px;
		font-weight: 300;
		padding: 10px 10px;
		background: #eee;
		max-width: 350px;
		width: 98%;
		border-radius: 4px;
		-moz-border-radius: 4px;
		-webkit-border-radius: 4px;
		box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 0 0 rgba(0, 0, 0, 0);
		-moz-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 0 0 rgba(0, 0, 0, 0);
		-webkit-box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 0 0 rgba(0, 0, 0, 0);
		box-sizing: border-box;
		-moz-box-sizing: border-box;
		-webkit-box-sizing: border-box;
		transition: border linear 0.2s, box-shadow linear 0.2s;
		-o-transition: border linear 0.2s, box-shadow linear 0.2s;
		-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
		-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
	}
	.saved  {
		background:#cd1000; margin-top:20px; color:#fff; text-align:center; padding:10px;
	}
	.saved a, .saved a:active, .saved a:visited { background:#fff;  color:#28d52d; border-radius:50px; padding:3px 10px; font-weight:800; }
	.saved a:hover { color:#fff;  background:#28d52d; }

	.rounded { border-radius: 50px; -moz-border-radius: 50px; -webkit-border-radius: 50px; padding-left:20px; padding-right:20px; }
</style>

		<?php
		if (isset($saved)) {
			echo "<div class='saved' />$saved &nbsp;&nbsp;&nbsp; <a href='/admin/?subscribers&edit={$subscriber['id']}'>Ok</a></div>";
		}
		?>
<br />
<div class="clear"></div>
<div class="home-feature-category" style="background:none; border:none;">
	<div class="container_12 clearfix">
		<div class="grid_12 marked-category">

			<h1 style="margin-bottom:0px; padding-bottom:0px; font-size:17px; 
			font-weight:500; width:225px; float:left;">
				<a href="/admin/subscribers">&laquo; Back</a> | <?php

				if ($subscriber) {
					echo "Edit";
				} else {
					echo "Add";
				}

				?> Subscriber
			</h1>

			<form method="post" class="form form-profile" enctype="multipart/form-data" 
			style="padding:0px 0px 0px; margin-top:0px;">
				<br /><br /><br />
				<div class="row-item clearfix" style="padding-bottom:10px;">

					<label class="lbl" for="txt_name1" style="width:auto; 
					margin-right:5px;">ID#:</label>
					
					<div class="val" style="margin-left:0px;">
						<input class="txt" type="text" name="id" 
						value="<?= $subscriber['id'] ?>" disabled="disabled" 
						readonly="readonly" style="">
						<p class="rs description-input"></p>
					</div>

					<label class="lbl" for="txt_name1" 
					style="width:auto; margin-right:5px;">Date:</label>
					
					<div class="val" style="margin-left:0px;">
						<input class="txt" type="text" name="date" 
						value="<?= $subscriber['date'] ?>" 
						style="" disabled="disabled" 
						readonly="readonly">
						<p class="rs description-input"></p>
					</div>
					
					<label class="lbl" for="txt_name1" style="width:auto; margin-right:5px;"></label>
					<div class="val" style="margin-left:0px; font-size:17px;">
						<i class="fa fa-clock" aria-hidden="true"></i> 
						<?= date('m/d/Y h:i:s a', strtotime($subscriber['date'])); ?>	
					</div>
					<br />
					
					<label class="lbl" for="txt_name1" style="width:auto; 
					margin-right:5px;">Email:</label>
					<div class="val" style="margin-left:0px;">
						<input class="txt" type="text" name="email" 
						value="<?= $subscriber['email'] ?>" >
						<p class="rs description-input"></p>
					</div>
					
					<label class="lbl" for="txt_name1" style="width:auto;
					margin-right:5px;">Code:</label>
					<div class="val" style="margin-left:0px;">
						<input class="txt" type="text" name="code"
						value="<?= $subscriber['code'] ?>" >
						<p class="rs description-input"></p>
					</div>
					
					<?php if ($subscriber) { ?>
						<!-- EDIT -->
					<?php } else { ?>
						<!-- ADD -->
						<label class="lbl" for="txt_name1" style="width:auto; 
						margin-right:5px;"></label>
						<div class="val" style="margin-left:0px; font-size:17px;">
							<i>this will generate on its own</i>
						</div>
						<br />
					<?php } ?>
					
					<label class="lbl" for="txt_name1" style="width:auto;
					margin-right:5px;">Redeemed:</label>
					<div class="val" style="margin-left:0px;">
						<input class="txt" type="text" name="redeemed"
						value="<?= $subscriber['redeemed'] ?>" >
						<p class="rs description-input"></p>
					</div>
					
					<label class="lbl" for="txt_name1" style="width:auto;
					margin-right:5px;">Interested:</label>
					<div class="val" style="margin-left:0px;">
						<input class="txt" type="text" name="interestedin"
						value="<?= $subscriber['interestedin'] ?>" >
						<p class="rs description-input"></p>
					</div>

					<!-- // email, code, date, redeemed, interestedin -->
									
				</div>
				<!-- END OF THE CONTAINING DIV -->
				<br />
	
				<input type="submit" style="font-weight:300" class="btn btn-black" />
				<input type="button" value="Cancel" class="btn btn-black" 
				onclick="location = '/admin/subscribers'" />
			</form>

		</div>
	</div>
</div>

<script type="text/javascript">
$(document).ready(function() {

});
</script>

<?php

include('views/_footer_m.tpl.php');

?>