$title, "CSS" => "./style.css")); $my_meta->full(); require_once ("lib/TDBEngine.php"); class TMyEngine extends TDBEngine { function client_item_vars($vars = "") { if (is_array($vars['type_short'])&&is_array($vars['type'])) { foreach ($vars['type'] as $key => $val) { if ($vars['type_short'][$key] != "") { $vars['type'][$key] = $vars['type_short'][$key]; } } } else { if ($vars['type_short'] != "") { $vars['type'] = $vars['type_short']; } } if (is_array($vars['objs_short'])&&is_array($vars['objs'])) { foreach ($vars['objs'] as $key => $val) { if ($vars['objs_short'][$key] != "") { $vars['objs'][$key] = $vars['objs_short'][$key]; } } } else { if ($vars['objs_short'] != "") { $vars['objs'] = $vars['objs_short']; } } return $vars; } } function build_select($my, $value, $filed_val, $filed_key, $sql, $tbl, $ord, $arr = "") { if ($sql != "") { $sql = "select distinct date_start from sea_base order by date_start"; $vars_list = $my->items->list_db($tbl, array("sql" => $sql)); } else { $vars_list = $my->items->list_db($tbl, array("order" => $ord)); } $html = ""; if (is_array($vars_list)) foreach ($vars_list as $key => $val) { $sel = ""; if ($value == $val[$filed_val]) { $sel = " selected"; } if ($val[$filed_val] > 0) { if (($arr == "") || (isset($arr[$val[$filed_val]]))) { if (is_array($filed_key)) { $filed = ""; foreach ($filed_key as $key_2 => $val_2) { if ($filed == "") { if ($val[$val_2] != "") { $filed = $val[$val_2]; } } } } else { $filed = $val[$filed_key]; } $html .= "\n"; } } } return $html; } $my = new TMyEngine(array("table" => "sea_base", "user" => true)); $total = $my->items->get_count($my->table, "_enable=1"); ?>

Морские проекты в Северной Евразии

Информационная база данных (число проектов: )

Все года\n"; $vars['_date'] = $date_select.build_select($my, $_list_date, 'date_start', 'date_start', "select distinct date_start from sea_base order by date_start", "sea_base", ""); $region_select = "\n"; $vars['_region'] = $region_select.build_select($my, $_list_region, 'id', 'title', "", "sea_list_region", "title"); $type_select = "\n"; $arr = ""; if ($opt == "cng_type") { $sql = "select distinct slt.id as id from sea_base as b, sea_list_type as slt, sea_list_objs as slo, sea_map as m2, sea_map as m3 where (m2.base_id = b.id and m2.list_id = slt.id and m2.type='type') and (m3.base_id = b.id and m3.list_id = slo.id and m3.type='objs' and m3.list_id = '".$_list_objs."') and b._enable=1"; $arr = $my->items->list_db($my->table, array("sql" => $sql)); if (is_array($arr)) { foreach ($arr as $key => $val) { $tmp[$val['id']] = true; } $arr = $tmp; } else { $arr = array(); } } $vars['_type'] = $type_select.build_select($my, $_list_type, 'id', 'title', "", "sea_list_type", "_order, title", $arr); $objs_select = "\n"; $arr = ""; if ($opt == "cng_objs") { $sql = "select distinct slo.id as id from sea_base as b, sea_list_type as slt, sea_list_objs as slo, sea_map as m2, sea_map as m3 where (m2.base_id = b.id and m2.list_id = slt.id and m2.type='type' and m2.list_id = '".$_list_type."') and (m3.base_id = b.id and m3.list_id = slo.id and m3.type='objs') and b._enable=1"; $arr = $my->items->list_db($my->table, array("sql" => $sql)); if (is_array($arr)) { foreach ($arr as $key => $val) { $tmp[$val['id']] = true; } $arr = $tmp; } else { $arr = array(); } } $vars['_objs'] = $objs_select.build_select($my, $_list_objs, 'id', 'title', "", "sea_list_objs", "_order, title", $arr); $tpl = new TTemplate(array("template_file" => "./templates/common.inc")); $html = $tpl->get($vars, "client_search"); echo $html; ?> "?".$GLOBALS['QUERY_STRING']); $my->client(array("sql" => $sql, "multi" => true, "vars" => $vars)); } else { ?>

Полный перечень проектов