


<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">المصروفات والايرادات</a></li>
            <li><a href="bankController.php?do=show">البنوك</a></li>
            <li class="active">حركة حساب</li>
        </ol>




        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">حركة حساب
                <a href="{$youtubes[89]->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">


                <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 " id="bankAccountForm" action="bankAccountOpController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">الحساب</label>
                        <select class="select2 wdt300"  name="accountid" id="accountNo" data-placeholder="اختر حساب"  required>
                            <option  ></option>
                            {foreach $allAccounts as $data}
                            <option value="{$data->accountid}">{$data->bankname} - {$data->accountnumber}/{$data->accountname}</option>
                            {/foreach}
                        </select>

                    </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="startDate" >
                    </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="endDate" >
                    </div>
                    <input type="button" id="bankAccountSt" class="btn btn-primary" value="بحث"/>
                    <span id="bankAccountError" style="color: red;display: none;"> اختر حساب أولا </span>
                </form>
            </div>

            <hr/>

            <div class="col-lg-offset-4 col-lg-8">
                <div class="well well-sm2">
                    <h4 class="text-center">الرصيد الحالي للحساب: {$currentBalance}</h4>
                </div>

            </div>



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

            <!-- Table -->
            <form method="post" action="bankAccountOpController.php?do=show">
                <table class="table table-black dataTableClass">
                    <thead>
                        <tr>
                            <th rowspan="2">#</th>
                            <th rowspan="2">العملية</th>
                            <th rowspan="2">تاريخ العملية</th>
                            <th rowspan="2">الرصيد قبل</th>
                            <th colspan="2">قيمة العملية</th>
                            <th rowspan="2">الرصيد بعد</th>
                            <th rowspan="2">المستخدم</th>
                            <th rowspan="2">التفاصيل</th>
                        </tr>
                        <tr>
                            <td>وارد</td>
                            <td>صادر</td>
                        </tr>
                    </thead>
                    <tbody>



                        {foreach $allMovements as $data}
                        <tr>
                            <td>
                                {$data@iteration}
                            </td>

                            <td>{if $data->tablename eq "cashTransferController.php"}{$data->processname}{else}{$data->processname} ({$data->bankname}- {$data->accountname} {if $data->clientname}/{$data->clientname}{/if}){/if}</td>
                            <td>{$data->accountmovementdate}</td>
                            <td>{$data->accountmovementbefore}</td>
                            <td>
                                {if $data->accountmovementtype eq 0}
                                {$data->accountmovementamount}
                                {/if}
                            </td>
                            <td>
                                {if $data->accountmovementtype eq 1}
                                {$data->accountmovementamount}
                                {/if}
                            </td>


                            <td>{$data->accountmovementafter}</td>
                            <td>{$data->employeename}</td>
                            <td>
                                <a href="
                                   {if $data->tablename == 'sellbillController.php'}
                                   {$data->tablename}?do=showDetail&sellbillid={$data->accountmovementmodelid}
                                   {else if $data->tablename == 'sellbillandruternController.php'}
                                   {$data->tablename}?do=showDetail&sellbillid={$data->accountmovementmodelid}
                                   {else if $data->tablename == 'returnsellbillController.php'}
                                   {$data->tablename}?do=showDetail&returnsellbillid={$data->accountmovementmodelid}
                                   {else}
                                   {$data->tablename}?do=details&{if $data->tablename eq 'bankaccountController.php'}accountid={else}id={/if}{$data->accountmovementmodelid}
                                   {/if}
                                   "
                                   target="_blank">التفاصيل</a></td>
                        </tr>
                        {/foreach}


                    </tbody>
                </table>





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


                <hr />






            </form>

        </div>



        <!-- Modal -->
    </div>

</div>
