<div class="page-content-wrap">                
	<div class="row">
		<div class="col-md-12">

            <!-- START DEFAULT DATATABLE -->
            {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.category_details eq ''}
						<h3 class="panel-title">
	                 		<h2>
	                 			<span class="fa fa-sitemap"></span> Create New Category
	                 		</h2>
	                 	</h3>
						<form class="form-horizontal" name="services-form" id="services-form" enctype="multipart/form-data" method="post" action="{$data.base_url}category/">
							<div class=" col-sm-12">
								<div class="form-group">
	                                <label class="col-md-3 col-xs-12 control-label">	New Category 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"   required>
	                                    </div>
	                                </div>
	                                <div class="col-sm-2 col-xs-12">
								        <input type="submit" class="btn btn-primary pull-right" value="Save" name="category" ></button>
								    </div>
	                            </div>
							</div>
						</form>
		            {else}
		            	<h3 class="panel-title">
	                 		<h2>
	                 			<span class="fa fa-sitemap"></span> Edit Category
	                 		</h2>
	                 	</h3>
						<form class="form-horizontal" name="services-form" id="services-form" enctype="multipart/form-data" method="post" action="{$data.base_url}category/update/">
							<input type="hidden" id="id" name="data[id]" value="{$data.category_details.id}">
							<div class=" col-sm-12">
								<div class="form-group">
	                                <label class="col-md-3 col-xs-12 control-label">	 Category 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.category_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="category" ></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"> <h2><span class="fa fa-sitemap"></span> Category List</h2></h3>
                     
                </div>
                    <table class="table datatable">

                    	<tr>
                    		<th>Sr No.</th>
                    		<th>Id</th>
							<th>Name</th>
							<th>Action</th>
						</tr>
						{section name = i loop = $data.category}
                            <tr>
                            	<td>{$smarty.section.i.index+1}</td>
                            	<td>{$data.category[i].id}</td>
                                <td>{$data.category[i].name|upper}</td>
                               	<td>
                               		<a href="{$data.base_url}category/update/{$data.category[i].id}">
                                		 <span class="btn btn-primary"><i class="fa fa-pencil"></i></span>
                                	</a>
                                	<a href="{$data.base_url}category/delete/{$data.category[i].id}">
                                		 <span class="btn btn-danger"><i class="fa fa-trash-o"></i></span> 
                                	</a>
                                </td>
                            </tr>   
                        {/section}
						
                    </table>

                </div>

            </div>

            <!-- END DEFAULT DATATABLE -->

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

 