コード例 #1
0
function getSellingPointMatrix($category_id = null, $materials_id = null, $jng_sp_id = null)
{
    $result = '';
    if ($jng_sp_id == '2') {
        $result = getSellingPointMatrixOTDE($category_id, $materials_id);
    } elseif ($jng_sp_id == '5') {
        $result = getSellingPointMatrixAMDE($category_id, $materials_id);
    } elseif ($jng_sp_id == '1001') {
        $result = getSellingPointMatrixLAID($category_id, $materials_id);
    }
    return $result;
}
コード例 #2
0
tep_db_connect();
$max_selling_point = 3;
$y_axis = array('1' => 'Silver pure', '52' => 'Silver with Diamond', '52-5' => 'Silver with Diamond & Freshwater Pearl', '2' => 'Silver with CZ', '4' => 'Silver with Swarovski', '22' => 'Silver with Enamel', '17' => 'Goldplated pure', '17-2' => 'Goldplated with CZ', '17-4' => 'Goldplated with Swarovski', '17-22' => 'Goldplated with Enamel', '5' => 'Silver with Freshwater Pearl', '5-4' => 'Silver with Freshwater Pearl & Swarovski', '5-2' => 'Silver with Freshwater Pearl & CZ', '17-5' => 'Goldplated with Freshwater Pearl', '17-5-4' => 'Goldplated with Freshwater Pearl & Swarovski', '17-5-4' => 'Goldplated with Freshwater Pearl & Swarovski');
$x_axis = array('2', '3', '29', '4', '9', 'beads', '28', '33', '30');
$border = ' style="border:solid 1px #000;"';
echo '<table border="0" cellpadding="0" cellspacing="0"' . $border . '>';
echo '<tr>';
echo '<td' . $border . '>&nbsp;</td>';
echo '<td align="center"' . $border . '><b>Necklace</b></td>';
echo '<td align="center"' . $border . '><b>Bracelet</b></td>';
echo '<td align="center"' . $border . '><b>Rings</b></td>';
echo '<td align="center"' . $border . '><b>Earring</b></td>';
echo '<td align="center"' . $border . '><b>Charms</b></td>';
echo '<td align="center"' . $border . '><b>Beads</b></td>';
echo '<td align="center"' . $border . '><b>Pendants</b></td>';
echo '<td align="center"' . $border . '><b>Anklets</b></td>';
echo '<td align="center"' . $border . '><b>Sets</b></td>';
echo '</tr>';
foreach ($y_axis as $m_key => $mat) {
    echo '<tr>';
    echo '<td align="center"' . $border . '><b>' . $y_axis[$m_key] . '</b></td>';
    foreach ($x_axis as $cat) {
        $sel_pt = getSellingPointMatrixAMDE($cat, $m_key);
        $sel_pt_total = count(explode(';', $sel_pt));
        $color = $sel_pt_total >= $max_selling_point ? '#ff868b' : '#8dc63f';
        $title = $sel_pt_total >= $max_selling_point ? 'No new selling point could be added to this category' : 'There still ' . (5 - $sel_pt_total) . ' new selling point could be added to this category';
        echo '<td style="background:' . $color . ';border:solid 1px #000;"><span style="background:black;color:white;padding:2px;" title="' . $title . '">' . $sel_pt_total . '</span><br/>' . str_replace(';', ';<br/>', str_replace('Das ideale Geschenk für die Frau oder Freundin', '<b>Das ideale Geschenk für die Frau oder Freundin</b>', $sel_pt)) . ';</td>';
    }
    echo '</tr>';
}
echo '</table>';