Example #1
0
?>
 
<b>From :</b>
<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'from_date', 'value' => Yii::app()->request->cookies['from_date']->value, 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd'), 'htmlOptions' => array('style' => 'height:20px;')));
?>
<b>To :</b>
<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'to_date', 'value' => Yii::app()->request->cookies['to_date']->value, 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd'), 'htmlOptions' => array('style' => 'height:20px;')));
echo CHtml::submitButton('Go');
$this->endWidget();
?>
 

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'job-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'image', 'header' => 'Image', 'type' => 'html', 'value' => 'Job::showImage($data->id)', 'filter' => false), title, description, array('name' => 'user_id', 'header' => 'Posted By (Grown Up)', 'type' => 'html', 'value' => 'Job::searchUser($data->user_id)', 'filter' => CHtml::listData(User::getAllUserExceptAdmin(1), 'id', 'name')), array('name' => 'kid_id', 'header' => 'Assigned To (Kid)', 'type' => 'html', 'value' => 'Job::searchKid($data->kid_id)', 'filter' => CHtml::listData(Kid::getAllKidsInDropDown(1), 'id', 'name')), array('name' => 'created_on', 'header' => 'Date Posted', 'type' => 'html', 'filter' => false), array('name' => 'status', 'header' => 'status', 'type' => 'html', 'value' => 'Job::getJobStatus($data->id)', 'filter' => false))));
?>


<script type="text/javascript">
/*<![CDATA[*/
jQuery(function($) {

   jQuery(".activate").on('click',function(){
   
			   jQuery.ajax({
			      type:'POST',
				  url: 'backend.php?r=rights/user/approve',
				  data : {userid : $(this).attr('data-id')  }
			    }).done(function(response){
		     alert(response);