I use the YII Framework and I would like to put the results of a MySQL query in a table in index.php.
The MySQL query is already good:
SELECT categories.name,
systemes.name,
systemes.etat_de_base,
maintenances.name,
maintenances.date,
maintenances.duree
FROM systemes_maintenances
LEFT JOIN systemes
ON systemes_maintenances.id_systemes = systemes.id_systemes
LEFT JOIN categories
ON systemes.id_categories = categories.id_categories
LEFT JOIN maintenances
ON systemes_maintenances.id_maintenances = maintenances.id_maintenances;
And my PHP page looks like this at the moment:
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
?>
<!--<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>
<p>Congratulations! You have successfully created your Yii application.</p>
<p>You may change the content of this page by modifying the following two files:</p>
<ul>
<li>View file: <code><?php echo __FILE__; ?></code></li>
<li>Layout file: <code><?php echo $this->getLayoutFile('main'); ?></code></li>
</ul>
<p>For more details on how to further develop this application, please read
the <a href="http://www.yiiframework.com/doc/">documentation</a>.
Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
should you have any questions.</p>-->
<table>
<caption>État des systèmes</caption>
<tr>
<th>Catégorie</th>
<th>Nom</th>
<th>État actuel</th>
<th>Maintenance prévue</th>
<th>Début de l'incident</th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
I want to display the results in the empty
<td> </ td>
.
Does anyone know how to do it without jQuery?
Since you are using Yii framework you can use CGridView component. This give nice set of features such as sorting, pagination and filtering. Check following link for example usage. http://www.yiiplayground.com/index.php?r=UiModule/dataview/gridView
0 comments:
Post a Comment