Display popup

Hello,

In model, I write one query, if data is not match then will display a popup.

how can i do this?

in model, my logic is

$sql="SELECT id,User_id,book_id from Book where book=$book";

		$command=$connection->createCommand($sql);


		list($book_id,$User_id)=$command->queryRow();

if ($book!=$this->book){

Java popup

}

check out this link

in my model, I want to display popup when $books are wrong. Can any one help me how to display popup.

$sql="SELECT id,User_id,book_id from Book where book=$book";

$command=$connection->createCommand($sql);

$row=$command->queryRow();

if ($book!=$this->book){

Java popup

}




//controller

$model=Book::model()->find(array('book'=>':book'),array(':book'=>$book));

$this->render('view',array('model'=>$model));

//in the view

if (!count($model)){

   $this->beginWidget('zii.widgets.jui.CJuiDialog',array('autoOpen'=>true));

  	echo 'no book\'s result from your search.Try to be less specific';

   $this->endWidget();

}else{

   //display the book details

   print_r($model);

} 			             						

here you can find more options for your dialog