<!--to call from js-->
<div id="RawMaterials" style="display:none">
    {foreach $rows as $material}
    <option value="{$material->productId}">{$material->productName}</option>
    {/foreach}
</div>
<!--    end   -->

<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="productionOrderController.php?do=update" method="post" id="form1" class="form-horizontal nameToBeChecked" >

                    <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                    <input type="hidden" name="conditions" id="conditions" value="{$productionorder->conditions}"/>
                    <input type="hidden" name="orderStatus" id="orderStatus" value="{$productionorder->orderStatus}"/>
                    <input type="hidden" name="productionOrderid" id="productionOrderid" value="{$productionorder->productionOrderid}" />

                    <!-- امر الانتاج -->
                    <div class="form-group mg-bt5" >
                        <label class="col-lg-2 control-label"> امر الانتاج</label>
                        <div class="col-lg-3">
                            <input type="text" name="orderName" id="orderName" value="{$productionorder->name}" class="form-control numberinput"/>
                        </div>
                    </div>




                    <!--من التاريخ-->

                    <div class="form-group mg-bt5" >
                        <label class="col-lg-2 control-label"> التاريخ من</label>
                        <div class="col-lg-3">
                            <input type="text" class="form-control wdt200 awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" id="from" value="{$productionorder->startDate}">
                        </div>
                    </div>

                    <div class="form-group mg-bt5" >
                        <label class="col-lg-2 control-label sr-only">إلى التاريخ</label>
                        <div class="col-lg-3">
                            <input type="text" class="form-control wdt200 awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" id="to" value="{$productionorder->endDate}">
                        </div>
                    </div>


                    <!--المنتج-->
                    <div class="form-group mg-bt5" >
                        <label class="col-lg-3 control-label">المنتج</label>

                        <label>{$product}</label>
                        <input type="hidden"   name="productId" id="productId" value="{$productionorder->productId}"/>


                    </div>


                    <!--وحدة القياس-->
                    <div class="form-group mg-bt5" >
                        <label class="col-lg-3 control-label">وحدة القياس</label>
                        <label>{$Unit}</label>
                        <input type="hidden"   name="unitId" id="unitId" value="{$productionorder->measureUnitId}"/>


                    </div>




                    <div class="form-group mg-bt5" >
                        <label class="col-lg-2 control-label">اختر المرحلة</label>
                        <div class="col-lg-3">

                            <select name="stage" id="stage" class="select2 wdt300">
                                <option value="-1"> اختر المرحلة</option>
                                {foreach $stages as $s}
                                <option {if {$s->stageId}=={$productionorder->stageId}}selected="selected"{/if}
                                    value="{$s->stageId}"> {$s->stagename} </option>
                                {/foreach}
                            </select>

                        </div>
                    </div>

                    <div class="form-group mg-bt5" >
                        <label class="col-lg-3 control-label">اختر المخزن</label>

                        <label>{$store}</label>
                        <input type="hidden"   name="store" id="store" value="{$productionorder->storeId}"/>


                    </div>

                    <div class="form-group mg-bt5" >
                        <label class="col-lg-2 control-label">الكمية المخرجة</label>
                        <div class="col-lg-3">

                            <input class="form-control numberinput checkedit" type="text" name="outQuantity" id="outQuantity"  value="{$productionorder->outQuantity}"/>


                            <input name="oldOutQuantity"  id="oldOutQuantity" type="hidden" value="{$productionorder->outQuantity}" />
                        </div>
                    </div>





                    <!--<table width="100%"  dir="ltr">
                      <tr align="right">
                        <td style="margin-bottom:20px">
                          <label>{$Unit}</label>
                          <input type="hidden"   name="unitId" id="unitId" value="{$productionorder->measureUnitId}"/>

                           <div id="unitDiv">
                            <select name="unitId" id="unitId" class="select2 wdt300">
                                  <option value="-1"> اختر المنتج اولا</option>
                            </select>
                            </div>
                        </td>
                        <td style="margin-bottom:20px"><label class="sr-only">وحدة القياس</label></td>
                        <td style="margin-bottom:20px">
                         <label>{$product}</label>
                         <input type="hidden"   name="productId" id="productId" value="{$productionorder->productId}"/>

                        </td>
                        <td style="margin-bottom:20px"><label class="sr-only">المنتج</label></td>
                      </tr>
                      <tr align="right">
                        <td>
                        <span class="form-group">
                          <select name="store" id="store" class="select2 wdt300">
                              <option value="-1"> اختر المخزن</option>

                              {foreach $stores as $s}

                              <option
                              {if {$s->storeId}=={$productionorder->storeId}}selected="selected"{/if}
                              value="{$s->storeId}">{$s->storeName}</option>

                              {/foreach}

                            </select>
                          </span>

                       <label>{$store}</label>
                         <input type="hidden"   name="store" id="store" value="{$productionorder->storeId}"/>

                            </td>
                        <td><label class="sr-only">اختر المخزن</label></td>
                        <td>
                            <select name="stage" id="stage" class="select2 wdt300">
                                  <option value="-1"> اختر المرحلة</option>
                              {foreach $stages as $s}
                              <option
                              {if {$s->stageId}=={$productionorder->stageId}}selected="selected"{/if}
                               value="{$s->stageId}"> {$s->stagename} </option>
                              {/foreach}
                        </select>           	  </td>
                        <td><label class="sr-only">المرحلة</label></td>
                      </tr>
                      <tr>
                            <td>

                        </td>
                          <td></td>
                        <td>
                          <input style="float:right" type="text" name="outQuantity" id="outQuantity" class="wdt300 checkedit" value="{$productionorder->outQuantity}"/>
                          <input name="oldOutQuantity"  id="oldOutQuantity" type="hidden" value="{$productionorder->outQuantity}" />
                        </td>
                        <td><label class="sr-only" style="float:right">الكمية المخرجة</label></td>
                      </tr>
                    </table>-->




                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit"  class="btn btn-primary pull-left" id="save" name="save"> تعديل</button>
                        </div>
                    </div>

                    <span style="color:#F00;font-weight:bold;font-size:120%;" > {$msg}</span>

                </form>


            </div>

        </div>



    </div>

</div>









