<?php
/*
Plugin Name: table_test
Version: 1.0
Plugin URI: http://www.u-gen.net
Author: U-GEN TECH.
Description: 自定义列表
*/


define( 'PLUGIN_DIR', dirname( __FILE__ ).'\\');
add_action('init','tospur_init');

function tospur_init(){
    require_once(PLUGIN_DIR . 'Tools\TCSync.php');
    require_once(PLUGIN_DIR . 'Dao\SearchDao.php');
    add_action('admin_menu', 'create_menu');
    tospur_ajax_set();
}

function tospur_ajax_set(){
    add_action( 'wp_ajax_serachCity', 'SearchDao::ajax_serachCity' );
    add_action( 'wp_ajax_nopriv_serachCity', 'SearchDao::ajax_serachCity' );
    add_action( 'wp_ajax_searchArea', 'SearchDao::ajax_searchArea' );
    add_action( 'wp_ajax_nopriv_searchArea', 'SearchDao::ajax_searchArea' );
    add_action( 'wp_ajax_searchBuildProperty', 'SearchDao::ajax_searchBuildProperty' );
    add_action( 'wp_ajax_nopriv_searchBuildProperty', 'SearchDao::ajax_searchBuildProperty' );
    add_action( 'wp_ajax_searchRoom', 'SearchDao::ajax_searchRoom' );
    add_action( 'wp_ajax_nopriv_searchRoom', 'SearchDao::ajax_searchRoom' );
    add_action( 'wp_ajax_searchUnitPriceRange', 'SearchDao::ajax_searchUnitPriceRange' );
    add_action( 'wp_ajax_nopriv_searchUnitPriceRange', 'SearchDao::ajax_searchUnitPriceRange' );
    add_action( 'wp_ajax_searchTotalPrice', 'SearchDao::ajax_searchTotalPrice' );
    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' );
}


function create_menu(){
    add_menu_page("talbe_test", "table_test", "manage_options", "1", "create_table");
}

function create_table(){
    TCSync::user_sync();
    //TCSync::organization_sync();
}