I've modified my website so that I can get dynamic data into an article. (this is a joomla site).
Formerly, the website visitor accessed the data via a form with a drop-down menu. I've decided it is better to create individual pages for each dataset.
SO... I was successful in modifying the php in the form so that it now generates a table for a specific set of data. This way, I don't need the form. (Note that in the code below, I inserted "CPFX" so as to pull up only the CPFX dataset).
But there are two issues I'd like to clean up:
The code pulls up the first row (the header) of the table. Normally this would be fine, however because I'm using Joomla and will be translating the headers, I want to publish the table contents without a header row.
The code still contains "form" elements. What code can I safely remove, in my efforts to clean it up?
I will deeply appreciate any help.
Thanks!
note: style definitions in the code below are deleted to save space in this post.
<form method= POST action = "">
<?php
@ include ('DBconnect.php');
$T1='CTF';
$_POST['T1']='CPFX';
?>
<p><br></p>
<h2> <span style="color: rgb(0, 0, 0);" mce_style="color: #000000;"><span style="color: rgb(128, 0, 0);" mce_style="color: #800000;">Note: No program listed with AscentFX is available to US Investors</span></span></h2>
<h2><font color="#0A3300"><span id="result_box" class="short_text" lang="en">
<span title="Cliquer ici pour voir d'autres traductions" class="hps">click</span>
<span title="Cliquer ici pour voir d'autres traductions" class="hps">a</span>
<span title="Cliquer ici pour voir d'autres traductions" class="hps">graph</span>
<span title="Cliquer ici pour voir d'autres traductions" class="hps">to</span>
<span title="Cliquer ici pour voir d'autres traductions" class="hps">see</span>
<span title="Cliquer ici pour voir d'autres traductions" class="hps">details</span>
<span title="Cliquer ici pour voir d'autres traductions" class="hps">below</span></span></font></h2>
<p> </p>
<div style="position: relative; overflow: auto;" class="mceItemVisualAid" mce_style="position:relative; overflow:auto;"> </div><!--table start here--><mce:style type="text/css"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style><mce:style type="text/css" mce_bogus="1"></mce:style>
<mce:style type="text/css" mce_bogus="1"></mce:style><style type="text/css" mce_bogus="1"></style>
<div height=100%>
<?php
$sql= ("select * from program group by program");
$req1= mysql_query($sql);
$pr="";
while ($val1= mysql_fetch_array($req1)) {
$nom= $val1['program'];
if (isset($_POST[$nom])) { $pr .= $nom." - "; }
}
if (isset ($_POST['T10'])){
$T10= $_POST['T10'];
$S1= $_POST['S1'];
$T2=$_POST['T2'];
$T3= $_POST['T3'];
$T4=$_POST['T4'];
$T5=$_POST['T5'];
$sql= "Insert into subscribe values ('$T10','$T2','$T3','$T4','$T5','$S1','$pr')";
mysql_query($sql) or die (mysql_error());
$message= "Name: ".$T10."
"."E-mail: ".$T2."
"."Requests: ".$S1."
"."City: ".$T3."
"."State: ".$T4."
"."Country: ".$T5."
"."Selected programs: ".$pr;
$TO = "relay@ascentfx.com";
$h = "From: " . $T2;
$subject= "Ascentfx - New submission from Accounts!";
mail($TO, $subject, $message, $h);
}
$sql= ("SELECT distinct program FROM program");
$request= mysql_query($sql);
while ($data= mysql_fetch_array($request)) {
?>
<?php
}
?>
</table>
</div>
<p>Regards<br><img alt="" src="http://www.ascentfx.com/images/stories/signaturelogo.jpg" mce_src="/images/stories/signaturelogo.jpg"></p>
</form>
<?php
$description="";
if ((isset ($_POST['T1']))||(isset ($_GET['T1'])) ) {
if (isset ($_POST['T1'])) {
$T1= $_POST['T1']; }else {$T1=$_GET['T1']; }
$sql= ("select * from sgj_ckforms_1 where F1='$T1'");
$req= mysql_query($sql);
while($data=mysql_fetch_array($req)) {
$description = $data['F2'];
}
echo $description;
?>
<br><br>
<img src="components/com_ckforms/views/ckformsdata/tmpl/display.php?D1=<?php echo $T1; ?>">
<p>Performance in the table below is represented in percent (%). The top row
(REG) indicates the regular gross profit or loss each month. This is the NON-COMPOUNDED
return. Please note that performance varies significantly with this system from
one brokerage to another.</p>
<p> </p>
<table border="1" width="100%">
<?php
$sql1= ("select * from program where program='$T1' order by year desc");
$req1= mysql_query ($sql1);
while ($val = mysql_fetch_array($req1)) {
$T1= $val['program'];
$T2= $val['mininvest'];
$T3= $val['risk'];
$T4= $val['inceptiondate'];
$T5= $val['managementfee'];
$T6= $val['incentivefee'];
$T7= $val['year'];
$T8= $val['jan'];
$T9= $val['feb'];
$T10= $val['mar'];
$T11= $val['apr'];
$T12= $val['mai'];
$T13= $val['jun'];
$T14= $val['jul'];
$T15= $val['aug'];
$T16= $val['sep'];
$T17= $val['oct'];
$T18= $val['nov'];
$T19= $val['december'];
$T20= $val['total'];
$T21= $val['cumulative'];
$T22= $val['avgmonth'];
$T23= $val['running'];
$T24= $val['totalmonths'];
$T25= $val['negative'];
$T26= $val['negmonper'];
$T27= $val['worstloss'];
$idp= $val['idprogram'];
?>
<table style="width: 578px;" id="table8" border="1" cellspacing="1">
<tbody>
<tr>
<td align="middle" bgcolor="#ffffff" width="44"><?php echo $T7; ?></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="color: rgb(0, 0, 0);" mce_style="color: #000000;"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Jan</span></span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="color: rgb(0, 0, 0);" mce_style="color: #000000;"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Feb</span></span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Mar</span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Apr</span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">May</span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Jun</span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Jul</span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Aug</span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Sep</span></td>
<td align="middle" bgcolor="#c6feab" width="44"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Oct</span></td>
<td align="middle" bgcolor="#c6feab" width="45"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Nov</span></td>
<td align="middle" bgcolor="#c6feab" width="45"><span style="font-size: 8pt;" mce_style="FONT-SIZE: 8pt">Dec</span></td></tr>
<tr>
<td align="middle" bgcolor="#909090" width="44" height="25"><span style="font-size: xx-small; font-weight: 700;" mce_style="font-size: xx-small; font-weight: 700;"><span style="color: rgb(10, 51, 0);" mce_style="color: #C0C0C0;">REG</span></span></td>
<td align="middle" bgcolor="#ffff99" width="44" height="25"><font color ="<?php if ($T8<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T8; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T9<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T9; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T10<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T10; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T11<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T11; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T12<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T12; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T13<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T13; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T14<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T14; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T15<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T15; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T16<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T16; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="44"><font color ="<?php if ($T17<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T17; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="45"><font color ="<?php if ($T18<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T18; ?></font></td>
<td align="middle" bgcolor="#ffff99" width="45"><font color ="<?php if ($T19<0) {echo 'red' ; } else {echo 'green';} ?>"><?php echo $T19; ?></font></td></tr></tbody></table>
<p>REG = Monthly Static Return. CMP = Compounded Return. MDD = Max
Drawdown.</p>
<p> </p>
<?php
}
}
?>