Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 3.147.82.22
<?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])) { /*Between icon*/$iconstyle = 'between'; } else {/*End icon*/ $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'; }
?>
<td bgcolor="#<?php if ($this->tabs[$i]->is_active == true) { echo '546085'; } else { echo '868A96'; } ?>" 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>
<?php
}
?>
</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;
}
}
?>
|