pagination in the join data table in the yii.

This is my controler.

public function actionAdmin()

{


	/* fix for search */


	if(isset($_GET['dispId']))


		{


			return $this->actionDView($_GET["dispId"]);


		}


	$model=new Tasks('search');


	$model->unsetAttributes();  // clear any default values


	if(isset($_GET['Tasks']))


		$model->attributes=$_GET['Tasks'];


	


	


	$data = Yii::app()->db->createCommand()


			->select('t.*,e.v_first_name,s.v_status_text')


			->from('tasks t')


			->join('routes r', 'r.b_id=t.b_route_id')


			->join('employee_users e', 'e.b_id=r.b_employee_id')


			->join('status s', 's.b_id=t.b_status_id')


			->where('t.b_status_id !=2 and t.b_status_id !=6 and t.b_status_id !=9 and t.v_status="enable" and r.v_route_status="Active" and r.v_status="enable" and s.v_status != "enable_admin"')


			 ->order(array('t.b_id desc'))


			->limit(200)


			->queryAll();


			//print_r($user);exit;


			//print_r($data);exit;


	//$empname = EmployeeUsers::model()->findAll(array("condition"=>"v_status =  'enable'"));


	//$routs = Yii::app()->db->createCommand()->select(array())->from('routes')->where(array('and',"v_status='enable'"))->order('b_employee_id'." ".'ASC')->queryAll();


	


	$empname = Yii::app()->db->createCommand()


			->select('r.b_id,eu.v_first_name,r.v_route')


			->from('employee_users eu')


			->join('routes r', 'r.b_employee_id=eu.b_id')


			->where('eu.v_status="enable" and r.v_route_status="Active" and r.v_status="enable" ')


			->order(array('eu.b_id ASC'))


			->queryAll();


			


			


	//print_r($empname);exit;		


	//$task = $model->findAll(array("condition"=>"v_status = 'enable' order by b_id asc"));


	$maxloop = Yii::app()->db->createCommand()


			->select('count(b_route_id) as m')


			->from('tasks t')


			->join('status s', 's.b_id=t.b_status_id')


			->where('t.b_status_id !=2 and t.b_status_id !=6 and t.b_status_id !=9  and t.v_status="enable"')


			->group('b_route_id')


			->order(array('m desc'))


			->limit(1)


			->queryAll();


	//print_r($maxloop);exit;


	//echo $maxloop[0]['m'];exit;


	$this->render('admin',array(


		//'model'=>$model,


		'empname'=>$empname,


		//'routs'=>$routs,


		//'task'=>$task,


		'data'=>$data,


		'maxloop'=>$maxloop,


	));


}





//ajax filter status

and this is my model

public function search()

{


	// @todo Please modify the following code to remove attributes that should not be searched.





	$criteria=new CDbCriteria;


	$criteria->compare('b_id',$this->b_id,true);


	$criteria->compare('b_taskperformed_id',$this->b_taskperformed_id,true);


	$criteria->compare('b_route_id',$this->b_route_id,true);


	$criteria->compare('b_status_id',$this->b_status_id,true);


	$criteria->compare('b_payment_id',$this->b_payment_id,true);


	$criteria->compare('b_old_status_id',$this->b_old_status_id,true);


	$criteria->compare('v_dispatch_id',$this->v_dispatch_id,true);


	$criteria->compare('t_task',$this->t_task,true);


	$criteria->compare('create_time',$this->create_time,true);


	$criteria->compare('update_time',$this->update_time,true);


	$criteria->compare('v_status','enable',true);


	$criteria->compare('i_ip',$this->i_ip);


	$criteria->compare('t_note',$this->t_note,true);


	$criteria->compare('b_part1_id',$this->b_part1_id,true);


	$criteria->compare('b_part2_id',$this->b_part2_id,true);


	$criteria->compare('b_part3_id',$this->b_part3_id,true);


	$criteria->compare('b_part4_id',$this->b_part4_id,true);


	$criteria->compare('b_part5_id',$this->b_part5_id,true);


	$criteria->compare('b_part6_static_id',$this->b_part6_static_id,true);


	$criteria->compare('t_part_note',$this->t_part_note,true);


	$criteria->limit =5;





	return new CActiveDataProvider(get_class($this), array(


                    'pagination'=>false,


                    'criteria'=>$criteria,


            ));


}

and this is admin view

<!–<script>

timer(j=14,i=60);

function timer(j,i)

