欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php結(jié)合js實現(xiàn)多條件組合查詢

 更新時間:2019年05月28日 10:00:13   作者:苦的人生遇見甜  
這篇文章主要為大家詳細介紹了php結(jié)合js實現(xiàn)多條件組合查詢,具有一定的參考價值,感興趣的小伙伴們可以參考一下

一、效果圖

二、前端代碼

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Jquery分類</title> 
<script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
<style type="text/css"> 
 .templinkactive { 
 padding:5px; 
 text-decoration:none; 
 color:red; 
 } 
 .templink { 
 cursor:pointer; 
 padding:5px; 
 text-decoration:none; 
 } 
 table{border:1px solid #ccc;}
 table tr{ height:35px;} 
</style>
<script type="text/javascript"> 
 $(function () { 
 //品牌 
 var alink01 = $("#linktype01").find("span"); 
 alink01.click(function () { 
 alink01.each(function () { 
 $(this).removeClass("templinkactive").addClass("templink"); 
 }); 
 $(this).removeClass("templink").addClass("templinkactive"); 
 $("#Brand").val($(this).attr("tag"));
 SetPara();
 });

 //價格 
 var alink02 = $("#linktype02").find("span"); 
 alink02.click(function () { 
 alink02.each(function () { 
 $(this).removeClass("templinkactive").addClass("templink"); 
 }); 
 $(this).removeClass("templink").addClass("templinkactive"); 
 $("#Price").val($(this).attr("tag"));
 SetPara();
 }) 

 //尺寸 
 var alink03 = $("#linktype03").find("span"); 
 alink03.click(function () { 
 alink03.each(function () { 
 $(this).removeClass("templinkactive").addClass("templink"); 
 }); 
 $(this).removeClass("templink").addClass("templinkactive"); 
 $("#Size").val($(this).attr("tag")); 
 SetPara(); 
 }); 
 }); 

 function SetPara() { 
 var Brand = $("#Brand").val(); 
 var Price = $("#Price").val(); 
 var Size = $("#Size").val(); 
 alert("1.php?Brand=" + Brand + "&Price=" + Price + "&Size=" + Size); 
 // var keywords = $("#search").val();
  // var skip_url = "http://" + window.location.hostname + window.location.pathname;
  // var url = skip_url + "?s=/admin/goods/goods_list/Brand/"+Brand+"/Price/"+Price+"/Size/"+Size;
  // window.location.href = url;
  // alert(url); 
 }; 
</script>
<script type="text/javascript">
 /*//TP框架-start
 $(function(){
  var Brand = $("#Brand").val();
  var Price = $("#Price").val();
  var Size = $("#Size").val();
  // alert(tag);
  if(Brand != ''){
   $("#linktype01").find("span").removeClass("templinkactive").addClass("templink")
   $('span[tag="'+Brand+'"]').css('color','red');
  }
  if(Price != ''){
   $("#linktype02").find("span").removeClass("templinkactive").addClass("templink")
   $('span[tag="'+Price+'"]').css('color','red');
  }
  if(Size != ''){
   $("#linktype03").find("span").removeClass("templinkactive").addClass("templink")
   $('span[tag="'+Size+'"]').css('color','red');
  }
 });
 //TP框架-end*/
</script>
</head> 
<body> 
 <form id="form1" runat="server"> 
 <div> 
 <table> 
 <tr id="linktype01"> 
  <td style="width:100px"> 
  <b>筆記本品牌</b> 
  </td> 
  <td> 
  <span class='templinkactive' tag="0">不限</span> 
  </td> 
  <td> 
  <span class='templink' tag="100101">聯(lián)想(Lenovo)</span> 
  </td> 
  <td> 
  <span class='templink' tag="100102">宏碁(Acer)</span> 
  </td> 
  <td> 
  <span class='templink' tag="100103">華碩(ASUS)</span> 
  </td> 
  <td> 
  <span class='templink' tag="100104">戴爾(DELL)</span> 
  </td> 
  <td> 
  <span class='templink' tag="100105">蘋果(Apple)</span> 
  </td> 
  <td> 
  <span class='templink' tag="100106">三星 (SAMSUNG)</span> 
  </td> 
 </tr> 
 <tr id="linktype02"> 
  <td style="width:100px"> 
  <b>價格范圍</b> 
  </td> 
  <td> 
  <span class='templinkactive' tag="0">不限</span> 
  </td> 
  <td> 
  <span class='templink' tag="100201">1000-2999</span> 
  </td> 
  <td> 
  <span class='templink' tag="100202">3000-3499</span> 
  </td> 
  <td> 
  <span class='templink' tag="100203">4000-4499</span> 
  </td> 
  <td>
  <span class='templink' tag="100204">5000-5999</span>
  </td>
  <td>
  <span class='templink' tag="100205">6000-6999</span>
  </td>
  <td>
  <span class='templink' tag="100206">7000及以上</span>
  </td>
 </tr>
 <tr id="linktype03">
  <td style="width:100px">
  <b>尺寸范圍</b>
  </td>
  <td>
  <span class='templinkactive' tag="0" >不限</span>
  </td>
  <td>
  <span class='templink' tag="100301">8.9英寸及以下</span>
  </td>
  <td>
  <span class='templink' tag="100302">11英寸</span>
  </td>
  <td>
  <span class='templink' tag="100303">12英寸</span>
  </td>
  <td>
  <span class='templink' tag="100304">13英寸</span>
  </td>
  <td>
  <span class='templink' tag="100305">14英寸</span>
  </td>
  <td>
  <span class='templink' tag="100306">15英寸及以上</span>
  <input type="hidden" id="Brand" value="" />
  <input type="hidden" id="Price" value="" />
  <input type="hidden" id="Size" value="" />
  </td> 
 </tr> 
 </table> 
 </div> 
 </form> 
</body> 
</html>

三、服務端代碼

goodsController.class.php

<?php
public function goods_list(){
 $Brand= I('Brand');
 $Price= I('Price');
 $Size= I('Size');
 $this->assign('Brand',$Brand);
 $this->assign('Price',$Price);
 $this->assign('Size',$Size);
 $this->display();
}
?>

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 一個JavaScript的求愛小特效

    一個JavaScript的求愛小特效

    本文做了一個JavaScript的求愛小特效,不僅能出現(xiàn)下面的圖的效果,還可以讓這個圖形跟隨著鼠標轉(zhuǎn)動哦,需要的朋友可以參考下
    2014-05-05
  • div+css布局的圖片連續(xù)滾動js實現(xiàn)代碼

    div+css布局的圖片連續(xù)滾動js實現(xiàn)代碼

    整理一個div+css圖片連續(xù)滾動代碼,原理跟腳本之家之前發(fā)布的文章一樣。
    2010-05-05
  • uni-app中Navigator組件的用法詳解及傳參方式

    uni-app中Navigator組件的用法詳解及傳參方式

    這篇文章主要給大家介紹了關(guān)于uni-app中Navigator組件的用法詳解及傳參方式的相關(guān)資料,在實際應用開發(fā)中我們經(jīng)常要使用到路由跳轉(zhuǎn),在uniapp官網(wǎng)中提供了navigator內(nèi)置組件,供我們使用,需要的朋友可以參考下
    2023-09-09
  • 快速使用Bootstrap搭建傳送帶

    快速使用Bootstrap搭建傳送帶

    這篇文章主要介紹了快速使用Bootstrap搭建傳送帶的相關(guān)資料,非常具有參考借鑒價值,需要的朋友可以參考下
    2016-05-05
  • javascript實現(xiàn)點擊按鈕切換輪播圖功能

    javascript實現(xiàn)點擊按鈕切換輪播圖功能

    這篇文章主要為大家詳細介紹了javascript實現(xiàn)點擊按鈕切換輪播圖功能,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-09-09
  • js實現(xiàn)手機發(fā)送驗證碼功能

    js實現(xiàn)手機發(fā)送驗證碼功能

    本文主要介紹了js實現(xiàn)手機發(fā)送驗證碼功能的示例。具有很好的參考價值。下面跟著小編一起來看下吧
    2017-03-03
  • JavaScript實現(xiàn)下拉列表選擇框

    JavaScript實現(xiàn)下拉列表選擇框

    這篇文章主要為大家詳細介紹了JavaScript實現(xiàn)下拉列表選擇框,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-10-10
  • js contains方法實現(xiàn)代碼

    js contains方法實現(xiàn)代碼

    IE有許多好用的方法,后來都被其他瀏覽器抄襲了,比如這個contains方法。如果A元素包含B元素,則返回true,否則false。唯一不支持這個方法的是IE的死對頭firefox。
    2011-01-01
  • 關(guān)于document.cookie的使用javascript

    關(guān)于document.cookie的使用javascript

    設置cookie 每個cookie都是一個名/值對,可以把下面這樣一個字符串賦值給document.cookie:
    2008-04-04
  • JS實現(xiàn)靜態(tài)頁面搜索并高亮顯示功能完整示例

    JS實現(xiàn)靜態(tài)頁面搜索并高亮顯示功能完整示例

    這篇文章主要介紹了JS實現(xiàn)靜態(tài)頁面搜索并高亮顯示功能,涉及javascript事件響應、字符遍歷替換及頁面元素屬性動態(tài)變換等相關(guān)操作技巧,需要的朋友可以參考下
    2017-09-09

最新評論