
<form class="form-inline hidden-print" action="deleveryReportController.php" method="post" id="deleverysearch">
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default panel-m">
                <div class="panel-heading">
                    <h6 class="text-center"><strong> تقرير استلام</strong> </h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">


                        <div class="form-group">

                            <label class="sr-only"> اسم العميل </label>
                            <select class="select2 wdt300" name="clientid" id="clientid" >
                                <option value="-1">اختر عميل </option>
                                <option value="all"> كل العملاء</option>
                                {foreach $clientsData as $newclient}
                                <option id="xx" value="{$newclient->clientid}">{$newclient->clientname}</option>
                                {/foreach}
                            </select>
                        </div>


                        <!--<div class="form-group">

                       <label class="sr-only"> سيريال الفاتورة </label>
                        <select class="select2 wdt300" name="recitID" id="recitID" >
                                              <option value="-1">اختر سيريال </option>
                                           {foreach $clientsData as $newclient}
                                                      <option id="xx" value="{$newclient->clientid}">{$newclient->clientname}</option>
                                             {/foreach}
                                             </select>
                                     </div>-->




                        </br>
                        <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="from" >
                        </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="to" >
                        </div>
                        <button type="submit" class="btn btn-primary">بحث</button>

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





{if !empty($checkData)}

<form method="post"  action="deleveryReportController.php?do=delever" id="delevery">
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default panel-m">
                <div class="panel-heading">
                    <h6 class="text-center"><strong> تقرير استلام</strong> </h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <!-- hidden values -->
                        <input type="hidden" name="clint_insure_no" id="clint_insure_no" value="1">
                        <input type="hidden" name="clint_tabindex_no" id="clint_tabindex_no" value="19">
                        <table class="table table-condensed table-black">
                            <thead>
                                <tr>
                                    <td><strong>اسم العميل</strong></td>
                                    <td class="text-center"><strong>اسم الجهاز</strong></td>
                                    <td class="text-center"><strong> السيريال الخاص</strong></td>
                                    <td class="text-center"><strong> السيريال</strong></td>
                                    <td class="text-center"><strong>التاريخ</strong></td>
                                    <td class="text-center"><strong>الحاله</strong></td>
                                    <td class="text-center"><strong> نوع الصيانة</strong></td>
                                    <td class="text-center"><strong> تقرير التكاليف</strong></td>
                                    <td class="text-center"><strong> تسليم</strong></td>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var="i" value="1"}
                                {foreach $checkData as $mycheckData}
                                <tr>
                                    <td>{$mycheckData->clientname}</td>
                                    <td class="text-center">{$mycheckData->productName}</td>
                                    <td class="text-center">{$mycheckData->ourSerial}</td>
                                    <td class="text-center">{$mycheckData->productserial}</td>
                                    <td class="text-center">{$mycheckData->checkDate}</td>
                                    <td class="text-center">{if $mycheckData->productHistoryStatus == 0}
                                        مقبول
                                        {else if $mycheckData->productHistoryStatus == 1}
                                        مرفوض
                                        {/if}
                                    </td>
                                    <td class="text-center">
                                        {if $mycheckData->granttype == 0}
                                        صيانة
                                        {else if $mycheckData->granttype == 1}
                                        ضمان عميل
                                        {else if $mycheckData->granttype == 2}
                                        ضمان شركة
                                        {/if}
                                    </td>
                                    <td align="center" class="hidden-print"> <a id="2" type="button" class="btn btn-default btn-lg editicon check" data-initialcost = "{$mycheckData->Initialcost}" data-ourSerial="{$mycheckData->ourSerial}"></a> </td>
                                    <td class="text-center">
                                        <input name="done{$i}" id="done{$i}" type="checkbox" value="1" />
                                        <input name="ourSerial{$i}" type="hidden" value="{$mycheckData->ourSerial}" />
                                    </td>
                                </tr>
                                {assign var="i" value=$i+1}
                                {/foreach}

                            <input name="itr" type="hidden" value="{$itr}" />
                            </tbody>
                        </table>
                        <div align="center"><button type="submit" name="delever" id="delever" class="btn btn-primary"> تسليم </button>
                            <button type="submit" name="deleverandPay" class="btn btn-success" onclick="andPay();"> تسليم ودفع </button>
                        </div>

                        <br/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
{/if}


<!-------------------------- من  مراحل اخرى  Type 2 ------------------->
<!-- ======================= check report Modal Box =========== -->
<!-- Modal -->
<div class="modal fade" id="checkReportModal2" tabindex="-1" role="dialog" aria-labelledby="checkReportModal2" 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">
                <form id="checkReportInfo2" action="#" method="post" class="form-horizontal">

                    <!------------------------------>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">التكلفة الاسترشادية</label>
                        <div class="col-lg-4">
                            <label class="control-label2" name="initialCost2" id="initialCost2">0</label>
                        </div>
                    </div>
                    <!------------------------------>
                    <div class="form-group">

                        <br/>
                        <hr />

                        <label> حساب التكاليف</label>

                        <hr />
                        <br/>
                        <!------------------------------>
                        <div id="allCostsDiv">

                        </div>



                    </div>
                    <!------------------------------>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">خصم</label>
                        <div class="col-lg-4">
                            <input class="form-control" name="discount" id="discount" type="text">
                        </div>
                    </div>
                    <!------------------------------>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default closeReport" id="2">اغلاق</button>
                <button type="button" id="2" class="btn btn-primary insertcheckReport" >حفظ</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- ============================================= -->