<?php // $cs = Yii::app()->getClientScript(); ?>
 
<?php
 
$form = $this->beginWidget('CActiveForm', array(
 
    'id' => 'project-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, 'project_name',array('data-label'=>'Project Name *','data-validation'=>'required')); ?>
 
 
                </li>

                  <li class="col-sm-6">
 
                    <?php echo $form->textField($model, 'ftp_address',array('data-label'=>'Ftp Address *','data-validation'=>'required')); ?>

 
                </li>

                 </li>

                  <li class="col-sm-6">
 
                    <?php echo $form->textField($model, 'ftp_username',array('data-label'=>'Ftp Username *','data-validation'=>'required')); ?>

 
                </li>
                 </li>

                  <li class="col-sm-6">
 
                    <?php echo $form->textField($model, 'ftp_password',array('data-label'=>'Ftp Password *','data-validation'=>'required')); ?>

 
                </li>

                 </li>

                  <li class="col-sm-6">
 
                    <?php echo $form->textField($model, 'ftp_port',array('data-label'=>'Port No *','data-validation'=>'required')); ?>

 
                </li>

                  <li class="col-sm-6">
 
                    <?php echo $form->textField($model, 'github_repo',array('data-label'=>'Github',)); ?>

 
                </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('/projects/Save');
               
                echo CHtml::ajaxSubmitButton('Save', $url, array(
 
                            'dataType' => 'json',
 
                            'type' => 'post',
 
                            'success' => 'function(data) {
 
                                    $("#loader").hide();
                                    if(data.status=="success"){  
 
                                         t8.success("Saved Successfully!");
 
                                        {
                                         $(".x.close").click();
                                         reloadTable("#tbl_projects");
                                         }
 
                                    } else {
 
                                        $("#project-form .projects-save-btn").prop("disabled", false);                      
                                        $("#project-form .projects-save-btn").addClass("btn-theme").removeClass("btn_loding");
                                        $.each(data, function(key, val) {
 
                                                $("#project-form #"+key+"_em_").text(val).show();
 
                                                t8.error(""+val+"");
 
                                            });
 
                                    }
 
                            }',
 
                            'beforeSend' => 'function(){
                                $("#loader").show();
                                $("#project-form .projects-save-btn").prop("disabled", true);                      
                                $("#project-form .projects-save-btn").addClass("btn_loding").removeClass("btn-theme");
                                $(".toast8-error").hide();
                            }'
                               
 
                    ), array('id' => 'mybtn' . rand(), 'class' => 'projects-save-btn btn btn-theme'));
 
       
 
    ?>
 
 
 
    </div>
 
<?php $this->endWidget(); ?>