<?php $cs = Yii::app()->getClientScript(); ?>
<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'date-form',
    'enableAjaxValidation' => false,
    'enableClientValidation' => false,
    ));
$baseUrl = Yii::app()->baseUrl;
 ?>
<ul class="clearfix form-ul material">
   
                <li class="col-sm-3">
                    <?php echo $form->hiddenField($model,'id');?>
                    <?php echo $form->textField($model, 'expected_delivery_date', array('class' => 'datepicker','data-label'=>'Date <span style="color:red;">*</span>')); ?>
                    <input type="hidden" name="frm" id="frm" value="<?php echo $frm;?>">
                </li>
                <li class="col-sm-9">
                    <?php echo $form->textArea($model, 'notes', array('class' => '','data-label'=>'Remarks')); ?>
                </li>
</ul>


     <div class="modal-footer">
         <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
        <?php  $url = Yii::app()->createUrl('purchasingorder/updatedeliverytracker');
        echo CHtml::ajaxSubmitButton('Update', $url, array(
                            'dataType' => 'json',
                            'type' => 'post',
                            'success' => 'function(data) {
                                var frm= $("#frm").val();
                                    if(data.status=="success"){  
                                        t8.success("Delivery tracker saved successfully!");
                                        $("#loader").hide();
                                        $(".x.close").click();
                                        if(frm =="cockpit"){
                                            loadReport(5);
                                        }else{
                                            reloadTable("#tbl_order_details");
                                        }
                                    } else { 
                                        $("#loader").hide();
                                        t8.error("Date Cannot Blank!"); 
                                           
                                    } 
                            }',
                            'beforeSend' => 'function(){
                                $("#loader").show();
                                $(".errorMessage").hide(); 
                                }',
                            
                                
                    ), array('id' => 'mybtn' . rand(), 'class' => 'order-save-btn btn btn-theme'));
                

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