FastTemplate Question
| From: | Angel Behar Rodriguez | Date: | Wed, 22 Nov 2000 20:24:42 +0000 |
| Subject: | FastTemplate Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26700@lists.php.net to get a copy of this message | ||
Hi !!
I'm trying to generate a FastTemplate script and I don't know if I can't
run a php script as a template I mean if I use the following script with
the tables as an html templates works fine, but i write a script (art.php)
wich generate the HTML code for that template but doesn't work, please let
me know if there are a solution for this, thanks in advance.
include "class.FastTemplate.php";
$tpl = new FastTemplate(".");
$tpl->define(array(
"pagina" => "templates/muebles_main.html",
"menu" => "templates/renglones.html",
"arts" => "templates/art.php" <- This script generate the HTML
code for the template --->
));
mysql_pconnect("$DB_SERVER","$DB_LOGIN","$DB_PASS")
or die("No puedo acceder la base de datos consulte al
administrador");
mysql_select_db("$DB") or die("Hay un problema con la seleccion de la
base de datos.");
$result_r=mysql_query("SELECT dpto_desc, dpto_id FROM linea_ropa GROUP
BY dpto_desc ");
while($res_r=mysql_fetch_array($result_r)) {
if (!(trim($res_r['dpto_desc']) =="")) {
$val = $res_r['dpto_id'];
$url ="ropa.php?id=$val";
$tpl->assign("ROPA","ROPA");
$tpl->assign("URL",$url);
$tpl->assign("DEPTO",$res_r['dpto_desc']);
$tpl->parse("RENGLONES_ROPA",".menu");
$tpl->parse("DATOS","arts");
}
}
$result_m=mysql_query("SELECT desc_clase, id_clase, desc_dpto FROM
linea_muebles WHERE id_dpto = '$dpto' GROUP
BY desc_clase ");
while($res_m=mysql_fetch_array($result_m)) {
if (!(trim($res_m['desc_clase']) =="")) {
$valm = $res_m['id_clase'];
$urlm ="clase_muebles.php?dpto=$dpto&clase=$valm";
$tpl->assign("MUEBLES",strtoupper($res_m['desc_dpto']));
$tpl->assign("URL",$urlm);
$tpl->assign("DEPTO",$res_m['desc_clase']);
$tpl->parse("RENGLONES_MUEBLES",".menu");
}
}
$tpl->parse("FINAL","pagina");
$tpl->FastPrint(FINAL);
---------------------------------------------------------------------------
Ing. Angel Behar R. | "The box says : Windows 98, Windows NT or BETTER
Tel : (67) 15-15-15 | That's why I installed FreeBSD"
---------------------------------------------------------------------------