{

//alert(j);


myVar = setInterval(


function() 


{


//	if(i&gt;=0)


	//{


		


		


	//}


	/*if(i==0)


	{


		&#036;('.Timer').text('Page Refreshing...');


		//location.reload(true);


	//&#036;('.Timer').text('');


	}*/


	i--;


	if(i==-1)


	{


		j--;


		timer(j,i=59);


	}


	if(j==0)


	{


		i=0;


	}


	&#036;('.Timer').text(&quot;Time Left : &quot;+pad(j)+':'+pad(i));


	if(j==0)


	{


		//alert(j);


		//setTimeout(function(){location.reload(true);},1000);


		location.reload(true);


	}


	


}, 1000);


//setTimeout(function(){location.reload(true);},900000);


//setTimeout(function(){location.reload(true);},59000);

}

function pad(n) {

return (n &lt; 10) ? (&quot;0&quot; + n) : n;

}

</script>–>

<script type="text/javascript">

setTimeout(function(){location.reload(true);},900000);

$(document).ready(function() {

/*&#036;('#taskupdate').fixheadertable({


     height : 450,


     minWidthAuto : true,


     pager : true


});*/


//&#036;('#taskupdate').dataTable();


/*&#036;('#taskupdate').dataTable( {


    &quot;sScrollY&quot;: &quot;200px&quot;,


	&quot;bPaginate&quot;: false


});*/

});

//$(window).bind("load", function() {

   // code here


   &#036;('.btn-toolbar').css('top','-105px');


   //&#036;('.dataTables_scrollBody').css('height','300px');

//});

function setreturnurl(){

//alert('&lt;?php echo Yii::app()-&gt;request-&gt;url;?&gt;');return false;


&lt;?php Yii::app()-&gt;user-&gt;setState(&quot;taskreturnurl&quot;,Yii::app()-&gt;request-&gt;url);?&gt;

}

</script>

<style>

/*a.lnkdispatch{

color: #0088CC &#33;important;


text-decoration: none;

}

#taskupdate_length{

display:none;

}

#taskupdate_filter{

display:none;

}

.ui-icon{

display:none;

}

#content.container-fluid.btn-toolbar{

position:relative;


float:right;


top:-105px &#33;important;

}*/

.alert{

margin-bottom:0px &#33;important;

}

</style>

<?php

/* @var $this TasksController */

/* @var $model Tasks */

$s = explode(’/’,$_SERVER[‘REQUEST_URI’]);

if(isset($s)){

&#036;sa = isset(&#036;s[6]) ? &#036;s[6] : '12';

}else{

&#036;sa = '12';

}

//echo $sa;

$this->breadcrumbs=array(

'Tasks'=&gt;array('admin'),


'Manage',


'titlecustom'=&gt;'Manage Tasks',

);

$this->menu=array(

array('label'=&gt;'&lt;i class=&quot;icon-plus&quot; style=&quot;vertical-align:text-bottom;&quot;&gt;&lt;/i&gt;&amp;nbsp;Create Tasks', 'url'=&gt;array('create'),'linkOptions'=&gt; array('class' =&gt; 'btn btn-primary')),

);

Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . ‘/js/custom.js’);

?>

<!–<div class="Timer" style="left: -25px;position: relative;text-align: right;top: 20px;">Time Left : 15:00</div>–>

<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/fullcalendar.css" />

<input type="hidden" id="hdnbaseurl" value="<?php echo Yii::app()->request->baseUrl; ?>">

<div style="margin-left: 250px; position: absolute; top: 30px;" >

	&lt;form action=&quot;&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/admin/tasks/admin&quot; method=&quot;get&quot; class=&quot;form-inline&quot;&gt;


	&lt;div class=&quot;form-group&quot;&gt;


&lt;?php


&#036;statuslist = CHtml::listData(Status::model()-&gt;findAll(array(&quot;condition&quot;=&gt;&quot;v_status like  'enable%'&quot;)), 'b_id', 'v_status_text');


//&#036;statuslist = CHtml::listData(Status::model()-&gt;findAll(array(&quot;condition&quot;=&gt;&quot;v_status =  'enable'&quot;)), 'b_id', 'v_status_text');


//&#036;statuslist['0']='All Status';


&#036;statuslist['12']='Current Dispatch';


//echo CHtml::dropDownList('statusname',&#036;sa, &#036;statuslist,array('options' =&gt; array('12'=&gt;array('selected'=&gt;true))));


