Commit b3fa582f by shz

每日一更

parent c4a8cea1
<?php
class Contract {
public static function init_view(){
global $wpdb;
$type = $_POST["type"];
$context = array();
$context['siteUrl'] = get_site_url();
$params = array(
'business' => $_REQUEST['business'],
'houseNumber' =>$_REQUEST['houseNumber'],
'customerNumber' =>$_REQUEST['customerNumber'],
'signedDate' =>$_REQUEST['signedDate'],
'permitNumber' =>$_REQUEST['permitNumber'],
'area' =>$_REQUEST['area'],
'house_number' =>$_REQUEST['house_number'],
'price' =>$_REQUEST['price'],
'managerId' =>$_REQUEST['managerId'],
'paymentMethod' =>$_REQUEST['paymentMethod'],
'codicil' =>$_REQUEST['codicil'],
'oName' =>$_REQUEST['oName'],
'oPhone' =>$_REQUEST['oPhone'],
'oID' =>$_REQUEST['oID'],
'oCommission' =>$_REQUEST['oCommission'],
'oAddress' =>$_REQUEST['oAddress'],
'oPayBack' =>$_REQUEST['oPayBack'],
'oMoney' =>$_REQUEST['oMoney'],
'cName' =>$_REQUEST['cName'],
'cPhone' =>$_REQUEST['cPhone'],
'cID' =>$_REQUEST['cID'],
'cCommission' =>$_REQUEST['cCommission'],
'cAddress' =>$_REQUEST['cAddress'],
'cPayBack' =>$_REQUEST['cPayBack'],
'cMoney' =>$_REQUEST['cMoney']
);
if($type==1){
}else if(isset($_GET['edit'])){
}
Timber::render("contract.html",$context);
}
public static function insert($params){
global $wpdb;
//$wpdb->insert(Config::);
}
public static function update($params){
}
}
\ No newline at end of file
......@@ -6,14 +6,6 @@ require_once(PLUGIN_DIR . 'Tools/Core.php');
require_once(PLUGIN_DIR . 'Admin/Tospur_House.php');
class House extends Tospur_House{
public static function init_view(){
wp_enqueue_script('jquery-ui');
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('jquery-ui_css');
wp_enqueue_style('bootstrapMinCss');
global $wpdb;
$type = $_POST["type"];
$context = array();
......@@ -60,12 +52,11 @@ class House extends Tospur_House{
}else{
$insert_tospur_house_array['status'] = $_POST['status'];
$result = House::data_insert($insert_tospur_house_array);
if($result == 506){
if($result != 200){
$wpdb->query("ROLLBACK");
print_r($result);;
echo "新增房源失败";
}else{
$house_id = $result;
$wpdb->query("COMMIT");
echo "新增房源成功";
}
......@@ -144,7 +135,6 @@ class House extends Tospur_House{
echo "推荐置业顾问修改失败";
}
InsertDao::addHouseTag($_POST['mark'],$houseId);
CustomerTrackingDao::insert($houseId, $_REQUEST);
return $result;
}
......@@ -168,12 +158,10 @@ class House extends Tospur_House{
InsertDao::addHouseTag($_POST['mark'],$houseId);
CustomerTrackingDao::insert($houseId, $_REQUEST);
return $houseId;
}else{
return 506;
}
return 200;
}
}
\ No newline at end of file
<?php
require_once(PLUGIN_DIR . 'Dao/SearchDao.php');
require_once(PLUGIN_DIR . 'Dao/InsertDao.php');
class customer extends Tospur_House
{
//二手房信息
public static function customer_html()
{
global $wpdb;
$context = array();
$context['siteUrl'] = get_site_url();
$insert_tospur_house_array = array(
//customerInfo(4)
'name' => $_POST['name'],
'customer_type' => $_POST['customer_type'],
'phone' => $_POST['phone'],
'customer_remark' => $_POST['customer_remark'],
//customerDemand(14)
'new_house' => $_POST['new_house'],
'secondHand_house' => $_POST['secondHand_house'],
'rent_house' => $_POST['rent_house'],
'character' => $_POST['character'],
'origin' => $_POST['origin'],
'payment_mode' => $_POST['payment_mode'],
'min_totalPrice' => $_POST['min_totalPrice'],
'max_totalPrice' => $_POST['max_totalPrice'],
'min_unitPrice' => $_POST['min_unitPrice'],
'max_unitPrice' => $_POST['max_unitPrice'],
'min_rent' => $_POST['min_rent'],
'max_rent' => $_POST['max_rent'],
'rent' => $_POST['rent'],
'tenancy' => $_POST['tenancy'],
//customerDetail(name 19)
'city_id' => $_POST['baseCity'],
'district_id' => $_POST['baseAreaId'],
'plate_id' => $_POST['basePlateId'],
'community_name' => $_POST['community_name'],
'room_id' => $_POST['baseRoom'],
'check_in_time' => $_POST['check_in_time'],
'min_coveredArea' => $_POST['min_coveredArea'],
'max_coveredArea' => $_POST['max_coveredArea'],
'min_floor' => $_POST['min_floor'],
'max_floor' => $_POST['max_floor'],
'propertyRight' => $_POST['propertyRight'],
'decoration' => $_POST['decoration'],
'age' => $_POST['age'],
'faceto' => $_POST['faceto'],
'bedroom' => $_POST['bedroom'],
'hall' => $_POST['hall'],
'bathroom' => $_POST['bathroom'],
'origin_remark' => $_POST['origin_remark'],
'consultant_id' => $_POST['consultant_id'],
'status' => $_POST['status']
);
if ($_POST) {
$wpdb->query("START TRANSACTION");
if (isset($_POST['houseId'])) {
$result = $wpdb->update(Config::TOSPUR_CUSTOMER_TABLE,
$insert_tospur_house_array,
array('id' => $_POST['houseId'])
);
if ($result) {
$wpdb->query("COMMIT");
echo "修改客源成功";
} else {
$wpdb->query("ROLLBACK");
echo "修改客源失败";
}
} else {
$id = InsertDao::insert_customer($insert_tospur_house_array);
if ($id) {
$wpdb->query("COMMIT");
echo "新增客源成功";
} else {
$wpdb->query("ROLLBACK");
echo "新增客源失败";
}
}
exit;
} else if (isset($_GET['edit'])) {
$context['houseId'] = $_GET['id'];
$context = array_merge($context, SearchDao::searchCustomer($_GET['id']));
$context["district"] = SearchDao::searchCity($context['result']->city_id);
$context["plate"] = SearchDao::searchCity($context['result']->city_id, $context['result']->district_id);
}
$context['role'] = customer::getCurrentRole();
$context['city'] = SearchDao::searchCity();
$context['buildProperty'] = SearchDao::searchBuildProperty();
$context['room'] = SearchDao::searchRoom();
$context['status'] = searchDao::searchStatusType(5);
$context['customer_type'] = searchDao::searchStatusType(6);
for ($i = 1970; $i <= 2020; $i++) {
$context['age'][] = $i;
}
Timber::render('customer.html', $context);
}
public static function data_update($houseId, $params)
{
}
}
<?php
if (!class_exists('WP_List_Table')) {
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
}
class customerList extends WP_List_Table
{
function __construct()
{
global $status, $page;
//Set parent defaults
parent::__construct(array(
'singular' => 'customerList', //singular name of the listed records
'plural' => 'customerLists', //plural name of the listed records
'ajax' => false //does this table support ajax?
));
}
function column_default($item, $column_name)
{
switch ($column_name) {
case'id':
case 'name':
case 'address':
case 'average_price':
case 'developer':
case 'check_in_time':
case 'room_id':
case 'property_age':
case 'decoration':
case 'covered_area':
case 'status':
case 'volume_rate':
case 'greening_rate':
case 'households':
case 'parking_spaces':
case 'property_management':
case 'property_money':
default:
return '<a href="' . admin_url() . 'admin.php?page=newHouse&edit=true&id=' . $item['id'] . '">' . $item[$column_name] . '</a>';
}
}
function column_cb($item)
{
return sprintf(
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
/*$1%s*/
$this->_args['singular'], //Let's simply repurpose the table's singular label ("score")
/*$2%s*/
$item['id'] //The value of the checkbox should be the record's id
);
}
function get_columns()
{
if (current_user_can('administrator')) {
$columns = array(
'cb' => '<input type="checkbox" />'
);
}
$columns['name'] = '姓名';
$columns['demand_type'] = '需求类型';
$columns['customer_remark'] = '客户备注';
$columns['consultant'] = '置业顾问';
$columns['check_in_time'] = '状态';
return $columns;
}
function get_sortable_columns()
{
$sortable_columns = array();
return $sortable_columns;
}
function prepare_items()
{
global $wpdb;
$per_page = 10;
$columns = $this->get_columns();
$hidden = array();
$sortable = $this->get_sortable_columns();
$this->_column_headers = array($columns, $hidden, $sortable);
$sql = "select * from tospur_customer tc";
$result = $wpdb->get_results($sql);
$data = array();
foreach ($result as $key => $value) {
}
$current_page = $this->get_pagenum();
$total_items = count($data);
$data = array_slice($data, (($current_page - 1) * $per_page), $per_page);
$this->items = $data;
$this->set_pagination_args(array(
'total_items' => $total_items, //WE have to calculate the total number of items
'per_page' => $per_page, //WE have to determine how many items to show on a page
'total_pages' => ceil($total_items / $per_page) //WE have to calculate the total number of pages
));
}
}
function function_customerList()
{
$context = array();
Timber::render("customerList.html", $context);
}
function addCustomerTable()
{
$customerList = new customerList();
$customerList->prepare_items();
$customerList->display();
}
?>
......@@ -16,6 +16,6 @@ $context['consultant_result'] = $wpdb->get_results($consultant_sql);
$context['url'] = home_url();
$context['id'] = $house_id;
Timber::render('Admin/views/handle.html', $context);
Timber::render('handle.html', $context);
?>
\ No newline at end of file
......@@ -5,11 +5,6 @@ require_once(PLUGIN_DIR . 'Tools/Image.php');
class RentHouse extends Tospur_House{
//二手房信息
public static function rentHouse_html(){
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('bootstrapMinCss');
global $wpdb;
$type = $_POST["type"];
$context = array();
......
......@@ -5,11 +5,6 @@ require_once(PLUGIN_DIR . 'Tools/Image.php');
class SecHandHouse extends Tospur_House{
//二手房信息
public static function secHandHouse_html(){
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('bootstrapMinCss');
global $wpdb;
$type = $_POST["type"];
$context = array();
......
......@@ -24,8 +24,7 @@ $context['consultant_result'] = $wpdb->get_results($consultant_sql);
$context['url'] = home_url();
$context['id'] = $house_id;
$context['house_type'] = $house_type;
$context['view'] = plugins_url() . '/tospur/Admin/views';
Timber::render('Admin/views/sale_detail.html', $context);
Timber::render('sale_detail.html', $context);
?>
\ No newline at end of file
{% block addTag %}
{% if feature %}
<style>
.table td {
text-align: center;
}
</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-content">
<div class="row" id="featureTable">
<div class="col-md-12">
<table class="table">
{% for item in feature %}
{% if loop.index0%4 == 0%}
<tr>
{% endif %}
<td>{{ item.value }}</td>
{% if loop.index0%4 == 3%}
</tr>
{% endif %}
{% endfor %}
</table>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
\ No newline at end of file
<br />
<div class="row">
<div class="col-md-6">
<label for="total_price">总价:</label>
<input name="total_price" id="total_price" type="text" value="{{result.total_price}}" class="form-control"> 万元
</div>
<div class="col-md-6">
<label for="average_price">单价:</label>
<input name="average_price" id="average_price" type="text" value="{{result.average_price}}" class="form-control">
</div>
</div>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<br>
<div class="row">
<div class="col-md-10">
<input type="checkbox" name="new_house" id="new_house" value="{{ result.new_house }}" style="margin: 0;"{% if
result.new_house == 1 %} checked {% endif %}>
<label for="new_house">新房</label>
<input type="checkbox" name="secondHand_house" id="secondHand_house" value="{{ result.secondHand_house }}"
style="margin: 0;"{% if result.secondHand_house == 1 %} checked {% endif %}>
<label for="secondHand_house">二手房</label>
<input type="checkbox" name="rent_house" id="rent_house" value="{{ result.rent_house }}" style="margin: 0;"{% if
result.rent_house == 1 %} checked {% endif %}>
<label for="rent_house">租房</label>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<label for="character">性质:</label>
<select name="character" id="character" class="form-control">
<option value="公客">公客</option>
<option value="私客">私客</option>
</select>
</div>
<div class="col-md-6">
<label for="origin">来源:</label>
<select name="origin" id="origin" class="form-control">
<option value="来电">来电</option>
<option value="来访">来访</option>
<option value="扫街">扫街</option>
<option value="网络">网络</option>
<option value="派单">派单</option>
<option value="广告">广告</option>
<option value="陌拜">陌拜</option>
<option value="微信">微信</option>
<option value="内部推荐">内部推荐</option>
<option value="老带新">老带新</option>
<option value="租转售">租转售</option>
<option value="售转租">售转租</option>
<option value="盘源">盘源</option>
<option value="CALL客">CALL客</option>
<option value="其他">其他</option>
</select>
</div>
</div>
<br>
<div id="new_secondHand_house_input">
<div class="row">
<div class="col-md-6">
<label for="payment_mode">付款:</label>
<select name="payment_mode" id="payment_mode" class="form-control" disabled="disabled">
<option value="其它">其它</option>
<option value="商业贷款">商业贷款</option>
<option value="公积金贷款">公积金贷款</option>
<option value="组合贷款">组合贷款</option>
<option value="全款">全款</option>
</select>
</div>
<br>
</div>
<br>
<div class="row">
<div class="col-md-6">
<label>总价:</label>
<label for="min_totalPrice" class="hidden"></label>
<input type="text" name="min_totalPrice" id="min_totalPrice" value="{{ result.min_totalPrice }}"
class="form-control" disabled="disabled">
<label for="max_totalPrice" class="hidden"></label>
<input type="text" name="max_totalPrice" id="max_totalPrice" value="{{ result.max_totalPrice }}"
class="form-control" disabled="disabled">
</div>
<div class="col-md-6">
<label>单价:</label>
<label for="min_unitPrice" class="hidden"></label>
<input type="text" name="min_unitPrice" id="min_unitPrice" value="{{ result.min_unitPrice }}"
class="form-control" disabled="disabled">
<label for="max_unitPrice" class="hidden"></label>
<input type="text" name="max_unitPrice" id="max_unitPrice" value="{{ result.max_unitPrice }}"
class="form-control" disabled="disabled">
元/m²
</div>
</div>
</div>
<br>
<div id="rent_house_input">
<div class="row">
<div class="col-md-6">
<label>月租:</label>
<label for="min_rent" class="hidden"></label>
<input type="text" name="min_rent" id="min_rent" value="{{ result.min_rent }}" class="form-control"
disabled="disabled">
<label for="max_rent" class="hidden"></label>
<input type="text" name="max_rent" id="max_rent" value="{{ result.max_rent }}" class="form-control"
disabled="disabled">
元/月
</div>
<div class="col-md-3">
<label for="rent">整租:</label>
<select name="rent" id="rent" class="form-control" disabled="disabled">
<option value="不限">不限</option>
<option value="整租">整租</option>
<option value="合租">合租</option>
</select>
</div>
<div class="col-md-3">
<label for="tenancy">租期:</label>
<select name="tenancy" id="tenancy" class="form-control" disabled="disabled">
<option value="不限">不限</option>
<option value="一个月">一个月</option>
<option value="三个月">三个月</option>
<option value="半年">半年</option>
<option value="一年">一年</option>
<option value="一年以上">一年以上</option>
</select>
</div>
</div>
</div>
<script>
(function ($) {
var new_house_checkbox, secondHand_house_checkbox, rent_house_checkbox;
$(document).ready(function () {
new_house_checkbox = $('input[name=new_house]');
secondHand_house_checkbox = $('input[name=secondHand_house]');
rent_house_checkbox = $('input[name=rent_house]');
$('input[type=checkbox]').change(function () {
if ($(this).is(':checked')) {
$(this).val(1);
} else {
$(this).val(0);
}
changeCheckBox();
});
changeCheckBox();
});
function changeCheckBox() {
if (new_house_checkbox.is(':checked') || secondHand_house_checkbox.is(':checked')) {
$('#new_secondHand_house_input').find('select, input').removeAttr('disabled');
} else if (!new_house_checkbox.is(':checked') && !secondHand_house_checkbox.is(':checked')) {
$('#new_secondHand_house_input').find('select, input').attr('disabled', 'disabled');
}
if (rent_house_checkbox.is(':checked')) {
$('#rent_house_input').find('select, input').removeAttr('disabled');
} else {
$('#rent_house_input').find('select, input').attr('disabled', 'disabled');
}
}
})(jQuery);
</script>
\ No newline at end of file
<br>
<div class="row">
<div class="col-md-12">
<label>城市:</label>
<label for="baseCity"></label>
<select id="baseCity" name="baseCity" class="form-control">
<option value="-1">城市</option>
{% for item in city %}
<option {{ item.id == result.city_id?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<label for="baseAreaId"></label>
<select id="baseAreaId" name="baseAreaId" class="form-control">
<option value="-1">区域</option>
{% if district %}
{% for item in district %}
<option {{ item.id == result.district_id?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<label for="basePlateId"></label>
<select id="basePlateId" name="basePlateId" class="form-control">
<option value="-1">板块</option>
{% if district %}
{% for item in plate %}
<option {{ item.id == result.plate_id?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<label for="community_name">小区名称:</label>
<input type="text" name="community_name" id="community_name" value="{{ result.community_name }}" class="form-control">
</div>
<div class="col-md-6">
<label for="baseRoom">建筑类型:</label>
<select id="baseRoom" name="baseRoom" class="form-control">
{% for item in room %}
<option {{ item.id == result.room_id?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
</div>
</div>
<br>
<div class="row">
<div class="col-md-4">
<label for="check_in_time">入住时间:</label>
<input type="text" name="check_in_time" id="check_in_time" value="{{ result.check_in_time }}" class="form-control">
</div>
</div>
<br>
<div class="row">
<div class="col-md-10">
<label>面积:</label>
<label for="min_coveredArea" class="hidden"></label>
<input type="text" name="min_coveredArea" id="min_coveredArea" value="{{ result.min_coveredArea }}" class="form-control">
<label for="max_coveredArea" class="hidden"></label>
<input type="text" name="max_coveredArea" id="max_coveredArea" value="{{ result.max_coveredArea }}" class="form-control">
</div>
</div>
<br>
<div class="row">
<div class="col-md-10">
<label>楼层:</label>
<label for="min_floor" class="hidden"></label>
<input type="text" name="min_floor" id="min_floor" value="{{ result.min_floor }}" class="form-control">
<label for="max_floor" class="hidden"></label>
<input type="text" name="max_floor" id="max_floor" value="{{ result.max_floor }}" class="form-control">
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<label for="propertyRight">产权:</label>
<select name="propertyRight" id="propertyRight" class="form-control">
<option value="个人产权">个人产权</option>
<option value="单位产权">单位产权</option>
<option value="售后产权">售后产权</option>
<option value="家庭成员共有">家庭成员共有</option>
<option value="使用权">使用权</option>
<option value="小产权">小产权</option>
<option value="协议房">协议房</option>
<option value="私产">私产</option>
<option value="公产">公产</option>
<option value="合同发票">合同发票</option>
<option value="三联单">三联单</option>
<option value="其他">其他</option>
</select>
</div>
<div class="col-md-6">
<label for="decoration">装修:</label>
<select name="decoration" id="decoration" class="form-control">
<option value="不限">不限</option>
<option value="毛坯">毛坯</option>
<option value="简单装修">简单装修</option>
<option value="中等装修">中等装修</option>
<option value="精装修">精装修</option>
<option value="豪华装修">豪华装修</option>
</select>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<label for="age">年代:</label>
<select name="age" id="age" class="form-control">
<option value="不限">不限</option>
{% for item in age %}
<option value="{{ item }}">{{ item }}</option>
{% endfor %}
</select>
</div>
<div class="col-md-6">
<label for="faceto">朝向:</label>
<select name="faceto" id="faceto" class="form-control">
<option value="其他">其他</option>
<option value="东"></option>
<option value="南"></option>
<option value="西">西</option>
<option value="北"></option>
<option value="东西">东西</option>
<option value="南北">南北</option>
<option value="南南">南南</option>
<option value="东南">东南</option>
<option value="东北">东北</option>
<option value="西南">西南</option>
<option value="西北">西北</option>
</select>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
<label>户型:</label>
<select name="bedroom" id="bedroom" class="form-control">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
<label for="bedroom"></label>
<select name="hall" id="hall" class="form-control">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<label for="hall"></label>
<select name="bathroom" id="bathroom" class="form-control">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<label for="bathroom"></label>
</div>
</div>
<br>
<div class="row">
<div class="col-md-8">
<label for="origin_remark">客源备注:</label><br>
<textarea name="origin_remark" id="origin_remark" rows="5" cols="50" class="form-control">{{ result.origin_remark }}</textarea>
</div>
</div>
<br>
<table class="form-table">
<tbody>
<tr>
<th><label>置业顾问</label></th>
<td>
<div id="consultantImg">
{% for item in consultant %}
<p>
<img src="{{ item.imageUrl }}" height="100" width="100" style="margin-right: 50px">
<span style="margin-right: 50px">{{ item.name }}</span>
<input type="button" value="删除" class="button action consultantCancel existsCancel">
<input type="hidden" name="consultant_id" value="{{ item.id }}">
</p>
{% endfor %}
</div>
<br>
<button type="button" class="button action" data-toggle="modal" data-target="#myConsultant" id="recConsultantBt">
选择置业顾问
</button>
</td>
</tr>
</tbody>
</table>
\ No newline at end of file
<br>
<div class="row">
<div class="col-md-6">
<label for="name">姓名:</label>
<input type="text" name="name" id="name" value="{{ result.name }}" class="form-control">
</div>
<div class="col-md-6">
<label for="customer_type">等级:</label>
<select name="customer_type" id="customer_type" class="form-control">
{% for item in customer_type %}
<option{% if(item.id == result.customer_type) %} selected="selected"{% endif %} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
</div>
</div>
<br>
<div class="row">
<div class="col-md-8">
<label for="phone">电话:</label>
<input type="text" name="phone" id="phone" value="{{ result.phone }}" class="form-control">
</div>
</div>
<br>
<div class="row">
<div class="col-md-8">
<label for="customer_remark">客户备注:</label><br>
<textarea name="customer_remark" id="customer_remark" rows="5" cols="50" class="form-control">{{ result.customer_remark }}</textarea>
</div>
</div>
<div class="wrap">
<h2>客户列表</h2>
<form id="scores-filter" method="post">
<input type="hidden" name="page" value="{{page}}"/>
<select id="listCity" name="listCity">
<option value="0"> 城市</option>
{% for item in city %}
<option {{ item.id == cityId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<select id="listDistrict" name="listDistrict">
<option value="0">区域</option>
{% if district %}
{% for item in district %}
<option {{ item.id == districtId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<select id="listPlate" name="listPlate">
<option value="0">板块</option>
{% if plate %}
{% for item in plate %}
<option {{ item.id == plateId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<select id="totalPrice" name="totalPrice">
<option value ="">价格</option>
{% if dicTotalPrice %}
{% for item in dicTotalPrice %}
<option {{ item.value == totalPrice ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<select id="room" name="room">
<option value="0">类型</option>
{% for item in room %}
<option {{ item.id == roomId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<select id="buildProperty" name="buildProperty">
<option value="0"> 房型</option>
{% for item in buildProperty %}
<option {{ item.id == buildPropertyId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<select id="acreage" name="acreage">
<option value ="">面积</option>
{% if acreage %}
{% for item in dicArea %}
<option {{ item.value == acreage ?"selected":"" }} value="{{ item.value }}">{{ item.value }}</option>
{% endfor %}
{% endif %}
</select>
<select name="status" name="status">
<option value="-1">状态</option>
{% for item in status%}
<option {{ item.id == statusId ?"selected":"" }} value="{{ item.id }}">{{ item.value }}</option>
{% endfor %}
</select>
<input type="text" placeholder="请出入楼盘名" name="searchText">
<input type="hidden" name="hasSearch" value="1"/>
<input type="submit" id="submit" class="button action" value="搜索">
<!-- Now we can render the completed list table -->
{{function("addCustomerTable")}}
</form>
</div>
<script>
(function ($) {
$(document).ready(function(){
});
})(jQuery);
</script>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{% import "macro.html" as macro %}
<!DOCTYPE HTML>
<html>
<head>
......@@ -291,8 +290,6 @@
</tr>
</tbody>
</table>
{{ macro.customer_tracking_list(houseId) }}
{% include "save_customer_tracking.html" %}
<input type="text" name="type" value="1" hidden="hidden">
{% if houseId %}
<input type="text" name="houseId" value="{{houseId}}" hidden="hidden">
......
<br />
<div class="row">
<div class="col-md-6">
<label for="owner_name">业主姓名:</label>
<input name="owner_name" id="owner_name" type="text" value="" class="form-control">
</div>
<div class="col-md-6">
<label for="owner_phone">业主电话:</label>
<input name="owner_phone" id="owner_phone" type="text" value="" class="form-control">
</div>
</div>
\ No newline at end of file
<table class="form-table">
<thead>
<tr>
<th>类型</th>
<th>相册</th>
<th>设为封面</th>
<th></th>
</tr>
</thead>
<tbody id="photosTbody">
{% set exists_photo_ids = "" %}
{% for item in images %}
{% if exists_photo_ids != "" %}
{% set exists_photo_ids = exists_photo_ids~"," %}
{% endif %}
{% set exists_photo_ids = exists_photo_ids~item.image_id %}
<tr>
<td>
<select name="exists_photo[{{ item.image_id }}][type]" style="margin-right: 50px">
{% for i in photoType %}
<option {{ i.id == item.image_type?"selected":"" }} value="{{ i.id }}">{{ i.value }}</option>
{% endfor %}
</select>
</td>
<td>
<img src="{{siteUrl}}{{item.path}}" height="90" width="140" style="margin-right: 50px">
</td>
<td>
<input type="radio" name="frontCover" style="margin-right: 50px" value="{{item.image_id}}" {{ result.frontCover_id == item.image_id?"checked":"" }} />
</td>
<td>
<input type="button" value="删除" class="button action cancel existsCancel">
</div>
</tr>
{% endfor %}
</tbody>
</table>
<input type="hidden" name="exists_photo_ids" value="{{exists_photo_ids}}" >
<button type="button" id="housePicture" class="button action" data-toggle="modal" style="margin-top: 10px">
新增
</button>
<script>
(function($){
$(document).ready(function(){
//新增房源相册
var j = 0;
$("#housePicture").click(function(){
var tr = $("<tr>");
var td = $("<td>");
var select = $("<select>").attr({"name":"data["+j+"][type]"}).addClass("form-control");
{% for item in photoType %}
select.append($("<option>").attr("value",{{item.id}}).append('{{item.value}}'));
{% endfor%}
var td1 = td.clone().append(select);
var file = $("<input>").attr({"type":"file","name":"files["+j+"]"}).addClass("picFiles form-control");
var td2 = td.clone().append(file);
var radio = $("<input>").attr({"type":"radio","name":"frontCover","value":j}).addClass("form-control");
var td3 = td.clone().append(radio);
var picDelet = $("<input>").attr({"type":"button","value":"删除"}).addClass("button action existsCancel form-control");
var td4 = td.clone().append(picDelet);
tr.append(td1).append(td2).append(td3).append(td4);
$("#photosTbody").append(tr);
j++
});
$("#photosTbody").on("change",".picFiles",function(){
var that = this;
if (this.files && this.files[0]){
var reader = new FileReader();
reader.onload = function (e){
var img = $("<img>").attr({"src":e.target.result,"heghit":90,"width":140});
$(that).before(img);
$(that).hide();
}
reader.readAsDataURL(this.files[0]);
}
});
$("#photosTbody").on("click",".existsCancel",function(){
$(this).parent().parent().remove();
});
});
})(jQuery);
</script>
\ No newline at end of file
<link rel="stylesheet" type="text/css" href="{{ view }}/css/bootstrap.min.css">
<style>
.sale_detail ul {
margin-top: 30px;
......
<br />
<div class="row">
<div class="col-md-12">
<label for="housename">标题:</label>
<input name="housename" id="housename" type="text" value="{{result.name}}" class="form-control" >
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<label for="mark">标签:</label>
<input name="mark" id="mark" type="text" value="{{mark}}" class="form-control">
</div>
</div>
\ No newline at end of file
......@@ -24,13 +24,14 @@ class Config {
const TOSPUR_VIEW_HOUSE_TABLE = 'tospur_view_house';
const TOSPUR_VERIFY_TABLE = 'tospur_verify';
const TOSPUR_SALE_TABLE = 'tospur_sale';
const WP_USERS_TABLE = 'wp_users';
const TOSPUR_STATUS_TABLE = 'tospur_status';
const TOSPUR_CUSTOMER_TRACKING_TABLE = 'tospur_customer_tracking';
const TOSPUR_CUSTOMER_TABLE = 'tospur_customer';
const TOSPUR_CONTRACT = 'tospur_contract';
//sync url
const user_url = 'http://218.1.67.130:8988/api/NanTongWechat/GetPropertyConsultant?cityId=1';
const other_url = 'http://218.1.67.130:8988/api/NanTongWechat/GetCommonPlate?radomPla=123456';
const organization_url = 'http://218.1.67.130:8988/api/NanTongWechat/GetOrgnaziTion?radomOrg=123456';
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ class InsertDao{
global $wpdb;
$houseRes = $wpdb->insert(Config::TOSPUR_HOUSE_TABLE, $params);
$houseId = $wpdb->insert_id;
if(!SearchDao::setHouseNumber($houseId,$params['house_type'],$params['city_id'])){
if(!InsertDao::setHouseNumber($houseId,$params['house_type'],$params['city_id'])){
return 510;
}
if($houseRes){
......@@ -14,6 +14,43 @@ class InsertDao{
return 500;
}
}
public static function insert_customer($params){
global $wpdb;
$result = $wpdb->insert(Config::TOSPUR_CUSTOMER_TABLE, $params);
print_r($wpdb->last_query);
$insert_id = $wpdb->insert_id;
if($result){
return $insert_id;
}else{
return 0;
}
}
public static function setHouseNumber($houseId,$houseType,$cityId){
global $wpdb;
switch($houseType){
case 0:
$prefix = "xf";
break;
case 1:
$prefix = "CS";
break;
case 2:
$prefix = "CZ";
break;
}
$house_number = $prefix.str_pad($cityId,4,'0',STR_PAD_LEFT).str_pad($houseId,8,'0',STR_PAD_LEFT);
return $wpdb->update(Config::TOSPUR_HOUSE_TABLE,
array(
'house_number' => $house_number
),
array(
"id" => $houseId
)
);
}
public static function insert_tospur_image($params){
global $wpdb;
$imgRes = $wpdb->insert(Config::TOSPUR_IMAGE_TABLE, $params);
......
......@@ -288,7 +288,7 @@ class SearchDao
$result = $wpdb->get_results('select id,photo_name as value from ' . Config::DIC_PHOTOTYPE_TABLE);
return $result;
}
public static function ajax_searchConsultant(){
wp_send_json(SearchDao::searchConsultant($_GET["consulCityId"],$_GET["consultantName"]));
}
......@@ -344,30 +344,6 @@ class SearchDao
return $wpdb->get_results($sql);
}
public static function setHouseNumber($houseId,$houseType,$cityId){
global $wpdb;
switch($houseType){
case 0:
$prefix = "xf";
break;
case 1:
$prefix = "CS";
break;
case 2:
$prefix = "CZ";
break;
}
$house_number = $prefix.str_pad($cityId,4,'0',STR_PAD_LEFT).str_pad($houseId,8,'0',STR_PAD_LEFT);
return $wpdb->update(Config::TOSPUR_HOUSE_TABLE,
array(
'house_number' => $house_number
),
array(
"id" => $houseId
)
);
}
public static function getDetailInfo($hid,$type = NULL){
global $wpdb;
$sql = "select *,dr.literal as room,db.literal as buildproperty from ".Config::TOSPUR_HOUSE_TABLE." th
......@@ -442,6 +418,21 @@ class SearchDao
return $context;
}
public static function searchCustomer($id)
{
global $wpdb;
$sql = "SELECT tcs.* FROM tospur_customer tcs where tcs.id = %d";
$result = $wpdb->get_row($wpdb->prepare($sql, $id));
$context = array();
if($result){
$context['result'] = $result;
$consultant_sql = "SELECT * FROM tospur_consultant where id = %d";
$consultant = $wpdb->get_results($wpdb->prepare($consultant_sql, $result->consultant_id));
$context['consultant'] = $consultant;
}
return $context;
}
public static function searchHouseTag($houseId){
global $wpdb;
$sql = "select tt.name from a_house_tag aht
......
......@@ -93,8 +93,7 @@ class TospurDao
public static function search_consultant_info($consultant_id)
{
global $wpdb;
$sql = 'select c.*,u.display_name,s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' .
'left join ' . Config::WP_USERS_TABLE . ' u on c.id = u.ID ' .
$sql = 'select c.id, c.cityId, c.mobile, c.imageUrl, c.name as display_name, c.introduction, s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' .
'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' group by consultant_id) s ' .
'on c.id = s.consultant_id where c.id = ' . $consultant_id;
return $wpdb->get_row($sql);
......@@ -146,10 +145,9 @@ class TospurDao
public static function search_consultant_by_city($city_id, $index)
{
global $wpdb;
$consultant_sql = 'select c.*,u.display_name,s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' .
'left join ' . Config::WP_USERS_TABLE . ' u on c.id = u.ID ' .
$consultant_sql = 'select c.id, c.mobile, c.imageUrl, c.name as display_name, s.average_score from ' . Config::TOSPUR_CONSULTANT . ' c ' .
'left join (select consultant_id,sum(score)/count(score) as average_score from ' . Config::TOSPUR_CONSULTANT_SCORE_TABLE . ' where valid=1 group by consultant_id) s on c.id = s.consultant_id ' .
'where cityid = ' . $city_id . ' LIMIT ' . $index . ',20;';
'where c.cityid = ' . $city_id . ' LIMIT ' . $index . ',20;';
return $wpdb->get_results($consultant_sql);
}
......
......@@ -22,15 +22,15 @@ class TCSync {
$user = get_user_by( "login", $item['WorkNum'] );
$userdata = array(
'ID' => $user->data->ID,
'display_name' => $item['Name']
'display_name' => $item['Name'],
'role' => 'author'
);
$user_id = wp_update_user( $userdata ) ;
}else{
$userdata = array(
'user_login' => $item['WorkNum'],
'user_pass' => $item['WorkNumAndID'], // When creating an user, `user_pass` is expected.
'role' => 'editor',
'wp_user_level' => 7,
'role' => 'author',
'display_name' => $item['Name']
);
$user_id = wp_insert_user( $userdata ) ;
......
......@@ -17,18 +17,21 @@ function tospur_init()
require_once(PLUGIN_DIR . 'Tools/Image.php');
require_once(PLUGIN_DIR . 'Dao/SearchDao.php');
require_once(PLUGIN_DIR . 'Dao/TospurDao.php');
require_once(PLUGIN_DIR . 'Dao/CustomerTrackingDao.php');
require_once(PLUGIN_DIR . 'Admin/House.php');
require_once(PLUGIN_DIR . 'Admin/newHouseList.php');
require_once(PLUGIN_DIR . 'Admin/secHandHouse.php');
require_once(PLUGIN_DIR . 'Admin/secHandHouseList.php');
require_once(PLUGIN_DIR . 'Admin/rentHouse.php');
require_once(PLUGIN_DIR . 'Admin/rentHouseList.php');
require_once(PLUGIN_DIR . 'Admin/customer.php');
require_once(PLUGIN_DIR . 'Admin/customerList.php');
require_once(PLUGIN_DIR . 'Admin/feature.php');
require_once(PLUGIN_DIR . 'Admin/introduction.php');
require_once('consultant_score.php');
require_once('view_house.php');
require_once('tospur_sale.php');
require_once(PLUGIN_DIR . 'Dao/CustomerTrackingDao.php');
require_once(PLUGIN_DIR . 'Admin/Contract.php');
require_once(PLUGIN_DIR . 'Admin/consultant_score.php');
require_once(PLUGIN_DIR . 'Admin/view_house.php');
require_once(PLUGIN_DIR . 'Admin/tospur_sale.php');
add_action('admin_menu', 'reset_menu');
tospur_register_script_style();
tospur_ajax_set();
......@@ -40,6 +43,7 @@ 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');
add_action( 'admin_enqueue_scripts', 'tospur_load_resources');
//admin bar
add_action('wp_before_admin_bar_render', 'tospur_remove_admin_bar');
function tospur_remove_admin_footer_text($footer_text =''){
......@@ -70,6 +74,19 @@ function tospur_theme_format(){
<?php }
}
function tospur_load_resources(){
wp_enqueue_script('jquery-ui');
wp_enqueue_script('bootstrapjs');
wp_enqueue_script('publicjs');
wp_enqueue_script('validate');
wp_enqueue_style('jquery-ui_css');
wp_enqueue_style('bootstrapMinCss');
}
function tospur_register_script_style(){
wp_register_script('jquery-ui',plugins_url('Admin/views', __FILE__)."/js/jquery-ui.js");
wp_register_script('validate',plugins_url('Admin/views', __FILE__)."/js/jquery.validate.js");
......@@ -145,7 +162,7 @@ function update_consultant()
function reset_menu()
{
add_menu_page("sync", "同步数据", "manage_options", "1", "do_sync");
add_menu_page('newHouseList','新房列表', 'moderate_comments', 'newHouseList', 'function_newHouseList', 'dashicons-menu', 6);
add_menu_page('nesHouseList','新房列表', 'moderate_comments', 'newHouseList', 'function_newHouseList', 'dashicons-menu', 6);
add_submenu_page('newHouseList', '添加新房', '添加新房', 'moderate_comments', 'newHouse', 'House::init_view');
add_menu_page('secHandHouseList','二手房列表', 'moderate_comments', 'secHandHouseList', 'function_secHandHouseList', 'dashicons-menu', 7);
add_submenu_page('secHandHouseList', '添加二手房', '添加二手房', 'moderate_comments', 'secHandHouse', 'SecHandHouse::secHandHouse_html');
......@@ -153,6 +170,9 @@ function reset_menu()
add_menu_page('rentHouseList','租房列表', 'moderate_comments', 'rentHouseList', 'function_rentHouseList', 'dashicons-menu', 8);
add_submenu_page('rentHouseList', '添加租房', '添加租房', 'moderate_comments', 'rentHouse', 'RentHouse::rentHouse_html');
add_menu_page("introduction", "诚信宣言", "editor", "introduction", "introduction::introduction_html", 'dashicons-menu', 9);
add_menu_page('contract','合同管理', 'moderate_comments', 'contract', 'Contract::init_view', 'dashicons-menu', 10);
add_menu_page('客户列表','客户列表', 'moderate_comments', 'customerList', 'function_customerList', 'dashicons-menu', 11);
add_submenu_page('customerList', '新增客户', '新增客户', 'moderate_comments', 'customer', 'customer::customer_html');
//移除更新信息
remove_action( 'admin_notices', 'update_nag', 3 );
global $menu;
......
......@@ -48,7 +48,7 @@ var utils = (function () {
};
me.prefixPointerEvent = function (pointerEvent) {
return window.MSPointerEvent ?
return window.MSPointerEvent ?
'MSPointer' + pointerEvent.charAt(9).toUpperCase() + pointerEvent.substr(10):
pointerEvent;
};
......@@ -258,7 +258,7 @@ function IScroll (el, options) {
snapThreshold: 0.334,
// INSERT POINT: OPTIONS
// INSERT POINT: OPTIONS
startX: 0,
startY: 0,
......@@ -315,7 +315,7 @@ function IScroll (el, options) {
// INSERT POINT: NORMALIZATION
// Some defaults
// Some defaults
this.x = 0;
this.y = 0;
this.directionX = 0;
......@@ -1571,11 +1571,11 @@ IScroll.prototype = {
this._key(e);
break;
case 'click':
if ( !e._constructed ) {
e.preventDefault();
e.stopPropagation();
}
break;
if ( !e._constructed ) {
e.preventDefault();
e.stopPropagation();
}
break;
}
}
};
......@@ -1875,7 +1875,7 @@ Indicator.prototype = {
this.maxBoundaryX = this.maxPosX;
}
this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));
this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));
}
if ( this.options.listenY ) {
......
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