This is a discussion on Is this TableBox class correct? within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; Hi, I wanted to make a new tablebox class which displays all the products in the shopping cart with an ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hi, I wanted to make a new tablebox class which displays all the products in the shopping cart with an overall border...but everytime i use it, the $table_box string that stores all the html code spews out only half of the stuff. Is there anything wrong with my code? class tableBox_with_border { var $table_border = '0'; var $table_width = '100%'; var $table_cellspacing = '0'; var $table_cellpadding = '2'; var $table_parameters = ''; var $table_row_parameters = ''; var $table_data_parameters = ''; function tableBox_with_border($contents, $direct_output = false) { $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"'; if (tep_not_null($this->table_parameters)) {$tableBox_string .= ' ' . $this->table_parameters;} $tableBox_string .= '>' . "\n"; $tableBox_string .= '<tr bgcolor="#8BB4D0">' . "\n"; $tableBox_string .= '<td height="7" colspan="6"></td>'. "\n"; $tableBox_string .= '</tr>' . "\n"; for ($i=0, $n=sizeof($contents); $i<$n; $i++) { if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n"; $tableBox_string .= ' <tr'; if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>' . "\n"; $tableBox_string .= '<td width="8" bgcolor="#8EB4CB"></td>' . "\n"; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { $tableBox_string .= ' <td'; if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"'; if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) { $tableBox_string .= ' ' . $contents[$i][$x]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>'; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; $tableBox_string .= $contents[$i][$x]['text']; if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>'; $tableBox_string .= '</td>' . "\n"; } } } else { $tableBox_string .= ' <td'; if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"'; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) { $tableBox_string .= ' ' . $contents[$i]['params']; } elseif (tep_not_null($this->table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n"; } $tableBox_string .= ' <td width="8" bgcolor="#8EB4CB"></td></tr>' . "\n"; if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n"; } $tableBox_string .= '<tr bgcolor="#8BB4D0"><td height="7" colspan="6">'; $tableBox_string .= '</td></tr></table>' . "\n"; if ($direct_output == true) echo $tableBox_string; return $tableBox_string; } } |
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is this the correct setting? | CatieKoch | osCMax v2 Installation issues | 0 | 06-23-2006 08:59 PM |
| What are the correct settings for paypal IPN ? | fuzioneer | osCMax v1.7 Installation | 0 | 06-10-2005 04:41 AM |
| What is passed to constructor of tableBox ? ($contents) | raj | osCommerce 2.2 Modification Help | 0 | 04-09-2004 02:03 AM |
| 404 - page not found. Database correct. Permission correct. | Futureline | osCommerce 2.2 Installation Help | 4 | 03-04-2003 03:08 PM |
| Tax not correct in Admin -> Orders | Buzz | osCommerce 2.2 Installation Help | 0 | 02-10-2003 09:16 AM |