

<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#"> صرف مصروف</a></li>
            <li><a href="expenseexchange.php?do=show">عرض صرف مصروف </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">

                <input type="hidden" name="searchvalue" id="searchvalue" value="{$Programsettingdata->searchvalue}"/>
                <input type="hidden" name="path" id="path" value="{$path}"/>
                <input name="edit_projectmaterialbill" type="hidden" value="1" id="edit_projectmaterialbill" />
                <input type="hidden" name="expenseexchange" id="expenseexchange" value="1"/>


                {literal}
                <form class="nameToBeChecked form-horizontal" role="form" id="projectoperation_form" action="expenseexchange.php?do=update" method="post"  enctype="multipart/form-data" >

                    {/literal}


                    <div class="row">
                        <div class="col-lg-8">
                            <div class="form-group">
                                <label class="col-lg-3 control-label">رقم التسلسل</label>
                                <div class="col-lg-4">
                                    <input type="text" name="serialno" id="serialno" class="form-control" placeholder="رقم التسلسل" value="{$editelement->serialno}" readonly="">
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4">
                            <div class="form-group mg-bt5">
                                <label for="clientname" class="col-lg-4 control-label">اسم  المشروع</label>
                                <div class="col-lg-8">
                                    <input type="text" name="projectname" id="project_id"   class="select2product wdt100"  data-placeholder="اختر مشروع" required tabindex="301"/>
                                    <input type="hidden" id="edit_hiddenprojectId" name="edit_hiddenprojectId" value="{$projectData->id}"  />
                                    <input type="hidden" id="edit_hiddenprojectName" name="edit_hiddenprojectName" value="{$projectData->name}"  />

                                </div>
                            </div>
                            <!-- end of form-group-->

                        </div>


                        <div class="col-lg-8">
                            <div class="form-group">
                                <label class="col-lg-3 control-label">صرف من</label>
                                <div class="col-lg-4">
                                    <div class="radio-inline">
                                        <label>
                                            <input value="0" class="expensefrom" name="expensefrom" type="radio" {if $editelement->expensefrom == "0"}checked="checked"{/if}>

                                            خزينة  </label>
                                    </div>
                                    <div class="radio-inline">
                                        <label>
                                            <input value="1" class="expensefrom" name="expensefrom" type="radio" {if $editelement->expensefrom == "1"}checked="checked"{/if}>
                                            بنك </label>
                                    </div>
                                    <!--div class="radio-inline">
                                        <label>
                                            <input value="2" class="expensefrom" name="expensefrom" type="radio" {if $editelement->expensefrom == "2"}checked="checked"{/if}>
                                            عهد </label>
                                    </div-->
                                </div>
                            </div>

                        </div>


                        <div class="col-lg-4">
                            <div class="form-group mg-bt5" >
                                <label class="col-lg-4 control-label">مركز التكلفة</label>
                                <div class="col-lg-8">
                                    <input type="text" class="form-control" value="{$projectData->name}" name="costcenterid" id="costcenterid" disabled>
                                </div>
                            </div>
                        </div>

                        <div class="col-lg-8">
                            <!--اختر خزنة-->
                       <!--      <div id="saveDiv" {if $editelement->expensefrom != "0"} style="display: none" {/if}>
                                <div class="form-group mg-bt5">
                                    <label class="col-lg-3 control-label">الخزنة</label>
                                    <div class="col-lg-4">
                                        <select class="select2 wdt100" name="saveid" id="saveid" required>
                                            <option value=""></option>
                                            {foreach $saves as $data}
                                            <option value="{$data->saveid}" {if $data->saveid == $editelement->expenseid}selected="selected"{/if}>{$data->savename}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div> -->


                            {if $searchinonesave == 1}
                            <input type="hidden" name="saveid" id="saveid" value="{$saves}" />
                            {else}
                            <div id="saveDiv" {if $editelement->expensefrom != "0"} style="display: none" {/if}>
                                <div class="form-group mg-bt5">
                                        <label class="col-lg-3 control-label">الخزنة</label>
                                    <div class="col-lg-4">
                                        <select name="saveid" id="saveid" class="select2 wdt100">
                                            <option value=""></option>
                                            {foreach $saves as $data}
                                            <option value="{$data->saveid}" {if $saveid == $data->saveid}selected{/if}>{$data->savename}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div>
                            {/if}

                            <!--اختر بنك-->
                            <div id="bankDiv" {if $editelement->expensefrom != "1"} style="display: none" {/if}>
                                <div class="form-group mg-bt5">
                                    <label class="col-lg-3 control-label">البنك</label>
                                    <div class="col-lg-4">
                                        <select class="select2 wdt100" name="bankid" id="bankid" required>
                                            <option value=""></option>
                                            {foreach $banks as $data}
                                            <option value="{$data->bankid}" {if $data->bankid == $editelement->expenseid}selected="selected"{/if}>{$data->bankname}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <!--اختر عهد-->
                            <!--div id="ohadDiv" {if $editelement->expensefrom != "2"} style="display: none" {/if}>
                                <div class="form-group mg-bt5">
                                    <label class="col-lg-3 control-label">العهد</label>
                                    <div class="col-lg-4">
                                        <select class="select2 wdt100" name="ohadid" id="ohadid" required>
                                            <option value=""></option>
                                            {foreach $binds as $data}
                                            <option value="{$data->id}">{$data->employeeid}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div-->
                        </div>

                        <!-- <div class="col-lg-4">
                            <div class="form-group mg-bt5">
                                <label class="col-lg-4 control-label">نوع المصروف</label>
                                <div class="col-lg-8">
                                    <select class="select2 wdt100" name="expensetype" id="expensetype" required>
                                        <option value=""></option>
                                        {foreach $expenseType as $data}
                                        <option value="{$data->expensestypeid}" {if $data->expensestypeid == $editelement->expensetype}selected="selected"{/if}>{$data->expensestypename}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>

                        </div> -->


                        <div class="col-lg-4">
                            <div class="form-group mg-bt5">
                                <label class="col-lg-4 control-label">نوع المصروف</label>
                                <div class="col-lg-8">
                                    <input type="text" name="expensetype"  class="wdt100" id="expensetype" data-placeholder=" " />
                                    <input type="hidden" id="expensetypeid" value="{$editelement->expensestype}" />
                                    <input type="hidden" id="expensetypetext" value="{$expensetype->expensestypename}" />
                                </div>
                            </div>

                        </div>

                        
                        <div class="col-lg-8">
                            <!--اختر حساب بنكى-->
                            <div id="bankaccountDiv" {if $editelement->expensefrom != "1"} style="display: none" {/if}>
                                <div class="form-group mg-bt5">
                                    <label class="col-lg-3 control-label">الحساب</label>
                                    <div class="col-lg-4">
                                        <select class="select2 wdt100" name="bankaccountid" id="bankaccountid" required>
                                            <option value=""></option>
                                            {foreach $bankAccounts as $data}
                                            <option value="{$data->accountid}" {if $data->accountid == $editelement->expenseid2}selected="selected"{/if}>{$data->accountname}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                       

                        <div class="col-lg-8">
                            <div class="form-group">
                                <label class="col-lg-3 control-label">القيمة</label>
                                <div class="col-lg-4">
                                    <input type="text" name="thevalue" id="thevalue" class="form-control positiveNo" placeholder="القيمة" value="{$editelement->thevalue}" required>
                                </div>
                            </div>

                        </div>

                        <div class="col-lg-4">
                             <div class="form-group" >
                                <label class="col-lg-4 control-label">تاريخ الصرف</label>
                                <div class="col-lg-8">
                                    <input type="text" class="form-control awdatepicker" autocomplete="off"  data-date-format="yyyy-mm-dd" placeholder="تاريخ الصرف" required value="{$editelement->expensedate}" name="expensedate" id="expensedate">
                                </div>
                            </div>
                        </div>


                         <div class="col-lg-12">
                            <div class="form-group">
                                <label for="owner_name" class="col-lg-2 control-label">الصور</label>
                                <div class="col-lg-4">
                                    <input type="file" name="images[]" multiple="" class="form-control" />
                                    <input type="hidden" name="oldimages" value="{$editelement->allimages}" />
                                     {foreach $editelement->allimages as $image}
                                     <img src="../upload/expenseexchange/{$image}" style=" width: 30px;height: 30px;">
                                     {/foreach}
                                </div>
                            </div>    
                        </div>



                        <div class="col-lg-12">
                            <div class="form-group" >
                                <label class="col-lg-2 control-label">تاريخ الصرف</label>
                                <div class="col-lg-10">
                                    <textarea class="form-control" rows="2" name="expenseexcomment">{$editelement->expenseexcomment}</textarea>
                                </div>
                            </div>
                        </div>
                    </div>











                    <input type="hidden" name="editid" id="editid" value="{$editelement->id}"/>
                    <input type="hidden" name="entryid" id="entryid" value="{$editelement->entryid}"/>
                    <!-- =================================================   -->

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <input type="submit"   id="offerprice_save" class="btn btn-primary pull-left" value="تعديل">

                        </div>
                    </div>


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




</div>



<!--{literal}

<script type="text/javascript">
    var name = new Spry.Widget.ValidationTextField("name");
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real");
</script>

{/literal}-->

