示例#1
0
文件: yywd.php 项目: justin1986/hoau
<?php

require_once '../frame.php';
$db = get_db();
$title = $_REQUEST['title'];
$title = format_mssql($title);
$province = $_REQUEST['province'];
$city = $_REQUEST['city'];
$id_drd = $_REQUEST['is_drd'];
$is_new = $_REQUEST['is_new'];
$sql = "select t1.*,t2.PMC,t3.CITYNAME from hoau_yywd t1 left join hoau_new_province t2 on t1.SF=t2.PID left join hoau_new_city t3 on t1.CS=t3.CITYID where 1=1";
if ($title != '') {
    $sql = $sql . " and (QYBH like '%{$title}%' or QYMC like '%{$title}%' or GSBH like '%{$title}%' or GSJC like '%{$title}%' or SJGSBH like '%{$title}%' or ZS like '%{$title}%' or DH like '%{$title}%' or CZ like '%{$title}%' or YB like '%{$title}%' or BZ like '%{$title}%' or QH like '%{$title}%')";
}
if ($province != '0' && $province != '') {
    $sql = $sql . " and SF='{$province}'";
}
if ($city != '0' && $city != '' && $city != 'undefined') {
    $sql = $sql . " and CS='{$city}'";
}
if ($id_drd != '') {
    if ($id_drd == 1) {
        $sql = $sql . " and SFTGDRDFW={$id_drd}";
    } else {
        $sql = $sql . " and (SFTGDRDFW is null or SFTGDRDFW<>1)";
    }
}
if ($is_new != '') {
    $sql = $sql . " and is_new={$is_new}";
}
$sql = $sql . " order by GSJC asc";
示例#2
0
<?php

require_once '../frame.php';
$id = $_POST['id'];
//var_dump($_POST);
$position = new table_class('hoau_position');
if ($id != '') {
    $position->find($id);
}
$position->name = $_POST['post']['name'];
$position->priority = $_POST['post']['priority'];
$position->jieshao = $_POST['post']['jieshao'];
$position->jieshao = format_mssql($position->jieshao);
$position->save();
redirect($_POST['url']);