echo CHtml::dropDownList('statusname',&#036;sa, &#036;statuslist);


//echo CHtml::dropDownList('statusname',&#036;sa, &#036;statuslist,array('empty'=&gt;array('0'=&gt;'All Status')));


?&gt;


			&lt;input type=&quot;search&quot; placeholder=&quot;Dispatchid&quot; name=&quot;dispId&quot; value=&quot;&lt;?=isset(&#036;_GET['dispId']) ? CHtml::encode(&#036;_GET['dispId']) : '' ; ?&gt;&quot; /&gt;


			&lt;input class=&quot;btn btn-primary&quot; type=&quot;submit&quot; value=&quot;Search&quot; /&gt;


	&lt;/div&gt;


	&lt;/form&gt;


	&lt;br&gt;

</div>

<div class="container-fluid">

&lt;div class=&quot;row-fluid&quot;&gt;


	&lt;div class=&quot;span12&quot; style=&quot;margin-top: -75px;&quot;&gt;


		&lt;div id=&quot;statusMsg&quot;&gt;


			&lt;?php


				foreach(Yii::app()-&gt;user-&gt;getFlashes() as &#036;key =&gt; &#036;message) {


					echo '&lt;div class=&quot;alert alert-' . &#036;key . '&quot;&gt;&lt;button class=&quot;close&quot; data-dismiss=&quot;alert&quot;&gt;×&lt;/button&gt;' . &#036;message . &quot;&lt;/div&gt;&#092;n&quot;;


				}


				?&gt;


			&lt;?php if(Yii::app()-&gt;user-&gt;hasFlash('error')):?&gt;


			&lt;?php echo Yii::app()-&gt;user-&gt;getFlash('error'); ?&gt;


			&lt;?php endif; ?&gt;


		&lt;/div&gt;


		&lt;div class=&quot;widget-box widget-calendar&quot;&gt;


			&lt;div class=&quot;widget-title&quot;&gt;


				&lt;span class=&quot;icon&quot;&gt;&lt;i class=&quot;icon-calendar&quot;&gt;&lt;/i&gt;


				&lt;/span&gt;


				&lt;h5&gt;Manage Tasks&lt;/h5&gt;


				&#60;&#33;--&lt;div class=&quot;buttons&quot;&gt; &lt;a id=&quot;add-event&quot; data-toggle=&quot;modal&quot; href=&quot;#modal-add-event&quot; class=&quot;btn btn-success btn-mini&quot;&gt;&lt;i class=&quot;icon-plus icon-white&quot;&gt;&lt;/i&gt; Add new event&lt;/a&gt;


                    &lt;div class=&quot;modal hide&quot; id=&quot;modal-add-event&quot;&gt;


                        &lt;div class=&quot;modal-header&quot;&gt;


                            &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot;&gt;×&lt;/button&gt;


                            &lt;h3&gt;Add a new event&lt;/h3&gt;


                        &lt;/div&gt;


                        &lt;div class=&quot;modal-body&quot;&gt;


                            &lt;p&gt;Enter event name:&lt;/p&gt;


                            &lt;p&gt;


                                &lt;input type=&quot;text&quot; id=&quot;event-name&quot;&gt;


                            &lt;/p&gt;


                        &lt;/div&gt;


                        &lt;div class=&quot;modal-footer&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;btn&quot; data-dismiss=&quot;modal&quot;&gt;Cancel&lt;/a&gt; &lt;a href=&quot;#&quot; id=&quot;add-event-submit&quot; class=&quot;btn btn-primary&quot;&gt;Add event&lt;/a&gt; &lt;/div&gt;


                    &lt;/div&gt;


                &lt;/div&gt;--&#62;


			&lt;/div&gt;


			&lt;div class=&quot;widget-content nopadding&quot;&gt;


				&lt;div class=&quot;panel-left&quot; style=&quot;margin-right: 0px;&quot;&gt;


					&lt;div id=&quot;fullcalendar&quot; class=&quot;fc&quot;&gt;


						&lt;div style=&quot;width: 100%&quot; class=&quot;fc-header&quot;&gt;


							&#60;&#33;--&lt;div&gt;


                                &lt;div class=&quot;fc-header-left&quot;&gt;&lt;span class=&quot;fc-button fc-button-prev fc-state-default fc-corner-left&quot;&gt;&lt;span class=&quot;fc-button-inner&quot;&gt;&lt;span class=&quot;fc-button-content&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fc-button fc-button-next fc-state-default fc-corner-right&quot;&gt;&lt;span class=&quot;fc-button-inner&quot;&gt;&lt;span class=&quot;fc-button-content&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;


                                &lt;div class=&quot;fc-header-center&quot;&gt;&lt;span class=&quot;fc-header-title&quot;&gt;&lt;strong&gt;January 2014&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;


                                &lt;div class=&quot;fc-header-right&quot;&gt;&lt;span class=&quot;fc-button fc-button-month fc-state-default fc-corner-left fc-state-active&quot;&gt;&lt;span class=&quot;fc-button-inner&quot;&gt;&lt;span class=&quot;fc-button-content&quot;&gt;month&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fc-button fc-button-basicWeek fc-state-default&quot;&gt;&lt;span class=&quot;fc-button-inner&quot;&gt;&lt;span class=&quot;fc-button-content&quot;&gt;week&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fc-button fc-button-basicDay fc-state-default fc-corner-right&quot;&gt;&lt;span class=&quot;fc-button-inner&quot;&gt;&lt;span class=&quot;fc-button-content&quot;&gt;day&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;


                            &lt;/div&gt;--&#62;


						&lt;/div&gt;


						&lt;div style=&quot;position: relative; min-height: 1px;&quot; class=&quot;fc-content&quot;&gt;


							&lt;div style=&quot;position: relative; -moz-user-select: none;&quot; class=&quot;fc-view fc-view-month fc-grid&quot; unselectable=&quot;on&quot;&gt;


								&lt;table cellspacing=&quot;0&quot; style=&quot;width: 100%&quot; class=&quot;data-table&quot; id=&quot;taskupdate&quot;&gt;


									&lt;thead&gt;


										&lt;tr class=&quot;fc-first fc-last&quot;&gt;


										&lt;?php //print_r(&#036;empname);exit;


										//echo count(&#036;empname);exit;


										if(count(&#036;empname) &gt; 0){


											for(&#036;i=0;&#036;i&lt;count(&#036;empname);&#036;i++)


											{//echo &#036;empname[&#036;i]-&gt;v_route;exit;


												?&gt;


												&lt;th class=&quot;fc-mon fc-widget-header&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;?php echo &#036;empname[&#036;i]['v_first_name'].'&lt;br/&gt;('.&#036;empname[&#036;i]['v_route'].')';?&gt;&lt;/th&gt;


												&lt;?php 


												&#036;emparrayids[&#036;i]=&#036;empname[&#036;i]['b_id'];


											}	


										}else{


											?&gt;


											&lt;th class=&quot;fc-mon fc-widget-header&quot; style=&quot;font-size: 16px;&quot;&gt;&lt;/th&gt;


											&lt;?php


										}


										?&gt;


										&lt;/tr&gt;


									&lt;/thead&gt;


									&lt;tbody&gt;


									&lt;?php


									for(&#036;m=0;&#036;m&lt;count(&#036;empname);&#036;m++)


									{


										for(&#036;n=0;&#036;n&lt;count(&#036;data);&#036;n++)


										{


											if(&#036;empname[&#036;m]['b_id']==&#036;data[&#036;n]['b_route_id'])


											{


												&#036;col[&#036;m][] = &#036;data[&#036;n]['b_id'].'||||'.&#036;data[&#036;n]['v_dispatch_id'].'|||||'.&#036;data[&#036;n]['v_status_text'].'|||||'.date('m-d-Y',strtotime(&#036;data[&#036;n]['create_time']));


											}


										}												


									}


																		//	unset(&#036;data);





									if(isset(&#036;maxloop[0]['m']))


									{


										for(&#036;j=0;&#036;j&lt;&#036;maxloop[0]['m'];&#036;j++)


										{


									?&gt;


										&lt;tr class=&quot;fc-week1&quot;&gt;


											&lt;?php 


                                            for(&#036;k=0;&#036;k&lt;count(&#036;empname);&#036;k++)


                                            {


                                            ?&gt;


											&lt;td class=&quot;fc-sun fc-widget-content&quot;&gt;


												&lt;div style=&quot;min-height: 80px; min-width: 100px;&quot;&gt;


													&lt;div style=&quot;text-align: center &#33;important; padding: 3px 5px;&quot;&gt;


														&lt;?php 


														if(isset(&#036;col[&#036;k][&#036;j]))


														{


															&#036;temp = explode('|||||',&#036;col[&#036;k][&#036;j]);


															for(&#036;y=0;&#036;y&lt;count(&#036;temp);&#036;y++)


															{


																if(&#036;y==0)


																{


																	&#036;temp1 = explode('||||',&#036;col[&#036;k][&#036;j]);


														?&gt;


														&lt;?php /*?&gt;&lt;a href=&quot;&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/admin/tasks/update/id/&lt;?php echo &#036;temp1[0]; ?&gt;&quot;&gt;&lt;?php echo &#036;temp1[1].&quot;&lt;br/&gt;&quot;; ?&gt;&lt;/a&gt;&lt;?php */?&gt;


														&lt;a onclick=&quot;setreturnurl();&quot; class=&quot;lnkdispatch&quot; href=&quot;&lt;?php echo Yii::app()-&gt;request-&gt;baseUrl; ?&gt;/admin/tasks/view/id/&lt;?php echo &#036;temp1[0]; ?&gt;&quot;&gt;&lt;?php echo &#036;temp1[1].&quot;&lt;br/&gt;&quot;; ?&gt;&lt;/a&gt;


														&lt;?php


																}


																else


																{


																	echo &#036;temp[&#036;y].&quot;&lt;br/&gt;&quot;;


																}


															}


														}


														?&gt;


													&lt;/div&gt;


													&lt;div class=&quot;fc-day-content&quot;&gt;


														&lt;div style=&quot;position: relative; height: 0px;&quot;&gt;&amp;nbsp;&lt;/div&gt;


													&lt;/div&gt;


												&lt;/div&gt;


											&lt;/td&gt;


											&lt;?php 


                                            }


                                            ?&gt;


										&lt;/tr&gt;


										&lt;?php 


										}


										//unset(&#036;col);


									}


									else


									{


									?&gt;


										&lt;tr class=&quot;fc-week1&quot;&gt;


											&lt;td class=&quot;fc-sun fc-widget-content&quot; colspan=&quot;20&quot;&gt;


												&lt;div style=&quot;min-height: 109px;&quot;&gt;


													&lt;div style=&quot;text-align: center &#33;important; padding: 40px;&quot;&gt; No Task Created.&lt;/div&gt;


													&lt;div class=&quot;fc-day-content&quot;&gt;


														&lt;div style=&quot;position: relative; height: 0px;&quot;&gt;&amp;nbsp;&lt;/div&gt;


													&lt;/div&gt;


												&lt;/div&gt;


											&lt;/td&gt;


										&lt;/tr&gt;


									&lt;?php


									}


									?&gt;





									&lt;/tbody&gt;


									





	&lt;/div&gt;


&lt;/div&gt;						

</div>

&lt;/div&gt;


									


									


									


									


									


									


								&lt;/table&gt;


								


								


								


								








								


								


								


								&lt;div style=&quot;position: absolute; z-index: 8; top: 0; left: 0&quot;&gt;&lt;/div&gt;





								


								


								


							&lt;/div&gt;


						&lt;/div&gt;


					&lt;/div&gt;


				&lt;/div&gt;


				&#60;&#33;--&lt;div id=&quot;external-events&quot; class=&quot;panel-right&quot;&gt;


                    &lt;div class=&quot;panel-title&quot;&gt;


                        &lt;h5&gt;Events&lt;/h5&gt;


                    &lt;/div&gt;


                    &lt;div class=&quot;panel-content&quot;&gt;


                        &lt;div class=&quot;external-event ui-draggable label label-inverse&quot; style=&quot;position: relative;&quot;&gt;My Event 1&lt;/div&gt;


                        &lt;div class=&quot;external-event ui-draggable label label-inverse&quot; style=&quot;position: relative;&quot;&gt;My Event 2&lt;/div&gt;


                        &lt;div class=&quot;external-event ui-draggable label label-inverse&quot; style=&quot;position: relative;&quot;&gt;My Event 3&lt;/div&gt;


                        &lt;div class=&quot;external-event ui-draggable label label-inverse&quot; style=&quot;position: relative;&quot;&gt;My Event 4&lt;/div&gt;


                        &lt;div class=&quot;external-event ui-draggable label label-inverse&quot; style=&quot;position: relative;&quot;&gt;My Event 5&lt;/div&gt;


                    &lt;/div&gt;


                &lt;/div&gt;


            &lt;/div&gt;--&#62;


			


			


			


			


			


			


			


			


			


			


			


			





			&lt;/div&gt;


		&lt;/div&gt;


	&lt;/div&gt;


	


	&lt;div class=&quot;row-fluid&quot;&gt;





	


	


	


	


	&lt;/div&gt;


	


	


&lt;/div&gt;


&lt;?php


		//Yii::app()-&gt;clientScript-&gt;registerScriptFile(Yii::app()-&gt;baseUrl . '/js/fullcalendar.min.js');


		//Yii::app()-&gt;clientScript-&gt;registerScriptFile(Yii::app()-&gt;baseUrl . '/js/unicorn.calendar.js');


        ?&gt;

</div>

please tell me how i set the pagination in data table.

Please:

  • only post code that is relevant to your problem, nobody reads the novel you posted

  • use "code" tags when you post code