<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">بصريات</a></li>
            <li><a href="#">تقرير سائق</a></li>
        </ol>

        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">تقرير سائق</h3>
            </div>
            <div class="panel-body">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#transport_tab" data-toggle="tab">تحت النقل</a></li>
                    <li><a href="#delivered_tab" data-toggle="tab">تم التسليم</a></li>
                    <li><a href="#allorders_tab" data-toggle="tab">كل الطلبيات</a></li>
                </ul>
                <div class="tab-content">
                    <!-- tab1 ----------------------------------------------------------------------------->
                    <div class="tab-pane active" id="transport_tab">
                        <form class="form-inline hidden-print" action="driveropticreport.php" method="post">
                            <div class="form-group">
                                <label class="sr-only">رقم الطلبية</label>
                                <input type="text" class="form-control" placeholder="رقم الطلبية" name="orderNo" id="orderNo">
                            </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="datefrom" >
                            </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="dateto" >
                            </div>
                            <button type="submit" class="btn btn-primary">بحث</button>
                        </form>
                        <br />
                        {if $msg!=""}
                        <div class="well well-">
                            <h3>{$msg}</h3>
                        </div>
                        {/if}
                        <br/>
                        <!-- Table -->
                        <div class="table-responsive" style="width:100%;max-width:100%;overflow-x: scroll">

                        <table class="table table-black" >
                            <thead>
                                <tr>
                                    <th>رقم المسلسل</th>
                                    <th>رقم الطلبية</th>
                                    <th>عامل التوصيل/السائق</th>
                                    <th>تاريخ التسليم</th>
                                    <th>عدد المنتجات</th>
                                    <th>من</th>
                                    <th>الى</th>
                                    <th class="hidden-print">تفاصيل</th>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var=i value=1}
                                {foreach $ordersAtWorkshop as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>{$data->driverId}</td>
                                    <td>{$data->deliverWorkshopDate}</td>
                                    <td>{$data->productNo}</td>
                                    <td>الفرع:{$data->branchId}</td>
                                    <td>الورشة:{$data->workshopId}</td>
                                    <td class="hidden-print">  <a data-id="{$data->id}" class="btn btn-default notesicon getoredrproduct"></a></td>
                                </tr>
                                {assign var=i value=$i+1}
                                {/foreach}
                                {foreach $ordersAtWorkshop_2 as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>{$data->driverId}</td>
                                    <td>{$data->deliverBranchDate}</td>
                                    <td>{$data->productNo}</td>
                                    <td>الورشة:{$data->workshopId}</td>
                                    <td>الفرع:{$data->branchId}</td>
                                    <td class="hidden-print">  <a data-id="{$data->id}" class="btn btn-default notesicon getoredrproduct"></a></td>
                                </tr>
                                {assign var=i value=$i+1}
                                {/foreach}

                            </tbody>

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

                    <!-- tab2 ----------------------------------------------------------------------------->
                    <div class="tab-pane" id="delivered_tab">
                        <form class="form-inline hidden-print" action="driveropticreport.php" method="post">
                            <div class="form-group">
                                <label class="sr-only">رقم الطلبية</label>
                                <input type="text" class="form-control" placeholder="رقم الطلبية" name="orderNo2" id="orderNo2">
                            </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="datefrom2" >
                            </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="dateto2" >
                            </div>
                            <button type="submit" class="btn btn-primary">بحث</button>
                        </form>
                        <br />
                        {if $msg2!=""}
                        <div class="well well-">
                            <h3>{$msg2}</h3>
                        </div>
                        {/if}
                        <br/>
                        <!-- Table -->
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th>رقم المسلسل</th>
                                    <th>رقم الطلبية</th>
                                    <th>عامل التوصيل/السائق</th>
                                    <th>تاريخ التسليم للورشة</th>
                                    <th>عدد المنتجات</th>
                                    <th>الحالة</th>
                                    <th>الفرع</th>
                                    <th class="hidden-print">تفاصيل</th>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var=i value=1}
                                {foreach $deliveredToWorkshop as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>{$data->driverId}</td>
                                    <td>{$data->recieveWorkshopDate}</td>
                                    <td>{$data->productNo}</td>
                                    <td>تم التسليم للورشة</td>
                                    <td>{$data->branchId}</td>
                                    <td class="hidden-print">  <a data-id="{$data->id}" class="btn btn-default notesicon getoredrproduct"></a></td>
                                </tr>
                                {assign var=i value=$i+1}
                                {/foreach}
                                {foreach $deliveredToBranch as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>{$data->driverId}</td>
                                    <td>{$data->recieveBranchDate}</td>
                                    <td>{$data->productNo}</td>
                                    <td>تم التسليم للفرع</td>
                                    <td>{$data->branchId}</td>
                                    <td class="hidden-print">  <a data-id="{$data->id}" class="btn btn-default notesicon getoredrproduct"></a></td>
                                </tr>
                                {assign var=i value=$i+1}
                                {/foreach}

                            </tbody>

                        </table>
                    </div>

                    <!-- tab4 ----------------------------------------------------------------------------->
                    <div class="tab-pane" id="allorders_tab">
                        <form class="form-inline hidden-print" action="driveropticreport.php" method="post">
                            <div class="form-group">
                                <label class="sr-only">رقم الطلبية</label>
                                <input type="text" class="form-control" placeholder="رقم الطلبية" name="orderNo3" id="orderNo3">
                            </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="datefrom3" >
                            </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="dateto3" >
                            </div>
                            <button type="submit" class="btn btn-primary">بحث</button>
                        </form>
                        <br />
                        {if $msg3!=""}
                        <div class="well well-">
                            <h3>{$msg3}</h3>
                        </div>
                        {/if}
                        <br/>
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th>رقم المسلسل</th>
                                    <th>رقم الطلبية</th>
                                    <th>تاريخ التسليم للورشة</th>
                                    <th>عدد المنتجات</th>
                                    <th>الفرع</th>
                                    <th>الحالة</th>
                                    <th class="hidden-print">تفاصيل</th>
                                </tr>
                            </thead>
                            <tbody>
                                {assign var=i value=1}
                                {foreach $allOrders as $data}
                                <tr>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>{$data->deliverWorkshopDate}</td>
                                    <td>{$data->productNo}</td>
                                    <td>{$data->branchId}</td>
                                    <td>{$data->orderStatus}</td>
                                    <td class="hidden-print">  <a data-id="{$data->id}" class="btn btn-default notesicon getoredrproduct"></a></td>
                                </tr>
                                {assign var=i value=$i+1}
                                {/foreach}

                            </tbody>

                        </table>
                    </div>
                </div>
            </div><!--row-->


            <!-- ======================= accountstree Modal Box =========== -->
            <!-- Modal -->
            <div class="modal fade in" id="orderproductModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
                <div class="modal-dialog modal-lg">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close pull-left savemodel2" data-dismiss="modal" aria-hidden="true">×</button>
                            <h4 class="modal-title">منتجات الطلبية</h4>
                        </div>
                        <div class="modal-body" id="orderproductDivModal">
                            <!-- =================================================   -->

                            <!-- =================================================   -->
                            <br/>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default pull-left" onclick="closeClientForm()" data-dismiss="modal">اغلاق</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <!-- ============================================= -->

