
<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="#">{$smarty.const.PRODUCTS}</a></li>
            <li><a href="productCatController.php?do=show">{$smarty.const.PRODUCTS_CATEGORIES}</a></li>
            <li class="active">{$smarty.const.SHOW_MAIN_CATEGORIES}</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;">{$smarty.const.SHOW_MAIN_CATEGORIES}</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="productCatController.php" class="hidden-print"><input type="button"  id="submit" style="margin-left: 12px" class="btn btn-primary pull-left " value="{$smarty.const.CATEGORY_ADD_NEW}"/></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="productCatController.php?do=show">
                <div class="form-group">
                    <label class="sr-only">{$smarty.const.CATEGORY_NAME}</label>
                    <select data-placeholder="{$smarty.const.CHOOSE_CATEGORY}"  class="select2 wdt100"  name="catId" id="catId" onChange="this.form.submit();">
                        <option value="-1">{$smarty.const.CHOOSE_CATEGORY}</option>





                        {foreach $allData as $cat}





                        <option value="{$cat->productCatId}">{$cat->productCatName}</option>





                        {/foreach}





                    </select>
                </div>
                <button type="submit" class="btn btn-primary">{$smarty.const.CATEGORY_SEARCH}</button>
            </form>
            <!-- Table -->
            {literal}
            <form method="post" action="productCatController.php?do=executeOperation" onsubmit="if (Spry.Widget.Form.validate(this)) {
                        return countChoosenProducts('productCatController');
                    } else {
                        return false;
                    }">
                {/literal}
                <table class="display table-black" id="example">
                    <thead>
                        <tr>
                            <th  class="hidden-print">
                                <input type="checkbox" name="checkAll" id="checkAll"/>
                            </th>
                            <th>{$smarty.const.MAIN_PRODUCT_NAME}</th>
                            <th class="hidden-print">{$smarty.const.CATEGORY_STOP}</th>
                            <th class="hidden-print">{$smarty.const.CATEGORY_EDIT}</th>

                            {if {$Programsettingdata->allowfinsldelete} eq 0}
                            <th class="hidden-print">{$smarty.const.CATEGORY_DELETE} </th>
                            {/if}
                        </tr>
                    </thead>
                    <tbody>

                        {foreach $productCatData as $data}
                        {if {$data->conditions} eq 1}
                        <tr class="danger" style="background-color:#eed3d7;"> {elseif {$data->conditions} eq 0}

                        <tr> {/if}
                            <td class="hidden-print">
                                <input type="checkbox" name="choosedItem[]" id="checked{$i}" class="choosenItem" value="{$data->productCatId}" />
                            </td>
                            <td>{$data->productCatName}{if $data->parentName !=""} / {$data->parentName}{/if}</td>
                            <td class="hidden-print"> {if {$data->conditions} eq 0} <a href="productCatController.php?do=tempdelete&id={$data->productCatId}" type="button" class="btn btn-default btn-lg removeicon"></a> {elseif {$data->conditions} eq 1 } <a href="productCatController.php?do=returndelete&id={$data->productCatId}" type="button" class="btn btn-default btn-lg correcticon"></a> {/if} </td>
                            <td class="hidden-print"> <a href="productCatController.php?do=edit&id={$data->productCatId}&parentid={$data->productCatParent}" class="btn btn-default btn-lg editicon"></a> </td>

                            {if {$Programsettingdata->allowfinsldelete} eq 0}
                            <td class="hidden-print"><a href="#" name="dd" type="button" class="btn btn-default btn-lg deleteicon conformdel1" data-position="productCatController.php?do=deleteFinaly&id={$data->productCatId}" ></a></td>
                            {/if}
                        </tr>
                        {/foreach}

                    </tbody>

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

                <!-- Modal -->
                <div class="hidden-print">
                    <div class="modal fade " id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                                    <h4 class="modal-title">{$smarty.const.CATEGORY_CONFIRM_GROUP_DELETION}</h4>
                                </div>
                                <div class="modal-body"> {$smarty.const.CATEGORY_WANT_DELETE_CATEGORY} </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">{$smarty.const.CATEGORY_NO}</button>
                                    <button type="button" class="btn btn-primary savemodel1">{$smarty.const.CATEGORY_YES}</button>
                                </div>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                    </div>
                </div>
                <!-- /.modal -->

                <hr />
                <div  class="hidden-print">
                    <div class="col-lg-12">
                        <div class="well well-sm">
                            <div class="form-group">
                                <div class="col-lg-4">
                                    <label for="operation"></label>
                                    <span id="spryselect1">
                                        <select name="operation" id="operation"  data-placeholder="{$smarty.const.CATEGORY_CHOOSE_PROCESS}" class="select2 wdt100">
                                            <option value="-1">{$smarty.const.CATEGORY_CHOOSE_PROCESS}</option>
                                            <option value="1">{$smarty.const.CATEGORY_STOP}</option>
                                            <option value="2"> {$smarty.const.CATEGORY_START}</option>
                                        </select>
                                        <span class="selectInvalidMsg">*</span></span></div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-4">
                                    <input name=""  class="hidden-print btn btn-primary" type="submit" value="{$smarty.const.CATEGORY_EXECUTION}"/>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div id="noElementsError" class="alert alert-danger fade in" style="display:none;">
                                <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">×</button>
                                <p>{$smarty.const.CATEGORY_ITEMS_SELECTED_FIRST}</p>
                                <div class="clearfix"></div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="form-group">
                            <div class="col-lg-4">
                                <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right">{$smarty.const.CATEGORY_PRINT}</button>
                            </div>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <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}