<div class="row">
	<div class="col-md-12">
		{if $data.message neq ''}
            <div class="alert alert-info alert-dismissible fade in" role="alert">
				<button type="button" class="close" data-dismiss="alert" aria-label="Close">
					<span aria-hidden="true">×</span>
				</button>
				<strong>{$data.message}.</strong>
			</div>
        {/if}
        <div class="panel panel-default">
			<div class="panel-body">
				{if $data.route_details eq ''}
					<h3 class="panel-title">
                 		<h2>
                 			<span class="fa fa-road"></span> Create New Route
                 		</h2>
                 	</h3>
					<form class="form-horizontal" name="services-form" id="services-form" enctype="multipart/form-data" method="post" action="{$data.base_url}route/">
						<div class=" col-sm-12">
							<div class="form-group">
                                <label class="col-sm-3 control-label">	New Route Name <span>*</span>
                                </label>
                                <div class="col-sm-9">    
                                	<div class="input-group">
                                        <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                       <textarea class="form-control" type="text"  id="name"  name="data[name]" required></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-12 col-xs-12">
							        <input type="submit" class="btn btn-primary pull-right" value="Save" name="route" ></button>
							    </div>
                            </div>
						</div>
					</form>
	            {else}
	            	<h3 class="panel-title">
                 		<h2>
                 			<span class="fa fa-sitemap"></span> Edit Route
                 		</h2>
                 	</h3>
					<form class="form-horizontal" name="services-form" id="services-form" enctype="multipart/form-data" method="post" action="{$data.base_url}route/update/">
						<input type="hidden" id="id" name="data[id]" value="{$data.route_details.id}">
						<div class=" col-sm-12">
							<div class="form-group">
                                <label class="col-md-3 col-xs-12 control-label">	 Route Name <span>*</span>
                                </label>
                                <div class="col-md-6 col-xs-12">    
                                	<div class="input-group">
                                        <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                       <input  class="form-control" type="text" id="name" name="data[name]" maxlength="55"  value="{$data.route_details.name}"   required>
                                    </div>
                                </div>
                                <div class="col-sm-2 col-xs-12">
							        <input type="submit" class="btn btn-primary pull-right" value="Update" name="route" ></button>
							    </div>
                            </div>
						</div>
					</form>
				 {/if}
            </div>
        </div>
        <div class="panel panel-default">
			<div class="panel-body">
            	<div class="panel-heading">
            		<h3 class="panel-title">
            			<span class="fa fa-road"></span> Route List
            		</h3>
            	</div>
                <table class="table datatable">
                	<thead>
                		<tr>
							<th>Name</th>
							<th>Action</th>
						</tr>
                	</thead>
					<tbody>
						{section name = i loop = $data.route}
	                        <tr>
	                            <td>{$data.route[i].name|upper}</td>
	                           	<td>
	                           		<a href="{$data.base_url}route/update/{$data.route[i].id}">
	                            		 <span class="btn btn-primary"><i class="fa fa-pencil"></i></span>
	                            	</a>
	                            	<a href="{$data.base_url}route/delete/{$data.route[i].id}">
	                            		 <span class="btn btn-danger"><i class="fa fa-trash-o"></i></span> 
	                            	</a>
	                            </td>
	                        </tr>   
	                    {/section}
					</tbody>
				</table>

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

 