<div class="container">
    <ol class="breadcrumb">
        <li><a href="#">الورش</a></li>
        <li class="active">الطلبيات</li>
    </ol>
    {if $showmsg == 1}
    {literal}
    <script>
        jQuery(".themessage").show();
        setTimeout(function () {
            jQuery(".themessage").hide().data("active", false);
        }, 2000);
    </script>
    {/literal}
    <div class="panel panel-default panel-m themessage">
        <div class="panel-heading">
            <h3 class="panel-title">{$msg1}</h3>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <center>   <h1 style="font-family:'GE SS Two Light';font-size:50px;">{$msg2} </h1></center>
            </div>
        </div>
    </div>
    {/if}
    <div class="panel panel-default panel-m">
        <!-- Default panel contents -->
        <div class="panel-heading">الطلبيات </div>
        <div class="panel-body">

            <ul class="nav nav-tabs">
                <li class="active"><a href="#underDelivery_tab" data-toggle="tab">تحت التوصيل</a></li>
                <li><a href="#underManufacturing_tab" data-toggle="tab">تحت التصنيع</a></li>
                <li><a href="#finished_tab" data-toggle="tab">منتهى</a></li>
            </ul>
            <div class="tab-content">
                <!-- tab1-1 ----------------------------------------------------------------------------->
                <div class="tab-pane active" id="underDelivery_tab">
                    <form class="form-inline hidden-print" action="workshop.php?do=billtransport" 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 />
                    <hr/>
                    <br/>
                    <form class="form-horizontal" action="workshop.php?do=receive" method="post" id="workshopRecieveForm"><!--checkName(event, 'costcenter', 'name');-->
                        <!-- Table -->
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th><input type="checkbox" name="checkAll_2" id="checkAll_2"></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><input type="checkbox" name="choosedItem_2[]" id="checked_2{$i}" class="choosenItem_2" value="{$data->id}"></td>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>{$data->driverId}</td>
                                    <td>{$data->deliverWorkshopDate}</td>
                                    <td>{$data->productNo}</td>
                                    <td>{$data->branchId}</td>
                                    <td class="hidden-print">  <a href="workshoptransport.php?do=orderdetails&id={$data->id}" target="_blank" type="button" class="btn btn-default btn-lg notesicon"></a>
                                    </td>
                                </tr>
                                {assign var=i value=$i+1}
                                {/foreach}

                            </tbody>

                        </table>
                        <div class="clearfix"></div>
                        <a href="javascript:;" id="send_2" class="btn btn-primary" style="float: left;"> استلام</a>
                        <div class="clearfix"></div>
                        <div id="sendDiv_2" style="display: none">
                            <div class="form-group col-lg-4">
                                <label class="sr-only">عامل التوصيل</label>
                                <select class="select2 wdt300" id="driver_2" name="driver_2">
                                    <option value="-1"></option>
                                    {foreach $deliveryWorkers as $data}
                                    <option value="{$data->userid}">{$data->employeename}</option>
                                    {assign var=i value=$i+1}
                                    {/foreach}
                                </select>
                            </div>
                            <div class="clearfix"></div>
                            <div class="form-group col-lg-4">
                                <label class="sr-only">تاريخ الاستلام</label>

                                <div class="input-group date form_datetime col-md-5" data-date="" data-date-format="yyyy-mm-dd  h:i:s" data-link-field="dtp_input1">
                                    <input class="form-control" size="16" type="text" value="{$now}" readonly="" id="recieveWorkshopDate" name="recieveWorkshopDate">
                                    <span class="input-group-addon "><span class=" glyphicon glyphicon-remove col-lg-4"></span></span>
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-th col-lg-4"></span></span>
                                </div>

                            </div>
                            <div class="clearfix"></div>
                            <div class="form-group col-lg-12">
                                <div align="center">
                                    <a href="javascript:;" id="transport_2" class="btn btn-success">استلام و طباعة</a>
                                </div>
                            </div>
                            <div class="clearfix"></div>

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

                <!-- tab2 ----------------------------------------------------------------------------->
                <div class="tab-pane" id="underManufacturing_tab">
                    <!--form class="form-inline hidden-print" action="workshop.php?do=billtransport" 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 />
                    <hr/>
                    <br/-->
                    <form class="form-horizontal" action="workshop.php?do=deliver" method="post" id="workshopDeliverForm"><!--checkName(event, 'costcenter', 'name');-->
                        <!-- Table -->
                        <table class="table table-black">
                            <thead>
                                <tr>
                                    <th><input type="checkbox" name="checkAll_3" id="checkAll_3"></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 $underManufacturingOrders as $data}
                                <tr>
                                    <td><input type="checkbox" name="choosedItem_3[]" id="checked_3{$i}" class="choosenItem_3" value="{$data->id}"></td>
                                    <td>{$i}</td>
                                    <td>{$data->orderNo}</td>
                                    <td>{$data->driverId}</td>
                                    <td>{$data->deliverWorkshopDate}</td>
                                    <td>{$data->productNo}</td>
                                    <td>{$data->branchId}</td>
                                    <td class="hidden-print">  <a href="workshoptransport.php?do=orderdetails&id={$data->id}" target="_blank" type="button" class="btn btn-default btn-lg notesicon"></a>
                                    </td>
                                </tr>
                                {assign var=i value=$i+1}
                                {/foreach}

                            </tbody>

                        </table>
                        <div class="clearfix"></div>
                        <a href="javascript:;" id="send_3" class="btn btn-primary" style="float: left;"> تسليم</a>
                        <div class="clearfix"></div>
                        <div id="sendDiv_3" style="display: none">
                            <div class="form-group col-lg-4">
                                <label class="sr-only">السائق</label>
                                <select class="select2 wdt300" id="driver_3" name="driver_3">
                                    <option value="-1"></option>
                                    {foreach $drivers as $data}
                                    <option value="{$data->userid}">{$data->employeename}</option>
                                    {assign var=i value=$i+1}
                                    {/foreach}
                                </select>
                            </div>
                            <div class="clearfix"></div>
                            <div class="form-group col-lg-12">
                                <div align="center">
                                    <a href="javascript:;" id="transport_3" class="btn btn-success">تسليم و طباعة</a>
                                </div>
                            </div>
                            <div class="clearfix"></div>

                        </div>
                    </form>
                </div>
                <!-- tab3 ----------------------------------------------------------------------------->
                <div class="tab-pane" id="finished_tab">
                    <!--form class="form-inline hidden-print" action="workshop.php?do=billtransport" 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 />
                    <hr/>
                    <br/-->
                    <!-- Table -->
                    <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 $finishedOrders 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 class="hidden-print">  <a href="workshoptransport.php?do=orderdetails&id={$data->id}" target="_blank" type="button" class="btn btn-default btn-lg notesicon"></a>
                                </td>
                            </tr>
                            {assign var=i value=$i+1}
                            {/foreach}

                        </tbody>

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

                </div>

            </div>

        </div>
    </div>
