Commit 4be24ca1 by felix

移除:

1、登录界面与wordpress相关的信息
2、后台wordpress原始的菜单栏和工具蓝
修改:
1、置业顾问数据单独建立张表,不再把数据添加到wp_usermeta表中。
新增:
1、新房初步功能
parent 79d4c76d
......@@ -111,30 +111,6 @@ else
add_screen_option( 'per_page' );
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' =>
'<p>' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>'
) );
get_current_screen()->add_help_tab( array(
'id' => 'moderating-comments',
'title' => __('Moderating Comments'),
'content' =>
'<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' .
'<p>' . __( 'In the <strong>Author</strong> column, in addition to the author&#8217;s name, email address, and blog URL, the commenter&#8217;s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
'<p>' . __( 'In the <strong>Comment</strong> column, above each comment it says &#8220;Submitted on,&#8221; followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
'<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>'
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
'<p>' . __( '<a href="https://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
'<p>' . __( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
require_once( ABSPATH . 'wp-admin/admin-header.php' );
?>
......
<?php
class House {
public static function init_view(){
wp_enqueue_script('jquery-ui');
wp_enqueue_script('bootstrapjs');
wp_enqueue_style('jquery-ui_css');
wp_enqueue_style('bootstrapcss');
if(isset($_GET["updated"])){
echo "updated success";
}else{
global $wpdb;
$context = array();
$citysql ="select DISTINCT cityId,cityName from";
$cityRes = $wpdb->get_results($citysql.' dic_city');
foreach($cityRes as $value){
$cityParams = array(
"cityId" => $value->cityId,
"cityName" => $value->cityName
);
$context["city"][] = $cityParams;
}
$sql = "select * from";
$buildpropertyRes = $wpdb->get_results($sql.' dic_buildproperty');
foreach($buildpropertyRes as $v){
$buildpropertyParams = array(
"value" => $v->value,
"literal" => $v->literal
);
$context["buildproperty"] []= $buildpropertyParams;
}
$buildpropertyRes = $wpdb->get_results($sql.' dic_room');
foreach($buildpropertyRes as $v){
$roomParams = array(
"value" => $v->value,
"literal" => $v->literal
);
$context["room"] []= $roomParams;
}
House::data_insert();
Timber::render("newhouse.html",$context);
}
}
public static function data_insert(){
global $wpdb;
date_default_timezone_set("Etc/GMT-8");;
//图片信息
$uploadedfile = $_FILES['files'];
//房源与类型以及面积信息
$data = $_POST["data"];
//获取新房信息,存入tospur_house表
$insert_tospur_house_array = array(
'name' => $_POST['name'],
'average_price' => $_POST['average_price'],
'latest_news' => $_POST['event'],
'address' => $_POST['address'],
'traffic' => $_POST['traffic'],
'periphery' => $_POST['periphery'],
'developer' => $_POST['developers'],
'check_in_time' => $_POST['check_in_time'],
'building_type' => $_POST['building_type'],
'property_age' => $_POST['property_age'],
'decoration' => $_POST['decoration'],
'covered_area' => $_POST['acreage'],
'volume_rate' => $_POST['volume_rate'],
'greening_rate' => $_POST['greening_rate'],
'households' => $_POST['households'],
'parking_spaces' => $_POST['parking_spaces'],
'property_management' => $_POST['property_management'],
'overview' => $_POST['overview'],
'plate_id'=>$_POST["basePlateId"],
"room_id"=>$_POST["baseRoom"],
"property_money" =>$_POST["property_money"],
'creattime'=>date("Y-m-d H:i:s")
);
$res = $wpdb->get_results( 'SELECT * FROM tospur_house WHERE name="'.$_POST['name'].'" and address="'.$_POST['address'].'"', OBJECT );
if(!$res){
$houseRes = $wpdb->insert('tospur_house', $insert_tospur_house_array);
if(!$houseRes){
return 500;
}
$houseid = $wpdb->insert_id;
}
for ($x=0; $x<=count($uploadedfile["name"])-1; $x++) {
$uploadParam = array(
"name"=>$uploadedfile["name"]["$x"],
"type"=>$uploadedfile["type"]["$x"],
"tmp_name"=>$uploadedfile["tmp_name"]["$x"],
"error"=>$uploadedfile["error"]["$x"],
"size"=>$uploadedfile["size"]["$x"]
);
//因为file提交过来有一个空的数组,所以这里判断在filename不为空的情况下,再做后续操作
if($uploadParam["name"]!=""){
//从wp_options中获取地址域名
$results = $wpdb->get_row( 'SELECT * FROM wp_options WHERE option_name = "home"', OBJECT );
$patharray = explode("/", $results->option_value);
$path = "/".$patharray[3]."/wp-content/uploads/2015/08/".$uploadParam['name'];
//上传图片
if (!function_exists('wp_handle_upload')){
require_once(ABSPATH.'wp-admin/includes/file.php');
}
$overrides = array( 'test_form' => false);
$movefile = wp_handle_upload($uploadParam,$overrides);
if ( $movefile && !isset( $movefile['error'] ) ) {
//上传成功后将图片信息存入tospur_image表
$insert_image_array = array(
'name' => $uploadParam['name'],
'path' => $path,
'creattime' => date("Y-m-d H:i:s"),
'alt' => "",
'image_type' =>$uploadParam['type']
);
//插入图片表
$imgRes = $wpdb->insert('tospur_image', $insert_image_array);
if(!$imgRes){
return 501;
}
//获取插入图片的id
$imgid = $wpdb->insert_id;
//echo "File is valid, and was successfully uploaded.\n";
} else {
echo $movefile['error'];
}
//房源类型、面积与图片关联表
$houseTypeArea = array(
'house_id' =>$houseid,
"buildproperty_id" => $data["$x"]["buildproperty"],
"house_area" => $data["$x"]["housearea"],
"image_id" =>$imgid
);
$houseTypeAreaRes = $wpdb->insert('a_district_area', $houseTypeArea);
if(!$houseTypeAreaRes){
return 502;
}
//将房源id与图片id储存到关联表中
$house_img_array = array(
'house_id' =>$houseid,
'image_id'=>$imgid
);
$houseImgRes = $wpdb->insert('a_house_image', $house_img_array);
if(!$houseImgRes){
return 503;
}
}
}
}
}
\ No newline at end of file
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=77eb5b80e2738ea76db2)
* Config saved to config.json and https://gist.github.com/77eb5b80e2738ea76db2
*/
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
color: inherit;
font: inherit;
margin: 0;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
input[type="search"] {
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
legend {
border: 0;
padding: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 10px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333333;
}
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
a {
color: #337ab7;
text-decoration: none;
}
a:hover,
a:focus {
color: #23527c;
text-decoration: underline;
}
a:focus {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
figure {
margin: 0;
}
img {
vertical-align: middle;
}
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
.img-rounded {
border-radius: 6px;
}
.img-thumbnail {
padding: 4px;
line-height: 1.42857143;
background-color: #ffffff;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
display: inline-block;
max-width: 100%;
height: auto;
}
.img-circle {
border-radius: 50%;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eeeeee;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
[role="button"] {
cursor: pointer;
}
.modal-open {
overflow: hidden;
}
.modal {
display: none;
overflow: hidden;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
-webkit-overflow-scrolling: touch;
outline: 0;
}
.modal.fade .modal-dialog {
-webkit-transform: translate(0, -25%);
-ms-transform: translate(0, -25%);
-o-transform: translate(0, -25%);
transform: translate(0, -25%);
-webkit-transition: -webkit-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
}
.modal.in .modal-dialog {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal-dialog {
position: relative;
width: auto;
margin: 10px;
}
.modal-content {
position: relative;
background-color: #ffffff;
border: 1px solid #999999;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
-webkit-background-clip: padding-box;
background-clip: padding-box;
outline: 0;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000000;
}
.modal-backdrop.fade {
opacity: 0;
filter: alpha(opacity=0);
}
.modal-backdrop.in {
opacity: 0.5;
filter: alpha(opacity=50);
}
.modal-header {
padding: 15px;
border-bottom: 1px solid #e5e5e5;
min-height: 16.42857143px;
}
.modal-header .close {
margin-top: -2px;
}
.modal-title {
margin: 0;
line-height: 1.42857143;
}
.modal-body {
position: relative;
padding: 15px;
}
.modal-footer {
padding: 15px;
text-align: right;
border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
margin-left: 5px;
margin-bottom: 0;
}
.modal-footer .btn-group .btn + .btn {
margin-left: -1px;
}
.modal-footer .btn-block + .btn-block {
margin-left: 0;
}
.modal-scrollbar-measure {
position: absolute;
top: -9999px;
width: 50px;
height: 50px;
overflow: scroll;
}
@media (min-width: 768px) {
.modal-dialog {
width: 600px;
margin: 30px auto;
}
.modal-content {
-webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.modal-sm {
width: 300px;
}
}
@media (min-width: 992px) {
.modal-lg {
width: 900px;
}
}
.clearfix:before,
.clearfix:after,
.modal-footer:before,
.modal-footer:after {
content: " ";
display: table;
}
.clearfix:after,
.modal-footer:after {
clear: both;
}
.center-block {
display: block;
margin-left: auto;
margin-right: auto;
}
.pull-right {
float: right !important;
}
.pull-left {
float: left !important;
}
.hide {
display: none !important;
}
.show {
display: block !important;
}
.invisible {
visibility: hidden;
}
.text-hide {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.hidden {
display: none !important;
}
.affix {
position: fixed;
}
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=77eb5b80e2738ea76db2)
* Config saved to config.json and https://gist.github.com/77eb5b80e2738ea76db2
*//*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.42857143px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.clearfix:before,.clearfix:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}
\ No newline at end of file
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://v3.bootcss.com/customize/?id=77eb5b80e2738ea76db2)
* Config saved to config.json and https://gist.github.com/77eb5b80e2738ea76db2
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(t){"use strict";function e(e,o){return this.each(function(){var s=t(this),n=s.data("bs.modal"),r=t.extend({},i.DEFAULTS,s.data(),"object"==typeof e&&e);n||s.data("bs.modal",n=new i(this,r)),"string"==typeof e?n[e](o):r.show&&n.show(o)})}var i=function(e,i){this.options=i,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.5",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},i.prototype.show=function(e){var o=this,s=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(s),this.isShown||s.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var s=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),s&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var n=t.Event("shown.bs.modal",{relatedTarget:e});s?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(n)}).emulateTransitionEnd(i.TRANSITION_DURATION):o.$element.trigger("focus").trigger(n)}))},i.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(e){var o=this,s=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var n=t.support.transition&&s;if(this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+s).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),n&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;n?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):r()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},i.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=i,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var o=t(this),s=o.attr("href"),n=t(o.attr("data-target")||s&&s.replace(/.*(?=#[^\s]+$)/,"")),r=n.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(s)&&s},n.data(),o.data());o.is("a")&&i.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){o.is(":visible")&&o.trigger("focus")})}),e.call(n,r,this)})}(jQuery);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,16 +13,20 @@ class SearchDao{
$selectName = "cityId as id,cityName as value";
$where = " where 1=1 ";
$groupBy = " group by cityId";
$params = array();
if($cityId != NULL && $districtId == NULL){
$selectName = "districtId as id,districtName as value";
$where .= " and cityId =".$cityId;
$where .= " and cityId = %d";
$params[] = $cityId;
$groupBy = " group by districtId";
}else if($cityId != NULL && $districtId != NULL){
$selectName = "plateId as id,plateName as value";
$where .= " and cityId = ".$cityId." and districtId = ".$districtId;
$where .= " and cityId = %d and districtId = %d";
$params[] = $cityId;
$params[] = $districtId;
$groupBy = "";
}
$result = $wpdb->get_results('select '.$selectName.' from '.TCSync::DIC_CITY_TABLE.$where.$groupBy);
$result = $wpdb->get_results($wpdb->prepare('select '.$selectName.' from '.TCSync::DIC_CITY_TABLE.$where.$groupBy,$params));
return $result;
}
......@@ -34,9 +38,9 @@ class SearchDao{
global $wpdb;
$where = " where 1=1";
if(isset($_GET['cityId'])){
$where .= " and cityId = ".$cityId;
$where .= " and cityId = %d";
}
$result = $wpdb->get_results('select id,priceValue as value from '.TCSync::DIC_AREA_TABLE.$where);
$result = $wpdb->get_results($wpdb->prepare('select id,priceValue as value from '.TCSync::DIC_AREA_TABLE.$where,$cityId));
return $result;
}
......@@ -68,9 +72,9 @@ class SearchDao{
global $wpdb;
$where = " where 1=1";
if(isset($_GET['cityId'])){
$where .= " and cityId = ".$cityId;
$where .= " and cityId = %d";
}
$result = $wpdb->get_results('select id,priceValue as value from '.TCSync::DIC_UNITPRICERANGE_TABLE.$where);
$result = $wpdb->get_results($wpdb->prepare('select id,priceValue as value from '.TCSync::DIC_UNITPRICERANGE_TABLE.$where,$cityId));
return $result;
}
......@@ -84,7 +88,7 @@ class SearchDao{
if(isset($_GET['cityId'])){
$where .= " and cityId = ".$cityId;
}
$result = $wpdb->get_results('select id,priceValue as value from '.TCSync::DIC_TOTALPRICE_TABLE.$where);
$result = $wpdb->get_results($wpdb->prepare('select id,priceValue as value from '.TCSync::DIC_TOTALPRICE_TABLE.$where,$cityId));
return $result;
}
......@@ -98,13 +102,13 @@ class SearchDao{
if($parentId != NULL){
$where .= " and ParentId =".$parentId;
}
$result = $wpdb->get_results('select Id as id,Name as name from '.TCSync::TOSPUR_ORGANIZATION_TABLE.$where);
$result = $wpdb->get_results($wpdb->prepare('select Id as id,Name as name from '.TCSync::TOSPUR_ORGANIZATION_TABLE.$where,$parentId));
return $result;
}
public static function getCityNameWithId($cityId){
global $wpdb;
$result = $wpdb->get_var("select cityName from ".TCSync::DIC_CITY_TABLE." where cityId = ".$cityId);
$result = $wpdb->get_var($wpdb->prepare("select cityName from ".TCSync::DIC_CITY_TABLE." where cityId = %d",$cityId));
if($result){
return $result;
}else{
......@@ -112,6 +116,54 @@ class SearchDao{
}
}
public static function ajax_searchHouse(){
wp_send_json(SearchDao::searchHouse($_GET["cityId"],$_GET["districtId"],$_GET["plateId"],$_GET["buildPropertyId"],$_GET["roomId"],$_GET["acreage"],$_GET["totalPrice"],$_GET["searchText"]));
}
public static function searchHouse($cityId = NULL,$districtId = NULL,$plateId = NULL,$buildpropertyId = NULL,$roomId = NULL,$acreage = NULL,$totalPrice = NULL,$searchText = NULL){
global $wpdb;
if($acreage == "面积"){
$acreage = null;
}
if($totalPrice == "价格"){
$totalPrice = null;
}
$areaArray = explode("-",$acreage);
$priceArray = explode("-",$totalPrice);
$sql = "select * from tospur_house th
left join (select buildproperty_id,house_area,image_id,house_id as bph_id from a_district_area) ada on th.id = ada.bph_id
left join dic_city dc on th.plate_id = dc.plateId
left join (select * from a_house_image group by house_id) hi on th.id = hi.house_id
left join (select id,name as iname,path,creattime as itime,alt,image_type from tospur_image) i on hi.image_id = i.id where 1=1";
if($cityId!=NULL ){
$sql = $sql." and cityId=".$cityId;
}
if($districtId != NULL ){
$sql = $sql." and districtId=".$districtId;
}
if($plateId != NULL){
$sql = $sql." and plateId=".$plateId;
}
if($buildpropertyId!=NULL){
$sql = $sql." and buildproperty_id=".$buildpropertyId;
}
if($roomId!=NULL){
$sql = $sql." and room_id=".$roomId;
}
if($acreage!=NULL){
$sql = $sql." and covered_area between ". $areaArray[0]." and ". $areaArray[1];
}
if($totalPrice!=NULL){
$sql = $sql." and total_price between ". $priceArray[0]." and ". $priceArray[1];
}
if($searchText!=NULL){
$sql = $sql." and name like '%".$searchText."%'";
}
$sql = $sql." group by bph_id order by th.creattime DESC";
$result = $wpdb->get_results($sql);
return $result;
}
public static function getWorkUser(){
}
......
......@@ -11,8 +11,10 @@ class TCSync {
const DIC_UNITPRICERANGE_TABLE = 'dic_unitpricerange';
const DIC_TOTALPRICE_TABLE = 'dic_totalprice';
const TOSPUR_ORGANIZATION_TABLE = 'tospur_organization';
const TOSPUR_CONSULTANT = 'tospur_consultant';
public static function user_sync(){
global $wpdb;
$response = wp_remote_post( TCSync::user_url );
$res = array(
'code' => 200,
......@@ -46,11 +48,14 @@ class TCSync {
$user_id = wp_insert_user( $userdata ) ;
}
if(is_numeric($user_id)){
if(!is_null($item['ImageUrl']))
update_user_meta( $user_id, "tc_image", $item['ImageUrl'] );
update_user_meta( $user_id, "tc_cityId", $item['CityId'] );
if(!is_null($item['Mobile']) && $item['Mobile']!="")
update_user_meta( $user_id, "tc_mobile", $item['Mobile'] );
$info = array(
'id' => $user_id,
'cityId' => $item['CityId'],
'imageUrl' => $item['ImageUrl'],
'mobile' => $item['Mobile'],
'name' => $item['Name']
);
$wpdb->query(TCSync::create_insert_update_sql(TCSync::TOSPUR_CONSULTANT,$info,array('id')));
}
}
}
......
......@@ -17,8 +17,58 @@ function tospur_init()
require_once('view_house.php');
require_once(PLUGIN_DIR . 'Tools\TCSync.php');
require_once(PLUGIN_DIR . 'Dao\SearchDao.php');
add_action('admin_menu', 'create_menu');
require_once(PLUGIN_DIR . 'Admin\House.php');
add_action('admin_menu', 'reset_menu');
$type = $_POST["type"];
if($type==1){
wp_redirect("?page=newHouse&updated=true");
}
tospur_register_script_style();
tospur_ajax_set();
tospur_theme_format();
}
function tospur_theme_format(){
//移除
add_filter('admin_footer_text', tospur_remove_admin_footer_text, 1000);
add_filter('update_footer', tospur_remove_admin_footer_upgrade, 1000);
add_action('login_enqueue_scripts', 'tospur_login_logo');
//admin bar
add_action('wp_before_admin_bar_render', 'tospur_remove_admin_bar');
function tospur_remove_admin_footer_text($footer_text =''){
return '';
}
function tospur_remove_admin_footer_upgrade($footer_text =''){
return '';
}
function tospur_remove_admin_bar(){
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo');
$wp_admin_bar->remove_menu('updates');
$wp_admin_bar->remove_menu('new-content');
$wp_admin_bar->remove_menu('edit-profile');
$wp_admin_bar->remove_menu('view-site');
$wp_admin_bar->remove_menu('user-info');
}
function tospur_login_logo()
{ ?>
<style type="text/css">
.login h1 a {
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/img/fnl.jpg);
padding-bottom: 30px;
}
</style>
<?php }
}
function tospur_register_script_style(){
wp_register_script('jquery-ui',plugins_url('Admin/views', __FILE__)."/js/jquery-ui.js");
wp_register_script('bootstrapjs',plugins_url('Admin/views', __FILE__)."/js/bootstrap.min.js");
wp_register_style('jquery-ui_css', plugins_url('Admin/views', __FILE__)."/css/jquery-ui.css");
wp_register_style('bootstrapcss', plugins_url('Admin/views', __FILE__)."/css/bootstrap.css");
}
function tospur_ajax_set()
......@@ -37,6 +87,8 @@ function tospur_ajax_set()
add_action('wp_ajax_nopriv_searchTotalPrice', 'SearchDao::ajax_searchTotalPrice');
add_action('wp_ajax_searchOrganization', 'SearchDao::ajax_searchOrganization');
add_action('wp_ajax_nopriv_searchOrganization', 'SearchDao::ajax_searchOrganization');
add_action( 'wp_ajax_searchHouse', 'SearchDao::ajax_searchHouse' );
add_action( 'wp_ajax_nopriv_searchHouse', 'SearchDao::ajax_searchHouse');
//后台处理 置业顾问评分
add_action('wp_ajax_valid_consultant_score', 'valid_consultant_score');
......@@ -59,7 +111,6 @@ function valid_consultant_score()
wp_send_json($array);
}
}
function update_consultant()
{
$house_id = $_POST['id'];
......@@ -76,9 +127,41 @@ function update_consultant()
}
}
function create_menu()
function reset_menu()
{
add_menu_page("talbe_test", "table_test", "manage_options", "1", "create_table");
add_menu_page( 'newHouse_title', '新房信息', 'manage_options', 'newHouse', 'House::init_view', 'dashicons-admin-tools', 6 );
//移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 );
global $menu;
$restricted = array(
__('Dashboard'),
__('Posts'),
__('latestnews'),
__('Media'),
__('Links'),
__('Pages'),
__('Appearance'),
__('Tools'),
__('Users'),
__('Settings'),
__('Comments'),
__('Plugins'),
);
end($menu);
while (prev($menu)) {
$value = explode(' ', $menu[key($menu)][0]);
if (strpos($value[0], '<') === FALSE) {
if (in_array($value[0] != NULL ? $value[0] : "", $restricted)) {
unset($menu[key($menu)]);
}
} else {
$value2 = explode('<', $value[0]);
if (in_array($value2[0] != NULL ? $value2[0] : "", $restricted)) {
unset($menu[key($menu)]);
}
}
}
}
function create_table()
......
......@@ -118,10 +118,14 @@
//do somthing
$(".btn-group").removeClass("open");
console.log(JSON.stringify(searchData));
getHouse();
}
}
});
});
var searchData = {
action:"searchHouse",
cityId:{{cityId}},
districtId:0,
plateId:0,
......@@ -131,7 +135,16 @@
acreage:'',
searchText:''
};
function getHouse(){
$.ajax({
type: "GET",
url: "/tospur/wp-admin/admin-ajax.php",
data: searchData,
success:function(json){
alert(JSON.stringify(json));
}
});
}
</script>
</head>
<body>
......
......@@ -149,7 +149,6 @@ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
</head>
<body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<div id="login">
<h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<?php
unset( $login_header_url, $login_header_title );
......@@ -215,9 +214,7 @@ function login_footer($input_id = '') {
global $interim_login;
// Don't allow interim logins to navigate away from the page.
if ( ! $interim_login ): ?>
<p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php esc_attr_e( 'Are you lost?' ); ?>"><?php printf( __( '&larr; Back to %s' ), get_bloginfo( 'title', 'display' ) ); ?></a></p>
<?php endif; ?>
?>
</div>
......@@ -567,17 +564,6 @@ case 'retrievepassword' :
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Get New Password'); ?>" /></p>
</form>
<p id="nav">
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in') ?></a>
<?php
if ( get_option( 'users_can_register' ) ) :
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
/** This filter is documented in wp-includes/general-template.php */
echo ' | ' . apply_filters( 'register', $registration_url );
endif;
?>
</p>
<?php
login_footer('user_login');
......@@ -672,16 +658,6 @@ case 'rp' :
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Reset Password'); ?>" /></p>
</form>
<p id="nav">
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
<?php
if ( get_option( 'users_can_register' ) ) :
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
/** This filter is documented in wp-includes/general-template.php */
echo ' | ' . apply_filters( 'register', $registration_url );
endif;
?>
</p>
<?php
......@@ -754,11 +730,6 @@ case 'register' :
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Register'); ?>" /></p>
</form>
<p id="nav">
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> |
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ) ?>"><?php _e( 'Lost your password?' ); ?></a>
</p>
<?php
login_footer('user_login');
break;
......@@ -929,20 +900,7 @@ default:
</p>
</form>
<?php if ( ! $interim_login ) { ?>
<p id="nav">
<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
if ( get_option( 'users_can_register' ) ) :
$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
/** This filter is documented in wp-includes/general-template.php */
echo apply_filters( 'register', $registration_url ) . ' | ';
endif;
?>
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a>
<?php endif; ?>
</p>
<?php } ?>
<script type="text/javascript">
function wp_attempt_focus(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment