Example #1
0
            }
            print ">" . $prodb->result("name") . "</option>";
        }
        ?>
</select></td></tr>
			<tr><td><input type="radio" name="type" value="product"<?php 
        if (isset($error) && $_POST[type] == 'product') {
            print " checked=\"checked\"";
        } elseif (isset($moddb) && $moddb->result("type") == 'product') {
            print " checked=\"checked\"";
        }
        ?>
></td><td>Product <select name="product"><option value=""></option><?php 
        $prodb = new dbi();
        $prodb->query("select * from product_category where site = '" . SITE . "' order by name asc");
        while ($prodb->loop()) {
            print "<option value=\"" . $prodb->result("id") . "\"";
            if (isset($error) && $_POST[type] == "product" && $prodb->result("id") == $_POST[product] || !isset($error) && isset($moddb) && $moddb->result("type") == "product" && $moddb->result("type_id") == $prodb->result("id")) {
                print " selected=\"selected\"";
            }
            print ">" . $prodb->result("name") . "</option>";
        }
        ?>
</select></td></tr>
			</table>
		</td></tr>
		<tr bgcolor="#990000"><td colspan="2" align="center"><input type="submit" value="Update"></td></tr>
		</table>
	</form>
<?php 
    }
Example #2
0
        }
    }
    $db = new dbi();
    if (isset($_GET['category'])) {
        $results = mysql_query("select name from product_category where id = '" . $_GET['category'] . "'", $dbh);
        $bar_title = "Products for '" . mysql_result($results, 0, "name") . "'";
        $db->query("select * from product where category = '{$_GET['category']}' and user = '******' order by sort, description asc");
    } else {
        $results = mysql_query("select email from account where id = '" . $_GET['user'] . "'", $dbh);
        $bar_title = "Products for '" . mysql_result($results, 0, "email") . "'";
        $db->query("select product_category.site,product.* from product inner join product_category on product_category.id = product.category where user = '******'user']}' order by sort, description asc");
    }
    print "<table align=\"center\" cellpadding=\"2\" cellspacing=\"0\">";
    print "<tr class=\"bar\"><td>{$bar_title}</td><td align=\"right\"><a href=\"product.php?" . (isset($_GET[category]) ? "category=" . $_GET['category'] : "user="******"&add=1\">Add a Product</a></td></tr>";
    if ($db->numrows()) {
        while ($db->loop()) {
            print "<tr><td align=\"left\"><a href=\"product.php?" . (isset($_GET[category]) ? "category={$_GET['category']}" : "user={$_GET['user']}") . "&mod=" . $db->result("id");
            if (isset($_GET[user])) {
                print "&setsite=" . $db->result("product_category.site");
            }
            print "\">" . substr($db->result("description"), 0, 60) . "</td><td align=\"right\"><a href=\"product.php?" . (isset($_GET[category]) ? "category=" . $_GET['category'] : "user={$_GET['user']}") . "&delete=" . $db->result("id") . "\">Delete?</a></td></tr>";
        }
    } else {
        print "<tr><td colspan=\"2\" align=\"center\">No Products for that Category/User!</td></tr>";
    }
    print "</table>";
}
include "footer.inc";
?>
</body>
</html>
Example #3
0
<h1>Invoice for Order #<?php 
    echo $db->result("id");
    ?>
</h1>
<div style="text-align:center;margin:10px;"><a href="invoice.php?<?php 
    echo $db->result("id");
    ?>
" target="_blank"><b>PRINT A COPY OF THIS INVOICE</b></a></div>
<table width="95%" align="center" cellpadding="4" cellspacing="0" style="border:2px solid #000000;">
<tr class="bar"><td align="left" style="font-weight:bold;font-size:14px;" colspan="2">Shipping Information</td></tr>
<tr><td colspan="2">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr><td align="left" class="order_header">Item</td><td align="right" class="order_header">Quantity</td><td align="right" class="order_header">Price</td></tr>
<?php 
    $tdb->query("select description,quantity,price from order_items where order_id = '{$order_id}'");
    while ($tdb->loop()) {
        print "<tr><td align=\"left\">" . $tdb->result("description") . "</td><td align=\"right\">" . $tdb->result("quantity") . "</td><td align=\"right\">\$" . sprintf("%0.2f", $tdb->result("price")) . "</td></tr>";
    }
    ?>
</table></td>
<tr><td valign="top"><?php 
    print_address($db->result("ship_address"));
    ?>
</td><td valign="top">
<table align="right" cellpadding="2" cellspacing="0" border="0">
<tr><td align="right" class="order_header">SubTotal:</td><td align="right">$<?php 
    echo sprintf("%0.2f", $db->result("subtotal"));
    ?>
</td></tr>
<tr><td align="right" class="order_header">Shipping &amp; Handling(<?php 
    echo $ship_type[$db->result("ship_method")];