
<script type="text/javascript" charset="utf-8">


    $(document).ready(function () {
        $('#example').dataTable({
            "bPaginate": false,
            "bStateSave": true,
            "sDom": 'TCR<"clear">lfrtip',
            "oTableTools": {
                "aButtons": [
                    "copy",
                    "print",
                    {
                        "sExtends": "collection",
                        "sButtonText": "حفظ",
                        "aButtons": ["csv", "xls"]
                    }
                ]
            }
        });
    });

</script>
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المتجر اونلاين</a></li>
            <li><a href="productCatOnlineController.php?do=show">تصنيفات الاونلاين</a></li>
            <li class="active">عرض</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;">عرض</h3>
                <a href="{$youtubes[47]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
                <a href="productCatOnlineController.php" class="hidden-print"><input type="button"  id="submit" style="margin-left: 12px" class="btn btn-primary pull-left " value="اضافة جديد"/></a>
            </div>
            <div class="panel-body">
                <div id="outputString" class="alert alert-block alert-success fade in" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <p id="outputStringValue">{$outputString}</p>
                    <div class="clearfix"></div>
                </div>
            </div>
            <hr/>
            <form class="form-inline  hidden-print" method="post" action="productCatOnlineController.php?do=show">
                <div class="form-group">
                    <label class="sr-only">التصنيف</label>
                    <select class="select2 wdt100"  name="catId" id="catId" onChange="this.form.submit();">
                        <option value="-1">اختر تصنيف</option>
                        {foreach $allData as $cat}
                        <option value="{$cat->id}">{$cat->title}</option>
                        {/foreach}
                    </select>
                </div>
                <button type="submit" class="btn btn-primary">بحث</button>
            </form>
            <!-- Table -->
            {literal}
            <form method="post" action="productCatOnlineController.php?do=executeOperation" onsubmit="if (Spry.Widget.Form.validate(this)) {
                        return countChoosenProducts('productCatOnlineController');
                    } else {
                        return false;
                    }">
                {/literal}
                <table class="table table-black" id="example">
                    <thead>
                        <tr>
                            <th>التصنيف</th>
                            <th>الحالة</th>
                            <th class="hidden-print">تعديل</th>
                            <th class="hidden-print">حذف </th>
                        </tr>
                    </thead>
                    <tbody>

                        {foreach $productCatData as $data}
                        <tr class="noprint {if $data->status == 1} danger {/if}">
                            <td>{$data->title}{if $data->parentName !=""} / {$data->parentName}{/if}</td>
                            <td class="hidden-print"><a href="productCatOnlineController.php?do=toggleStatus&id={$data->id}"
                                    type="button" class="btn btn-default btn-lg {if $data->status == 0} removeicon {else} correcticon {/if}"> </a>
                                </td>
                            <td class="hidden-print"> <a href="productCatOnlineController.php?do=edit&id={$data->id}&parentid={$data->parentid}" class="btn btn-default btn-lg editicon"></a> </td>
                            <td class="hidden-print"><a href="productCatOnlineController.php?do=deleteFinaly&id={$data->id}" type="button" class="btn btn-default btn-lg deleteicon"></a></td>
                        </tr>
                        {/foreach}

                    </tbody>

                </table>
                <div class="clearfix"></div>

            </form>
        </div>

    </div>
</div>
{literal}
<script type="text/javascript">
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
</script>
{/literal}