
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">{$smarty.const.EXPENSES_REVENUE}</a></li>
            <li><a href="#">{$smarty.const.INCOME_EDIT}</a></li>
            <li class="active"> {$smarty.const.INCOME_TYPE_EDIT} </li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title"> {$smarty.const.INCOME_TYPE_EDIT}</h3>
            </div>
            <div class="panel-body">
                {literal}
                <form id="incform" class="form-horizontal" action="incomeTypeController.php?do=update" method="post" >
                    <!--validate the form before checking name-->
                    {/literal}
                    <input type="hidden" name="incomeTypeId" id="incomeTypeId" value="{$id}" />
                    <div class="form-group">
                        <label class="col-lg-2 control-label">{$smarty.const.INCOME_TYPE_MAIN_CLASSIFICATION}</label>
                        <div class="col-lg-4">
                            <select name="parent" id="parent" class="select2 wdt100">
                                <option value="0">{$smarty.const.INCOME_TYPE_NO_MAIN_CLASSIFICATION}</option>
                                {foreach $allParents as $parent}
                                <option value="{$parent->incomeTypeId}"  {if $incomeType->incomeTypeId == $parent->incomeTypeId}  selected="selected" {/if} > {$parent->incomeTypeName}</option>
                                {/foreach}
                            </select>
                            <div id="parentError" style="display:none;"></div>
                        </div>
                    </div>

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

                    <div class="form-group">
                        <label class="col-lg-2 control-label">{$smarty.const.INCOME_TYPE_NAME}</label>
                        <div class="col-lg-4">
                            <input type="text" name="name" id="name" class="form-control" value="{$incomeType->incomeTypeName}"/>
                            <input type="hidden" name="oldname" id="oldname" class="form-control" value="{$incomeType->incomeTypeName}"/>
                            <div id="nameError" style="display:none;"></div>
                        </div>
                    </div>

                    <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">{$smarty.const.INCOME_TYPE_DEFAULT_VALUE}</label>
                        <div class="col-lg-4">
                            <input name="defaultValue" required="required" id="defaultValue" type="text" class="form-control numberinput" value="{$incomeType->defaultValue}"/>
                            <div id="valueError" style="display:none;"></div>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">{$smarty.const.INCOME_TYPE_OTHER_DETAILS}</label>
                        <div class="col-lg-4">
                            <textarea cols="20" rows="5" name="descripe" id="descripe" class="form-control">{$incomeType->incomeTypeDetails}</textarea>
                        </div>
                    </div>

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

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button" id="saveIncBtn" class="btn btn-primary pull-left">{$smarty.const.INCOME_TYPE_EDIT}</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{literal}
<script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
</script> {/literal}