
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="clientController.php?do=show">العملاء</a></li>
            <li class="active">عرض العملاء</li>
        </ol>
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">عرض العملاء <br />
                {if $message != ""}
                {$message}
                {/if}</div>
            <div class="panel-body">

                <div id="outputString" class="alert alert-block alert-success fade in hidden-print" 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="clientController.php?do=show" method="post">
                    <!--          <div class="form-group">
                                <label class="sr-only"> العميل</label>
                                <input type="text" name="clients" id="clients" class="form-control" placeholder="اسم العميل">
                              </div>-->
                    <div class="form-group">

                        <label class="sr-only"> اسم العميل </label>
                        <select class="select2 wdt300" name="clientid" id="clientid" >
                            <option value="-1">اختر عميل </option>
                            <option value="-2"> كل العملاء</option>
                            {foreach $alldata as $data }



                            <option value="{$data->clientname}">{$data->clientname}</option>


                            {/foreach}


                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <div class="col-lg-offset-8 col-lg-4">
                <div class="well well-sm">
                    <h4 class="text-center">إجمالي مديونية العملاء الغير محذوفين <br/>
                        {$sum}  {$currency}</h4>
                </div>
            </div>
            <div class="clearfix"></div>


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

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

                        <tr> {/if}
                            <td class="hidden-print">
                                <input type="checkbox" name="choosedItem[]" id="checked{$i}" class="choosenItem" value="{$data->clientid}" />
                            </td>
                            <td>{$data->clientname}</td>
                            <td>{$data->clientdebt}</td>
                            <td class="hidden-print"> {if {$data->conditions} eq 0} <a href="clientController.php?do=tempdelete&id={$data->clientid}" type="button" class="btn btn-default btn-lg removeicon"></a> {elseif {$data->conditions} eq 1 } <a href="clientController.php?do=returndelete&id={$data->clientid}" type="button" class="btn btn-default btn-lg correcticon"></a> {/if} </td>
                            <td class="hidden-print"> <a href="clientController.php?do=edit&id={$data->clientid}" type="button" 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="clientController.php?do=deleteFinaly&id={$data->clientid}&action={$data->dailyentryid}" ></a></td>
                            {/if}
                        </tr>
                        {/foreach}

                    </tbody>

                </table>
                <div class="col-lg-offset-8 col-lg-4">
                    <div class="well well-sm">
                        <h4 class="text-center">إجمالي مديونية العملاء الغير محذوفين <br/>
                            {$sum}  {$currency}</h4>
                    </div>
                </div>
                <div class="clearfix"></div>
                <hr />


                <!-- 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">تأكيد حذف عميل</h4>
                                </div>
                                <div class="modal-body"> هل تريد حذف هذا العميل؟ </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">لا</button>
                                    <button type="button" class="btn btn-primary savemodel1">نعم</button>
                                </div>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                    </div>
                </div>
                <!-- /.modal -->



                <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">ايقاف</option>
                                            <option value="2">تشغيل </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 hidden-print" 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"></div>
                        </div>
                        <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>
            </form>
        </div>

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