$content = '';
if (count($brands) == 0) {
    $content .= '<h3>No Brand found in database</h3>';
} else {
    $btable = array();
    $bt = array();
    $bt['id'] = 'ID';
    $bt['logo'] = 'Brand Logo';
    $bt['name'] = 'Name';
    $bt['status'] = 'Active in J&amp;G';
    $bt['w100'] = 'Active Products';
    $btable[] = $bt;
    foreach ($brands as $b) {
        $link = '<a href="?open=products-brand&amp;id=' . $b['products_brand_id'] . '">%s</a>';
        $logo = $b['brand_image'] == '' ? '<span class="notice">No Logo</span>' : sprintf($link, webImage($b['brand_image'], '', '50'));
        $bt = array();
        $bt['id'] = sprintf($link, $b['products_brand_id']);
        $bt['logo'] = '<div style="width:100%;height:100%;padding:10px 0;background:#fff;">' . $logo . '</div>';
        $bt['name'] = sprintf($link, $b['brand_name']);
        $status_img = 'icon-tick';
        if ($b['active_status'] != '1') {
            $status_img .= '-dis';
        }
        $bt['status'] = '<img src="images/' . $status_img . '.png" />';
        $bt['tac'] = strval($class_pb->getTotalProducts($b['products_brand_id']));
        $btable[] = $bt;
    }
    $content .= tep_draw_table('', $btable);
}
$content .= '<div class="buttons-left"><input type="button" class="blue" name="create" value="Create New Brand" onclick="location.href=\'?open=products-brand\';" /></div>';
$title = 'Products Brands';
Esempio n. 2
0
    } elseif ($_GET['action'] == 'update') {
        $messagebox->add('Brand data is successfully updated', 'green');
    }
}
$content .= '';
if ($brand_desc_preview != '') {
    $content .= '<div style="float:left;">';
    $content .= $brand_image;
    $content .= $brand_desc_preview;
    $content .= '</div>';
    $content .= '<div style="margin-left:530px;">';
} else {
    $content .= '<div>';
}
$content .= '<form name="pbrand" action="?open=products-brand" method="post" enctype="multipart/form-data">';
$total_products = $brand_id > 0 ? $class_pb->getTotalProducts($brand_id) : 0;
if (!$is_deleted) {
    $content .= '<input type="hidden" name="me_action" value="SAVEPRODUCTSBRAND" />';
    $content .= '<input type="hidden" name="brand_id" value="' . $brand_id . '" />';
    $content .= '<table border="0" cellpadding="0" cellspacing="0">';
    $content .= '<tr><td width="130">Active Status</td><td><input type="checkbox" id="brandstatus" name="active_status" value="1" ' . $active_status . ' /> <label for="brandstatus" class="red">Check this to activate brand in J&G Website</label></td></tr>';
    $content .= '<tr><td>Active Products</td><td>' . strval($total_products) . '</td></tr>';
    $content .= '<tr><td>Brand Name</td><td><input type="text" name="brand_name" value="' . $brand_name . '" class="input2" /></td></tr>';
    $content .= '<tr><td>Brand Description</td><td><textarea id="brand-desc" name="brand_description" class="input2" style="height:100px;">' . $brand_desc . '</textarea></td></tr>';
    $content .= '<tr><td>SEO Brand Text</td><td><textarea id="seo_text" name="seo_text" class="input2" style="height:100px;">' . $seo_text . '</textarea></td></tr>';
    $content .= '<tr><td>Upload Brand Logo</td><td><input type="file" name="brand_image" /></td></tr>';
    $content .= '<tr><td>Need Repackaging</td><td><input type="checkbox" name="need_repackaging" ' . $need_repackaging . ' value="1" /></td></tr>';
    $content .= '<tr><td colspan="2" style="padding-top:20px;"><h3>Brand ID in Sales Partner</h3></td></tr>';
    $partners = $class_sp->retrieveList();
    $sp_brands = $brand_id != '' ? $class_pb->getSPbrands($brand_id) : array();
    foreach ($partners as $p) {