<?php

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

?>

<link rel="stylesheet" href="/static/css/jquery.datetimepicker.css"/>
<script src='/static/js/jquery.datetimepicker.js'></script>

<script type="text/javascript">
$(document).ready(function()
{
    $(".datepicker").datetimepicker({
    	hours24: true,
        format: 'Y-m-d H:i',
        formatTime: 'H:i',
        datepicker: true,
        timepicker: true,
        timepickerScrollbar: true,
        step: 30        
    });
    
        //hours12: true,
        //format: 'Y-m-d hh:mm A',
        //formatDate: 'Y-m-d hh:mm A',
        //datepicker: true,
        //timepicker: true,
        //step: 30,
        //showMeridian:true    

    $(".timepicker").datetimepicker({
        hours12: true,
        format: 'h:i A',
        formatTime: 'h:i',
        timepicker: true,
        datepicker: false,
        timepickerScrollbar: false,
        step: 30
    });
});
</script>

 <div class="home-feature-category" style="background:none; border:none;">
        <div class="container_12 clearfix">
        <div class="grid_8 marked-category">

		<h1 style="margin-bottom:0px;"><?php
		
		if ($event) {
			echo "Edit";
		} else {
			echo "Add";
			$def = "https://master.thndev.com/static/uploads/logos/placeholder.jpg";
		}
		
		?> Event</h1>

		<form method="post" class="form form-profile" enctype="multipart/form-data" style="padding:25px 0px 0px;">
			<div class="row-item clearfix" style="padding-bottom:10px;">
				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Image:</label>
                <div class="val" style="margin-left:0px; margin-bottom:10px;">
                	<img src="<?php if($event) { echo "" .$event['image']. ""; } else { echo "" . $def . ""; } ?>" style="height:100px; width:auto;" />
                    <p class="rs description-input"></p>
                </div>			
				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Title:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="title" value="<?= $event['title'] ?>" >
                    <p class="rs description-input"></p>
                </div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Text:</label>
                <div class="val" style="margin-left:0px;">
					<textarea class="txt" name="content"><?= $event['content'] ?></textarea>
                    <p class="rs description-input"></p>
                </div>

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Auth:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="author" value="<?= $event['author'] ?>">
                    <p class="rs description-input"></p>
                </div>				

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Short:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="short" value="<?= $event['short'] ?>">
                    <p class="rs description-input"></p>
                </div>	

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Link:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="link" value="<?= $event['link'] ?>">
                    <p class="rs description-input"></p>
                </div>	

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Label:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="label" value="<?= $event['label'] ?>">
                    <p class="rs description-input"></p>
                </div>	

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Custom:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="custom" value="<?= $event['custom'] ?>">
                    <p class="rs description-input"></p>
                </div>	

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Date:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt datepicker" type="text" name="date" value="<?= $event['date'] ?>" placeholder="<?= date('m/d/Y g:i A') ?>">
                    <p class="rs description-input"></p>
                </div>	

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">mm:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="mm" value="<?= $event['mm'] ?>">
                    <p class="rs description-input"></p>
                </div>	

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">dd:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="dd" value="<?= $event['dd'] ?>">
                    <p class="rs description-input"></p>
                </div>	

				<label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">day:</label>
                <div class="val" style="margin-left:0px;">
                	<input class="txt" type="text" name="day" value="<?= $event['day'] ?>">
                    <p class="rs description-input"></p>
                </div>					
				
                <label class="lbl" for="txt_name1" style="text-align:left; width:50px; margin-right:5px;">Img:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="file" name="image" >
                    <p class="rs description-input"></p>
                </div>			
            </div>
            <br />
            <input type="submit" style="font-weight:300" class="btn btn-blue" /> 
			<input type="button" value="Cancel" class="btn btn-black" onclick="location = '/admin/'" />
		</form>

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

<?php

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

?>