1 Star 1 Fork 1

gujiejing / WEBWMS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
findcust.php 2.67 KB
一键复制 编辑 原始数据 按行查看 历史
gujiejing 提交于 2018-03-09 15:22 . eefefessdasdfqwerddsssasdfewer
<?php
header('Content-type: text/html; charset=utf-8');
require_once('connDB.php');
if(!isset($_SESSION)){
session_start();
}
$custidt=" ";
$custcnt=" ";
$custent=" ";
$addrt=" ";
$telt=" ";
$contactt=" ";
$typet =" ";
$sql = " ";
if(isset($_POST['research'])){
if($_POST['custid']<>""){
$custidt=$_POST['custid'];
echo $custidt;
}
if($_POST['custcn']<>""){
$custcnt = $_POST['custcn'];
}
if($_POST['custen']<>""){
$custent = $_POST['custen'];
}
if($_POST['addr']<>""){
$addrt = $_POST['addr'];
}
if($_POST['tel']<>""){
$telt = $_POST['tel'];
}
if($_POST['contact']<>""){
$contactt = $_POST['contact'];
}
if($_POST['type']<>""){
$typet = $_POST['type'];
}
$dbc = mysql_connect("localhost","root","root");
mysql_select_db("webwms",$dbc);
mysql_query("set names utf8");
$sql = "SELECT * FROM `cust`";
$sql = $sql." WHERE 1=1 ";
if($custidt<>" "){
$sql = $sql."AND `custid` = '$custidt' ";
}
if($custcnt<>" "){
$sql = $sql."AND `custcn` LIKE '$custcnt' ";
}
if($custent<>" "){
$sql = $sql."AND `custen` LIKE '$custent' ";
}
if($addrt<>" "){
$sql = $sql."AND `addr` LIKE '$addrt' ";
}
if($telt<>" "){
$sql = $sql."AND `tel` = '$telt' ";
}
if($contactt<>" "){
$sql = $sql."AND `contact` LIKE '$contactt' ";
}
if($typet<>" "){
$sql = $sql."AND `type` = '$typet' ";
}
$sql = $sql." ORDER BY `cust`.`id` DESC;";
$arr1 = Array();
$result = mysql_query($sql,$dbc);
$total_Row = mysql_num_rows($resule);
while($Rec_Row=mysql_fetch_assoc($result)){
$arr2=array("id"=>$Rec_Row['id'],
"custid"=>$Rec_Row['custid'],
"custcn"=>$Rec_Row['custcn'],
"custen"=>$Rec_Row['custen'],
"addr"=>$Rec_Row['addr'],
"tel"=>$Rec_Row['tel'],
"contact"=>$Rec_Row['contact'],
"type"=>$Rec_Row['type']);
array_push($arr1,$arr2);
}
$obj->total = $total_Row;
$obj->rows=$arr1;
echo json_encode($obj);
}
/*
SELECT * FROM `cust` WHERE `custid` = 'ballantines' AND `custcn` LIKE '百龄坛' AND `custen` LIKE 'Ballantine’s' AND `addr` LIKE 'wu' AND `tel` = 'wu' AND `contact` LIKE 'wu' AND `type` = 'cust' ORDER BY `id` DESC
SELECT * FROM `cust`
WHERE 1=1
AND `custid` = 'ballantines'
AND `custcn` LIKE '百龄坛'
AND `custen` LIKE 'Ballantine’s'
AND `addr` LIKE 'wu'
AND `tel` = 'wu'
AND `contact` LIKE 'wu'
AND `type` = 'cust'
ORDER BY `id` DESC
$sql = "SELECT * FROM `cust` WHERE `custid` = \'ballantines\' AND `custcn` LIKE \'百龄坛\' AND `custen` LIKE \'Ballantine’s\' AND `addr` LIKE \'wu\' AND `tel` = \'wu\' AND `contact` LIKE \'wu\' AND `type` = \'cust\' ORDER BY `id` DESC";
*/
?>
PHP
1
https://gitee.com/laotou99_admin/WEBWMS.git
git@gitee.com:laotou99_admin/WEBWMS.git
laotou99_admin
WEBWMS
WEBWMS
master

搜索帮助