<section role="main" class="content-body">
					<header class="page-header">
						<h2>Manage Brands</h2>
					
						<div class="right-wrapper pull-right">
							<ol class="breadcrumbs">
								<li>
									<a href="<?php echo base_url();?>admin">
										<i class="fa fa-home"></i>
									</a>
								</li>
								<li><span>Manage Brands</span></li>
							</ol>
					
						</div>
					</header>

					<div class="row">
                	
                    
                    <!-- User Activity -->
                    <div class="col-md-4">
                    <?php if($this->session->flashdata("msg")){echo $this->session->flashdata("msg"); }?>
                    	 <div class="panel panel-featured">							
                          <div class="panel-heading">Add Brands</div>
                          <div class="panel-body">
                          	  <?php if($this->uri->segment(3)){?>
                              <form action="<?php echo base_url();?>admin/update_dept" method="post">
                              <input type="hidden" name="depid" value="<?php echo $edit->brid;?>" />
                              <div class="form-group">
                              	<label for="new">Brand Title</label>
                                <input type="text" class="form-control" name="machine" value="<?php echo $edit->brname;?>" />
                              </div>  <br/>
                              <button type="submit" name="submit" class="btn btn-primary">Update Brand</button>
                              </form>
                              <?php }else{?>
                              <form action="<?php echo base_url();?>admin/add_dept" method="post">
                              <div class="form-group">
                              	<label for="new">Brand Title</label>
                                <input type="text" class="form-control" name="machine" />
                              </div>  <br/>
                              <button type="submit" name="submit" class="btn btn-primary">Add Brand</button>
                              </form>
                              <?php }?>
                          </div>
                         </div> 
                    </div>
                    <div class="col-md-5"><?php if($this->session->flashdata("msg")!==""){echo $this->session->flashdata("msg"); }?>
                       <section class="panel panel-featured">
                          <div class="panel-heading">Listing Brand</div>
                          <div class="panel panel-body"> 	
                            <table class="table table-striped table-responsive">
                                <thead><tr><th>S.No.</th><th>Brand Name.</th><th>Action</th></tr></thead>
                                <tbody>
                                    <?php $i=1;foreach($deps as $dep){?>
                                    <tr><td ><?php echo $i;?></td>
                                    <td><?php echo $dep->brname?></td>
                                    <td>
                            <a href="<?php echo base_url().'admin/brands/'.$dep->brid;?>" class="btn btn-xs btn-warning"><i class="fa fa-edit"></i></a>
                            <a href="<?php echo $dep->brid;?>" class="btn btn-xs btn-danger brand_delete"><i class="fa fa-trash-o"></i></a></td>
                                    <?php $i++;}?></tr>
                                   
                                </tbody>
                            </table>
                          </div>
	                  </section>
                </div>
						
                    </div>
				</section>
			</div>

			
		</section>

		<!-- Vendor -->
        <script>
	$(document).ready(function(){
		$(".brand_delete").click(function(e){e.preventDefault();
		if (!confirm("Sure you want to delete?")){
				  return false;
				}
			var id=$(this).attr("href");$(this).closest("tr").remove();
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/brand_delete',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
		});
</script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/bootstrap/js/bootstrap.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/nanoscroller/nanoscroller.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
		
		<!-- Theme Base, Components and Settings -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.js"></script>
		
		<!-- Theme Custom -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.custom.js"></script>
		
		<!-- Theme Initialization Files -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.init.js"></script>

	</body>
</html>