<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><a href="#">قسط عميل</a></li>
            <li class="active">تفاصيل قسط العميل</li>
        </ol>

        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">تفاصيل قسط العميل</h3>
            </div>

            <div class="panel-body">

                <form action="premiumController.php?do=show" method="post" id="form1" class="form-horizontal nameToBeChecked">


                    <!-- المكونات -->
                    <div class="card">
                        <div class="col-lg-6">
                            <h4>بيانات العميل</h4>
                        </div>
                        <div class="col-lg-3 ">
                            <div class="form-group mt-10">
                                <label class="col-lg-3"> العميل</label>
                                <div class="col-lg-9">
                                    <select class=" select2" id="clientID" name="clientID" disabled>
                                        <option value="-1">اختر العميل</option>
                                        {foreach $clientsData as $item}
                                        <option value="{$item->clientid}" {if $alldata->clientId == $item->clientid}selected{/if}>{$item->clientname}</option>
                                        {/foreach}
                                    </select>
                                </div>

                            </div>
                        </div>

                        <div class="table-responsive">
                            <table class="table billtable table-bordered table-black " id="table">
                                <thead>
                                <tr>
                                    <th class="wdt300">اسم العميل</th>
                                    <th class="wdt120 ">رقم  الموبيل</th>
                                    <th class="wdt120">المنطقه</th>
                                    <th  class="wdt120" >نوع العميل</th>
                                    <th  class="wdt120">مديونيه العميل</th>
                                    <th class="wdt120">التعليق</th>
                                </tr>
                                </thead>
                                <tbody>
                                <td>{$clientData->clientname}</td>
                                <td>{$clientData->clientmobile}</td>
                                <td>{$clientData->areaName}</td>
                                <td>{$clientData->typeName}</td>
                                <td>{$clientData->clientdebt}</td>
                                <td>{$clientData->clientdetails}</td>
                                </tbody>
                            </table>
                        </div>

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

                    <!-- المخرجات -->
                    <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>
                                    <th class="wdt300">تاريخ السداد</th>
                                    <th class="wdt230">سداد</th>
                                    <th class="wdt230">تأجيل</th>
                                    <!--<th class="wdt50"></th>-->
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $alldataclient as $item}


                                {if {$item->payed} eq 1}
                                <tr class="danger"> {elseif {$item->payed} eq 0}
                                <tr data-itr="1">
                                    {/if}

                                    <td>
                                        <input type="text" class="form-control awdatepicker" value="{$item->date}" readonly autocomplete="off" data-date-format="yyyy-mm-dd" name="date1" id="date1">
                                    </td>
                                    <td>
                                        <input type="number" name="Amount1" id="Amount1" min="0" class="form-control countAmount" value="{$item->value}" readonly />
                                    </td>
                                    <td class="hidden-print">
                                        <input type="number" name="Amount1"  min="0" class="form-control countAmount" value="{$item->rest}" readonly />
                                    </td>
                                    <td class="hidden-print">
                                        <input type="text" name="payment_date" class="form-control " value="{if $item->payment_date}{$item->payment_date}{else}لا يوجد تاريخ للدفع{/if}" readonly />
                                    </td>
                                    <td class="hidden-print">
                                        {if $item->payed == 0}
                                        <a class="btn btn-info" href="clientPayedDeptController.php" data-id="{$item->id}" id="add_pay" role="button" {if $item->conditions == 1}disabled{/if}>سداد</a>
                                        {else}
                                        <a class="btn btn-info" href="clientPayedDeptController.php" data-id="{$item->id}"  role="button" disabled>تم السداد</a>
                                        {/if}
                                    </td>
                                    <td class="hidden-print">
                                        {if $item->conditions == 0}
                                        <a class="btn btn-info" href="#" data-id="{$item->id}" id="delay" data-toggle="modal" data-target="#myModal" role="button" {if $item->payed == 1}disabled{/if}>تأجيل</a>
                                        {else}
                                        <a class="btn btn-info" href="#" data-id="{$item->id}" data-toggle="modal" data-target="#myModal" role="button" disabled="">تم التأجيل</a>
                                        {/if}
                                    </td>
                                    <!--<td class="noprint"><a href="javascript:;" type="button" class="btn add addWastePro" id="addWastePro1"><i class="glyphicon glyphicon-plus-sign"></i></a></td>-->
                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>

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

                        <div class="row">
                            <div class="col-lg-12">
                                <button type="button" class="btn btn-dark pull-left ft-nor">
                                    اجمالى الاقساط <span class="badge wht-clo">
                                    <div id='allCost'>{$total}</div>
                                </span>
                                </button>
                            </div>
                        </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 id="rtnBtn" class="btn btn-dark">
                                <i class="glyphicon glyphicon-backward"></i>  رجوع</button>
                        </div>



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

                </form>

            </div> <!-- end of panel-body-->

        </div>  <!-- end of panel panel-default-->

    </div> <!-- end of container-->

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


<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>




