<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'editinventoryupload-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-4">
                    <?php echo CHtml::textField('product_id',$model['category_det']['product_category'],array('data-label'=>'Category','readonly'=>'true')); ?>
                </li>
    			<li class="col-sm-4">
                    <?php echo CHtml::textField('product_id',$model['product_det']['model_no'],array('data-label'=>'Model No','readonly'=>'true')); ?>
                </li>
    			<li class="col-sm-4">
                    <?php echo CHtml::textField('product_id',$model['product_det']['gmc_code'],array('data-label'=>'GMC','readonly'=>'true')); ?>
                </li>
    			<li class="col-sm-4">
                    <?php echo $form->textField($model, 'total_quantity',array('data-label'=>'Quantity <span style="color:red">*</span>','data-validation'=>'required')); ?>
                </li> 
    		</ul>
        </div>
      
    </div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" id="editinventoryupload_close" data-dismiss="modal">Close</button>
        <?php
                $url = Yii::app()->createUrl('inventoryupload/SaveEdittedInventory');
                echo CHtml::ajaxSubmitButton('Save', $url, array(
                            'dataType' => 'json',
                            'type' => 'post',
                            'success' => 'function(data) {
                                $("#loader").hide();
                                    if(data.status=="success"){  
                                        t8.success("Quantity Updated Successfully!");
                                        $("#editinventoryupload_close").click();
                                        reloadTable("#tbl_view_inventoryupload_details");
                                    } else { 
                                        $("#editinventoryupload-form .editinventoryupload-save-btn").prop("disabled", false);                      
                                        $("#editinventoryupload-form .editinventoryupload-save-btn").addClass("btn-theme").removeClass("btn_loading"); 
                                        $.each(data, function(key, val) {
                                            t8.error(""+val+""); 
                                        }); 
                                    } 
                            }',
                            'beforeSend' => 'function(){ 
                               $("#loader").show();
                               $(".toast8-error").hide();
                               $("#editinventoryupload-form .editinventoryupload-save-btn").prop("disabled", true);                      
                               $("#editinventoryupload-form .editinventoryupload-save-btn").addClass("btn_loading").removeClass("btn-theme"); 
                                
                            }'
                            
                                
                    ), array('id' => 'mybtn' . rand(), 'class' => 'editinventoryupload-save-btn btn btn-theme'));
           
    ?>
    </div>
<?php $this->endWidget(); ?>




