







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





<?php 



$dbitem= DB::table('nn_settings')->first();

$filialebi= DB::table('nn_filialebi')->first();



?>



    <div class="page-content">

    

    

     

                                    

                                   	

        <!-- BEGIN PAGE HEADER-->



        <!-- BEGIN PAGE BAR -->



        <div class="page-bar">



            <ul class="page-breadcrumb">



                <li>



                    <a href="<?php echo e(url(getCurrentLocale() . '/manager')); ?>"><?php echo e(trans('general.bcHome')); ?></a>



                    <i class="fa fa-circle"></i>



                </li>



                



            </ul>



        </div>



        <!-- END PAGE BAR -->



        <!-- BEGIN PAGE TITLE-->



        <h3 class="page-title"> <?php echo e(trans('general.ptCatalog')); ?>




        </h3>



        <!-- END PAGE TITLE-->



        <!-- END PAGE HEADER-->



        <a href="<?php echo e(url(getCurrentLocale() . '/manager/collection')); ?>" class="btn green btn-outline sbold uppercase margin-bottom-20"><i class="fa fa-arrow-left"></i> <?php echo e(trans('general.back')); ?></a>



        <!-- END BACK BTN -->



        <div class="portlet light bordered">



            <div class="portlet-body">



                <div class="row">



                    <div class="col-xs-8">



                        <a href="<?php echo e(url(getCurrentLocale() . '/manager/collection/'.$collection->id.'/catalog/create')); ?>" class="btn green-seagreen btn-outline sbold uppercase" data-action="collapse-all"><?php echo e(trans('general.cAddNew')); ?></a>



                    </div>



                    <div class="col-xs-4">

<?php

						$cat = DB::table('nn_category_lang')->where('lang','=', 'ka')->get();

						

						?>

                             <?php echo Form::open(array('method' => 'get', 'url' => getCurrentLocale() . '/manager/collection/' . $collection->id . '/catalog/search', 'class' => 'form-horizontal')); ?>


						<div class="input-group">

							<?php 

								$sel=""; 

									if(isset($_GET["cat"])){

										

										if($_GET["cat"] =='')$sel="selected";

									}

								?>



							<select class="form-control" name="cat" onchange>

								<option value="all">ყველა კატეგორია</option>

								<option value="" <?php echo e($sel); ?> >კატეგორიის გარეშე</option>

								<?php $__currentLoopData = $cat; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

								<?php 

								$sel=""; 

									if(isset($_GET["cat"])){

										

										if($_GET["cat"] == $c->category_id)$sel="selected";

									}

								?>

								<option value="<?php echo e($c->category_id); ?>" <?php echo e($sel); ?>><?php echo e($c->name); ?></option>

								<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

							</select>





                        </div>



                        <div class="input-group">



                           <input type="text" class="form-control" placeholder="დასახელება" name="q" value="<?php echo e(isset($_GET['q'])?$_GET['q']:''); ?>">



                            <span class="input-group-btn">



                                <button class="btn green-seagreen" type="submit">



                                    <i class="fa fa-search fa-fw"></i>



                                </button>



                            </span>



                        </div>



                        <?php echo Form::close(); ?>




                    </div>



                </div>



            </div>



        </div>



        <div class="portlet box green-seagreen">



            <div class="portlet-title">



                <div class="caption">



                    <i class="fa fa-cogs"></i> <?php echo e(trans('general.yourCatalogs')); ?> </div>



                <div class="tools">



                    <a href="javascript:;" class="collapse" data-original-title="" title=""> </a>



                </div>



            </div>



            <div class="portlet-body">



                <div class="table-responsive">



                    <table class="data-table table table-bordered">



                        <thead>



                            <tr>



                                <th> <?php echo e(trans('general.id')); ?> </th>



                                <th> <?php echo e(trans('general.dtName')); ?> </th>



                                <th> <?php echo e(trans('general.dtDesc')); ?> </th>

                                <th>სახელი</th>

                                <th> <?php echo e(trans('general.dtTools')); ?> </th>


                                <th> გამოჩენა / დამალვა </th>



                            </tr>



                        </thead>



                        <tbody>



                            <?php $__currentLoopData = $catalog; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>



                            <tr>



                                <td> <?php echo e($item->id); ?>  </td>
                                <td> <?php echo e($item->id); ?>  </td>



                                <td> <?php echo e($item->name); ?> </td>



                                <td> <?php echo e($item->description); ?> </td>



                                <td>



                                    <div class="clearfix">



                                        <a href="<?php echo e(url(getCurrentLocale() . '/manager/collection/' . $collection->id . '/catalog/' . $item->id . '/edit')); ?>" class="btn btn-icon-only blue">



                                            <i class="fa fa-edit"></i>



                                        </a>



                                        <!-- Button trigger modal -->



                                        <a href="javascript:;" class="btn btn-primary red del" data-toggle="modal" data-target="#delete-item" data-element-id="<?php echo e($item->id); ?>" data-delete-url="catalog/destroy">



                                            <i class="fa fa-trash"></i>



                                        </a>



                                    </div>



                                </td>

                                
                                <td>
                                    <form action="<?php echo e(fullUrl('manager/collection/catalog/showhide')); ?>" method="POST">
                                        <?php echo csrf_field(); ?>
                                        <input type="hidden" name="id" value="<?php echo e($item->id); ?>">
                                        <input type="checkbox" name="show" value="1"<?php echo e($item->show ? ' checked' : ''); ?> onChange="this.form.submit()">
                                    </form>
                                </td>


                            </tr>



                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>



                        </tbody>



                    </table>



                </div>



            </div>



        </div>



        <nav>



            <?php echo $catalog->render(); ?>




        </nav>



    </div>







    <!-- Modal (item delete) -->



    <div class="modal fade" id="delete-item" tabindex="-1" role="dialog">



        <div class="modal-dialog" role="document">



            <div class="modal-content">



                <div class="modal-header">



                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>



                    <h4 class="modal-title"><?php echo e(trans('general.deleteQuestion')); ?></h4>



                </div>



                <div class="modal-footer">



                    <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo e(trans('general.no')); ?></button>



                    <button type="button" class="btn btn-danger confirm" data-dismiss="modal"><?php echo e(trans('general.yes')); ?></button>



                </div>



            </div>



        </div>



    </div>



<script>





    $("#savesettings, #savefil").submit(function(e){



        e.preventDefault();



	    var form = $(this);



        var data = form.serializeArray();



        var url = form.attr("action");



        var type = form.attr("method");



        $.ajax({



            url: url,



            type: type,



            data: data,



            beforeSend: function (data) {



            },



            success: function (data) {

alert('მონაცემები განახლდა')

        



            },



            error: function (data) {

		



            },



            complete: function (data) {



            },



        });



    });





</script>



    <?php $__env->startPush('body.bottom'); ?>



        <script src="<?php echo e(url('assets/nn_cms/custom/js/delete-item.js')); ?>" type="text/javascript"></script>



        <!-- END DELETE ITEM -->



    <?php $__env->stopPush(); ?>







<?php $__env->stopSection(); ?>
<?php echo $__env->make('../nn_cms/index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ttqpucgs/public_html/resources/views/nn_cms/pages/nn_catalog/index.blade.php ENDPATH**/ ?>