Meni
10-01-2006, 08:44 AM
1) Script Title: Switch contents script II
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent2.htm
3) Describe problem:
When i used this script on my pages everything worked like a charm until i added the 10th "SC"
See code below:
<table width="100%">
<tr>
<td class="heading" colspan="2" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc1')" style="cursor:hand;">1</td>
<td onClick="sweeptoggle('contract'); expandcontent(this, 'sc2')" class="heading" valign="top" style="cursor:hand;">2</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc3')" style="cursor:hand;">3 </td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc4')" style="cursor:hand;">4 </td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc5')" style="cursor:hand;">5</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc6')" style="cursor:hand;">6</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc8')" style="cursor:hand;">8</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc9')" style="cursor:hand;">9</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc7')" style="cursor:hand;">7</td>
<?php
$id = $_GET['id'];
$sql01 = "SELECT `id`,`clientTypeNumber` FROM `clients` WHERE `id` = '$id'";
$query01 = mysql_query($sql01);
$res01 = mysql_fetch_array($query01);
if($res01['clientTypeNumber'] > '1' && $res01['clientTypeNumber'] < '4') {
$iscompany = '1';
}
if ($iscompany = '1') {
echo '
<td class="heading" valign="top" onClick="sweeptoggle(\'contract\'); expandcontent(this, \'sc10\')" style="cursor:hand;">10</td>
';
}
?>
</tr>
<tr>
<td colspan="10" valign="top" id="sc1" class="switchcontent">
<?php include 'clientdetails.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc2" class="switchcontent">
<?php include 'yeladudes.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc3" class="switchcontent">
<?php include 'hazharothon.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc4" class="switchcontent">
<?php include 'drishalehazhon.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc5" class="switchcontent">
<?php include 'hagashot.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc6" class="switchcontent">
<?php include 'hamhaot.php'; ?> </td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc8" class="switchcontent">
<?php include '../comments/newcomment.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc9" class="switchcontent">
<?php include '../payments/index.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc7" class="switchcontent">
<?php include 'hours.php'; ?>
</td>
</tr>
<?php
if ($iscompany = '1') {
echo '
<tr>
<td colspan="10" valign="top" id="sc10" class="switchcontent">';
include '../hevshut/index.php';
echo '
</td>
</tr>
';
}
?>
</table>
The 10th SC won't work, but all the rest do.
Any ideas?
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent2.htm
3) Describe problem:
When i used this script on my pages everything worked like a charm until i added the 10th "SC"
See code below:
<table width="100%">
<tr>
<td class="heading" colspan="2" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc1')" style="cursor:hand;">1</td>
<td onClick="sweeptoggle('contract'); expandcontent(this, 'sc2')" class="heading" valign="top" style="cursor:hand;">2</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc3')" style="cursor:hand;">3 </td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc4')" style="cursor:hand;">4 </td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc5')" style="cursor:hand;">5</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc6')" style="cursor:hand;">6</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc8')" style="cursor:hand;">8</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc9')" style="cursor:hand;">9</td>
<td class="heading" valign="top" onClick="sweeptoggle('contract'); expandcontent(this, 'sc7')" style="cursor:hand;">7</td>
<?php
$id = $_GET['id'];
$sql01 = "SELECT `id`,`clientTypeNumber` FROM `clients` WHERE `id` = '$id'";
$query01 = mysql_query($sql01);
$res01 = mysql_fetch_array($query01);
if($res01['clientTypeNumber'] > '1' && $res01['clientTypeNumber'] < '4') {
$iscompany = '1';
}
if ($iscompany = '1') {
echo '
<td class="heading" valign="top" onClick="sweeptoggle(\'contract\'); expandcontent(this, \'sc10\')" style="cursor:hand;">10</td>
';
}
?>
</tr>
<tr>
<td colspan="10" valign="top" id="sc1" class="switchcontent">
<?php include 'clientdetails.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc2" class="switchcontent">
<?php include 'yeladudes.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc3" class="switchcontent">
<?php include 'hazharothon.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc4" class="switchcontent">
<?php include 'drishalehazhon.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc5" class="switchcontent">
<?php include 'hagashot.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc6" class="switchcontent">
<?php include 'hamhaot.php'; ?> </td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc8" class="switchcontent">
<?php include '../comments/newcomment.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc9" class="switchcontent">
<?php include '../payments/index.php'; ?>
</td>
</tr>
<tr>
<td colspan="10" valign="top" id="sc7" class="switchcontent">
<?php include 'hours.php'; ?>
</td>
</tr>
<?php
if ($iscompany = '1') {
echo '
<tr>
<td colspan="10" valign="top" id="sc10" class="switchcontent">';
include '../hevshut/index.php';
echo '
</td>
</tr>
';
}
?>
</table>
The 10th SC won't work, but all the rest do.
Any ideas?