Example #1
0
function shop_start()
{
    //Item shop start page
    global $HTTP_POST_VARS, $userdata, $locale, $settings, $golddata;
    if (isset($_REQUEST['rowstart']) && isnum($_REQUEST['rowstart'])) {
        $rowstart = $_REQUEST['rowstart'];
    } else {
        $rowstart = 0;
    }
    if (!isset($_REQUEST['sort'])) {
        $_REQUEST['sort'] = "1";
    }
    if (!isset($_REQUEST['sortDir'])) {
        $_REQUEST['sortDir'] = "0";
    }
    if (!isset($_REQUEST['category'])) {
        $_REQUEST['category'] = "0";
    }
    switch ($_REQUEST['sort']) {
        case 0:
            $sortType = 'Name';
            $sortQuery = "name";
            break;
        case 1:
            $sortType = 'Price';
            $sortQuery = "cost";
            break;
        case 2:
            $sortType = 'Description';
            $sortQuery = "description";
            break;
        case 3:
            $sortType = 'Stock';
            $sortQuery = "stock";
            break;
        default:
            die("Invalid sort method passed");
            break;
    }
    switch ($_REQUEST['sortDir']) {
        case 0:
            $sortDirType = 'ASC';
            $sortDirQuery = "ASC";
            break;
        case 1:
            $sortDirType = 'DESC';
            $sortDirQuery = "DESC";
            break;
        default:
            die("Invalid sort method passed");
            break;
    }
    $ug_cats = getcats();
    $categories_opts = "";
    $sel = "";
    while (list($key, $ug_cat) = each($ug_cats)) {
        $sel = $_REQUEST['category'] == $ug_cat['0'] ? " selected='selected'" : "";
        $categories_opts .= "<option value='" . $ug_cat['0'] . "'{$sel}>" . $ug_cat['1'] . "</option>\n";
    }
    table_top($locale['urg_shop_100']);
    echo "<table width='100%' cellpadding='5' cellspacing='0' border='0' class='tbl2'>\n<tr>\n";
    echo "<td align='left'>\n<form action='index.php' method='post'>\n";
    echo "<strong>Category</strong>\n";
    echo "<input type='hidden' name='op' value='shop_start' />\n";
    echo "<input type='hidden' name='sort' value='" . $_REQUEST['sort'] . "' />\n";
    echo "<input type='hidden' name='sortDir' value='" . $_REQUEST['sortDir'] . "' />\n";
    echo "<select name='category' class='textbox'>" . $categories_opts . "</select>\n";
    echo "<input type='submit' value='Select' class='button' />\n";
    echo "</form>\n</td>\n";
    echo "<td align='right'>\n<form action='index.php' method='post'>\n";
    echo "<strong>" . $locale['urg_shop_108'] . "</strong>\n";
    echo "<input type='hidden' name='op' value='shop_start' />\n";
    echo "<input type='hidden' name='category' value='" . $_REQUEST['category'] . "' />\n";
    echo "<select name='sort' class='textbox'>\n";
    echo "<option value='1'" . ($_REQUEST['sort'] == 1 ? " selected='selected'" : "") . ">" . $locale['urg_shop_109'] . "</option>\n";
    echo "<option value='2'" . ($_REQUEST['sort'] == 2 ? " selected='selected'" : "") . ">" . $locale['urg_shop_110'] . "</option>\n";
    echo "<option value='3'" . ($_REQUEST['sort'] == 3 ? " selected='selected'" : "") . ">" . $locale['urg_shop_111'] . "</option>\n";
    echo "</select>\n";
    echo "<select name='sortDir' class='textbox'>\n";
    echo "<option value='0'" . ($_REQUEST['sortDir'] == 0 ? " selected='selected'" : "") . ">" . $locale['urg_shop_112'] . "</option>\n";
    echo "<option value='1'" . ($_REQUEST['sortDir'] == 1 ? " selected='selected'" : "") . ">" . $locale['urg_shop_113'] . "</option>\n";
    echo "</select>\n";
    echo "<input type='submit' value='" . $locale['urg_shop_114'] . "' class='button' />\n";
    echo "</form>\n</td>\n";
    echo "</tr>\n</table>\n";
    render_shop("*", DB_UG3_USAGE, "purchase='1' AND active='1' AND category = '" . $_REQUEST['category'] . "' ", $sortQuery, $sortDirQuery, $rowstart);
    closetable();
}
Example #2
0
     }
     $c_result = dbquery("SELECT * FROM " . DB_UG3_CATEGORIES . " WHERE cat_id = '" . $_GET['id'] . "'");
     $c_data = dbarray($c_result);
     $c_formaction = FUSION_SELF . $aidlink . "&amp;op=useage&amp;step=c_edit&amp;id=" . $c_data['cat_id'];
 } else {
     $c_formaction = FUSION_SELF . $aidlink . "&amp;op=useage";
     $c_data['cat_id'] = '';
     $c_data['cat_name'] = '';
     $c_data['cat_description'] = '';
     $c_data['cat_sorting'] = '';
     $c_data['cat_access'] = '';
 }
 opentable($locale['urg_a_usage_100'], '');
 echo "<table width='100%'>\n<tr>\n";
 echo "<td class='tbl-border' width='50%'>\n";
 $ug_cats = getcats();
 $categories_opts = "";
 $sel = "";
 while (list($key, $ug_cat) = each($ug_cats)) {
     $sel = $data['category'] == $ug_cat['0'] ? " selected='selected'" : "";
     $categories_opts .= "<option value='" . $ug_cat['0'] . "'{$sel}>" . $ug_cat['1'] . "</option>\n";
 }
 //Create / Edit Items
 echo "<form name='item_form' method='post' action='" . $formaction . "'>\n";
 echo "<table align='center' width='100%' cellspacing='2' cellpadding='2'>\n<tr>\n";
 echo "<td colspan='2'><h3>" . $locale["urg_a_usage_107"] . "</h3></td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td width='100px'><strong>" . $locale["urg_a_usage_108"] . "</strong></td>\n";
 echo "<td><input type='text' name='name' value='" . $data["name"] . "' class='textbox' style='width:200px;' />\n";
 echo "<input type='hidden' name='originalname' value='" . $data["name"] . "' /></td>\n";
 echo "</tr>\n<tr>\n";
Example #3
0
<li><a href="#">Contact us</a></li>
</ul>
<div id="form">
<form method="get" action="results.php" enctype="multipart/form-data">
<input type="text" name="user_query" placeholder="search a product"/>
<input type="submit" name="search" value="Search"/>
</form>
</div>
</div>
<div class="content_wrapper">

<div id="sidebar">
<div id="sidebar_title">Categories</div>
<ul id="cats">
<?php 
getcats();
?>

</ul>


</div>
<div id="content_area">
<div id="shopping_cart">
<span style="float:right;font-size:18px;padding:5px;line-height:40px;">
Welcome Guest! <b style="color:yellow"> Shopping Cart -</b>Total Items:Total price:<a href="cart_ece.php" style="color:yellow">Go to cart</a>
</span>