<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=update" method="post" id="form1" class="form-horizontal nameToBeChecked">

                    <input type="hidden" name="Premiumclient"  value="{$alldataclient->id}">

                    <!-- المكونات -->
                    <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" required>
                                        <option value="-1">اختر العميل</option>
                                        {foreach $clientsData as $item}
                                        <option value="{$item->clientid}" {if $alldataclient->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>
                                <tr>

                                    <td id="name">{$clientData->clientname}</td>
                                    <td id="mobile">{$clientData->clientmobile}</td>
                                    <td id="area">{$clientData->areaName}</td>
                                    <td id="type">{$clientData->typeName}</td>
                                    <td id="debt">{$clientData->clientdebt}</td>
                                    <td id="comment">{$clientData->clientdetails}</td>

                                </tr>

                                </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="{$itrNo}"/>

                        <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="wdt50"></th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $alldata as $item}
                                <tr data-itr="{$i}">
                                    <td>
                                        <input type="text" class="form-control date" autocomplete="off" required data-date-format="yyyy-mm-dd" name="date{$item@iteration}" id="date{$item@iteration}" value="{$item->date}" {if $item->payed == 1}disabled{/if}>
                                    </td>
                                    <td>
                                        <input type="number" name="Amount{$item@iteration}" required id="Amount{$item@iteration}" min="0" class="form-control countAmount positiveNo" value="{$item->value - $item->rest}" {if $item->payed == 1}disabled{/if}/>
                                    </td>
                                    <td class="noprint">
                                        {if $item->payed != 1}
                                        <button id="remove{$item@iteration}" type="button" data-del="out" class="close flt-none removeicon removeproduct" aria-hidden="true">&times;</button>
                                        {/if}
                                        <!--{if $item@iteration eq count($alldata)}-->
                                        <!--<a href="javascript:;" type="button" class="btn add addWastePro" id="addWastePro{$item@iteration}"><i class="glyphicon glyphicon-plus-sign"></i></a>-->
                                        <!--{else}-->
                                        <!--{/if}-->
                                    </td>
                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>

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

                    <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 class="clearfix"></div>
                    <hr/>

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

                            <a href="premiumController.php?do=show" style="color: white" id="rtnBtn" class="btn btn-dark">
                                <i class="glyphicon glyphicon-backward"></i>  رجوع</a>
                        </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-->




