hey guys, im new to programming and i wanted to start with yii… what im trying to do is to get a data from database and i was watching tutorials on how to use yii. but im not clear about getting an specific data from a table in the database… i googled on php about getting the data and i tried bunch of the ways but not clue how to get it… this is my controller
<?php
class ReporteController extends Controller
{
//Direccion del diseno
public $layout='//reporte/layouts/column1';
public function actionIndex()
{
//se implementa la libreria PDF para generar la pagina en PDF
$mPDF1 = Yii::app()->ePdf->mpdf();
//Se incluye el diseno css en el archivo pdf
$stylesheet = file_get_contents(Yii::getPathOfAlias('webroot.css') . '/reporte/presentacion.css');
$stylesheet = file_get_contents(Yii::getPathOfAlias('webroot.css') . '/reporte/header_hidro.css');
$mPDF1->WriteHTML($stylesheet, 1);
/*
* Creando el contenido de la pagina PDF
*/
$mPDF1->SetHTMLHeader($this->render('header',array(), true));
$mPDF1->WriteHTML(CHtml::image(Yii::getPathOfAlias('webroot.css') . '/reporte/hidrolab_logo.jpg'));
$mPDF1->WriteHTML($this->render('presentacioncot', array('nombre'=>$nombre, 'direccion'=>$direccion), true));
$mPDF1->AddPage();
$mPDF1->WriteHTML($this->render('presentacioncot', array(), true));
$mPDF1->OutPut();
//$this->render('presentacioncot', array('reporte'=>$reporte));
}
}
and this is my view:
<html>
<p div align='right'> <?php echo date('d-F-Y')?> <?php echo $direccion; ?></p>
<p>Señores:</p>
<p class="izquierda"><b><?php echo $nombre;?></b></p>
<p class="izquierda"><?php echo $direccion; ?></a>
<p class="derecha">Atn: <?php echo $contacto; ?></p>
<p class="derecha">Ref:'Iniciales de la empresa'-'N° de departamento'-'N° de contizacion para esta empresa'-'año'</p>
<p>Estimados Señores:</p>
<p>Por medio de la presente nos es grato dirigirnos a Uds., para presentarles nuestra mejor <b>CONTRATO OFERTA </b>por los servicios 'SERVICIOS' de sus Instalaciones ubicadas en <?php echo $direccion; ?>. </p>
<p>Cabe a destacar que nuestro laboratorio esta registrado ante 'organizacion'.</p>
<p>Sin otro particular a que hacer referencia y quedando a la orden para cualquier aclaratoria adicional, nos suscribimos de ustedes.</p>
<p class="centro">Atentamente</p>
<p class="centro">Por, <b>HIDROLAB TORO CONSULTORES C.A</b></p>
<p style="text-align:center">'Coordinador de agua y desechos'||'Jefe del departamento de Ventas'</p>
</html>
it might seem to be uncomplete and its because of many times of tries… please tell me how to get data from database
example: get nombre from table cotizacion