當前位置: 首頁>>代碼示例>>PHP>>正文


PHP design::getDesignType方法代碼示例

本文整理匯總了PHP中design::getDesignType方法的典型用法代碼示例。如果您正苦於以下問題:PHP design::getDesignType方法的具體用法?PHP design::getDesignType怎麽用?PHP design::getDesignType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在design的用法示例。


在下文中一共展示了design::getDesignType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: drawKPItable


//.........這裏部分代碼省略.........
    } elseif ($kpi_type2) {
        $kpi_target[2] = $bgst['kpides_prodnl'];
        $kpi_target[3] = $bgst['kpides_prodbl'];
        $kpi_target[4] = $bgst['kpides_proder'];
        $kpi_target[9] = $bgst['kpides_prodch'];
        $kpi_target[28] = $bgst['kpides_prodpn'];
        $kpi_target[29] = $bgst['kpides_prodrg'];
        $kpi_target[30] = $bgst['kpides_prodset'];
        $kpi_target[33] = $bgst['kpides_prodan'];
        while ($row = tep_db_fetch_array($r)) {
            $kpi_data[$row['products_category_id']] = $row['total_designs'];
        }
        $pcs = getProductsCategorySupportData();
        $q = "SELECT {$pcs['field_id']} AS id, {$pcs['field_name']} AS name FROM {$pcs['tables']} WHERE {$pcs['filter']}";
        $dbq = tep_db_query($q);
        while ($r = tep_db_fetch_array($dbq)) {
            $descats_temp[$r['id']] = $r['name'];
        }
        //SORT Product Category as Requested by user
        $descats_sorts = array(4 => 1, 2 => 2, 3 => 3, 29 => 4, 30 => 5, 9 => 6, 28 => 7, 33 => 8, 35 => 9);
        foreach ($descats_temp as $key => $val) {
            $descats_temp2[$descats_sorts[$key]] = $key;
        }
        ksort($descats_temp2);
        foreach ($descats_temp2 as $val) {
            $descats[$val] = $descats_temp[$val];
        }
    } elseif ($kpi_type3) {
        $kpi_target[1] = $bgst['kpides_pr1target'];
        $kpi_target[2] = $bgst['kpides_pr2target'];
        $kpi_target[3] = $bgst['kpides_pr3target'];
        $kpi_target[4] = $bgst['kpides_pr4target'];
        $kpi_target[5] = $bgst['kpides_pr5target'];
        $kpi_target[6] = $bgst['kpides_pr6target'];
        $kpi_target[7] = $bgst['kpides_pr7target'];
        $kpi_target[8] = $bgst['kpides_pr8target'];
        while ($row = tep_db_fetch_array($r)) {
            if ($row['target_price'] >= $bgst['kpides_pr1bgn'] && $row['target_price'] <= $bgst['kpides_pr1end']) {
                $kpi_data[1] += $row['total_designs'];
            } elseif ($row['target_price'] >= $bgst['kpides_pr2bgn'] && $row['target_price'] <= $bgst['kpides_pr2end']) {
                $kpi_data[2] += $row['total_designs'];
            } elseif ($row['target_price'] >= $bgst['kpides_pr3bgn'] && $row['target_price'] <= $bgst['kpides_pr3end']) {
                $kpi_data[3] += $row['total_designs'];
            } elseif ($row['target_price'] >= $bgst['kpides_pr4bgn'] && $row['target_price'] <= $bgst['kpides_pr4end']) {
                $kpi_data[4] += $row['total_designs'];
            } elseif ($row['target_price'] >= $bgst['kpides_pr5bgn'] && $row['target_price'] <= $bgst['kpides_pr5end']) {
                $kpi_data[5] += $row['total_designs'];
            } elseif ($row['target_price'] >= $bgst['kpides_pr6bgn'] && $row['target_price'] <= $bgst['kpides_pr6end']) {
                $kpi_data[6] += $row['total_designs'];
            } elseif ($row['target_price'] >= $bgst['kpides_pr7bgn'] && $row['target_price'] <= $bgst['kpides_pr7end']) {
                $kpi_data[7] += $row['total_designs'];
            } elseif ($row['target_price'] > $bgst['kpides_pr8bgn']) {
                $kpi_data[8] += $row['total_designs'];
            }
        }
        $descats[1] = "{$bgst['kpides_pr1bgn']} - {$bgst['kpides_pr1end']}";
        $descats[2] = "{$bgst['kpides_pr2bgn']} - {$bgst['kpides_pr2end']}";
        $descats[3] = "{$bgst['kpides_pr3bgn']} - {$bgst['kpides_pr3end']}";
        $descats[4] = "{$bgst['kpides_pr4bgn']} - {$bgst['kpides_pr4end']}";
        $descats[5] = "{$bgst['kpides_pr5bgn']} - {$bgst['kpides_pr5end']}";
        $descats[6] = "{$bgst['kpides_pr6bgn']} - {$bgst['kpides_pr6end']}";
        $descats[7] = "{$bgst['kpides_pr7bgn']} - {$bgst['kpides_pr7end']}";
        $descats[8] = "&gt;&nbsp;{$bgst['kpides_pr8ge']}";
    } elseif ($kpi_type4) {
        $kpi_target['I'] = $bgst['kpides_typib'];
        $kpi_target['E'] = $bgst['kpides_typeb'];
        $kpi_target['T'] = $bgst['kpides_typth'];
        while ($row = tep_db_fetch_array($r)) {
            $kpi_data[$row['designs_type']] += $row['total_designs'];
        }
        $descats = design::getDesignType();
        if (array_key_exists('', $kpi_data)) {
            $descats[''] = '<span class="red">Unset</span>';
        }
    }
    $descat_count_total = array_sum($kpi_data);
    if (count($descats) > 0) {
        foreach ($descats as $key => $dc) {
            if ($descat_count_total == 0) {
                $descat_count[$key] = 0;
                $descat_percent[$key] = 0;
            } else {
                $descat_count[$key] = !isset($kpi_data[$key]) ? 0 : $kpi_data[$key];
                $descat_percent[$key] = number_format($descat_count[$key] / $descat_count_total * 100, 1);
            }
        }
    }
    $kpi_table = '';
    $kpi_table .= '<div id="' . $kpi_id . '" class="ibox ui-corner-all kpi-box" style="margin:0 0 10px 10px;float:left;' . ($hidetable ? 'display:none;' : '') . '">';
    $kpi_table .= '<input type="hidden" value="' . $kpi_title . '"/>';
    $kpi_table .= '<h3>KPI : ' . $kpi_header . '</h3>';
    $kpi_table .= '<table class="spo" border="0" cellpadding="0" cellspacing="0">';
    $kpi_table .= '<tr><td class="bold">' . (in_array($kpi_title, array('WIPT', 'FINT')) ? 'Type' : 'Category') . '</td><td class="bold" colspan="2" style="white-space:nowrap;">Total Designs</td><td class="bold" style="text-align:right;">Target</td></tr>';
    foreach ($descats as $key => $dc) {
        $kpi_table .= '<tr><td>' . $dc . '</td><td>' . $descat_count[$key] . '</td><td style="text-align:right;">' . $descat_percent[$key] . '%</td><td style="text-align:right;">' . $kpi_target[$key] . '%</td></tr>';
    }
    $kpi_table .= '<tr><td width="100" class="bold">Total Designs</td><td width="20" class="bold">' . $descat_count_total . '</td><td width="50">&nbsp;</td><td width="50">&nbsp;</td></tr>';
    $kpi_table .= '</table></div>';
    return $kpi_table;
}
開發者ID:blasiuscosa,項目名稱:manobo-2008,代碼行數:101,代碼來源:designs-manage.php


注:本文中的design::getDesignType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。