• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Share ajax địa giới Việt Nam chi tiết và chính xác

Admin

Well-Known Member
Staff member
Administrator
Demo
Code:
http://dieptruclam.com/testcode/diagioiVN/
Ai muốn sắp xếp theo tên thì mở tập tin func.php xóa hết và thay bằng
PHP:
<?phpfunction getDiaGioiTinh(){	$result = mysql_query("SELECT * FROM dtl_diagioiVN WHERE phanbiet='0' ORDER BY tentinh") 	or die(mysql_error());
	  while($tier = mysql_fetch_array( $result ))   		{		   echo '<option value="'.$tier['ma'].'">'.$tier['tentinh'].'</option>';		}
}if($_GET['func'] == "drop_1" && isset($_GET['func'])) {    drop_1($_GET['drop_var']); }
function drop_1($drop_var){      include_once('db.php');	$result = mysql_query("SELECT * FROM dtl_diagioiVN WHERE idcho='$drop_var' ORDER BY tentinh") 	or die(mysql_error());		echo '<select name="drop_2" id="drop_2">	      <option value=" " disabled="disabled" selected="selected">Vui lòng chọn huyện</option>';
		   while($drop_2 = mysql_fetch_array( $result )) 			{			  echo '<option value="'.$drop_2['ma'].'">'.$drop_2['tentinh'].'</option>';			}		echo '</select>';	echo "<script type=\"text/javascript\">$('#wait_2').hide();	$('#drop_2').change(function(){	  $('#wait_2').show();	  $('#result_2').hide();      $.get(\"func.php\", {		func: \"drop_2\",		drop_var: $('#drop_2').val()      }, function(response){        $('#result_2').fadeOut();        setTimeout(\"finishAjax_tier_three('result_2', '\"+escape(response)+\"')\", 400);      });    	return false;	});</script>";}

if($_GET['func'] == "drop_2" && isset($_GET['func'])) {    drop_2($_GET['drop_var']); }
function drop_2($drop_var){      include_once('db.php');	$result = mysql_query("SELECT * FROM dtl_diagioiVN WHERE idcho='$drop_var' ORDER BY tentinh") 	or die(mysql_error());		echo '<select name="drop_3" id="drop_3">	      <option value=" " disabled="disabled" selected="selected">Vui lòng chọn xã</option>';
		   while($drop_3 = mysql_fetch_array( $result )) 			{			  echo '<option value="'.$drop_3['ma'].'">'.$drop_3['tentinh'].'</option>';			}		echo '</select> ';}?>
Tải xuống tuoitreit.vn_diagioivn.zip (131.15 KB)
 

Facebook Comments

New posts New threads New resources

Back
Top