changeset 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 ff6cf071c65c
children bc72be51af82
files thule_fit_kits/index.php
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/thule_fit_kits/index.php	Mon Aug 23 22:51:42 2010 -0700
     1.2 +++ b/thule_fit_kits/index.php	Mon Aug 23 22:53:43 2010 -0700
     1.3 @@ -43,9 +43,13 @@
     1.4  	$results = mysql_query($query);
     1.5  
     1.6  	while ($row = mysql_fetch_assoc($results)) {
     1.7 -		echo '<TR>';
     1.8 -		echo '<TD><A HREF="pdf/thule-fit-kit-' . $row['kit_id'] . '-instructions.pdf">' . $row['kit_id'] . '</A></TD>';
     1.9 -		echo '<TD>';
    1.10 +		echo '<TR><TD>';
    1.11 +		$pdf_filename = 'pdf/thule-fit-kit-' . $row['kit_id']. '-instructions.pdf';
    1.12 +		if (file_exists($pdf_filename))
    1.13 +			echo '<A HREF="'. $pdf_filename . '">' . $row['kit_id'] . '</A>';
    1.14 +		else
    1.15 +			echo $row['kit_id'];
    1.16 +		echo '</TD><TD>';
    1.17  		$cars = explode(';', $row['car']);
    1.18  		foreach ($cars as $car)
    1.19  			echo $car . '<br>';