日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php js脚本查询php,php结合js实现多条件组合查询

發布時間:2025/3/15 php 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php js脚本查询php,php结合js实现多条件组合查询 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本文實例為大家分享了php結合js實現多條件組合查詢的具體代碼,供大家參考,具體內容如下

一、效果圖

二、前端代碼

Jquery分類

.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;}

$(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);

};

/*//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*/

筆記本品牌

不限

聯想(Lenovo)

宏碁(Acer)

華碩(ASUS)

戴爾(DELL)

蘋果(Apple)

三星 (SAMSUNG)

價格范圍

不限

1000-2999

3000-3499

4000-4499

5000-5999

6000-6999

7000及以上

尺寸范圍

不限

8.9英寸及以下

11英寸

12英寸

13英寸

14英寸

15英寸及以上

三、服務端代碼

goodsController.class.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();

}

?>

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

總結

以上是生活随笔為你收集整理的php js脚本查询php,php结合js实现多条件组合查询的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。