<?php 
include('views/_header.tpl.php'); 
if (isset($_GET['msg'])) {
	$msg = htmlentities(strip_tags($_GET['msg']));
}
if (isset($_GET['saved'])) {
	//$msg = htmlentities(strip_tags($_GET['msg']));
	$saved = "Saved Successfully!";
}
?>

<script src="/3rdparty/ckeditor/ckeditor.js"></script>

<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',
			formatTime: 'H:i',
			datepicker: true,
			timepicker: false,
			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: 'm-d-Y h:i A',
			formatTime: 'h:i',
			timepicker: true,
			datepicker: true,
			timepickerScrollbar: true,
			step: 30
		});
	});
</script>

<style>
	#mmen { display:none; }
	.spacer { padding-top:57px; }
	.form .row-item .val { margin-bottom:10px; }
	.form .row-item .lbl { min-width:70px; margin-top:5px; }
	.form .txt {
		font-weight: 300;
		background: #eee; border:0px;
	}
	.btn { padding: 15px 25px; font-size:15px;  font-weight:300; margin-right:10px; }
	.saved  {
		background:#cd1000; margin-top:2px; color:#fff; text-align:center; padding:10px; font-size:15px;
	}
	.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; }	
	.cke_contents {
		max-height: 150px !important;
		height: 150px !important;
	}	
	
	/* ##################################################### */
	/* ##############     CKEditor Styles     ############## */
	/* ##################################################### */ 
	
	.ck-editor__editable_inline, .ck-editor__editable, .ck.ck-editor__main .ck-content, .ck.ck-editor, .ck-content, .cke_contents {
		max-height: 300px !important;
		height: 300px !important;
		font-size:17px !important;
		background: #eee !important;
	}
	
	.cke_inner, .cke_reset {
		background: #eee !important;
	}
	div#cke_description, .cke_chrome {
		border-radius:6px !important;	
		background: #eee !important;
		font-size:17px !important;
	}	
</style>

		<?php
		if (isset($saved)) {
			echo "<div class='saved' />$saved &nbsp;&nbsp;&nbsp; <a 
			href='/admin/?account&edit={$account['id']}'>Ok</a></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;"><a href="/admin/accounts">&laquo; Back</a> | <?php
        
		if ($faq) {
            echo "Edit";
        } else {
            echo "Add";
			$def = "/static/images/placeholderimgg.jpg";
        }
		// onerror="this.src='/static/images/placeholderimgg.jpg'"
        ?> Account</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; font-size:17px; color:#000; 
            font-weight:300; line-height:25px;">
                 
				<label class="lbl" for="txt_name1" 
				style="text-align:left; width:auto; margin-right:5px;">ID:</label>
				<div class="val" style="margin-left:0px; margin-top:11px">
					
					<input class="txt" type="text" name="id" value="<?= $account['id'] ?>">
					<p class="rs description-input"></p>
				</div>
				<div class="clear"></div>
				
				<label class="lbl" for="txt_name1"
                style="text-align:left; width:auto; margin-right:5px;">Token:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="deviceToken" value="<?= $account['deviceToken'] ?>">
					<p class="rs description-input"></p>
				</div>

				<label class="lbl" for="txt_name1"
                style="text-align:left; width:auto; margin-right:5px;">DevID:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="deviceId" value="<?= $account['deviceId'] ?>">
					<p class="rs description-input"></p>
				</div>             
                
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto; 
					margin-right:5px;">DevOS:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="deviceOS" value="<?= $account['deviceOS'] ?>">
					<p class="rs description-input"></p>
				</div>																				   				            
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">Date:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="date" value="<?= $account['date'] ?>" readonly>
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">Updated:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="updated" value="<?= $account['updated'] ?>" readonly>
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">Phone:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="phone" value="<?= $account['phone'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">Email:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="email" value="<?= $account['email'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">PIN:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="pin" value="<?= $account['pin'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">Child:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="childname" value="<?= $account['childname'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">Stars:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="stars" value="<?= $account['stars'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">Used:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="usedstars" value="<?= $account['usedstars'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">VerCode:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="verifycode" value="<?= $account['verifycode'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">DevDesc:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="devicedescrip" value="<?= $account['devicedescrip'] ?>">
					<p class="rs description-input"></p>
				</div>
				
				<label class="lbl" for="txt_name1" style="text-align:left; width:auto;
					margin-right:5px;">VIP:</label>
				<div class="val" style="margin-left:0px;">
					<input class="txt" type="text" name="vip" value="<?= $account['vip'] ?>">
					<p class="rs description-input"></p>
				</div>
                
            </div>
            <br />
            <input type="submit" style="font-weight:300" class="btn btn-black" />
            <br /><br /> 
            <input type="button" value="Cancel" class="btn btn-black" onclick="location = '/admin/accounts'" />
        </form>

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

<!--<script src="/3rdparty/ckeditoradv/ckeditor.js?<?php echo rand() ?>"></script>-->

<!--<script>
	CKEDITOR.editorConfig = function( config ) {
		config.height = '20vh';
	};

	//	$(function() {
	//		CKEDITOR.config.height = '20vh';
	//	});
	//	$(function() {
	//		CKEDITOR.config.height = '20vh';
	//	});
	//	CKEDITOR.editorConfig = function( config ) {
	//		// Define changes to default configuration here. For example:
	//		// config.language = 'fr';
	//		// config.uiColor = '#AADC6E';
	//		config.height = '20vh';
	//	};
	CKEDITOR.replace( 'ckeditor' ,{
		config.height : '20vh';
	});
</script>-->

<script type="text/javascript">
	$(document).ready(function() {
		// CHECKBOX, I THINK
//		$("#add_mailing_addr").change(function() {
//			if ($(this).is(":checked")) {
//				$("input[name='mailing_address']").removeProp("disabled");
//				$("input[name='mailing_address']").focus();
//			} else
//				$("input[name='mailing_address']").prop("disabled", true);
//		});
		
		$('#selectcategory').on('change', function() {
			//var optionValue = $(this).val();
			//var optionText = $('#dropdownList option[value="'+optionValue+'"]').text();
			var optionText = $("#selectcategory option:selected").text();
			$("#textcat").val(optionText);
//			if (optionText == "Male" || optionText == "Female") {
//				$("#genderlabel").hide();
//				$("#gender").hide();
//				$("#gender").val(optionText);
//			} else {
//				$("#genderlabel").show();
//				$("#gender").show();
//				$("#gender").val("");
//			}

			//alert("Selected Option Text: "+optionText);
		});
		// END OF FUNCTIONS
	});
</script>

<?php include('views/_footer.tpl.php'); ?>