Ejemplo n.º 1
0
echo '<th>';
echo 'State';
echo '</th>';
echo '</tr>';
echo '<tr class="tableRowDark">';
echo '<td>';
echo $row['Quantity'];
echo '</td>';
echo '<td>';
echo $row['Year'] . " " . $row['Make'] . " " . $row['Model'];
echo '</td>';
echo '<td style="text-align: left;">';
echo $row['Description'];
echo '</td>';
echo '<td>';
echo format_to_money($row['Price']);
echo '</td>';
echo '<td>';
echo $row['State'];
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td colspan=5>';
echo '<img class="display_img" src="' . "uploads/" . (file_exists("uploads/" . $row["Picture_URL"]) && $row["Picture_URL"] != "" ? $row["Picture_URL"] : "BrownEquipmentDefault.png") . '" />';
echo '</td>';
echo '</tr>';
// echo '<ul style="float: left;">';
// if($row["Type"] != ''){ echo '<li>Type: ' . $row["Type"] . '</li>'; }
// if($row["Subtype"] != ''){ echo '<li>Subtype: ' . $row["Subtype"] . '</li>'; }
// if($row["Make"] != ''){ echo '<li>Make: ' . $row["Make"] . '</li>'; }
// if($row["Model"] != ''){ echo '<li>Model: ' . $row["Model"] . '</li>'; }
Ejemplo n.º 2
0
function display_thumbnails($conn, $sql)
{
    $result = $conn->query($sql);
    echo '<div class="thumbnail_div">';
    echo '<table class="tableElements" style="width: 100%;">';
    echo '<tr>';
    echo '<th>';
    echo 'Quantity';
    echo '</th>';
    echo '<th>';
    echo 'Name';
    echo '</th>';
    // echo '<th>';
    //   echo 'Make';
    // echo '</th>';
    // echo '<th>';
    //   echo 'Model';
    // echo '</th>';
    echo '<th>';
    echo 'Description';
    echo '</th>';
    echo '<th>';
    echo 'Price';
    echo '</th>';
    echo '<th>';
    echo 'State';
    echo '</th>';
    echo '</tr>';
    $rowColor = 0;
    $num_rows = 0;
    while ($row = $result->fetch_assoc()) {
        if ($row['Visible']) {
            $num_rows++;
            $rowClass = '';
            if ($rowColor % 2 == 0) {
                $rowClass = 'tableRowDark';
            } else {
                $rowClass = 'tableRowLight';
            }
            echo '<tr class="' . $rowClass . ' clickableRow" onclick="handleRowClick(' . $row["ID"] . ')">';
            echo '<td>';
            echo $row['Quantity'];
            echo '</td>';
            echo '<td>';
            echo $row['Year'] . " " . $row['Make'] . " " . $row['Model'];
            echo '</td>';
            // echo '<td>';
            //   echo $row['Make'];
            // echo '</td>';
            // echo '<td>';
            //   echo $row['Model'];
            // echo '</td>';
            echo '<td style="text-align: left;">';
            echo $row['Description'];
            echo '</td>';
            echo '<td>';
            echo format_to_money($row['Price']);
            echo '</td>';
            echo '<td>';
            echo $row['State'];
            echo '</td>';
            echo '</tr>';
            $rowColor++;
            // echo '<a href="display.php?id=' . $row["ID"] . '" >';
            // echo '<div class="thumbnail">';
            //   echo '<img class="thumbnail_img" src="' . "uploads/" . (($row["Picture_URL"] != "")? $row["Picture_URL"] : "BrownEquipmentDefault.png") . '" />';
            //   echo '<br>';
            //   echo '<p class="thumbnail_name">' . $row["Make"] . " " . $row["Model"] . '</p>';
            //   echo '<p class="thumbnail_price">$' . $row["Price"] . '</p>';
            // echo '</div>';
            // echo '</a>';
        }
    }
    if ($num_rows < 1) {
        echo '<td class="tableRowDark" colspan=5>No Items Currently Exist For This Category</td>';
    }
    echo '</table>';
    echo '</div>';
}