if (!empty($model_object->info)) { $cache_id = $mod_id; $viewhelper->setTitle($model_object->info['name'] . L("sub_" . $mod, "tpl")); if (empty($model_object->info['description'])) { $model_object->info['description'] = nl2br(L("sub_default_desc", "tpl", $model_object->info['name'])); } $viewhelper->setMetaDescription($model_object->info['description']); $viewhelper->setMetaKeyword(implode(",", array($model_object->info['name'] . L("offer", "tpl"), $model_object->info['name'] . L("market", "tpl"), $model_object->info['name'] . L("product_center", "tpl"), $model_object->info['name'] . L("yellow_page", "tpl"), $model_object->info['name'] . L("info", "tpl")))); setvar("item", $model_object->info); } } else { $datas = cache_read($mod); $datas = $special_controller->array_multi2single($datas); $alphabet_sorts = array(); foreach ($datas as $key => $val) { $letter = strtoupper(L10n::getinitial($val)); $alphabet_sorts[$letter]['child'][$key]['id'] = $key; $alphabet_sorts[$letter]['child'][$key]['title'] = $val; } ksort($alphabet_sorts); setvar("alpha_datas", $alphabet_sorts); setvar("type", $mod); setvar("station_name", L("sub_" . $mod, "tpl")); unset($datas, $alphabet_sorts); $tpl_file = "special/list"; $viewhelper->setTitle(L("sub_" . $mod, "tpl")); } } } $membertypes = cache_read("type", "membertype"); setvar("member_types", $membertypes);
} else { $vals['company_id'] = $pdb->GetOne("SELECT id FROM {$tb_prefix}companies WHERE name='" . $_POST['company_name'] . "'"); } } if (isset($_POST['brand']['username'])) { if (!pb_strcomp($_POST['brand']['username'], $_POST['username'])) { $vals['member_id'] = $pdb->GetOne("SELECT id FROM {$tb_prefix}members WHERE username='******'brand']['username'] . "'"); } else { $vals['member_id'] = $pdb->GetOne("SELECT id FROM {$tb_prefix}members WHERE username='******'username'] . "'"); } } $attachment->rename_file = "brand-" . ($brand->getMaxId() + 1); if (!empty($id)) { $attachment->rename_file = "brand-" . $id; } $vals['letter'] = L10n::getinitial($vals['name']); if (!empty($vals['description'])) { $vals['description'] = stripcslashes($vals['description']); } if (!empty($_FILES['pic']['name'])) { $attachment->upload_process(); $vals['picture'] = $attachment->file_full_url; } if (!empty($id)) { $result = $brand->save($vals, "update", $id); } else { $result = $brand->save($vals); } if (!$result) { flash(); }
$result['trend_data'] = true; setvar("item", $result); $tpl_file = "detail.default"; } else { flash("data_not_exists"); } } /**types**/ $price->findIt("productcategories"); if (!empty($price->params['data'])) { setvar("Items", $price->params['data'][1]); } /**types**/ $alphabet_sorts = $cats = array(); foreach ($price->params['result'] as $key1 => $val1) { $tmp_str = L10n::getinitial($val1['name']); $alphabet_sorts[$tmp_str][$val1['id']] = $val1['name']; if ($val1['parent_id'] == 0) { $cats[$val1['id']]['id'] = $val1['id']; $cats[$val1['id']]['title'] = $val1['name']; foreach ($price->params['result'] as $key2 => $val2) { if ($val2['parent_id'] == $val1['id']) { $cats[$val1['id']]['child'][$val2['id']]['id'] = $price->params['result'][$key2]['id']; $cats[$val1['id']]['child'][$val2['id']]['title'] = $price->params['result'][$key2]['name']; foreach ($price->params['result'] as $key3 => $val3) { if ($val3['parent_id'] == $val2['id']) { $cats[$val1['id']]['child'][$val2['id']]['child'][$val3['id']] = $price->params['result'][$key3]; } } } }