<?php // $cs = Yii::app()->getClientScript(); ?>
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'Portal-form',
'enableAjaxValidation' => false,
'enableClientValidation' => false,
));
?>
<div class="tab-content">
<div class="tab-pane active">
<ul class="clearfix form-ul material">
<?php echo $form->hiddenField($model, 'id');?>
  
     <li class="col-sm-6">
        <?php echo $form->dropDownList($model,'portal_id',MasPortal::getPortallist(), array('empty' => '--Select--','data-search'=>true, 'class' => 'tooltipster', 'data-label' => 'Portals')); ?>
    </li>
     <li class="col-sm-6">
        <?php echo $form->dropDownList($model,'user_id',User::getUser(), array('empty' => '--Select--','data-search'=>true, 'class' => 'tooltipster', 'data-label' => 'User')); ?>
    </li>
</ul>
</div>

</div>
<div class="modal-footer">
<a href="index.php"></a>

<button type="button" class="btn btn-danger" id="Portal_close" data-dismiss="modal">Close</button>
<?php
    $url = Yii::app()->createUrl('Userportal/Save');
    echo CHtml::ajaxSubmitButton('Save', $url, array(
                'dataType' => 'json',
                'type' => 'post',
                'success' => 'function(data) {
                    $("#loader").hide();
                        if(data.status=="success"){  
                                t8.success("User Portal Saved Successfully!");
                                reloadTable("#tbl_Userportal_details");
                                $("#Portal_close").click();
                                
                        } else { 
                            $("#Portal-form .Portal-save-btn").prop("disabled", false);
                            $("#Portal-form .Portal-save-btn").addClass("btn-theme").removeClass("btn_loding"); 
                            $.each(data, function(key, val) {
                                    $("#Portal-form #"+key+"_em_").text(val).show(); 
                                    t8.error(""+val+""); 
                                }); 
                        } 
                        }',
                'beforeSend' => 'function(){ 
                    $("#loader").show();
                    $("#Portal-form .Portal-save-btn").prop("disabled", true);
                    $("#Portal-form .Portal-save-btn").addClass("btn_loding").removeClass("btn-theme"); 
                    $(".toast8-error").hide();
                }'
                    
        ), array('id' => 'mybtn' . rand(), 'class' => 'Portal-save-btn btn btn-theme'));

?>
</div>
<?php $this->endWidget(); ?>




