annotate thule_fit_kits/index.php @ 21:0161134b2246

update FEEDS
author paulo@thepaulopc
date Sun, 09 Jan 2011 20:29:58 -0800
parents f6be2a5839f0
children a7ad7a5c899e
rev   line source
paulo@0 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
paulo@0 2 <HTML>
paulo@0 3 <HEAD>
paulo@0 4 <META NAME="generator" CONTENT="http://txt2tags.sf.net">
paulo@0 5 <LINK REL="stylesheet" TYPE="text/css" HREF="index.css">
paulo@0 6 <TITLE>Thule Fit Kit Database</TITLE>
paulo@0 7 </HEAD>
paulo@0 8 <BODY>
paulo@0 9
paulo@0 10 <DIV CLASS="header" ID="header">
paulo@0 11 <H1>Thule Fit Kit Database</H1>
paulo@0 12 </DIV>
paulo@0 13
paulo@0 14 <DIV CLASS="body" ID="body">
paulo@0 15
paulo@0 16 <P>
paulo@0 17 Trying to figure out if you can reuse those Thule fit kit rubber pads or mounting brackets on another car? Here's a database you can check, with PDF installation instruction manuals.
paulo@0 18 </P>
paulo@0 19
paulo@0 20 <TABLE>
paulo@0 21 <TR>
paulo@0 22 <TH>Kit Number</TH>
paulo@0 23 <TH>Cars</TH>
paulo@0 24 <TH>Rubber Pad Number</TH>
paulo@0 25 <TH>Bracket Number</TH>
paulo@0 26 <TH>Miscellaneous Parts</TH>
paulo@0 27 </TR>
paulo@0 28
paulo@0 29 <?php
paulo@0 30
paulo@0 31 include('../../login.php');
paulo@0 32 $database = 'pauloang_fitkits';
paulo@0 33
paulo@0 34 $link = mysql_connect('localhost', $username, $password);
paulo@0 35 if (!$link)
paulo@0 36 die('Could not connect to MySQL server: ' . mysql_error());
paulo@0 37
paulo@0 38 $db_selected = mysql_select_db($database, $link);
paulo@0 39 if (!$db_selected)
paulo@0 40 die('Could not select database: ' . mysql_error());
paulo@0 41
paulo@0 42 $query = 'SELECT * FROM Thule ORDER BY kit_id';
paulo@0 43 $results = mysql_query($query);
paulo@0 44
paulo@0 45 while ($row = mysql_fetch_assoc($results)) {
paulo@4 46 echo '<TR><TD><DIV class="kit_id">';
paulo@3 47 $pdf_filename = 'pdf/thule-fit-kit-' . $row['kit_id']. '-instructions.pdf';
paulo@3 48 if (file_exists($pdf_filename))
paulo@3 49 echo '<A HREF="'. $pdf_filename . '">' . $row['kit_id'] . '</A>';
paulo@3 50 else
paulo@3 51 echo $row['kit_id'];
paulo@4 52 echo '</DIV></TD><TD>';
paulo@0 53 $cars = explode(';', $row['car']);
paulo@0 54 foreach ($cars as $car)
paulo@0 55 echo $car . '<br>';
paulo@0 56 echo '</TD>';
paulo@0 57 echo '<TD>' . $row['rubber_pad'] . '</TD>';
paulo@0 58 echo '<TD>' . $row['bracket'] . '</TD>';
paulo@0 59 echo '<TD>';
paulo@0 60 $misc = explode(',', $row['misc']);
paulo@0 61 foreach ($misc as $misc_item) {
paulo@0 62 if ($misc_item) {
paulo@0 63 $misc_item = trim($misc_item);
paulo@0 64 $misc_filename = 'misc_' . $misc_item . '.png';
paulo@0 65 if (file_exists($misc_filename))
paulo@0 66 echo '<IMG SRC="' . $misc_filename . '" ALT="' . $misc_item . '"> ';
paulo@0 67 else
paulo@0 68 echo $misc_item . ',';
paulo@0 69 }
paulo@0 70 }
paulo@0 71 echo '</TD>';
paulo@0 72 echo '</TR>' . "\n";
paulo@0 73 }
paulo@0 74
paulo@0 75 mysql_free_result($results);
paulo@0 76 mysql_close($link);
paulo@0 77
paulo@0 78 ?>
paulo@0 79
paulo@0 80 </TABLE>
paulo@0 81 </DIV>
paulo@0 82
paulo@0 83 <!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
paulo@0 84 <!-- cmdline: txt2tags index.t2t -->
paulo@0 85 </BODY></HTML>