Commit 79910c51 by felix

每日一更

parent 38ca481e
......@@ -19,20 +19,26 @@ class Contract {
if($type==1){
$wpdb->query("START TRANSACTION");
$prefix = "新增";
$prefix = "<h4>新增";
if(isset($_REQUEST["id"])) {
$prefix = "修改";
$prefix = "<h4>修改";
}
$result = Contract::doSqlAction();
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
$context["error"] = $result;
echo $result;
echo $prefix."合同失败";
echo $prefix."合同失败</h4>";
}else{
$wpdb->query("COMMIT");
echo $prefix."合同成功";
}
echo $prefix."合同成功</h4>";
}
echo "<h4>3秒后自动跳转至合同列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=contractList') . "';
},3000);
</script>";
exit;
}else if(isset($_GET['edit'])){
$id = $_REQUEST["id"];
......
......@@ -47,11 +47,11 @@ class House extends Tospur_House{
$result = House::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
echo "<h4>新房房源修改失败</h4>";
print_r($result);
echo "新房房源修改失败";
}else{
$wpdb->query("COMMIT");
echo "新房房源修改成功";
echo "<h4>新房房源修改成功</h4>";
}
}else{
$insert_tospur_house_array["status"] = 0;
......@@ -59,13 +59,19 @@ class House extends Tospur_House{
$result = House::data_insert($insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
echo "<h4>新房房源新增失败</h4>";
print_r($result);
echo "新增房源失败";
}else{
$wpdb->query("COMMIT");
echo "新增房源成功";
echo "<h4>新房房源新增成功</h4>";
}
}
echo "<h4>3秒后自动跳转至新房列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=newHouseList') . "';
},3000);
</script>";
exit;
}else if(isset($_GET['edit'])){
$context['houseId'] = $_GET['id'];
......
......@@ -62,22 +62,28 @@ class customer extends Tospur_House
CustomerTrackingDao::insert($_POST['houseId'], $_REQUEST);
if ($result >= 0) {
$wpdb->query("COMMIT");
echo "修改客源成功";
echo "<h4>修改客源成功</h4>";
} else {
$wpdb->query("ROLLBACK");
echo "修改客源失败";
echo "<h4>修改客源失败</h4>";
}
} else {
$id = CustomerDao::insert_customer($insert_tospur_house_array);
if ($id) {
CustomerTrackingDao::insert($id, $_REQUEST);
$wpdb->query("COMMIT");
echo "新增客源成功";
echo "<h4>新增客源成功</h4>";
} else {
$wpdb->query("ROLLBACK");
echo "新增客源失败";
echo "<h4>新增客源失败</h4>";
}
}
echo "<h4>3秒后自动跳转至客户列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=customerList') . "';
},3000);
</script>";
exit;
} else if (isset($_GET['edit'])) {
$context['houseId'] = $_GET['id'];
......
......@@ -60,11 +60,11 @@ class RentHouse extends Tospur_House{
$result = RentHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
print_r($result);;
echo "租房房源修改失败";
echo "<h4>租房房源修改失败</h4>";
print_r($result);
}else{
$wpdb->query("COMMIT");
echo "租房房源修改成功";
echo "<h4>租房房源修改成功</h4>";
}
}else {
......@@ -73,13 +73,19 @@ class RentHouse extends Tospur_House{
$result = RentHouse::rentHouseData_insert($insert_tospur_house_array);
if (!is_numeric($result)) {
$wpdb->query("ROLLBACK");
echo "<h4>租房房源新增失败</h4>";
print_r($result);
echo "租房房源新增失败";
} else {
$wpdb->query("COMMIT");
echo "租房房源新增成功";
echo "<h4>租房房源新增成功</h4>";
}
}
echo "<h4>3秒后自动跳转至租房列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=rentHouseList') . "';
},3000);
</script>";
exit;
}else if(isset($_GET['edit'])){
$context['houseId'] = $_GET['id'];
......
......@@ -60,11 +60,11 @@ class SecHandHouse extends Tospur_House{
$result = SecHandHouse::data_update($_POST['houseId'],$insert_tospur_house_array);
if(!is_numeric($result)){
$wpdb->query("ROLLBACK");
print_r( $result);;
echo "二手房房源修改失败";
echo "<h4>二手房房源修改失败</h4>";
print_r($result);
}else{
$wpdb->query("COMMIT");
echo "二手房房源修改成功";
echo "<h4>二手房房源修改成功</h4>";
}
}else {
......@@ -73,13 +73,19 @@ class SecHandHouse extends Tospur_House{
$result = SecHandHouse::secHouseData_insert($insert_tospur_house_array);
if (!is_numeric($result)) {
$wpdb->query("ROLLBACK");
print_r( $result);;
echo "二手房房源新增失败";
echo "<h4>二手房房源新增失败</h4>";
print_r($result);
} else {
$wpdb->query("COMMIT");
echo "二手房房源新增成功";
echo "<h4>二手房房源新增成功</h4>";
}
}
echo "<h4>3秒后自动跳转至二手房列表</h4>
<script>
setTimeout(function(){
window.location.href='" . admin_url('admin.php?page=secHandHouseList') . "';
},3000);
</script>";
exit;
}else if(isset($_GET['edit'])){
$context['houseId'] = $_GET['id'];
......
......@@ -252,7 +252,7 @@ class upload
'entrustDay' => $sheet->getCell('B47')->getValue(),
'deadLine' => $sheet->getCell('B48')->getValue(),
'mortgage' => $sheet->getCell('B49')->getValue(),
'approval' => 1
'approval' => -2
);
$sql = null;
......
<table class="form-table">
<tbody>
<tr>
<th style="width:11.7%"><label for="periphery" style="margin-left: 30px">置业顾问:</label></th>
<td>
<div id="consultantImg">
</div>
<button type="button" class="button action" data-toggle="modal" data-target="#myConsultant" id="recConsultantBt">
选择置业顾问
</button>
</td>
<th style="width: 63px;box-sizing: content-box;">
<label>置业顾问:</label>
</th>
<td>
<div id="consultantImg">
</div>
<button type="button" class="button action" data-toggle="modal" data-target="#myConsultant" id="recConsultantBt">
选择置业顾问
</button>
</td>
</tr>
</tbody>
</table>
......
<table class="form-table addBorder">
<table class="form-table" style="margin-bottom: 15px;">
<tbody>
<tr>
<th style="width:20%"><label for="feature" style="margin-left: 45px">特色筛选:</label></th>
<td style="width: 75px;padding: 10px 0;">
<label class="control-label">特色筛选:</label>
</td>
<td>
<div id="feature" class="row">
</div>
<div id="feature"></div>
</td>
</tr>
<tr>
<td style="display: inline;padding: 10px 0;margin-left: 75px;">
<button type="button" class="button action" id="addFeatureBtn">
添加特色
</button>
......
<table class="form-table" id="recHouseTable">
<tbody>
<tr>
<th style="width:11.7%"><label for="traffic" style="margin-left: 30px">推荐房源:</label></th>
<th style="width: 63px;box-sizing: content-box;">
<label>推荐房源:</label>
</th>
<td>
<div id="houseImg">
</div>
......
{% block addTag %}
<style>
.table td {
.table > tbody > tr > td {
text-align: center;
padding: 12px;
border: 0;
}
.table > tbody > tr > td > span {
border-radius: 50px;
border: 1px solid #e5e5e5;
padding: 5px 10px;
}
.table > tbody > tr > td > span:active {
border-color: #1b9af7;
}
</style>
<!-- 房源特色出层 -->
<div class="modal fade" id="houseFeature" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document" style="position: absolute;top: 0;bottom: 0;left: 0;right: 0; margin: auto;height: 200px;overflow-y: auto;overflow-x: hidden;">
<div class="modal-dialog" role="document" style="position: absolute;top: 0;bottom: 0;left: 0;right: 0; margin: auto;height: 232px;overflow-y: auto;overflow-x: hidden;">
<div class="modal-content">
<div class="row" id="featureTable">
<div class="col-md-12">
<table class="table" id="tagList">
</table>
</div>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title"></h4>
</div>
<div id="featureTable">
<table class="table" id="tagList">
</table>
</div>
</div>
</div>
......@@ -35,13 +47,13 @@
if (index % 4 == 0) {
tr = $('<tr>');
}
tr.append('<td id="' + item.id + '">' + item.value + '</td>');
tr.append('<td><span id="' + item.id + '">' + item.value + '</span></td>');
tagList.append(tr);
});
}
});
});
tagList.on("click", "tr > td", function () {
tagList.on("click", "tr > td > span", function () {
search_callback($(this).attr('id'), $(this).text());
});
existsCancel();
......@@ -49,7 +61,10 @@
function init_modal_addTag(type, callback) {
search_type = type;
search_callback = callback;
$('#houseFeature').modal('show');
var houseTag = $('#houseFeature');
var title = (search_type == 0) ? '标签' : '特色';
houseTag.find('h4').text(title);
houseTag.modal('show');
}
</script>
{% endblock %}
\ No newline at end of file
......@@ -12,31 +12,11 @@ p[class^=col-]{
padding: 0;
}
#preview,#addPhotos,#recHouseTable,#featureTable,#weixin,#markTable,.addBorder{
#preview,#addPhotos,#recHouseTable{
border-bottom: 1px solid;
border-bottom: 1px solid #ddd;
}
.form-horizontal .form-group{
margin-left:0px;
margin-right:0px;
padding-bottom: 0px;
}
.addBorder{
margin-left:0px;
margin-right:0px;
}
#paidTbody_buy tr,#paidTbody_sell tr{
border-bottom: 1px solid #ddd;
}
.addBorder{
padding-bottom: 10px;
}
#photoTables th,#photoTables td{
text-align: center;
}
\ No newline at end of file
......@@ -4,6 +4,17 @@
{% set title = houseId?"修改新房房源":"添加新房房源" %}
<meta charset="utf-8">
<title>{{title}}</title>
<style>
.form-horizontal label.control-label{
text-align: left;
float: left;
margin-right: 10px;
width: 65px;
}
.form-horizontal span select{
display: inline;
}
</style>
</head>
<body>
<script>
......
<style>
#photoTables > tbody > tr {
border-top: 1px solid #ddd;
}
#photoTables > tbody > tr select {
width: 60px;
margin-left: 30px;
}
</style>
<div id="addPhotos">
<div class="row">
<div class="col-md-2">
<label for="photos" style="margin-left: 30px; margin-top: 25px">房源相册:</label>
</div>
<div class="col-md-10">
<label for="photos" style="float: left;margin-top: 25px;margin-left: 15px;">房源相册:</label>
<div class="col-md-7">
<table class="form-table" id="photoTables">
<thead>
<tr>
......@@ -22,7 +29,7 @@
{% set exists_photo_ids = exists_photo_ids~item.image_id %}
<tr>
<td>
<select name="exists_photo[{{ item.image_id }}][type]" style="width:38%;margin-left:30px" class="form-control" >
<select name="exists_photo[{{ item.image_id }}][type]" class="form-control" >
{% for i in photoType %}
<option {{ i.id == item.image_type?"selected":"" }} value="{{ i.id }}">{{ i.value }}</option>
{% endfor %}
......@@ -42,7 +49,7 @@
</tbody>
</table>
</div>
<button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-top: 10px;margin-left: 225px;margin-bottom: 10px">
<button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-left: 130px;margin-bottom: 20px;clear: both;display: block;">
新增
</button>
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
......@@ -56,7 +63,7 @@
$("#housePicture").click(function(){
var tr = $("<tr>");
var td = $("<td>");
var select = $("<select>").attr({"name":"data["+i+"][type]"}).addClass("form-control").css({"width":"38%","margin-left":"30px"});
var select = $("<select>").attr({"name":"data["+i+"][type]"}).addClass("form-control");
{% for item in photoType %}
select.append($("<option>").attr("value",{{item.id}}).append('{{item.value}}'));
{% endfor%}
......
......@@ -4,6 +4,17 @@
{% set title = houseId?"修改租房房源":"添租新房房源" %}
<meta charset="utf-8">
<title>{{title}}</title>
<style>
.form-horizontal label.control-label{
text-align: left;
float: left;
margin-right: 10px;
width: 65px;
}
.form-horizontal span select{
display: inline;
}
</style>
</head>
<body>
<script>
......
......@@ -5,6 +5,17 @@
{% set title = houseId?"修改二手房房源":"添加二手房房源" %}
<meta charset="utf-8">
<title>{{title}}</title>
<style>
.form-horizontal label.control-label{
text-align: left;
float: left;
margin-right: 10px;
width: 65px;
}
.form-horizontal span select{
display: inline;
}
</style>
<script>
var i = 0;
</script>
......
<div class="row form-group addBorder" >
<div class="row form-group">
<div class="col-xs-4">
<label for="housename" class="col-xs-5 control-label" >微信标题:</label>
<label for="housename" class="control-label">微信标题:</label>
<p class="col-xs-7">
<input name="housename" id="housename" type="text" value="{{result.name}}" class="form-control" >
</p>
</div>
{% if house_type == 0 %}
<div class="col-xs-4">
<label for="average_price" class="col-xs-5 control-label">均价:</label>
<label for="average_price" class="control-label">均价:</label>
<p class="col-xs-6">
<input name="average_price" id="average_price" type="text" value="{{result.average_price}}" class="form-control">
</p>
......@@ -18,13 +18,18 @@
</div>
{% endif %}
</div>
<table class="form-table addBorder">
<tbody >
<table class="form-table" style="margin-bottom: 15px;">
<tbody>
<tr>
<th style="width:20%"><label for="mark" style="margin-left: 72px">标签:</label></th>
<td style="width: 75px;padding: 10px 0;">
<label class="control-label">标签:</label>
</td>
<td>
<div id="mark" class="row">
</div>
<div id="mark"></div>
</td>
</tr>
<tr>
<td style="display: inline;padding: 10px 0;margin-left: 75px;">
<button type="button" class="button action" id="addTagBtn">
标签
</button>
......
......@@ -7,19 +7,19 @@ $context['url'] = home_url();
$current_user = wp_get_current_user();
$user_id = $current_user->ID;
if ($user_id != 0) {
require_once(WP_PLUGIN_DIR . "/tospur/Dao/SearchDao.php");
$city_id = 2;
if ($_GET['cityId']){
$city_id = $_GET['cityId'];
}
$context['city_id'] = $city_id;
$city = SearchDao::searchCity();
$context['city'] = $city;
$city_id = $_GET['city_id'];
if (!isset($city_id)) {
$city_id = $city[0]->id;
}
foreach ($city as $value) {
if ($value->id == $city_id) {
$context['city_name'] = $value->value;
}
}
$context['city_id'] = $city_id;
$context['default_head'] = get_avatar_url(1);
Timber::render('consultant_list.html', $context);
......
......@@ -61,7 +61,7 @@
</div>
<footer class="footer navbar-fixed-bottom">
<div class="btn-group btn-group-justified">
<a href="tel:{{ consultant_mobile }}" class="btn btn-phone">
<a class="btn btn-phone" id="mobile">
<span></span>电话联系
</a>
{% if consultant.QRcodeImg %}
......@@ -96,6 +96,15 @@
</li>
</ul>
</div>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content text-center">
<h4>提示</h4>
<p id="notice">该置业顾问还没有设置电话</p>
<button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</div>
</div>
</div>
<div id="template_0" style="display: none">
<p>
<img src="" data-attr="image">
......@@ -170,6 +179,15 @@
var loading;
var score = 0;
$(document).ready(function () {
var consultant_mobile = '{{ consultant_mobile }}';
var mobile = $('#mobile');
if(consultant_mobile){
mobile.attr('href','tel:'+consultant_mobile);
}else{
mobile.click(function(){
$('#myModal').modal('show');
});
}
$('#score').rating({
min: 0,
max: 5,
......
......@@ -12,6 +12,7 @@
<script src="{{ theme }}/js/iscroll.js"></script>
<script src="{{ theme }}/js/jquery.min.js"></script>
<script src="{{ theme }}/js/jquery.mobile.custom.min.js"></script>
<script src="{{ theme }}/js/bootstrap.min.js"></script>
<script src="{{ theme }}/js/star-rating.min.js"></script>
<script src="{{ theme }}/js/public.js"></script>
</head>
......@@ -46,7 +47,7 @@
</div>
<p>同策房屋</p>
</li>
<li class="col-xs-4">
<li class="col-xs-4" data-id="mobile">
<a class="btn btn-phone" data-attr="mobile">
<span></span>电话联系
</a>
......@@ -75,6 +76,15 @@
</li>
</ul>
</div>
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content text-center">
<h4>提示</h4>
<p id="notice">该置业顾问还没有设置电话</p>
<button type="button" class="btn btn-lg btn-block" data-dismiss="modal">确认</button>
</div>
</div>
</div>
<script>
var index = 0;
var cityScroll;
......@@ -86,17 +96,17 @@
loading = $('#loading');
$('#cityGroup').tap(function () {
var self = $(this);
if(self.hasClass('open')){
if (self.hasClass('open')) {
self.removeClass('open');
}else{
} else {
self.addClass('open');
}
cityScroll.refresh();
});
cityScroll = new IScroll('#city_wrapper',{
cityScroll = new IScroll('#city_wrapper', {
click: true
});
myScroll = scrollPullToRefresh(function(){
myScroll = scrollPullToRefresh(function () {
ajax_get_consultant();
});
template = $('#template').html();
......@@ -116,22 +126,29 @@
var div = $('<div>');
div.append(template);
div.find('[data-attr=name]').text(value.display_name);
div.find('[data-attr=score]').attr('style', 'width: '+ value.average_score*20+'%');
div.find('[data-attr=score]').attr('style', 'width: ' + value.average_score * 20 + '%');
var head = value.imageUrl;
if(!head){
if (!head) {
head = '{{ default_head }}';
}
div.find('[data-attr=image]').attr('src', head);
var infoUrl;
if(value.mobile){
div.find('[data-attr=mobile]').attr('href', 'tel:' + value.mobile);
infoUrl = consultant_info_url + '&consultant_id=' + value.id + '&mobile=' + value.mobile;
}else{
div.find('[data-attr=mobile]').attr('disabled',true);
infoUrl = consultant_info_url + '&consultant_id=' + value.id;
var mobile = div.find('[data-attr=mobile]');
if (!value.mobile) {
mobile.attr('disabled', true);
}
div.tap(function(e){
window.location.href = infoUrl;
mobile.tap(function (e) {
if (value.mobile) {
window.location.href = 'tel:' + value.mobile;
} else {
$('#myModal').modal('show');
}
return false;
});
div.tap(function (e) {
window.location.href = consultant_info_url + '&consultant_id=' + value.id + '&mobile=' + value.mobile;
});
$('#scroller').append(div);
});
......
......@@ -167,8 +167,10 @@
</ul>
</div>
<div class="detail_row">
<p class="detail_title">最新动态</p>
<p class="single_omit">{{result.latest_news}}</p>
<a class="collapsed" data-toggle="collapse" href="#latestNews">
<p class="detail_title">最新动态<span class="pull-right"></span></p>
</a>
<p id="latestNews" style="min-height:20px;display:block;overflow:hidden;height:0;">{{result.latest_news}}</p>
</div>
<div class="detail_row">
<p class="detail_title">主力户型</p>
......@@ -203,15 +205,15 @@
<p class="detail_title">基本信息<span class="pull-right"></span></p>
</a>
<ul class="list-unstyled collapse infoCont" id="collapseInfoCont" style="min-height:60px;display:block;overflow:hidden;height:0;">
<li>开发商:<span>{{result.developer}}</span></li>
<li>开发商:{{result.developer}}</li>
<li>建筑类型:{{result.room}}</li>
<li>装修状况:{{result.decoration}}</li>
<li>容积率:{{result.volume_rate}}</li>
<li>规划户数:{{result.households}}</li>
<li>物业公司:{{result.property_management}}</li>
<li>入住时间:<span>{{result.check_in_time}}</span></li>
<li>入住时间:{{result.check_in_time}}</li>
<li>产权年限:{{result.property_age}}</li>
<li>建筑面积:{{result.covered_area}}</li>
<li>建筑面积:{{result.covered_area}}</li>
<li>绿化率:{{result.greening_rate}}</li>
<li>车位数:{{result.parking_spaces}}</li>
<li>物业费:{{result.property_money}}</li>
......
......@@ -21,7 +21,7 @@
{% for item in result %}
<ul class="list-unstyled">
<li>
<p>楼盘名:{{ item.name }}</p>
<p><a href="{{ url }}/?page=detail&hid={{ item.house_id }}">{{ item.name }}</a></p>
<p>预约时间:{{ item.date }} {{ item.time }}</p>
{% if item.user_id %}
{% if item.handle==0 %}
......
......@@ -20,7 +20,7 @@
<script type="text/javascript" src="{{ theme }}/js/gftools.js"></script>
</head>
<body>
{% set commerce_rate = 5.15 %}
{% set commerce_rate = 4.90 %}
{% set accumulationFund_rate = 3.25 %}
<div id="pt-main" class="pt-perspective">
<div class="pt-page pt-page-1">
......
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