
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المصروفات والايرادات</a></li>
            <li><a href="depositcheckController.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[94]->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="checkwithdrawalController.php" class="hidden-print"><input type="button" style="margin-left: 12px" id="submit"  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>
                <form class="form-inline hidden-print" action="checkwithdrawalController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">المورد</label>
                        <select class="select2 wdt100"  name="supplierid" id="supplierid" onchange="this.form.submit();">
                            <option value="-1">اختر مورد</option>


                            {foreach $allsuplierdata as $suplierdata}


                            <option value="{$suplierdata->supplierid}">{$suplierdata->suppliername}</option>


                            {/foreach}


                        </select>
                    </div>
                    <br/>
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">{$message}</div>
                <div class="panel-body">
                    <hr/>

                    <!-- Table -->
                    {literal}
                    <form method="post" action="checkwithdrawalController.php?do=executeOperation" onsubmit="if (Spry.Widget.Form.validate(this)) {
                                return countChoosenProducts('depositcheckController');
                            } else {
                                return false;
                            }">
                        {/literal}
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th class="hidden-print">
                                        <input type="checkbox" name="checkAll" id="checkAll"/>
                                    </th>
                                    <th>رقم الشيك</th>
                                    <th>اسم البنك</th>
                                    <th>اسم الحساب</th>
                                    <th>اسم المورد</th>
                                    <th>المبلغ المدفوع</th>
                                    <th class="hidden-print">الحذف</th>
                                    <th class="hidden-print">التعديل</th>
                                    <th class="hidden-print">طباعه</th>
                                    <th class="hidden-print">قيد اليومية</th>
                                </tr>
                            </thead>
                            <tbody>

                                {foreach $shownData as $check}
                                {if {$check->conditions} eq 1}
                                <tr class="danger"> {elseif {$check->conditions} eq 0}

                                <tr> {/if}
                                    <td class="hidden-print">
                                        <input type="checkbox" name="choosedItem[]" id="checked{$i}" class="choosenItem" value="{$check->checkwithdrawalid}" />
                                    </td>
                                    <td>{$check->checkwithdrawalnumber}</td>
                                    <td>{$check->bankname}</td>
                                    <td>{$check->accountname}</td>
                                    <td> {if {$check->suppliername} <> ""}
                                        {$check->suppliername}
                                        {else}
                                        شراء اصل
                                        {/if} </td>
                                    <td>{$check->checkwithdrawalamount}</td>
                                    <td class="hidden-print"> {if {$check->conditions} eq 0}
                                        <a href="#"  name="dd" id="delbtn"   type="button" class="btn btn-default btn-lg deleteicon"> </a> </td>

                                    {elseif {$check->conditions} eq 1}
                                    تم الغاءه
                                    {/if} </td>
                                    <td class="hidden-print"> <a href="checkwithdrawalController.php?do=edit&id={$check->checkwithdrawalid}" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                                    <td class="hidden-print"> <a href="checkwithdrawalController.php?do=editprint&id={$check->checkwithdrawalid}" type="button" class="btn btn-default btn-lg printicon"></a> </td>
                                    <td class="hidden-print"><a href="dailyentry.php?id={$check->dailyentryid}" target="_blank" type="button" class="btn btn-default btn-lg editicon"> </a></td>
                                </tr>
                                {/foreach}

                            </tbody>

                        </table>
                        <div class="clearfix"></div>
                        <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="اختر العملية" class="select2 wdt100">
                                                    <option value="-1">اختر عملية</option>
                                                    <option value="1">ايقاف
                                                        {foreach $shownData as $check}
                                                        {if {$check->conditions} eq 0}
                                                    <input type="hidden" value="{$check->dailyentryid}" name="dailyentryid"/>
                                                    {/if}
                                                    {/foreach}
                                                    </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="تنفيذ"/>
                                        </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>يجب اختيار العناصر أولاً</p>
                                        <div class="clearfix"></div>
                                    </div>
                                    <div class="clearfix hidden-print " >
                                        <div class="col-lg-4">
                                            <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right">طباعة</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                    </form>


                    <!-- Modal -->
                    <div class="modal fade" id="myModal155" 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 savemodel2" data-dismiss="modal" aria-hidden="true">&times;</button>
                                </div>
                                <div class="modal-body">
                                    <h4 class="modal-title">هل تريد حذف هذا الشيك ؟</h4>

                                    <form id="expDel" action="checkwithdrawalController.php?do=delete&id={$check->checkwithdrawalid}&action={$check->dailyentryid}" method="post" class="form-horizontal">
                                    </form>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" id="ddbtn" class="btn btn-default" >حذف </button>

                                    <button type="button" class="btn btn-default" data-dismiss="modal">اغلاق </button>
                                </div>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                    </div>
                </div>
            </div>
        </div>
        {literal}
        <script type="text/javascript">
            var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
        </script>
        {/literal}