
<div id="newasset"  style="display:none" >
    {foreach $allassets as $newx}
    <option value="{$newx->assetId}">{$newx->assetsName}</option>
    {/foreach}
</div>
<div id="newemp" style="display:none">
    {foreach $allemp as $new}
    <option value="{$new->employeeId}">{$new->employeeName}</option>
    {/foreach}
</div>
<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="workstationController.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="workstation" id="workstation"   placeholder="اسم  المركز" class="form-control" value="" />
                                <span class="textfieldRequiredMsg">***.</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="addwork" id="addwork" 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="wdt400">اسم العمال</th>
                                        <th  class="wdt200">عدد الساعات </th>
                                        <th  class="wdt200" >الكفاءه %</th>
                                        <th>حذف</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>
                                            <div id="choose1"><span id="employeespry1">
                                                    <select class="select2 wdt300 " name="workname1" id="workname1" >
                                                        <option value="-1">اختر عامل</option>


                                                        {foreach $allemp as $new}


                                                        <option value="{$new->employeeId}">{$new->employeeName}</option>


                                                        {/foreach}


                                                    </select>
                                                    <span class="selectInvalidMsg">***.</span><span class="selectRequiredMsg">***.</span></span></div>
                                        </td>
                                        <td>
                                            <div id="workhours">
                                                <input type="text" name="hours1" id="hours1" value=""  class="form-control getprototal  numberinput txt-nonraduis workerhour" required onkeypress="return isNumberKey(event)" />
                                            </div>
                                        </td>
                                        <td>
                                            <div id="workefficency">
                                                <input type="text" name="efficency1" id="efficency1" class="form-control getprototal  numberinput txt-nonraduis workerhour effx" required onKeyPress="return isNumberKey(event)"/>
                                            </div>
                                        </td>
                                        <td id="1">
                                            <button id="remove1" name="remove1" type="button" class="close flt-none removeicon removework" aria-hidden="true">&times;</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>


                            <input type="hidden" name="stationitr" id="stationitr" value="1"/>
                            <button type="button" class="btn btn-primary pull-left ft-nor"> إجمالي عدد الساعات للعمال <span class="badge wht-clo"><div id="totalworkerhour"></div></span></button>
                            <input type="hidden" name="totalworkerhour1" id="totalworkerhour1" value="0"/>
                        </div>
                    </div>
                    <!-------------assets------------>
                    <div class="row">
                        <div class="row">
                            <hr/>
                            <div class="col-lg-6">
                                <h4> الاصول</h4>
                            </div>
                            <div class="col-lg-6">
                                <button type="button" name="addasset" id="addasset" class="btn btn-primary pull-left ft-nor"> اضافة جديد</button>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table class="table billtable table-bordered table-black" id="containerassets">
                                <thead>
                                    <tr>
                                        <th class="wdt400"> اسم الاله</th>
                                        <th  class="wdt200">عدد الساعات </th>
                                        <th  class="wdt200" >الكفاءه %</th>
                                        <th>حذف</th>

                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>
                                            <div id="chooseasset1"><span id="assetspry1">
                                                    <select class="select2 wdt300" name="asset1" id="asset1" >
                                                        <option value="-1">اختر اله</option>
                                                        {foreach $allassets as $new}
                                                        <option value="{$new->assetId}">{$new->assetsName}</option>
                                                        {/foreach}
                                                    </select>
                                                    <span class="selectInvalidMsg">***.</span><span class="selectRequiredMsg">***.</span></span></div>
                                        </td>
                                        <td>
                                            <div id="assethours">
                                                <input type="text" name="whour1" id="whour1"  class="form-control getprototal  numberinput txt-nonraduis assethour" required onkeypress="return isNumberKey(event)" />
                                            </div>
                                        </td>
                                        <td>
                                            <div id="assetefficency">
                                                <input type="text" name="wefficency1" id="wefficency1"  class="form-control getprototal  numberinput txt-nonraduis assethour effasset" onblur="xx();" required onkeypress="return isNumberKey(event)"/>
                                            </div>
                                        </td>
                                        <td id="x1">
                                            <button id="wremove1" type="button" class="close flt-none removeicon removeasset" aria-hidden="true">&times;</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>


                            <!-- end of second row-->

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


            </div>
        </div>
        {literal}
        <script>
            function isNumberKey(evt)
            {
                var charCode = (evt.which) ? evt.which : event.keyCode
                if (charCode > 31 && (charCode < 48 || charCode > 57))
                    return false;

                return true;
            }
            var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn: ["blur", "change"]});

        </script>

        {/literal}

