Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 18.227.183.161
<?php
class component_tabs {
//Properties
var $tabs = array();
var $width = '100%';
var $content = '';
//Constructor
function component_tabs($width = '100%'){
$this->width = $width;
}
//Methods
function add_tab(&$tab){
$this->tabs[] = &$tab;
}
//Output function
function draw_component() {
?>
<table width="<?= $this->width ?>" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<?php
for ($i=0; $i < count($this->tabs); $i++) {
if (isset($this->tabs[$i+1])) { $iconstyle = 'between'; } else { $iconstyle = 'end'; }
if ($this->tabs[$i]->is_active == true) { $tab1style = 'on'; } else { $tab1style = 'off'; }
if ($this->tabs[$i+1]->is_active == true) { $tab2style = 'on'; } else { $tab2style = 'off'; }
if ($iconstyle == 'between') { $iconimgsrc='../images/tabs/tab_between_'.$tab1style.'_'.$tab2style.'.jpg'; }
else { $iconimgsrc='../images/tabs/tab_end_'.$tab1style.'.jpg'; }
if ($this->tabs[$i]->is_active == true) { $sThisBgColor = '546085'; }
else { $sThisBgColor = '868A96'; }
echo '
<td bgcolor="#'.$sThisBgColor.'" class="whiteText10px" style="padding: 1px; font-weight: bold;"> <a href="'.$this->tabs[$i]->url.'">'.$this->tabs[$i]->caption.'</a> </TD>
<td><img src="'.$iconimgsrc.'" width="15" height="15"></td>
';
}
?>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#546085">
<td colspan=5><img src="../images/spacer.gif" width="10" height="10"></td>
</tr>
<tr bgcolor="#546085">
<td width="10"><img src="../images/spacer.gif" width="10" height="10"></td>
<td bgcolor="#546085">
<?php eval($this->content); ?>
</td>
<td width="10"><img src="../images/spacer.gif" width="10" height="10"></td>
</tr>
<tr bgcolor="#546085">
<td colspan="3"><img src="../images/spacer.gif" width="10" height="10"></td>
</tr>
</table>
<?php }
}
class component_tab {
//Properties
var $caption = 'default tab';
var $url = '?';
var $is_active = true;
//Constructor
function component_tab($caption, $url, $is_active = true){
$this->caption = $caption;
$this->url = $url;
$this->is_active = $is_active;
}
}
?>
|