- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
function select_district_area_city($selctor1,$selector2,$url,$bind_after_selector="", $bind_after_function="",$url2="", $pref=""){
$add_url=(empty($pref)?'""':'"&pref='.$pref.'"');
$main_page=is_home() && empty($_GET);
?>
<script type="text/javascript">
$(document).ready(function(){
$("<?=$selctor1?>").bind("change",new_chenge);
new_chenge();
//функция для отображения на карте
//alert("44444");
function new_chenge(){
params=$("<?=$selctor1?>").val();
//;
<?=($main_page?'showAddress(params);':'');?>
if (params.length > 0){
params='<?=$url?>='+params+<?=$add_url?>;
$("<?=$selector2?>").load(params,"",function(){
hidden_area=$("#<?=$pref?>hidden_area").val();
if (hidden_area.length > 0){
//$("#for_select_area")
$("#<?=$pref?>for_select_area [value='"+hidden_area+"']").attr("selected", "selected");
//showAddress_7(hidden_area);
<?=($main_page?'showAddress_7(hidden_area);':'');?>
<?=$pref?>new_chenge2();
}
if('<?=$bind_after_selector?>'.length > 0 && '<?=$bind_after_function?>'.length > 0){
if ($('<?=$bind_after_selector?>').length > 0){
$('<?=$bind_after_selector?>').bind(<?=$bind_after_function?>);
}
}
});
}
}
function <?=$pref?>new_chenge2(){
//alert("qqqqqq");
params2=$('<?=$bind_after_selector?>').val();
$("#<?=$pref?>hidden_area").val(params2);
//showAddress_7(params2);
<?=($main_page?'showAddress_7(params2);':'');?>
hidden_sity=$("#<?=$pref?>hidden_sity").val();
params2=params2+"&l1="+$("<?=$selctor1?>").val();
params2='<?=$url2?>'+"/?ajax_query&l2="+params2+<?=$add_url?>;
$(".<?=$pref?>for_select_city_load").load(params2,"",function(){
hidden_sity=$("#<?=$pref?>hidden_sity").val();
if (hidden_sity.length > 0){
$("#<?=$pref?>for_select_sity [value='"+hidden_sity+"']").attr("selected", "selected");
//showAddress_13(hidden_sity);
<?=($main_page?'showAddress_13(hidden_sity);':'');?>
}
$('#<?=$pref?>for_select_sity').bind("change",function(){
$("#<?=$pref?>hidden_sity").val($('#<?=$pref?>for_select_sity').val());
//showAddress_13($('#for_select_sity').val());
<?=($main_page?'showAddress_13($("#'.$pref.'for_select_sity").val());':'');?>
});
});
}
//////////////////////////////////////////////
});
</script>
<?
}
Vasiliy 07.02.2012 17:58 # +2
wvxvw 07.02.2012 19:06 # 0
bugmenot 07.02.2012 19:33 # +1
DBdev 07.02.2012 20:18 # 0
У автора везде нестыковки
SmackMyBitchUp 07.02.2012 20:57 # +2
яйцами блестит
istem 07.02.2012 23:19 # 0