annotate thule_fit_kits/index.php @ 0:561c0b0f3234

initial add
author paulo@twcdns.fastsearch.net
date Wed, 21 Jul 2010 00:11:54 -0700
parents
children f6be2a5839f0
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@0 46 echo '<TR>';
paulo@0 47 echo '<TD><A HREF="pdf/thule-fit-kit-' . $row['kit_id'] . '-instructions.pdf">' . $row['kit_id'] . '</A></TD>';
paulo@0 48 echo '<TD>';
paulo@0 49 $cars = explode(';', $row['car']);
paulo@0 50 foreach ($cars as $car)
paulo@0 51 echo $car . '<br>';
paulo@0 52 echo '</TD>';
paulo@0 53 echo '<TD>' . $row['rubber_pad'] . '</TD>';
paulo@0 54 echo '<TD>' . $row['bracket'] . '</TD>';
paulo@0 55 echo '<TD>';
paulo@0 56 $misc = explode(',', $row['misc']);
paulo@0 57 foreach ($misc as $misc_item) {
paulo@0 58 if ($misc_item) {
paulo@0 59 $misc_item = trim($misc_item);
paulo@0 60 $misc_filename = 'misc_' . $misc_item . '.png';
paulo@0 61 if (file_exists($misc_filename))
paulo@0 62 echo '<IMG SRC="' . $misc_filename . '" ALT="' . $misc_item . '"> ';
paulo@0 63 else
paulo@0 64 echo $misc_item . ',';
paulo@0 65 }
paulo@0 66 }
paulo@0 67 echo '</TD>';
paulo@0 68 echo '</TR>' . "\n";
paulo@0 69 }
paulo@0 70
paulo@0 71 mysql_free_result($results);
paulo@0 72 mysql_close($link);
paulo@0 73
paulo@0 74 ?>
paulo@0 75
paulo@0 76 </TABLE>
paulo@0 77 </DIV>
paulo@0 78
paulo@0 79 <!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
paulo@0 80 <!-- cmdline: txt2tags index.t2t -->
paulo@0 81 </BODY></HTML>