
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">ايصالات دفع</a></li>
            <li><a href="#">عرض ايصالات الدفع</a></li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">عرض ايصالات الدفع<br />
                {if $message != ""}
                {$message}
                {/if}
                <a href="{$youtubes[236]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>
            <div class="panel-body">
                <form class="form-inline  hidden-print" action="supPayController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">اختر مورد</label>
                        <select data-placeholder="اختر مورد" class="select2 wdt300" name="supplierId" id="supplierId">
                            <option value="-1"> اختر مورد</option>
                            <option value="-2"> كل الموردين</option>

                            {foreach $supplierData as $supplier}


                            <option value="{$supplier->supplierid}">{$supplier->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" id="datepicker_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" id="datepicker_to"   onChange="getResult();">
                    </div>

                    <button type="submit" class="btn btn-primary  hidden-print">بحث</button>
                </form>

                <label class="color-white" style="font-size: 13px; color: #111111; font-weight: bold;">اخفاء المحذوف</label>      <input type="checkbox" id="showDel" onclick="hideDel()"  name="showDel" value="{$shownData}"/>
            </div>
            <div class="col-lg-offset-8 col-lg-4">
                <div class="well well-sm"><h4 class="text-center">الإجمالي:  {$sum} {$currency}</h4></div>
            </div>
            <hr/>
            <div id="resultDiv"><!------ Start result --------->
                <hr/>
                <table class="table table-black">
                    <thead>
                        <tr>
                            <th>اسم المورد</th>
                            <th>التاريخ</th>
                            <th>الدين قبل </th>
                            <th>المبلغ</th>
                            <th>الدين بعد </th>
                            <th>طريقة الدفع </th>
                            <th>تعديل</th>
                            <th>حذف</th>
                            <th>طباعه  </th>
                        </tr>
                    </thead>

                    <tbody>

                        {foreach $shownData as $data}




                        <tr  class="{if $data->del eq 1}hideTrow{else}gradeA{/if}" {if $data->del eq 1}style="background: #cad4e6;" {/if}>


                            <td>{$data->suppliername}</td>
                            <td>{$data->supplierdebtchangedate}</td>
                            <td>{$data->supplierdebtchangebefore}</td>
                            <td>{$data->supplierdebtchangeamount}</td>
                            <td>{$data->supplierdebtchangeafter}</td>
                            <td>
                                {foreach $suppayData as $paydata}
                                {if $paydata->idsupdeptchange eq $data->supplierdebtchangeid }
                                {if $paydata->paytype eq 1}
                                شيك
                                {else}
                                خزنة
                                {/if}
                                {/if}
                                {/foreach}
                            </td>

                            <td>
                                {if $data->del eq 1}
                                لقد تم حذفه
                                {else}
                                <a href="supPayController.php?do=edit&id={$data->supplierdebtchangeid}" ><input  type="button"  class="btn btn-info pull-right" value="تعديل" /> </a>
                                {/if}
                            </td>


                            <td class="hidden-print">
                                {if $data->del eq 1}
                                لقد تم حذفه
                                {else}

                                <a href="supPayController.php?do=remove&id={$data->supplierdebtchangeid}&dailyentry={$data->dailyentryid}&suppayId={foreach $suppayData as $paydata} {if $paydata->idsupdeptchange eq $data->supplierdebtchangeid }{$paydata->id}{/if}{/foreach}"><input  type="button"  class="btn btn-danger pull-right" value="حذف" /></a>
                                {/if}
                            </td>
                            <td>
                                {if $data->del eq 1}
                                لقد تم حذفه
                                {else}
                                <a target="_blank" href="supPayController.php?do=editprint&id={$data->supplierdebtchangeid}" ><input  type="button"  class="btn btn-success pull-right" value="طباعه" /> </a>
                                {/if}
                            </td>
                        </tr>

                        {/foreach}
                    </tbody>

                </table>
                <div class="col-lg-offset-8 col-lg-4">
                    <div class="well well-sm"><h4 class="text-center">الإجمالي:  {$sum} {$currency}</h4></div>
                </div>
            </div> <!------ End result --------->

            <div class="clearfix"></div>
            <hr />
            <div  class=" hidden-print">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-4">
                            <!--              <button type="button" onclick="window.print() ;" class="btn btn-success pull-right">طباعة</button>-->
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>

    </div>
</div>
