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

<script type="text/javascript" language="javascript">
function switchNavType(Value){ 
	$(".type_slt").hide();
	$("#type_slt_"+Value).show();
}

function switchNavData(Value, Title, Obj_ID){ 
	$("#title").val(Title);
	$("#url").val(Value);
	$("#obj_id").val(Obj_ID);
}
</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/navigation')); ?>">Navigation 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>
			
			<?php echo parseErrorMessageLaravel($errors);?>
			  
          <div class="widget-content nopadding">
			<form name="my_add_form" id="my_add_form" action="<?php echo e(URL('admin/navigation/store')); ?>" method="POST" onsubmit="return form_check();" class="form-horizontal">
			  
			  
              <div class="control-group">
                <label class="control-label">Parent <span style="color:#FF0000;">*</span></label>
                <div class="controls">
				 <select name="parent_id" id="parent_id" class="span5">
				 	<option value="">-- Please select a Navigation --</option>
					<?php foreach( $parent_list as $parent ):?>
						<option value="<?php echo e($parent->id); ?>" <?php echo isset($object->parent_id) && $object->parent_id==$parent->id? ' selected="selected"': '';?>><?php echo e($parent->getBreakString()); ?> <?php echo e($parent->title); ?></option>
					<?php endforeach;?>
				</select>
                </div>
              </div>
			  
			  
			  <div class="control-group">
                <label class="control-label">Location <span style="color:#FF0000;">*</span></label>
                <div class="controls">
				
				<?php foreach( $location_list as $key=>$val ):?>
                  <label class="btn_choice"><input type="radio" name="location" value="<?php echo e($key); ?>" <?php echo isset($object->location) && $object->location==$key ? ' checked="checked"' : NULL?> /><?php echo e($val); ?></label>
				<?php endforeach;?>
                </div>
              </div>
			  <div class="control-group">
                <label class="control-label">Open New tab ? <span style="color:#FF0000;">*</span></label>
                <div class="controls">
				
				<?php foreach( $new_open_list as $key=>$val ):?>
                  <label class="btn_choice"><input type="radio" name="new_open" value="<?php echo e($key); ?>" <?php echo isset($object->new_open) && $object->new_open==$key ? ' checked="checked"' : NULL?> /><?php echo e($val); ?></label>
				<?php endforeach;?>
                </div>
              </div>
			  
			  <div class="control-group" style="background:#49afcd;">
                <label class="control-label">Type <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <select name="type" id="type" class="span5" onchange="switchNavType(this.options[this.selectedIndex].value)">
				  	<option value="">-- Please select a Type --</option>
					<?php foreach( $type_list as $key=>$val ):?>
						<option value="<?php echo e($key); ?>" <?php echo $object->type!==0 && $object->type==$key ? ' selected="selected"': NULL?>><?php echo e($val); ?></option>
					<?php endforeach;?>
				</select>
                </div>
              </div>
			  
			  <div class="control-group type_slt" id="type_slt_Section" style="background:#49afcd; display:none;">
                <label class="control-label">Section <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <select name="" id="" class="span5" onchange="switchNavData(this.options[this.selectedIndex].value, this.options[this.selectedIndex].title, this.options[this.selectedIndex].label)">
				  	    <option value="" title="">-- Please select one Section --</option>
					<?php foreach( $section_list as $section ):?>
						<option value="<?php echo e(url('Sections/'.$section->seo_url)); ?>" title="<?php echo e($section->title); ?>" label="<?php echo e($section->id); ?>"><?php echo e($section->getBreakString()); ?> <?php echo e($section->title); ?></option>
					<?php endforeach;?>
				</select>
                </div>
              </div>
			  <div class="control-group type_slt" id="type_slt_Article" style="background:#49afcd; display:none;">
                <label class="control-label">Article <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <select name="" id="" class="span5" onchange="switchNavData(this.options[this.selectedIndex].value, this.options[this.selectedIndex].title, this.options[this.selectedIndex].label)">
				  	    <option value="" title="">-- Please select one Article --</option>
					<?php foreach( $article_list as $article ):?>
						<option value="<?php echo e(url('Articles/'.$article->seo_url)); ?>" title="<?php echo e($article->title); ?>" label="<?php echo e($article->id); ?>" class="sec_<?php echo e($article->section_id); ?>"><?php echo e($article->title); ?></option>
					<?php endforeach;?>
				</select>
                </div>
              </div>
			  <div class="control-group type_slt" id="type_slt_System" style="background:#49afcd; display:none;">
                <label class="control-label">System <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <select name="" id="" class="span5" onchange="switchNavData(this.options[this.selectedIndex].value, this.options[this.selectedIndex].title, this.options[this.selectedIndex].label)">
				  	    <option value="" title="">-- Please select one row --</option>
					<?php foreach( $system_list as $system ):?>
						<option value="<?php echo e($system['url']); ?>" title="<?php echo e($system['title']); ?>" label="<?php echo e($system['id']); ?>"><?php echo e($system['title']); ?></option>
					<?php endforeach;?>
				</select>
                </div>
              </div>
			  
			  <div class="control-group type_slt" id="type_slt_PageCategory" style="background:#49afcd; display:none;">
                <label class="control-label">Page Category <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <select name="" id="" class="span5" onchange="switchNavData(this.options[this.selectedIndex].value, this.options[this.selectedIndex].title, this.options[this.selectedIndex].label)">
				  	    <option value="" title="">-- Please select one Category --</option>
					<?php foreach( $category_list as $category ):?>
						<option value="<?php echo e(url('pageCategory/'.$category->seo_url)); ?>" title="<?php echo e($category->title); ?>" label="<?php echo e($category->id); ?>"><?php echo e($category->getBreakString()); ?> <?php echo e($category->title); ?></option>
					<?php endforeach;?>
				</select>
                </div>
              </div>
			  <div class="control-group type_slt" id="type_slt_Page" style="background:#49afcd; display:none;">
                <label class="control-label">Page <span style="color:#FF0000;">*</span></label>
                <div class="controls">
                  <select name="" id="" class="span5" onchange="switchNavData(this.options[this.selectedIndex].value, this.options[this.selectedIndex].title, this.options[this.selectedIndex].label)">
				  	    <option value="" title="">-- Please select one Page --</option>
					<?php foreach( $page_list as $page ):?>
						<option value="<?php echo e(url('Pages/'.$page->seo_url)); ?>" title="<?php echo e($page->title); ?>" label="<?php echo e($page->id); ?>" class="sec_<?php echo e($page->cat_id); ?>"><?php echo e($page->title); ?></option>
					<?php endforeach;?>
				</select>
                </div>
              </div>
			  
              <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">URL <span style="color:#FF0000;">*</span></label>
                <div class="controls">
				  <input type="text" name="url" id="url" maxlength="255" class="span8 m-wrap" value="<?php echo isset($object->url) ? $object->url : NULL?>" required="required" placeholder="URL" />
                </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) : ' checked="checked"'?> />Active</label>
				  <label><input type="radio" name="status" id="status" value="Archive" <?php echo isset($object->status) && $object->status=='Archive' ? ' checked="checked"' : NULL?> />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="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="obj_id" id="obj_id" value="<?php echo isset($object->obj_id) ? $object->obj_id : ''?>" />
				
                <input type="submit" value="Save" 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(); ?>