CGridView - embed sound file in page body if row meets certain criteria

Hi folks,

I have created a web app that has a background process that updates a table in the database with numerical information. In the frontend, I plan on using CGridView to display information, which will include a calculated field. This page will be automatically refresh at set intervals by JS, displaying the latest information/calculations. What I am looking for is to have a sound file alert if one or more of the calculated fields meets a certain criteria.

I have done this before by handing coding the SQL query and (PHP) frontend (in my pre-framework days), and this was relatively simple as I simply had a boolean value set to TRUE if one of the rows matched the criteria and, further down the script, had PHP echo HTML to embed a sound file if the boolean was set to TRUE. However, I cant see a way to do this using CGridView.

Anyone got any suggestions?

Regards,

U4EA

I have a complete widget for generating sound in a web page, including file conversion, but I can not give it all for free.

Here is the view which should be helpfull.


<audio<?php

    echo " id={$this->id}";

    //echo $this->autostart?' autostart':'';

    echo $this->autoplay?' autoplay':'';

    echo $this->controller?' control':'';

    echo $this->loop?' loop':'';

    //echo $this->preload?' preload':'';

    ?>>

    <source src="<?php echo $this->mp3;?>" type="audio/mpeg">

    <source src="<?php echo $this->ogg;?>" type="audio/ogg">

    <source src="<?php echo $this->wav;?>" type="audio/wav">

    <source src="<?php echo $this->aiff;?>" type="audio/x-aiff">

    <object>

        <param name="autostart" value="<?php echo $this->autoplay?'true':'false';?>">

        <param name="src" value="<?php echo $this->mp3;?>">

        <param name="autoplay" value="<?php echo $this->autoplay?'true':'false';?>">

        <param name="controller" value="<?php echo $this->controller?'true':'false';?>">

        <embed src="<?php echo $this->mp3;?>" controller="<?php echo $this->controller?'true':'false';?>" autoplay="<?php echo $this->autoplay?'true':'false';?>" autostart="<?php echo $this->autoplay?'true':'false';?>" type="audio/mpeg"></embed>

    </object>

</audio>