<div id="opername" style="display:none">
    {foreach $alloperation as $operation}
    <option value="{$operation->settingOperationID}">{$operation->settingOperationName}</option>
    {/foreach}
</div>
<!-- DropDownList for Workstation -->

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <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">
                {literal}
                <form class="form-horizontal " role="form" action="stageController.php?do=add"  method="post" id="addform" >
                    {/literal}

                    <div class="form-group">
                        <label for="stagename" class="col-lg-2 control-label">اسم المرحله</label>
                        <div class="col-lg-4"><span id="sprytextfield1">
                                <input type="text" name="setoperation" id="setoperation"   placeholder="اسم  المرحله" class="form-control" value="" />
                                <span class="textfieldRequiredMsg">***.</span></span>
                            <input type="hidden" name="stageid" id="stageid" value="{$loadstage->stageId}"/>
                        </div>
                    </div>

                    <!-- =================================================   -->

                    <div class="form-group">
                        <label for="productName" class="col-lg-2 control-label">اسم المنتج</label>
                        <div class="col-lg-4"><span id="productspry1">
                                <select class="select2 wdt300 " name="productname" id="productname">
                                    <option value="-1"> اختر منتج </option>
                                    {foreach $allproduct as $product}
                                    <option value="{$product->productId}">{$product->productName}</option>
                                    {/foreach}

                                </select>
                                <span class="selectInvalidMsg">***.</span><span class="selectRequiredMsg">***.</span></span></div>
                    </div>
                    <!-- =================================================   -->


                    <div class="row">
                        <div class="row">
                            <hr/>
                            <div class="col-lg-6">
                                <h4>العمليات</h4>
                            </div>
                            <div class="col-lg-6">
                                <button type="button" name="addoperation" id="addoperation" class="btn btn-primary pull-left ft-nor"> اضافة جديد</button>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table billtable table-bordered table-black" id="containerpros">
                                <thead>
                                    <tr>
                                        <th  class="wdt200">رقم العمليه</th>
                                        <th class="wdt400">اسم العمليه</th>
                                        <th  class="wdt200">عدد الساعات </th>
                                        <th>حذف</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td><div id="number1">1</div>
                                            <input type="hidden" name="no1" id="no1" value="1"/>
                                        </td>
                                        <td>
                                            <div id="operat1"><span id="operatspry1">
                                                    <select class="select2 wdt300" name="oprationname1" id="oprationname1"  onchange="operationhour(this.value, 1);" >
                                                        <option value="-1">اختر عمليه</option>
                                                        {foreach $alloperation as $operation}
                                                        <option value="{$operation->settingOperationID}">{$operation->settingOperationName}</option>
                                                        {/foreach}
                                                    </select>
                                                    <span class="selectInvalidMsg">***.</span><span class="selectRequiredMsg">***.</span></span></div>
                                        </td>
                                        <td>
                                            <div id="operhours1">

                                                <input type="text" name="hours1" id="hours1"  class="form-control getprototal  numberinput txt-nonraduis settinghour" readonly />

                                            </div>
                                        </td>

                                        <td id="1" data-id="delno1">
                                            <button id="remove1" type="button" class="close flt-none removeicon removeoperation" aria-hidden="true" >&times;</button>
                                        </td>

                                    </tr>
                                </tbody>
                            </table>

                            <input type="hidden" name="operationitr" id="operationitr" value="1"/>
                            <button type="button" class="btn btn-primary pull-left ft-nor"> إجمالي عدد الساعات للعمليات <span class="badge wht-clo"><div id="totaloperationhourx"></div></span></button>
                            <input type="hidden" name="totaloperationhour1" id="totaloperationhour1" value=""/>
                        </div>
                    </div>
                    </hr>
                    <div class="row" >
                        <button type="submit" id="save" class="btn btn-primary">حفظ</button>
                    </div>
                </form>


                {literal}
                <script>
                    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn: ["blur", "change"]});

                    var productspry1 = new Spry.Widget.ValidationSelect("productspry1", {invalidValue: "-1"});
                </script>
                {/literal}