
      <?php echo $__env->make("include/header", \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>;
      <?php echo $__env->make("include/menu", \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>;
        <!-- ============================================================== -->
        <!-- End Left Sidebar - style you can find in sidebar.scss  -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Page wrapper  -->
        <!-- ============================================================== -->
        
       <script language="javascript">
         $().ready(function(){
			 
			 
			 
			 })
         
		 function loaddetails(id)
		  {  
		      
			  $.get("<?=url('/')?>/loadcategorybyid/"+id,{},function(data){ 
				   if(data)
				      {
						 $("#catdetails").html(data);  
					  }
					  else
					  {
						   $("#catdetails").html("No Data Found"); 
					  }
				  
				  
				  })
			  
			  
			  }
		 
		 
       </script> 
        
       
         <div class="modal fade" id="Modal2" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
                                    <div class="modal-dialog" role="document">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <h5 class="modal-title" id="exampleModalLabel">Category Details</h5>
                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                    <span aria-hidden="true">&times;</span>
                                                </button>
                                            </div>
                                            <div class="modal-body" id="catdetails">
                                                
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> 
                                            </div>
                          </div>
                   </div>
        </div> 
        <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
             <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-12 d-flex no-block align-items-center">
                        <h4 class="page-title"><?php echo $pagetitle;?></h4>
                        <div class="ml-auto text-right">
                            <nav aria-label="breadcrumb">
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item"><a href="/">Home</a></li>
                                    <li class="breadcrumb-item active" aria-current="page">Library</li>
                                </ol>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
          
          
          <div class="container-fluid">
                <!-- ============================================================== -->
                <!-- Start Page Content -->
                <!-- ============================================================== -->
                
              <a href="/addaction"  data-toggle="tooltip" data-placement="top" title="Add" ><img  src="<?php echo e(asset('assets/images/add.png')); ?>" alt="Add"/>
              
              </a> 
              <span style="color:#CCC;font-size:22px;text-shadow:#FFF 1px 1px;padding:0px 5px 0px 5px">/</span> 
              <a href="/Cat"  data-toggle="tooltip" data-placement="right" title="View" > <img  src="<?php echo e(asset('assets/images/view.png')); ?>" alt="View"/>
              </a> 
              
             
                  
      <?php if($action=='view')   {?>
              
                <div class="row">
                    <div class="col-12">  
                        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title"><?php echo $pagetitle;?></h5> 
                               
                                  <?php if (session('status')){?>
                                 <div class="alert alert-success" role="alert">
                                 <?php echo session('status');?>
                                 </div>   
                                     <?php }else if(session('failed')) { ?>
                                     
                                     <div class="alert alert-danger" role="alert">
	                                   <i class="fas fa-cross "></i>&nbsp;
	                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php echo e($error); ?> 
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                  <button type="button" class="close" data-dismiss="alert">×</button>
                                          </div>
                                     <?php } ?>
                                 
                                 
                                <div class="table-responsive">
                              
                                <form  method="post" enctype="multipart/form-data"  action="deleteaction">
                                  <?php echo e(csrf_field()); ?>

                            
                                    <table id="zero_config" width="100%" class="table table-striped table-bordered">
                                        <thead>
                                            <tr>
                                               <th width="30">
                                                       <label class="customcheckbox m-b-20">
                                                                 <input type="checkbox" id="mainCheckbox" />
                                                                 <span class="checkmark"></span>
                                                                </label>
    
    											</th>
                                                <th style="font-weight:900"  width="40"> SL </th>
                                                <td>Title</td>
                                                <td>ID</td>
                                                <td> Modified </td>
                                                <td>Create Date </td>
                                                <td>Publish Status </td>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
  <?php $i=1; foreach($result as $row) {?>
  
  <tr>
    <td> 
      <label class="customcheckbox">
      <input type="checkbox" name="chk_<?php echo  $i;?>" value="<?=$row->id?>" class="listCheckbox" />
       <span class="checkmark"></span>
      </label>
    
    </td>
    <td><?php echo e($i); ?></td>
    <td> <?=$row->chcategory_title?></td>
    <td> <?=$row->chchcategory_id?></td>
    <td> <?=$row->modify_date?></td>
    <td> <?=$row->create_date?></td> 
   <td> <?=$row->PublishStatus=='1'?"Yes":"No" ;?> </td> 
    <td> <a title="Edit" href="Editaction/<?=$row->id?>"> <img  src="<?php echo e(asset('assets/images/edit.png')); ?>" alt="Edit" width="20"/>    </a>
          <a href="#"  title="View Details"   data-toggle="modal" data-target="#Modal2"  onclick="loaddetails(<?=$row->id?>)" > 
             <img  src="<?php echo e(asset('assets/images/details.png')); ?>" alt="Details" width="20"/> 
              </a>
            
    </td>
    
  </tr>
  
   
 <?php $i++; } ?>
 </tbody>
 <tfoot>
   <tr>
      <td colspan="8"> <input type="submit"  value="Delete"  class="btn btn-danger" />
      <input type="hidden"  name="totalcount" value="<?php  echo $i;?>" />
            </td>
   </tr>
 </tfoot>
                                         
                                    </table>
                                    
                                    </form>
                                    
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
          
       <?php }  else if($action=='Add')   { ?>
             <div class="row">
                    <div class="col-md-12"> 
                        <div class="card"> 
                             
                                <div class="card-body" >
                                    <?php if (session('status')){?>
                                   
                                     <div class="alert alert-success" role="alert" id="alerts">
                                     <i class="fas fa-check "></i>&nbsp;  <?php echo session('status'); ?>
                                     <button type="button" class="close" data-dismiss="alert">×</button>
                                     </div>
                                     
                                     <?php }else if(session('failed')) { ?>
                                     
                                     <div class="alert alert-danger" role="alert">
	                                   <i class="fas fa-cross "></i>&nbsp;
	                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php echo e($error); ?> 
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                  <button type="button" class="close" data-dismiss="alert">×</button>
                                          </div>
                                     <?php } ?>
                                  
                            <form action="save" method="post" enctype="multipart/form-data" class="form-horizontal">  
                                    <h4 class="card-title">Category Information</h4> 
                                    <?php echo e(csrf_field()); ?> 

<!--   start here    -->

                                    <div class="form-group row">
                                        <label for="fname" class="col-sm-3 text-right control-label col-form-label">Category Title</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" required="required" id="chcategory_title" name="chcategory_title" placeholder="Name Here">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="lname" class="col-sm-3 text-right control-label col-form-label">Category ID</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control" id="chchcategory_id" name="chchcategory_id"   placeholder="Title Here">
                                        </div>
                                    </div>
                                   
                                    <div class="form-group row">
                                        <label for="lname" class="col-sm-3 text-right control-label col-form-label">publish</label>
                                        <div class="col-sm-9">
                                           Yes  <input   name="PublishStatus" id="PublishStatus" type="radio" value="1" />
                                            No
                                            <input   name="PublishStatus" type="radio" value="0" />   </td>
                                        </div>
                                    </div>



    <!--   end here    -->                                
                                <div class="border-top">
                                    <div class="card-body" style="text-align: center">
                                        <input type="submit" class="btn btn-primary" value="Save"> 
                                         <input type="reset" class="btn btn-warning" value="Clear"> 
                                         <input type="button"  class="btn btn-danger" value="Cancel"> 
                                    </div>
                                </div>
                            </form>
                        </div> 
                    </div>
                     
             </div>
       
       
       <?php }    else if($action=='Edit')   { ?>
             <div class="row">
                    <div class="col-md-12"> 
                        <div class="card"> 
                             
                                <div class="card-body" >
                                       <?php if (session('status')){?>
                                   
                                     <div class="alert alert-success" role="alert" id="alerts">
                                     <i class="fas fa-check "></i>&nbsp;  <?php echo session('status'); ?>
                                     <button type="button" class="close" data-dismiss="alert">×</button>
                                     </div>
                                     
                                     <?php }else if(session('failed')) { ?>
                                     
                                     <div class="alert alert-danger" role="alert">
	                                   <i class="fas fa-cross "></i>&nbsp;
	                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php echo e($error); ?> 
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                  <button type="button" class="close" data-dismiss="alert">×</button>
                                          </div>
                                     <?php } ?>
                                  
                            <form action="/update" method="post" enctype="multipart/form-data" class="form-horizontal">  
                                    <h4 class="card-title">Category Information</h4> 
                                    <?php echo e(csrf_field()); ?> 
                                    








                                    <div class="form-group row">
                                        <label for="fname" class="col-sm-3 text-right control-label col-form-label">Category Title</label>
                                        <div class="col-sm-9">
                                            <input type="text" value="<?=$chcategory_title?>" class="form-control" required="required" id="chcategory_title" name="chcategory_title" placeholder="Name Here">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="lname" class="col-sm-3 text-right control-label col-form-label">Category ID</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control"   value="<?=$chchcategory_id?>" id="chchcategory_id" name="chchcategory_id"   placeholder="Title Here">
                                        </div>
                                    </div>
                                   
                                    <div class="form-group row">
                                        <label for="lname" class="col-sm-3 text-right control-label col-form-label">publish</label>
                                        <div class="col-sm-9">
                                           Yes  <input   <?php  if($PublishStatus=="1"){ echo "checked='checked'";}?>  name="PublishStatus" type="radio" value="1" />
                                            No
                                            <input  <?php  if($PublishStatus=="0"){ echo "checked='checked'";}?>  name="PublishStatus" type="radio" value="0" />   </td>
                                        </div>
                                    </div>













                                   
                                 
                                <div class="border-top">
                                    <div class="card-body" style="text-align: center">
                                        <input type="submit" class="btn btn-success" value="Update"> 
                                         <input type="reset" class="btn btn-warning" value="Clear"> 
                                         <input type="hidden"  name="heid" value="<?=$Eid?>" />
                                    </div>
                                </div>
                            </form>
                        </div> 
                    </div>
                     
             </div>
       
       
       <?php } ?>  
     <?php echo $__env->make("include/footer", \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>;