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
  6. Well for reason's of security clearances I want the people on this project to work with a different database, that will work in the area that they are working. I actually have the vars file that I include in the header. I could create 3 of them pointing to a different source and load the vars.php, vars1, vars2, from the url. Or I can echo the contents using the parse_string parse_url command right into the variables themselves... This is something that we want to use for development, most of the engineers are python developers and they are used to &= in python. So this suggestion came from them. I would include my code but we have people at my work whose only job is to see what is going on with us on the outside. Thank you for your question.
  7. You did answer my question but I asked it wrong. Shame on me. What I meant is, http://example.com/main.php&="Contents to be echoed in the document." I'm wrestling with it now :/
  8. I couldn't find anything on this so I'm sorry in advanced if I missed something if it exists. I created a file for my includes... Because there are several people working on this project I would like to include a different vars file for each person. I remember in the past a way to add the includes file to your web url using a &... but I can't remember... Say the url is http://url.com/index.php and the includes file is called vars.php What would be the address to include the file? Thanks in advance....
  9. Would you be interested in teaching me php on a regular basis? I would gladly pay your hourly rate. William William
  10. Thank you... you saved me... I will pay it forward when done with this project. William
  11. I'm sorry I thought I bolded it, but I forgot. For example lets use the temperature from board 1
  12. Hi: I'm a java programmer so a brief answer is what I'm looking for, or a point in a direction. I want access one record in a flat file semicolon delimited txt file? I'm having problems... Thank you # comments start with pound sign - ignore these and blank lines. VERSION 1.0 # Allowable keywords: SCD, CCD, BRD, ACU, WCU # Possible status indicators are: # SCD/CCD/BRD CHIP/TARGET # G = green online in use # R = red offline marked out # Y = yellow partial disabled # N = no color not installed idle # SCD num scd_status SCD 0 ; G ; # RACK 0 ---------------------------------------------------------------------------------------------- # CCD num ccd_status target_status temp details CCD 0 ; G ; GGNNNNNNNRRY ; 34C ; sn=NCC023e00350010 # BRD num brd_status chip0 chip1 chip2 chip3 chip4 chip5 chip6 chip7 temp details BRD 0 ; G ; G G G N N N N G ; 37C ; sn=BRD023d00420000 BRD 1 ; G ; N N N Y Y N N N ; 37C ; sn=BRD023d00420001 BRD 2 ; G ; G N N N R N N N ; 37C ; sn=BRD023d00420002 BRD 3 ; G ; N N N N R Y Y Y ; 37C ; sn=BRD023d00420003 BRD 4 ; Y ; N N N N R R R R ; 37C ; sn=BRD023d00420004 BRD 5 ; R ; R R R R R R R R ; 37C ; sn=BRD023d00420005
×
×
  • 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.