Jump to content

malanno

Members
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

0 Neutral

About malanno

  • Rank
    Member
  1. I'm not looking for someone to write my code... It's almost written because of my company I can't share it. It would illegal for me to do so and I could be punished. I'm a python writer and got stuck with this php project. Your remark is absolutely no help... yes, I always to + by default that's python, but that wasn't my question. After 20 years programming chips in one of the best companies in the world, I've been there done that with the stereotypical bad attitude programmer type. I don't php and neither does anyone around here but we drew straws and I got this stupid project... With regards to the code... I'm using $_get to pass the parameters and I'm using document.GetElementById to get the data... I can't share my code it breaks all sorts of agreements with my company. I would lose my clearance... That's all... Sorry to lash out, normally I would just move on, but like I said, I'm tired of that old stereotype...
  2. Hello this is an example of my link... .../pes/mimo.php?rack=1+jobs=0+hosts=1 I'm passing the variables like this... <?php echo $_GET["rack"] ; echo $_GET["jobs"] ; echo $_GET["hosts"] ; ?> Rack would echo a grouping of divs with the contents: r1, r2, r3 Jobs it's grouping of divs: j1, j2, j3 Hosts: h1,h2, h3 I'm looking to connect the dots between passing the parameter and getting the data... Anyone feel me? Best, William
  3. Hi, I have all the elements I need but I need to connect the dots... Situation... I have a job table that is brought in with this variable <?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.'" target="_blank">'.$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); } ?> I attached a picture to show my screen... The right hand div with the list of jobs is on the right. I have it set so I can hover over the row and it highlights a row. Here is that code... It is jquery (1.9.1) <script type="text/javascript"> $("tr").not(':first').hover( function () { $(this).css("background","#d3d3d3"); }, function () { $(this).css("background",""); } ); </script> And finally the php query for the header.... <?php $row = 1; if (($handle = fopen("status.txt", "r")) !== FALSE) { echo '<table class="sortable" border="0">'; while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { if ($row > 1 && substr($data[0],0,3) != 'JOB' ) continue; $num = count($data); if ($row == 1) { echo '<thead><tr>'; }else{ echo '<tr>'; } for ($c=4; $c <$num; $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">'.$value."</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); } ?> What I need is to show this last query in the header on hover of the first query.... But I can't seem to connect the dots... Can anyone help me?
  4. It does work, but for some reason it picks up the first line of the database and lists that. So I added a blank line to the first line and it works great. If I can go to the wisdom well one more time I would like to ask.... Is there any way to pick and choose which columns are to be used? William
  5. Hi, I was wondering if someone could help me. I included a sample of my database... This is what I got... <?php $row = 1; if (($handle = fopen("jobstatus2.txt", "r")) !== FALSE) { echo '<table class="sortable" border="0">'; while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { $num = count($data); if ($row == 1) { echo '<thead><tr>'; }else{ echo '<tr>'; } for ($c=0; $c < $num; $c++) { //echo $data[$c] . "<br />\n"; if(empty($data[$c])) { $value = " "; }else{ $value = $data[$c]; } if ($row == 1) { echo '<th>'.$value.'</th>'; }else{ echo '<td>'.$value.'</td>'; } } if ($row == 1) { echo '</tr></thead><tbody>'; }else{ echo '</tr>'; } $row++; } echo '</tbody></table>'; fclose($handle); } ?> It works perfectly for what I'm doing. But it only works perfectly from a database I build just for this... The problem is the data I need is part of a bigger database and I just need a small part that I colored in yellow. Can someone help me out, on this? Any help would be appreciated. Thanks William
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.