<?php // $cs = Yii::app()->getClientScript(); ?>
 
<?php
 
$form = $this->beginWidget('CActiveForm', array(
 
    'id' => 'expensetype-form',
 
    'enableAjaxValidation' => false,
 
    'enableClientValidation' => false,
 
    ));
 
?>
 
    <div class="tab-content">
 
        <div class="tab-pane active">
 
           
 
                   <ul class="clearfix form-ul material">
 
               
 
                <li class="col-sm-6">
                            <input type="hidden" name="from" id="from" value="<?php echo $from; ?>">
 
                    <?php echo $form->hiddenField($model, 'id');?>
 
                    <?php echo $form->textField($model, 'expense_type',array('data-label'=>'Expense Type *','data-validation'=>'required')); ?>
 
                    <?php echo $form->error($model,'expense_type'); ?>
 
                </li>
                  <li class="col-sm-6">
 
                    <?php echo $form->textField($model, 'account_no',array('data-label'=>'Account Number *','data-validation'=>'required')); ?>
 
                    <?php echo $form->error($model,'account_no'); ?>
 
                </li>
             <!--    <li class="col-sm-6">
                          <?php //echo $form->dropdownList($model, 'isDefault',array('N'=>'No','Y'=>'Yes'),array('data-label'=>'Is default?')); ?>
                          <?php //echo $form->error($model,'isDefault'); ?>
                      </li> -->
            </ul>
 
        </div>
 
     
 
    </div>
 
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
 
        <?php
                $url= Yii::app()->createUrl('/masexpensetype/SaveExpenseType');
               
                echo CHtml::ajaxSubmitButton('Save', $url, array(
 
                            'dataType' => 'json',
 
                            'type' => 'post',
 
                            'success' => 'function(data) {
 
                                    $("#loader").hide();
                                    if(data.status=="success"){  
 
                                         t8.success("Expense Type Saved Successfully!");
 
                                         if(data.from != ""){
                                                loadPopupModal(data.from+"/create&masexpensetype="+data.id,"Add New Expense Type","lg");
                                         }else{
                                             $(".x.close").click();
                                         reloadTable("#tbl_expense_type");
                                         }
 
                                    } else {
 
                                        $("#masexpensetype-form .masexpensetype-save-btn").prop("disabled", false);                      
                                        $("#masexpensetype-form .masexpensetype-save-btn").addClass("btn-theme").removeClass("btn_loding");
                                        $.each(data, function(key, val) {
 
                                                $("#masexpensetype-form #"+key+"_em_").text(val).show();
 
                                                t8.error(""+val+"");
 
                                            });
 
                                    }
 
                            }',
 
                            'beforeSend' => 'function(){
                                $("#loader").show();
                                $("#masexpensetype-form .masexpensetype-save-btn").prop("disabled", true);                      
                                $("#masexpensetype-form .masexpensetype-save-btn").addClass("btn_loding").removeClass("btn-theme");
                                $(".toast8-error").hide();
                            }'
                               
 
                    ), array('id' => 'mybtn' . rand(), 'class' => 'masexpensetype-save-btn btn btn-theme'));
 
       
 
    ?>
 
 
 
    </div>
 
<?php $this->endWidget(); ?>