0
   

javascript semicolon table text file database bringing in one record that has a hover to show anothe

 
 
malanno
 
Reply Wed 19 Aug, 2015 04:12 pm
Hi, I started swimming waste deep in this water and now it's over my head...

My situation...

Here is my jquery code to highlight a row....

<script type="text/javascript">

$("tr").not(':first').hover(
function () {
$(this).css("background","#d3d3d3");
},
function () {
$(this).css("background","");
}
);

</script>

When it hovers I want to show a record in columns 4 and 5 to appear in the header.

I've been using php to do this so far but I'm not sure if php is the way I want to go for this...

Here is my php to grab the records and create the table....


<?php

$row = 1;
if (($handle = fopen($statfile, "r")) !== FALSE) {

echo '<table class="sortable" border="0">';

while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
if (substr($data[0],0,3)!='HDR' && substr($data[0],0,3) != 'JOB' ) continue;
$num = count($data);
if (substr($data[0],0,3)=='HDR') {
echo '<thead><tr>';
}else{
echo '<tr>';
}
for ($c=1; $c <= 4; $c++) {
//echo $data[$c] . "<br />\n";
if(empty($data[$c])) {
$value = " ";
}else{
$value = trim($data[$c]);
}
if (substr($data[0],0,3)=='HDR') {
echo '<th style="text-align:center">'.$value."</th>\n";
}else{
if ($c==1) {
echo '<td style="text-align:center"><a href="http://wfbscd13/cgi-bin/aplog.cgi?type=job&logname='.$value.'&hostname='.$host.'">'.$value."</a></td>\n";

}else{
echo '<td style="text-align:center">'.$value."</td>\n";
}
}
}

if (substr($data[0],0,3)=='HDR') {
echo '</tr></thead><tbody>';
}else{
echo '</tr>';
}
$row++;
}

echo '</tbody></table>';
fclose($handle);
}
?>

So far everything works it displays my info in the table, the sortable class sorts it...

PWR 9 ; #00FF00 ;
PWR 10 ; #00FF00 ;
PWR 11 ; #FF0000 ;
HDR 0 ; Session ; User ; Domains ; E-Time ; Host ; Design ; Path ;
JOB 1 ; 122:1 ; hupcey ; 6 ; 00:22:42 ; 158.140.43.151 ; ixdiag_model_bedb ; /home/hupcey/diags
JOB 2 ; 121:1 ; galzerano ; 2 ; 00:10:42 ; 158.140.43.151 ; ixdiag_model_bedb ; /home/hupcey/diags

I'm in the JOB index and I want the IP to show up when you hover over the row...

Am I barking up the right tree?
Can someone help me or point a finger? I appreciate any help on this matter.

William
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 675 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » javascript semicolon table text file database bringing in one record that has a hover to show anothe
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/18/2024 at 10:44:45