<style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
    .mHead{
        color: #002bff !important;
        font-weight: bold !important;
    }
</style>


<style>

    @media (min-width: 768px){
        .form-horizontal .form-group {
            margin-right: -10px;
            margin-left:-10px;
        }

        .m10{
            margin: 10px
        }
        h4{
            font-size: 17px;
            font-weight: bold;
            color: #000000;
            margin: 10px 0 15px;
            font-family: sans-serif;
        }
        hr {
            margin: 20px ;
            border: 0;
            border-top: 2px solid #d7d7d7;

        }
        .card{
            box-shadow: 0 4px 16px rgba(0,0,0,.12);
            padding: 10px;
            margin: 40px 0;
            border-radius: 5px
        }

    }
    .wdt230{
        width:230px
    }
    .billtable thead>tr>th {
        color: #eeecda;
        background-color: #0081a8;
    }
    .add i{
        font-size: 20px;
        color: #607D8B;
    }
    .wdt50{
        width:50px
    }
    .mt-10{
        margin-top: 10px
    }
    .data-search{
        margin: 10px 15px 0;
    }
    .btn-dark {
        color: #fff;
        background-color: #636262;
        border-color: #646464;
    }
    .data-search .form-control{
        border-radius:3px
    }

</style>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active">تقرير الاقساط المؤجله للعملاء</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تقرير الاقساط المؤجله للعملاء
                <a href="{$youtubes[275]->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="searchForm form-inline hidden-print" action="premiumReportDelayController.php?do=show" method="post">
                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                    <div class="form-group">
                        <label class="sr-only" style="margin-left: 13px;">العملاء</label>
                        <select class="select2 wdt300"  name="clientId" id="clientId" required>
                            <option value="-1">اختر عميل</option>

                            {foreach $clientsData as $c}

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

                            {/foreach}

                        </select>
                        <div class="clientError" style="display:none;"></div>
                    </div>

                    <!--<div class="form-group">-->
                        <!--<label class="sr-only" style="margin-left: 13px;">المنطقه</label>-->
                        <!--<select class="select2 wdt300"  name="areaId" id="areaId" required>-->
                            <!--<option value="-1">اختر المنطقه</option>-->

                            <!--{foreach $ClientareaData as $single}-->

                            <!--<option value="{$single->id}">{$single->name} </option>-->

                            <!--{/foreach}-->

                        <!--</select>-->
                        <!--<div class="clientError" style="display:none;"></div>-->
                    <!--</div>-->

                    <!--<div class="form-group">-->
                        <!--<label class="sr-only" style="margin-left: 13px;">نوع العميل</label>-->
                        <!--<select class="select2 wdt300"  name="typeclientId" id="typeclientId" required>-->
                            <!--<option value="-1">اختر نوع العميل</option>-->

                            <!--{foreach $TypeClientData as $single}-->

                            <!--<option value="{$single->typeId}">{$single->typeName} </option>-->

                            <!--{/foreach}-->

                        <!--</select>-->
                        <!--<div class="clientError" style="display:none;"></div>-->
                    <!--</div>-->
                    <!--<br />-->
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="dateStart 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="dateEnd form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>
                    <button type="submit" class="searchBtn btn btn-primary">بحث</button>
                    <!--<button type="button" class="searchBtn btn btn-primary">بحث</button>-->

                    <div class="dateStartError" style="display:none;"></div>
                    <div class="dateEndError" style="display:none;"></div>

                </form>
            </div>

            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading mHead">{$message}</div>
                <div class="panel-body">
                    <hr/>
                    <table class="table table-black" id="dataTableClass">
                        <thead>
                            <tr>
                                <th>اسم العميل</th>
                                <th>رقم موبيل</th>
                                <th>المنطقه</th>
                                <th>نوع العميل</th>
                                <th> المديونيه</th>
                                <th> الاقساط</th>
                                <th> التاريخ</th>
                                <th class="hidden-print">سداد قسط العميل</th>
                                <th class="hidden-print">تأجيل قسط العميل</th>
                            </tr>
                        </thead>
                        <tbody>

                            {foreach $allData as $single}
                            <tr>
                                <td>{$single->clientname}</td>

                                <td>{$single->clientmobile}</td>

                                <td>{$single->areaName}</td>
                                <td>{$single->typeName}</td>
                                <td>{$single->clientdebt}</td>
                                <td>{$single->value}</td>
                                <td>{$single->date}</td>
                                <td class="hidden-print">
                                    {if $single->payed == 0}
                                    <a class="btn btn-info" href="clientPayedDeptController.php" data-id="{$single->id}" id="add_pay" role="button" {if $single->premConditions == 1}disabled{/if}>سداد</a>
                                    {else}
                                    <a class="btn btn-info" href="clientPayedDeptController.php" data-id="{$single->id}" role="button" disabled>تم السداد</a>
                                    {/if}
                                </td>
                                <td class="hidden-print">

                                    {if $single->premConditions == 0}
                                    <a class="btn btn-info" href="#" data-id="{$single->id}" id="delay" data-toggle="modal" data-target="#myModal" role="button" {if $single->payed == 1}disabled{/if}>تأجيل</a>
                                    {else}
                                    <a class="btn btn-info" href="#" data-id="{$single->id}"  data-toggle="modal" data-target="#myModal" role="button" disabled="">تم التأجيل</a>
                                    {/if}
                                </td>
                            </tr>
                            {/foreach}




                        </tbody>

                    </table>

                    <div  class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog"  style="width:600px;">
                            <div class="modal-content">
                                <div class="modal-header text-center">
                                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" class="text-left">&times;</span><span class="sr-only"></span></button>
                                    <h3 class="modal-title" id="myModalLabel"> سداد اقساط العميل</h3>
                                </div>
                                <div class="modal-body">
                                    <form action="premiumController.php?do=addPremiumformreport" method="post" id="form1" class="form-horizontal nameToBeChecked">

                                        <!-- المخرجات -->
                                        <div class="card">

                                            <div class="col-lg-6">
                                                <h4>سداد اقساط العميل</h4>
                                            </div>

                                            <input type="hidden" name="premiumItr" id="premiumItr" value="1"/>

                                            <div class="table-responsive">
                                                <table class="table billtable table-bordered table-black " id="wasteTable">
                                                    <thead>
                                                    <tr>
                                                        <th class="wdt300">تاريخ الاقساط </th>
                                                        <th class="wdt300">القيمه</th>
                                                        <th class="wdt300">تاريخ  التأجيل </th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    <tr data-itr="1">
                                                        <input type="hidden" name="id" id="id">
                                                        <input type="hidden" name="premiumclientId" id="premiumclientId">
                                                        <td>
                                                            <input type="text" class="form-control date" autocomplete="off" data-date-format="yyyy-mm-dd" name="date" id="date" readonly>
                                                        </td>
                                                        <td>
                                                            <input type="number" name="Amount" id="Amount" min="0" class="form-control countAmount" value=""  readonly/>
                                                        </td>
                                                        <td>
                                                            <input type="text" class="form-control date" autocomplete="off" data-date-format="yyyy-mm-dd" name="delayDate" id="delayDate">
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </div>


                                        </div>
                                        <!-- end of title row-->


                                        <div class="row  hidden-print m10" >
                                            <div class="col-lg-12 text-center">
                                                <button type="submit"  id="saveBtn" class="btn btn-primary">
                                                    <i class="glyphicon glyphicon-ok "></i>  حفظ</button>
                                                <button type="button"  data-dismiss="modal"   class="btn btn-primary">
                                                    <i class="glyphicon glyphicon-ok "></i>  رجوع</button>
                                            </div>



                                        </div>
                                        <!-- end of fifth row-->

                                    </form>
                                </div>

                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>


