Exemplo n.º 1
0
$headers['c w150 tac'] = 'Pieces Sold (1)';
$headers['d w150 tac'] = 'Pieces Sold (2)';
$headers['e w100 tac'] = 'Stock Available';
$headers['f w100 tac'] = 'Action';
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADPRODUCT') {
        $pid = tep_db_prepare_input($_POST['pid']);
        $rowclass = tep_db_prepare_input($_POST['rowclass']);
        $product = new product($pid);
        $row = '<tr id="row-' . $pid . '" class="' . $rowclass . '">';
        foreach ($headers as $hk => $hv) {
            $value = '';
            $hk_classes = explode(' ', $hk);
            switch ($hk_classes[0]) {
                case 'a':
                    $value = $product->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
                    break;
                case 'b':
                    $value .= '<strong>' . $product->brand_name . '</strong>';
                    $value .= '<br /><a href="?open=product-detail&amp;products_id=' . $product->id . '" target="_blank">' . $product->id . ' / ' . $product->code . '</a>';
                    if (!is_null($product->last_keep_timestamp)) {
                        $value .= '<br /><br />';
                        $value .= '<span class="red">&laquo; Last kept on ' . date('d.m.Y', $product->last_keep_timestamp) . ' by ' . $product->last_keep_by . ' &raquo;</span>';
                    }
                    break;
                case 'c':
                    $value = $product->displayYearlySoldTable();
                    break;
                case 'd':
                    $value = $product->displayRecentSoldTable();
                    break;
Exemplo n.º 2
0
 use_class('element');
 $prid = $pid;
 $family_id = $p_data['p']['family_id'];
 $stars = $p_data['p']['stars'];
 $obj_family = new products_family(null, $pid);
 $family_name = $obj_family->name;
 $prinfo = constructProductDetailInfo($pid, $p_data, true, true);
 if ($family_id != '') {
     $fm = $obj_family->retrieveMembers();
     foreach ($fm as $fpid) {
         $family_is_locked = (int) $obj_family->productIsFamilyLocked($fpid);
         $family_members[] = "#box-pids-family|{$fpid}||{$family_is_locked}";
     }
 }
 //$primage = webImageWithDetailLinkStars($p_data['p']['products_image'], $image_size_w, $image_size_h, 'Product '.$pid, 'img-border', "Product $pid (Reference product)", '500', '500', $stars);
 $primage = $obj_product->displayImage($image_size_w, $image_size_h, '(Reference Product)');
 /* Moved this as function to object class products_family
    $family_searchkey = $p_data['p']['family_searchkey'];
    
    $q = "SELECT products_id, family_id FROM products";
    $q .= " WHERE products_id != $pid AND family_searchkey = '$family_searchkey'";
    if ($family_id != '') {
        $q .= " AND (family_id != '$family_id'  OR IFNULL(family_id,'') = '')";
    }
    $q .= " UNION";
    $q .= " SELECT p.products_id, p.family_id FROM products_articles pa";
    $q .= " INNER JOIN products p ON p.products_id = pa.products_id";
    $q .= " WHERE pa.products_id != $pid AND pa.family_searchkey = '$family_searchkey'";
    if ($family_id != '') {
        $q .= " AND (p.family_id != '$family_id'  OR IFNULL(p.family_id,'') = '')";
    }