当前位置: 首页>>代码示例>>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;未经允许,请勿转载。