
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">{$smarty.const.EXPENSES_REVENUE}</a></li>
            <li><a href="#"> {$smarty.const.REVENUE}</a></li>
            <li class="active">{$smarty.const.ADD_REVENUE}</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h3 class="panel-title">{$smarty.const.ADD_REVENUE}</h3>
            </div>
            <div class="panel-body">
                {literal}
                <form id="incform" class="form-horizontal" action="incomeController.php?do=add" method="post" >
                    <!--validate the form before checking name-->
                    {/literal}

                    <div  {if $Programsettingdata->costcenter eq 0} {else} style="display:none" {/if}>
                        <div class="form-group"   >
                            <label class="col-lg-2 control-label">{$smarty.const.REVENUE_COST_CENTER}</label>
                            <div class="col-lg-4">
                                <select class="select2 wdt100" name="Costcenterid" id="Costcenterid" >
                                    <option value="-1">{$smarty.const.REVENUE_CHOOSE_COST_CENTER}</option>
                                    {foreach $allCostcenter as $myallCostcenter}
                                    <option value="{$myallCostcenter->id}">{$myallCostcenter->name}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                    </div>
                    <div  {if $Programsettingdata->incomeclient eq 0} {else} style="display:none" {/if}>
                        <div class="form-group"   >
                            <label class="col-lg-2 control-label">{$smarty.const.REVENUE_CLIENTS}</label>
                            <div class="col-lg-4">
                                <select class="select2 wdt100" name="clientid" id="clientid" >
                                   <option value="-1">{$smarty.const.REVENUE_CHOOSE_CLIENT}</option>
                                    {foreach $clientsData as $data }
                                    <option value="{$data->clientid}" >{$data->clientname}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-2 control-label">{$smarty.const.REVENUE_MAIN_CLASSIFICATION}</label>
                        <div class="col-lg-4">
                            <select name="parent" id="parent" class="select2 wdt100" required="">
                                <option value="-1" >{$smarty.const.REVENUE_CHOOSE}</option>
                                <option value="0" >{$smarty.const.REVENUE_NO_MAIN_CLASSIFICATION}</option>
                                {foreach $allParents as $parent}
                                <option value="{$parent->incomeTypeId}">{$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.REVENUE_NAME}</label>
                        <div class="col-lg-4">
                            <input type="text" name="name" id="name" class="form-control"/>
                            <div id="nameError" style="display:none;"></div>
                        </div>
                    </div>

                    <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">{$smarty.const.REVENUE_VALUE}</label>
                        <div class="col-lg-4">
                            <input name="Value" id="defaultValue"  type="text" class="form-control numberinput"/>
                            <div id="valueError" style="display:none;"></div>
                        </div>
                    </div>
                    <!--==============================-->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">{$smarty.const.REVENUE_SAFE}</label>
                        <div class="col-lg-4">
                            <span id="spryselect3">
                                <select name="saveid"  id="saveid" class="select2">
                                    <option value="-1">{$smarty.const.REVENUE_CHOOSE_SAFE}</option>
                                    {foreach $allSave as $data}
                                    <option value="{$data->saveid}" >{$data->savename}</option>
                                    {/foreach}
                                </select>
                                <span class="selectInvalidMsg">{$smarty.const.REVENUE_CHOOSE_SAFE}</span></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> {$smarty.const.REVENUE_COMMIT} </label>
                        <div class="col-lg-4">
                            <textarea cols="20" rows="5" name="comment" id="comment" class="form-control"></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.REVENUE_SAVE}</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}