Categories > TinyButStrong general >

Need a little help here's my code & php

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Shawn
Date: 2008-08-03
Time: 19:20

Need a little help here's my code & php

I'm having some problems getting this to work.  The second table is working fine, it's the first table that I'm having real problems with.

Here's the HTML code:

<table width="100%" border="0">
  <tr>
    <td width="21%" class="style12">Total pips:</td>
    <td width="13%" class="style12"></td>
    <td width="28%" class="style12">Win ratio: </td>
    <td width="38%">&nbsp;</td>
  </tr>
  <tr>
    <td class="style12">Number of trades: </td>
    <td class="style12">&nbsp;</td>
    <td class="style12">Average pips per trade: </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td class="style12">Average win: </td>
    <td class="style12">&nbsp;</td>
    <td class="style12">Average loss: </td>
    <td>&nbsp;</td>
  </tr>
</table>
     <BR><BR>
<table width="104%" border="0">
     <tr>
       <td width="100%"><table width="100%" border="1" bordercolor="#ADADAD" style="border-collapse: collapse">
        
         <tr>
           <td width="7%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">#</div></td>
           <td width="9%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Session</div></td>
           <td width="12%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Date</div></td>
           <td width="9%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Pair</div></td>
           <td width="12%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Longshort</div></td>
           <td width="10%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Open</div></td>
           <td width="10%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Close</div></td>
           <td width="7%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Pips</div></td>
           <td width="11%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Trader</div></td>
           <td width="13%" height="25" bgcolor="#E3E1E1" class="style3"><div align="center" class="style9">Notes</div></td>
           </tr>
       [b1;block=begin]   <tr>
           <td height="25" class="style3"><div align="center">[b1.tradenumber]</div></td>
           <td height="25" class="style3"><div align="center">[b1.market]</div></td>
           <td height="25" class="style3"><div align="center">[b1.date]</div></td>
           <td height="25" class="style3"><div align="center">[b1.pair]</div></td>
           <td height="25" class="style3"><div align="center">[b1.longshort]</div></td>
           <td height="25" class="style3"><div align="center">[b1.openprice]</div></td>
           <td height="25" class="style3"><div align="center">[b1.closeprice]</div></td>
           <td height="25" bgcolor="[b1.color]" class="style3" ><div align="center">[b1.pips]</div></td>
           <td height="25" class="style3"><div align="center">[b1.trader]</div></td>
           <td height="25" class="style3"><div align="center">[b1.notes;ope=max:10]</div></td>
         </tr>[b1;block=end]
        
       </table>


Here's the php code:


<?

include_once('tbs_class.php') ;
include_once('tbs_plugin_aggregate.php');

//Connexion to the database
if (!isset($_SERVER)) $_SERVER=&$HTTP_SERVER_VARS ; //PHP<4.1.0
require($_SERVER['DOCUMENT_ROOT'].'/cnx_mysql.php');


//Default value
if (!isset($_GET)) $_GET=&$HTTP_GET_VARS ;
if (isset($_GET['PageNum'])) {
  $PageNum = $_GET['PageNum'] ;
} else {
    $PageNum = 1 ;
}

//Default value
if (isset($_GET['RecCnt'])) {
  $RecCnt = intval($_GET['RecCnt']) ;
} else {
    $RecCnt = -1 ;
}

$PageSize = 9999 ;

$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('tracker_t.html') ;


//Merge the block by page
//$query = "SELECT type, SUM(price) FROM products GROUP BY type";

$RecCnt = $TBS->MergeBlock('b1',$cnx_id,"SELECT * from tblpip WHERE date LIKE '2008-08-__' ORDER BY tradenumber ASC",$PageSize,$PageNum,$CurrRec,$RecCnt) ;



//$TBS->MergeNavigationBar('nv','',$PageNum,$RecCnt,$PageSize) ;
$tpl->Render = TBS_OUTPUT ;
$TBS->Show() ;


?>



By: TomH
Date: 2008-08-03
Time: 22:37

Re: Need a little help here's my code & php

Shawn,

There's no TBS tags shown in the first table - so how is there a problem in that one?

What  are you getting for results?

And what is the problem you are getting -and- what are the errors?



By: Shawn
Date: 2008-08-03
Time: 22:46

Re: Need a little help here's my code & php

I actually figured it out, by running an external script.  Was quite easy once I refreshed myself.  It's been a few years since I'm messed with TBS, php, and mysql.  lol.  I'm a n00b anyway.  Thanks for the response though.  TomH, you're quick on the response!  Glad to see that it's not just skrol responding.  :)