Mercurial > hg > index.fcgi > www > www-1
comparison thule_fit_kits/index.php @ 3:f6be2a5839f0
thule_fit_kits/index.php: check if pdf exists to see whether to make hyperlink or not
author | paulo@twcdns.fastsearch.net |
---|---|
date | Mon, 23 Aug 2010 22:53:43 -0700 |
parents | 561c0b0f3234 |
children | bc72be51af82 |
comparison
equal
deleted
inserted
replaced
0:c603bfc63585 | 1:262d3292d593 |
---|---|
41 | 41 |
42 $query = 'SELECT * FROM Thule ORDER BY kit_id'; | 42 $query = 'SELECT * FROM Thule ORDER BY kit_id'; |
43 $results = mysql_query($query); | 43 $results = mysql_query($query); |
44 | 44 |
45 while ($row = mysql_fetch_assoc($results)) { | 45 while ($row = mysql_fetch_assoc($results)) { |
46 echo '<TR>'; | 46 echo '<TR><TD>'; |
47 echo '<TD><A HREF="pdf/thule-fit-kit-' . $row['kit_id'] . '-instructions.pdf">' . $row['kit_id'] . '</A></TD>'; | 47 $pdf_filename = 'pdf/thule-fit-kit-' . $row['kit_id']. '-instructions.pdf'; |
48 echo '<TD>'; | 48 if (file_exists($pdf_filename)) |
49 echo '<A HREF="'. $pdf_filename . '">' . $row['kit_id'] . '</A>'; | |
50 else | |
51 echo $row['kit_id']; | |
52 echo '</TD><TD>'; | |
49 $cars = explode(';', $row['car']); | 53 $cars = explode(';', $row['car']); |
50 foreach ($cars as $car) | 54 foreach ($cars as $car) |
51 echo $car . '<br>'; | 55 echo $car . '<br>'; |
52 echo '</TD>'; | 56 echo '</TD>'; |
53 echo '<TD>' . $row['rubber_pad'] . '</TD>'; | 57 echo '<TD>' . $row['rubber_pad'] . '</TD>'; |