<?php $__env->startSection('content'); ?>

<script language="javascript" type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	editor = K.create('.content_wysiwyg', {		
		langType : 'en',
		newlineTag : 'br',		//p, br
		resizeType : 2,
		allowFileManager : true,
		afterBlur: function(){this.sync();}
	});
});
</script>

  <div id="content-header">
    <div id="breadcrumb"> <a href="<?php echo e(url('/admin')); ?>" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a href="<?php echo e(url('/admin/homepage')); ?>">Homepage Content Management</a> <a href="javascript:void(0);" class="current">Add/Edit</a> </div>
  </div>
  
  
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-box">
	  	
			<div class="title_btn">
				<h2><?php echo $pk_id>0? 'Edit': 'Add New';?></h2>
			</div>
			<div class="clear"></div>
			
			<div class="tab_name">
				<a href="<?php echo e(URL('/admin/homepage/index/Banner')); ?>" class="<?php echo isset($type) && $type=='Banner' ? 'active' : '';?>">Banner</a>
				<a href="<?php echo e(URL('/admin/homepage/index/Highlight')); ?>" class="<?php echo isset($type) && $type=='Highlight' ? 'active' : '';?>">Highlights</a>
				<a href="<?php echo e(URL('/admin/homepage/index/Content')); ?>" class="<?php echo isset($type) && $type=='Content' ? 'active' : '';?>">Content</a>
			</div><!--tab_name-->
			<div class="clear"></div>
			
			<?php echo parseErrorMessageLaravel($errors);?>
			  
          <div class="widget-content nopadding">
			<form name="my_add_form" id="my_add_form" action="<?php echo e(URL('admin/homepage/store')); ?>" method="POST" onsubmit="return form_check();" class="form-horizontal" enctype="multipart/form-data">


			  <div class="control-group">
                <label class="control-label">Title <span style="color:#FF0000;">*</span></label>
                <div class="controls">
				  <input type="text" name="title" id="title" maxlength="255" class="span8 m-wrap" value="<?php echo isset($object->title) ? $object->title : NULL?>" required="required" placeholder="Title" />
                </div>
              </div>
			
              <div class="control-group">
                <label class="control-label">Status <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <label><input type="radio" name="status" id="status" value="Active" <?php echo isset($object->status) && $object->status=='Active' ? ' checked="checked"' : NULL?> />Active</label>
				  <label><input type="radio" name="status" id="status" value="Archive" <?php echo isset($object->status) ? ( $object->status=='Archive' ? ' checked="checked"': NULL) : ' checked="checked"'?> />Archive</label>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">Sort <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <input type="text" name="sort" id="sort" maxlength="255" value="<?php echo isset($object->sort) ? $object->sort : NULL?>" onkeyup="value=value.replace(/[^\d]/g,'');" required="required" placeholder="Number Only" />
                </div>
			  </div>
			  
              <div class="control-group" style="<?php echo isset($type) && $type=='Content' ? 'display:none;' : '';?>">
                <label class="control-label">Banner </label>
                <div class="controls">
                  <input type="file" name="con_photos[]" id="con_photos_1" value=""> (image : <?php echo isset($type) && $type=='Banner' ? '1013px X 460px' : '237px X 88px';?>)
				<br />
				<input type="text" name="con_imageid_1" id="con_imageid_1" size="10" value="" onkeyup="value=value.replace(/[^\d-]/g,'');"/>Link to a image, Media ID (Please retrieve ID from Media Center, Set -1 will delete previous) 
				<br />
				<?php if( isset($object->media_path) && $object->media_path!="" ):?><img src="<?php echo get_ext_path_advanced($object->media_path, $object->media_id, 's');?>" style="max-width:400px;" /><?php endif;?>
                </div>
              </div>
			  
              <div class="control-group" style="<?php echo isset($type) && $type=='Banner' ? 'display:none;' : '';?>">
                <label class="control-label">Content <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <textarea style="height:300px; width:700px;" name="content" class="content_wysiwyg" ><?php echo isset($object->content) ? $object->content : NULL?></textarea>
                </div>
              </div>
			  
              <div class="control-group">
                <label class="control-label">Link </label>
                <div class="controls">
				  <input type="text" name="link" id="link" maxlength="255" class="span8 m-wrap" value="<?php echo isset($object->link) ? $object->link : NULL?>" placeholder="Link" /> Please input with http://
                </div>
              </div>
			
              <div class="control-group" style="<?php echo isset($type) && $type=='Highlight' ? 'display:block;' : 'display:none;';?>">
                <label class="control-label">Position <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <label><input type="radio" name="position" id="position" value="Right" <?php echo isset($object->position) && $object->position=='Right' ? ' checked="checked"' : NULL?> />Right</label>
				  <label><input type="radio" name="position" id="position" value="Bottom" <?php echo isset($object->position) ? ( $object->position=='Bottom' ? ' checked="checked"': NULL) : ' checked="checked"'?> />Bottom</label>
                </div>
              </div>
              <div class="control-group" style="<?php echo isset($type) && $type=='Highlight' ? 'display:block;' : 'display:none;';?>">
                <label class="control-label">Date <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <input type="text" name="date" id="date" data-date-format="yyyy-mm-dd" value="<?php echo isset($object->date) ? $object->date : NULL?>" class="datepicker span8">
				  <span class="help-block">Date with Formate of  (yyyy-mm-dd)</span>
                </div>
              </div>
<script language="javascript">
$(function() {
	$(".datepicker").datepicker({
		changeMonth: true,		//Allows you to change the month by selecting from a drop-down list.
		changeYear: true,		//Allows you to change the year by selecting from a drop-down list. 
		dateFormat: "yy-mm-dd",		//The format for parsed and displayed dates. 
		dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
		dayNamesMin: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
		firstDay: 1,		//Set the first day of the week: Sunday is 0, Monday is 1
		monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
		monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
		yearRange: "c-20:c+20",		//Control the range of years displayed in the year drop-down
		showButtonPanel: true,			//Whether to show the button panel.
	});
});
</script>
			  
			  
              <div class="form-actions">
			  	<input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
				<input type="hidden" name="pk_id" value="<?php echo isset($object->id) ? $object->id : 0?>" />
				<input type="hidden" name="type" value="<?php echo isset($type) ? $type : '';?>" />
				
                <input type="submit" value="Save <?php echo isset($type) ? $type : '';?>" class="btn btn-success">
				<input type="button" value="Cancel" class="btn btn-danger" onclick="javascript:history.go(-1);return false;" />
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
    
  </div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>