本文整理汇总了PHP中CI::Setup方法的典型用法代码示例。如果您正苦于以下问题:PHP CI::Setup方法的具体用法?PHP CI::Setup怎么用?PHP CI::Setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CI
的用法示例。
在下文中一共展示了CI::Setup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculate_setup
function calculate_setup($type = 1)
{
//echo '<pre>';print_r($_POST);exit;
$kVA = $_POST['kVA'];
$phase = $_POST['phase'];
$gen_number = $_POST['gen_number'];
\CI::load()->library('Setup');
\CI::Setup()->set($kVA, $phase, $gen_number);
if (isset($_POST['bon_dau'])) {
\CI::Setup()->bon_dung($_POST['dung_tich_bon_dau'], $_POST['duong_kinh_bon_dau'], $_POST['do_day_bon_dau']);
\CI::Setup()->ong_dan_dau('ODD21', 'VDD21', $_POST['do_dai_ong_dau'], 1);
\CI::Setup()->tu_bom($_POST['so_luong_tu_bom']);
}
//public function ong_khoi($phi, $length, $rockwool = true, $quantity_ong_nhung = 1){
if (isset($_POST['rockwool'])) {
$rockwool = true;
} else {
$rockwool = false;
}
if ($kVA <= 15) {
$phi = 49;
$funnel_quantity = 1;
} else {
if ($kVA >= 750) {
\CI::db()->where('group', 2);
}
$query = \CI::db()->where('kVA <= ', $kVA)->order_by('kVA', 'DESC')->limit(1)->get('parameters_kva');
if ($query->num_rows() > 0) {
$get_phi = $query->row();
if ($_POST['do_dai_ong_khoi'] > 20) {
if ($kVA >= 750) {
\CI::db()->where('group', 2);
}
$query = \CI::db()->where('funnel_phi > ', $get_phi->funnel_phi)->order_by('funnel_phi', 'ASC')->limit(1)->get('parameters_kva');
if ($query->num_rows() > 0) {
$get_phi = $query->row();
$phi = $get_phi->funnel_phi;
} else {
if ($kVA >= 750) {
\CI::db()->where('group', 2);
}
$query = \CI::db()->order_by('funnel_phi', 'DESC')->limit(1)->get('parameters_kva');
$get_phi = $query->row();
$phi = $get_phi->funnel_phi;
}
} else {
$phi = $get_phi->funnel_phi;
}
} else {
if ($kVA >= 750) {
\CI::db()->where('group', 2);
}
$query = \CI::db()->order_by('phi', 'DESC')->limit(1)->get('parameters_kva');
$get_phi = $query->row();
$phi = $get_phi->funnel_phi;
}
$funnel_quantity = $get_phi->funnel_quantity;
}
if (isset($_POST['vat_tu'])) {
\CI::Setup()->ong_khoi($phi, $_POST['do_dai_ong_khoi'], $_POST['do_day_ong_khoi'], $rockwool, 1, $funnel_quantity);
\CI::Setup()->cap_dong_luc($_POST['do_dai_day_cap']);
\CI::Setup()->cap_te($_POST['do_dai_day_cap']);
\CI::Setup()->cap_dieu_khien($_POST['do_dai_day_cap']);
// can xac dinh lai do dai
\CI::Setup()->bao_ve_cap($_POST['do_dai_day_cap']);
\CI::Setup()->vat_tu_phu(1);
}
if (isset($_POST['kiem_dinh'])) {
\CI::Setup()->kiem_dinh($_POST['kd_chat_luong'], $_POST['kd_tt3'], $_POST['thu_tai_gia']);
}
if (isset($_POST['nhan_cong'])) {
\CI::Setup()->nhan_cong($_POST['nc_thao_ra_vo'], $_POST['nc_day_vao_vi_tri_dg'], $_POST['nc_day_vao_vi_tri_pt'], $_POST['nc_lap_may'], $_POST['nc_lap_dat_ats'], $_POST['nc_lap_tu_hoa'], $_POST['nc_hd_sudung_nt']);
}
if (isset($_POST['van_chuyen'])) {
\CI::Setup()->khoang_cach($_POST['province'], $_POST['district'], $_POST['ward'], $_POST['address']);
\CI::Setup()->vc_thu_cong($_POST['transport_hands']);
}
if (isset($_POST['ats'])) {
\CI::Setup()->tu_ats();
}
if (isset($_POST['thoat_nhiet'])) {
\CI::Setup()->thoat_nhiet();
}
echo \CI::Setup()->get_all_value();
exit;
}