Categories > TinyButStrong general >

single it shows Plantilla

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Jesus
Date: 2006-07-11
Time: 21:45

single it shows Plantilla

Hi, I am testing with MySQL meanwhile so that in fact the DB this in Oracle, and another person is in charge to compile the PHP with in PATH of oracle. this it does not generate errors and apparently it works perfectly but single it shows the Template Is this PHP script

<?
include_once("tbs_us/tbs_class.php");
include_once("adodb/adodb.inc.php");
include_once("adodb/drivers/adodb-adodb.inc.php"); // file that contain John Lim's ADOdb function

$conn = NewADOConnection('mysql');
$conn->Connect('localhost', 'root', 'admin', 'new_db');

$tbs = new clsTinyButStrong;
$tbs->LoadTemplate("listar_view.html");

$query = "Select * from empleados";
$rs = tbsdb_adodb_open($conn,$query);

$tbs->MergeBlock("blk1","adodb",$rs);
$tbs->Show();
?>

And this is the Template


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Empleados</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="tbs_us_examples_0styles.css" rel="stylesheet" type="text/css"></head>
<body>
<table border="1" align="center" cellpadding="2" cellspacing="0">
  <tr bgcolor="#CACACA">
    <td width="50"><strong>Registro</strong></td>
    <td width="150"><strong>Cedula</strong></td>
    <td width="50"><strong>Nombre</strong></td>
    <td width="100"><strong>Apellido</strong></td>
    <td width="100"><strong>Departamento</strong></td>
  </tr>
  <tr bgcolor="#F0F0F0">
    <td>[blk1.#]</td>
    <td>[blk1.cedula;block=tr]</td>
    <td>[blk1.nombre;block=tr]</td>
    <td>[blk1.apellido;block=tr]</td>
    <td>[blk1.departamento;block=tr]</td>
  </tr>
  <tr bgcolor="#E6E6E6">
    <td>[blk1.#]</td>
    <td>[blk1.cedula;block=tr]</td>
    <td>[blk1.nombre;block=tr]</td>
    <td>[blk1.apellido;block=tr]</td>
    <td>[blk1.departamento;block=tr]</td>
  </tr>
  <tr bgcolor="#E6E6E6">
    <td colspan="5" bgcolor="#FFCFB9">[blk1;block=tr;nodata]There is no data. </td>
  </tr>
</table>
<p align="center">There are [blk1.#] displayed lines.</p>
</body>
</html>
By: Skrol29
Date: 2006-07-12
Time: 18:40

Re: single it shows Plantilla

Hi Jesus,

I don't understand your problem well, but I can see something wrong in your PHP code.
You should replace :
$query = "Select * from empleados";
$rs = tbsdb_adodb_open($conn,$query);

$tbs->MergeBlock("blk1","adodb",$rs);

With :
$query = "Select * from empleados";

$tbs->MergeBlock("blk1","adodb",$query);

The ADODB database plug-in for TBS (the one which contains the function tbsdb_adodb_open() your are using in your snippet) should be included in your script if it is not yet the case.
By: Jesus
Date: 2006-07-12
Time: 21:30

Re: single it shows Plantilla

Exactly it went what I put myself to change to see that happened and work. It was going to publish the solution but I put myself to think about Making a class that had functions to connect itself to different BD by ejmeplo, conectarse_mysql (), conectarse_oci8 (), etc. The class extend of ADOConnection but the constructor did not leave it, it comments it and it creates my own constructor but the result was a page in white…. Seeing well as well as this him he is better…. for but portability! It badly excuses my English, greetings from Vzla.
$tbs = new clsTinyButStrong;
$tbs->LoadTemplate("listar_view.html");
$query = "Select * from empleados";
$tbs->MergeBlock("blk1","adodb",$query);
$tbs->Show();

Work Fine..!!! thanks my Brother