`
ljqian
  • 浏览: 6790 次
  • 性别: Icon_minigender_1
  • 来自: 常熟
社区版块
存档分类
最新评论
收藏列表
标题 标签 来源
常见linux命令操作 linux
rm -rf #管理员删除批量文件不提示
/usr/local/nginx/sbin/nginx -t #测试nginx配置是否有问题
kill -HUP `cat /usr/local/nginx/logs/nginx.pid` 平滑重启nginx
kill -s 9 11502 强制杀死进程
netstat -anp 查看进程
tar -zxvf ./pip-1.4.tar.gz 解压
ssserver -c /etc/shadowsocks.json 启动代理
nohup ssserver -c /etc/shadowsocks.json > /dev/null 2>&1 & 后台启动代理
php实现排序算法 php, 排序 php四种基础算法:冒泡,选择,插入和快速排序法
//1. 冒泡排序法 
$arr=array(1,43,54,62,21,66,32,78,36,76,39);  
function getpao($arr)
{  
  $len=count($arr);
  //设置一个空数组 用来接收冒出来的泡
  //该层循环控制 需要冒泡的轮数
  for($i=1;$i<$len;$i++)
  { //该层循环用来控制每轮 冒出一个数 需要比较的次数
    for($k=0;$k<$len-$i;$k++)
    {
       if($arr[$k]>$arr[$k+1])
        {
            $tmp=$arr[$k+1];
            $arr[$k+1]=$arr[$k];
            $arr[$k]=$tmp;
        }
    }
  }
  return $arr;
} 
//1,43,54,21,62,32,66,36,76,39,78
//1,43,21,54,32,62,36,66,39,76,78
//1,21,43,32,54,36,62,39,66,76,78
//1,21,32,43,36,54,39,62,66,76,78
//1,21,32,36,43,39,54,62,66,76,78
//1,21,32,36,39,43,54,62,66,76,78
//虽然接下去的结果相同,但是还是得再执行4次

//2. 选择排序法
function select_sort($arr) {
//实现思路 双重循环完成,外层控制轮数,当前的最小值。内层 控制的比较次数
    //$i 当前最小值的位置, 需要参与比较的元素
    for($i=0, $len=count($arr); $i<$len-1; $i++) {
        //先假设最小的值的位置
        $p = $i;
        //$j 当前都需要和哪些元素比较,$i 后边的。
        for($j=$i+1; $j<$len; $j++) {
            //$arr[$p] 是 当前已知的最小值
            if($arr[$p] > $arr[$j]) {
     //比较,发现更小的,记录下最小值的位置;并且在下次比较时,
 // 应该采用已知的最小值进行比较。
                $p = $j;
            }
        }
        //已经确定了当前的最小值的位置,保存到$p中。
 //如果发现 最小值的位置与当前假设的位置$i不同,则位置互换即可
        if($p != $i) {
            $tmp = $arr[$p];
            $arr[$p] = $arr[$i];
            $arr[$i] = $tmp;
        }
    }
    //返回最终结果
    return $arr;
}
//3.插入排序法
function insert_sort($arr) {
    //区分 哪部分是已经排序好的
    //哪部分是没有排序的
    //找到其中一个需要排序的元素
    //这个元素 就是从第二个元素开始,到最后一个元素都是这个需要排序的元素
    //利用循环就可以标志出来
    //i循环控制 每次需要插入的元素,一旦需要插入的元素控制好了,
    //间接已经将数组分成了2部分,下标小于当前的(左边的),是排序好的序列
    for($i=1, $len=count($arr); $i<$len; $i++) {
        //获得当前需要比较的元素值。
        $tmp = $arr[$i];
        //内层循环控制 比较 并 插入
        for($j=$i-1;$j>=0;$j--) {
   //$arr[$i];//需要插入的元素; $arr[$j];//需要比较的元素
            if($tmp < $arr[$j]) {
                //发现插入的元素要小,交换位置
                //将后边的元素与前面的元素互换
                $arr[$j+1] = $arr[$j];
                //将前面的数设置为 当前需要交换的数
                $arr[$j] = $tmp;
            } else {
                //如果碰到不需要移动的元素
           //由于是已经排序好是数组,则前面的就不需要再次比较了。
                break;
            }
        }
    }
    //将这个元素 插入到已经排序好的序列内。
    //返回
    return $arr;
}
//4.快速排序法 
function quick_sort($arr) {
    //先判断是否需要继续进行
    $length = count($arr);
    if($length <= 1) {
        return $arr;
    }
    //如果没有返回,说明数组内的元素个数 多余1个,需要排序
    //选择一个标尺
    //选择第一个元素
    $base_num = $arr[0];
    //遍历 除了标尺外的所有元素,按照大小关系放入两个数组内
    //初始化两个数组
    $left_array = array();//小于标尺的
    $right_array = array();//大于标尺的
    for($i=1; $i<$length; $i++) {
        if($base_num > $arr[$i]) {
            //放入左边数组
            $left_array[] = $arr[$i];
        } else {
            //放入右边
            $right_array[] = $arr[$i];
        }
    }
    //再分别对 左边 和 右边的数组进行相同的排序处理方式
    //递归调用这个函数,并记录结果
    $left_array = quick_sort($left_array);
    $right_array = quick_sort($right_array);
    //合并左边 标尺 右边
    return array_merge($left_array, array($base_num), $right_array);
}

//5实现多维数组排序
function _handle_ranking_list($ranklist, $options=array()){
	if(!empty($ranklist) && !empty($options)){
		foreach ($ranklist as $key => $value) {
			foreach($options as $option){
				$tmp[$option['key']][$key] = $value[$option['key']];
			}
		}
		$str = 'array_multisort(';
		foreach ($options as $option){
			$str .= '$tmp["'.$option['key'].'"], '.$option['order'].', ';
		}
		$str .= '$ranklist);';
		
		eval($str);
	}
	return $ranklist;
}


$datalist = array(
		array('No'=>1, 'Fuin'=>'10000', 'iNum'=>1000, 'fdate'=>'2015-03-27', 'remark1'=>'500', 'remark2'=>'300', 'remark3'=>'200'),
		array('No'=>2, 'Fuin'=>'10001', 'iNum'=>2000, 'fdate'=>'2015-03-28', 'remark1'=>'1000', 'remark2'=>'600', 'remark3'=>'400'),
		array('No'=>3, 'Fuin'=>'10002', 'iNum'=>3000, 'fdate'=>'2015-03-29', 'remark1'=>'1500', 'remark2'=>'900', 'remark3'=>'600'),
		array('No'=>4, 'Fuin'=>'10003', 'iNum'=>4000, 'fdate'=>'2015-03-30', 'remark1'=>'2000', 'remark2'=>'1200', 'remark3'=>'800'),
		array('No'=>5, 'Fuin'=>'10004', 'iNum'=>5000, 'fdate'=>'2015-03-31', 'remark1'=>'2500', 'remark2'=>'1500', 'remark3'=>'1000')
);

$datalist = _handle_ranking_list($datalist, array(array('key'=>'iNum', 'order'=>'SORT_DESC')));
print_r($datalist);exit;

// 二维数组排序, $arr是数据,$keys是排序的健值,$order是排序规则,1是升序,0是降序
function array_sort($arr, $keys, $order = 0) {
	if (! is_array ( $arr )) {
		return false;
	}
	$keysvalue = array ();
	foreach ( $arr as $key => $val ) {
		$keysvalue [$key] = $val [$keys];
	}
	if ($order == 0) {
		asort ( $keysvalue );
	} else {
		arsort ( $keysvalue );
	}
	reset ( $keysvalue );
	foreach ( $keysvalue as $key => $vals ) {
		$keysort [$key] = $key;
	}
	$new_array = array ();
	foreach ( $keysort as $key => $val ) {
		$new_array [$key] = $arr [$val];
	}
	return $new_array;
} 

//二位数组排序节约代码版
function array_sort($arr, $key_order, $order=0) {
	if (!is_array($arr)) {
		return false;
	}
	
	$arrValue = array();
	foreach ($arr as $key=>$value) {
		$arrValue[$key] = $value[$key_order];
	}
	
	if ($order == 0) {
		asort($arrValue);
	} else {
		arsort($arrValue);
	}	
	
	$arrnew = array();
	foreach ($arrValue as $key=>$value) {
		$arrnew[$value] = $arr[$key];
	}
	return $arrnew;
}
使用openssl命令行生成密钥对 php iOS RSA公钥加密数据 服务端接受PHP私钥解密 反过服务端公钥加密数据 iOS端私钥解密数据
/**
 * 生成公共与私有证书操作
 * openssl req -x509 -out public_key.der -outform der -new -newkey rsa:1024 -keyout private_key.pem
 * 生成测试用公共证书操作
 * openssl rsa -in private_key.pem -pubout -out public_key.pem
 * 在本地进行加密调试时,使用public_key.pem证书
 * @author ljqian<ljqian@163.com>
 */
class RSA{		
	private $_filename;
	private $_key_content;
	
	public function __construct($filename){
		if(empty($filename)){
			$this->_show_msg('ERROR');
		}
		$this->_filename = $filename;
		$this->_get_key_content();
		if(empty($this->_key_content)){
			$this->_show_msg('ERROR');
		}
	}
	/**
	 * 加密操作
	 * @param string $sourcestr	源数据
	 * @return string $base64_encode_str 加密后的输出数据
	 */
	public function publickey_encode($sourcestr){
		$pubkeyid = openssl_get_publickey($this->_key_content);
		if(openssl_public_encrypt($sourcestr, $crypttext, $pubkeyid)){
			return base64_encode("".$crypttext);
		}
	}
	/**
	 * 解密操作
	 * @param string $crypttext 源数据
	 * @return string $sourcestr 解密后的输出数据
	 */
	public function privatekey_decode($crypttext){
		$prikeyid = openssl_pkey_get_private($this->_key_content, 'cslove090');
		$crypttext = base64_decode($crypttext);
		if(openssl_private_decrypt($crypttext, $sourcestr, $prikeyid, OPENSSL_PKCS1_PADDING)){
			//do success
			return $sourcestr;
		}
	}
	/**
	 * 获取证书内容
	 */
	private function _get_key_content(){	
		$this->_key_content = file_get_contents($this->_filename);		
	}
	
	private function _show_msg($msg){
		echo $msg;exit;
	}
}

$rsa_pub = new RSA('public_key.pem');//导入公共证书
$pub_content = $rsa_pub->publickey_encode('hello world');//加密操作

$rsa_pri = new RSA('private_key.pem');//导入私有证书
$rsa_pri->privatekey_decode($pub_content);//解密操作
js控制手机摇一摇 javascript 利用HTML5的一个重要特性 —— DeviceOrientation来实现手机网站上的摇一摇功能
<script>
// DeviceOrientation将底层的方向传感器和运动传感器进行了高级封装,提供了DOM事件的支持。
// 这个特性包括两个事件:
// 1、deviceOrientation:封装了方向传感器数据的事件,可以获取手机静止状态下的方向数据(手机所处的角度、方位和朝向等)。
// 2、deviceMotion:封装了运动传感器的事件,可以获取手机运动状态下的运动加速度等数据。
// 使用这两个事件,可以很能够实现重力感应、指南针等有趣的功能。

// 现在在很多Native应用中有一个非常常见而时尚的功能 —— 摇一摇,摇一摇找人、摇一摇看新闻、摇一摇找金币。。。
// 也许在android或者ios的客户端上对这个功能你已经很了解了,但是现在,我将告诉你如何在手机网页上实现摇一摇的功能。

// OK,那我们现在就开始吧,嘿嘿~
// 先来让我们了解一下设备运动事件 —— DeviceMotionEvent:返回设备关于加速度和旋转的相关信息,其中加速度的数据包含以下三个方向:
// x:横向贯穿手机屏幕;
// y:纵向贯穿手机屏幕;
// z:垂直手机屏幕。
// 鉴于有些设备没有排除重力的影响,所以该事件会返回两个属性:
// 1、accelerationIncludingGravity(含重力的加速度)
// 2、acceleration(排除重力影响的加速度)

// 作为码农,上代码才是最直接的,come on,代码走起!

// 首先在页面上要监听运动传感事件 
function init(){
  if (window.DeviceMotionEvent) {
    // 移动浏览器支持运动传感事件
    window.addEventListener('devicemotion', deviceMotionHandler, false);
    $("#yaoyiyaoyes").show();
  } else{
    // 移动浏览器不支持运动传感事件
    $("#yaoyiyaono").show();
  } 
}

// 那么,我们如何计算用户是否是在摇动手机呢?可以从以下几点进行考虑:
// 1、其实用户在摇动手机的时候始终都是以一个方向为主进行摇动的;
// 2、用户在摇动手机的时候在x、y、z三个方向都会有相应的想速度的变化;
// 3、不能把用户正常的手机运动行为当做摇一摇(手机放在兜里,走路的时候也会有加速度的变化)。
// 从以上三点考虑,针对三个方向上的加速度进行计算,间隔测量他们,考察他们在固定时间段里的变化率,而且需要确定一个阀值来触发摇一摇之后的操作。

// 首先,定义一个摇动的阀值
var SHAKE_THRESHOLD = 3000;
// 定义一个变量保存上次更新的时间
var last_update = 0;
// 紧接着定义x、y、z记录三个轴的数据以及上一次出发的时间
var x;
var y;
var z;
var last_x;
var last_y;
var last_z;

// 为了增加这个例子的一点无聊趣味性,增加一个计数器
var count = 0;

function deviceMotionHandler(eventData) {
  // 获取含重力的加速度
  var acceleration = eventData.accelerationIncludingGravity; 

  // 获取当前时间
  var curTime = new Date().getTime(); 
  var diffTime = curTime -last_update;
  // 固定时间段
  if (diffTime > 100) {
    last_update = curTime; 

    x = acceleration.x; 
    y = acceleration.y; 
    z = acceleration.z; 

    var speed = Math.sqrt((x-last_x)*(x-last_x) + (y-last_y)*(y-last_y) + (z-last_z)*(z-last_z)) / diffTime * 10000;

    if (speed > SHAKE_THRESHOLD) { 
      // TODO:在此处可以实现摇一摇之后所要进行的数据逻辑操作
      count++;
      $("#yaoyiyaoyes").hide();
      $("#yaoyiyaoresult").show();
      $("#yaoyiyaoresult").html("摇你妹!第" + count + "个了!");
    }

    last_x = x; 
    last_y = y; 
    last_z = z; 
  } 
} 
</script>
<div id="yaoyiyaono" style="font-size:20px;margin:10px;line-height:35px;display:none;">
  兄弟,如果您看到了我,说明您现在还不能摇,不是说您没有资格用我,而是:</br>
  1、如果您使用PC机的浏览器,那可就不对了,我只爱手机浏览器;</br>
  2、如果您是Android手机,那不好意思告诉你,android自带的浏览器抛弃了我,您可以用UCWeb、chrome等第三方浏览器;</br>
  3、如果您都不属于以上两种情况,那我只有告诉您:您改换手机啦!!!</br>
</div>
<div id="yaoyiyaoyes" style="font-size:20px;margin:10px;line-height:50px;display:none;">
  兄弟,摇一个吧,说不定有一个清纯的妹子等着你呢!
</div>
<div id="yaoyiyaoresult" style="font-size:20px;margin:10px;line-height:50px;display:none;"></div>
<script>
$(document).ready(function(){
init();
});
</script>
中国省市区sql sql
/*
MySQL Data Transfer
Source Host: 192.168.1.12
Source Database: dede56
Target Host: 192.168.1.12
Target Database: dede56
Date: 2014/8/14 10:32:00
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for dede_area_copy
-- ----------------------------
DROP TABLE IF EXISTS `dede_area_copy`;
CREATE TABLE `dede_area_copy` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL DEFAULT '',
  `reid` int(10) unsigned NOT NULL DEFAULT '0',
  `disorder` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `reid` (`reid`)
) ENGINE=MyISAM AUTO_INCREMENT=3524 DEFAULT CHARSET=gbk;

-- ----------------------------
-- Records 
-- ----------------------------
INSERT INTO `dede_area_copy` VALUES ('1', '北京市', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('2', '市辖区', '1', '0');
INSERT INTO `dede_area_copy` VALUES ('3', '东城区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('4', '西城区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('5', '崇文区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('6', '宣武区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('7', '朝阳区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('8', '丰台区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('9', '石景山区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('10', '海淀区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('11', '门头沟区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('12', '房山区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('13', '通州区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('14', '顺义区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('15', '昌平区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('16', '大兴区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('17', '怀柔区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('18', '平谷区', '2', '0');
INSERT INTO `dede_area_copy` VALUES ('19', '县', '1', '0');
INSERT INTO `dede_area_copy` VALUES ('20', '密云县', '19', '0');
INSERT INTO `dede_area_copy` VALUES ('21', '延庆县', '19', '0');
INSERT INTO `dede_area_copy` VALUES ('22', '天津市', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('23', '市辖区', '22', '0');
INSERT INTO `dede_area_copy` VALUES ('24', '和平区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('25', '河东区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('26', '河西区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('27', '南开区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('28', '河北区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('29', '红桥区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('30', '塘沽区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('31', '汉沽区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('32', '大港区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('33', '东丽区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('34', '西青区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('35', '津南区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('36', '北辰区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('37', '武清区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('38', '宝坻区', '23', '0');
INSERT INTO `dede_area_copy` VALUES ('39', '县', '22', '0');
INSERT INTO `dede_area_copy` VALUES ('40', '宁河县', '39', '0');
INSERT INTO `dede_area_copy` VALUES ('41', '静海县', '39', '0');
INSERT INTO `dede_area_copy` VALUES ('42', '蓟 县', '39', '0');
INSERT INTO `dede_area_copy` VALUES ('43', '河北省', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('44', '石家庄市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('45', '市辖区', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('46', '长安区', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('47', '桥东区', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('48', '桥西区', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('49', '新华区', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('50', '井陉矿区', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('51', '裕华区', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('52', '井陉县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('53', '正定县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('54', '栾城县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('55', '行唐县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('56', '灵寿县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('57', '高邑县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('58', '深泽县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('59', '赞皇县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('60', '无极县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('61', '平山县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('62', '元氏县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('63', '赵 县', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('64', '辛集市', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('65', '藁城市', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('66', '晋州市', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('67', '新乐市', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('68', '鹿泉市', '44', '0');
INSERT INTO `dede_area_copy` VALUES ('69', '唐山市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('70', '市辖区', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('71', '路南区', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('72', '路北区', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('73', '古冶区', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('74', '开平区', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('75', '丰南区', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('76', '丰润区', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('77', '滦 县', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('78', '滦南县', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('79', '乐亭县', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('80', '迁西县', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('81', '玉田县', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('82', '唐海县', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('83', '遵化市', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('84', '迁安市', '69', '0');
INSERT INTO `dede_area_copy` VALUES ('85', '秦皇岛市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('86', '市辖区', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('87', '海港区', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('88', '山海关区', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('89', '北戴河区', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('90', '青龙满族自治县', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('91', '昌黎县', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('92', '抚宁县', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('93', '卢龙县', '85', '0');
INSERT INTO `dede_area_copy` VALUES ('94', '邯郸市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('95', '市辖区', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('96', '邯山区', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('97', '丛台区', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('98', '复兴区', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('99', '峰峰矿区', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('100', '邯郸县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('101', '临漳县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('102', '成安县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('103', '大名县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('104', '涉 县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('105', '磁 县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('106', '肥乡县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('107', '永年县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('108', '邱 县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('109', '鸡泽县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('110', '广平县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('111', '馆陶县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('112', '魏 县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('113', '曲周县', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('114', '武安市', '94', '0');
INSERT INTO `dede_area_copy` VALUES ('115', '邢台市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('116', '市辖区', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('117', '桥东区', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('118', '桥西区', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('119', '邢台县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('120', '临城县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('121', '内丘县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('122', '柏乡县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('123', '隆尧县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('124', '任 县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('125', '南和县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('126', '宁晋县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('127', '巨鹿县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('128', '新河县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('129', '广宗县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('130', '平乡县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('131', '威 县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('132', '清河县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('133', '临西县', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('134', '南宫市', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('135', '沙河市', '115', '0');
INSERT INTO `dede_area_copy` VALUES ('136', '保定市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('137', '市辖区', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('138', '新市区', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('139', '北市区', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('140', '南市区', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('141', '满城县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('142', '清苑县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('143', '涞水县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('144', '阜平县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('145', '徐水县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('146', '定兴县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('147', '唐 县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('148', '高阳县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('149', '容城县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('150', '涞源县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('151', '望都县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('152', '安新县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('153', '易 县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('154', '曲阳县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('155', '蠡 县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('156', '顺平县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('157', '博野县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('158', '雄 县', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('159', '涿州市', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('160', '定州市', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('161', '安国市', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('162', '高碑店市', '136', '0');
INSERT INTO `dede_area_copy` VALUES ('163', '张家口市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('164', '市辖区', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('165', '桥东区', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('166', '桥西区', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('167', '宣化区', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('168', '下花园区', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('169', '宣化县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('170', '张北县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('171', '康保县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('172', '沽源县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('173', '尚义县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('174', '蔚 县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('175', '阳原县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('176', '怀安县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('177', '万全县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('178', '怀来县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('179', '涿鹿县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('180', '赤城县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('181', '崇礼县', '163', '0');
INSERT INTO `dede_area_copy` VALUES ('182', '承德市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('183', '市辖区', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('184', '双桥区', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('185', '双滦区', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('186', '鹰手营子矿区', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('187', '承德县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('188', '兴隆县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('189', '平泉县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('190', '滦平县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('191', '隆化县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('192', '丰宁满族自治县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('193', '宽城满族自治县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('194', '围场满族蒙古族自治县', '182', '0');
INSERT INTO `dede_area_copy` VALUES ('195', '沧州市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('196', '市辖区', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('197', '新华区', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('198', '运河区', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('199', '沧 县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('200', '青 县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('201', '东光县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('202', '海兴县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('203', '盐山县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('204', '肃宁县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('205', '南皮县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('206', '吴桥县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('207', '献 县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('208', '孟村回族自治县', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('209', '泊头市', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('210', '任丘市', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('211', '黄骅市', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('212', '河间市', '195', '0');
INSERT INTO `dede_area_copy` VALUES ('213', '廊坊市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('214', '市辖区', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('215', '安次区', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('216', '广阳区', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('217', '固安县', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('218', '永清县', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('219', '香河县', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('220', '大城县', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('221', '文安县', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('222', '大厂回族自治县', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('223', '霸州市', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('224', '三河市', '213', '0');
INSERT INTO `dede_area_copy` VALUES ('225', '衡水市', '43', '0');
INSERT INTO `dede_area_copy` VALUES ('226', '市辖区', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('227', '桃城区', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('228', '枣强县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('229', '武邑县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('230', '武强县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('231', '饶阳县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('232', '安平县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('233', '故城县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('234', '景 县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('235', '阜城县', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('236', '冀州市', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('237', '深州市', '225', '0');
INSERT INTO `dede_area_copy` VALUES ('238', '山西省', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('239', '太原市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('240', '市辖区', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('241', '小店区', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('242', '迎泽区', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('243', '杏花岭区', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('244', '尖草坪区', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('245', '万柏林区', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('246', '晋源区', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('247', '清徐县', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('248', '阳曲县', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('249', '娄烦县', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('250', '古交市', '239', '0');
INSERT INTO `dede_area_copy` VALUES ('251', '大同市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('252', '市辖区', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('253', '城 区', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('254', '矿 区', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('255', '南郊区', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('256', '新荣区', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('257', '阳高县', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('258', '天镇县', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('259', '广灵县', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('260', '灵丘县', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('261', '浑源县', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('262', '左云县', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('263', '大同县', '251', '0');
INSERT INTO `dede_area_copy` VALUES ('264', '阳泉市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('265', '市辖区', '264', '0');
INSERT INTO `dede_area_copy` VALUES ('266', '城 区', '264', '0');
INSERT INTO `dede_area_copy` VALUES ('267', '矿 区', '264', '0');
INSERT INTO `dede_area_copy` VALUES ('268', '郊 区', '264', '0');
INSERT INTO `dede_area_copy` VALUES ('269', '平定县', '264', '0');
INSERT INTO `dede_area_copy` VALUES ('270', '盂 县', '264', '0');
INSERT INTO `dede_area_copy` VALUES ('271', '长治市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('272', '市辖区', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('273', '城 区', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('274', '郊 区', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('275', '长治县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('276', '襄垣县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('277', '屯留县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('278', '平顺县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('279', '黎城县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('280', '壶关县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('281', '长子县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('282', '武乡县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('283', '沁 县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('284', '沁源县', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('285', '潞城市', '271', '0');
INSERT INTO `dede_area_copy` VALUES ('286', '晋城市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('287', '市辖区', '286', '0');
INSERT INTO `dede_area_copy` VALUES ('288', '城 区', '286', '0');
INSERT INTO `dede_area_copy` VALUES ('289', '沁水县', '286', '0');
INSERT INTO `dede_area_copy` VALUES ('290', '阳城县', '286', '0');
INSERT INTO `dede_area_copy` VALUES ('291', '陵川县', '286', '0');
INSERT INTO `dede_area_copy` VALUES ('292', '泽州县', '286', '0');
INSERT INTO `dede_area_copy` VALUES ('293', '高平市', '286', '0');
INSERT INTO `dede_area_copy` VALUES ('294', '朔州市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('295', '市辖区', '294', '0');
INSERT INTO `dede_area_copy` VALUES ('296', '朔城区', '294', '0');
INSERT INTO `dede_area_copy` VALUES ('297', '平鲁区', '294', '0');
INSERT INTO `dede_area_copy` VALUES ('298', '山阴县', '294', '0');
INSERT INTO `dede_area_copy` VALUES ('299', '应 县', '294', '0');
INSERT INTO `dede_area_copy` VALUES ('300', '右玉县', '294', '0');
INSERT INTO `dede_area_copy` VALUES ('301', '怀仁县', '294', '0');
INSERT INTO `dede_area_copy` VALUES ('302', '晋中市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('303', '市辖区', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('304', '榆次区', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('305', '榆社县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('306', '左权县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('307', '和顺县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('308', '昔阳县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('309', '寿阳县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('310', '太谷县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('311', '祁 县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('312', '平遥县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('313', '灵石县', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('314', '介休市', '302', '0');
INSERT INTO `dede_area_copy` VALUES ('315', '运城市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('316', '市辖区', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('317', '盐湖区', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('318', '临猗县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('319', '万荣县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('320', '闻喜县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('321', '稷山县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('322', '新绛县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('323', '绛 县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('324', '垣曲县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('325', '夏 县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('326', '平陆县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('327', '芮城县', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('328', '永济市', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('329', '河津市', '315', '0');
INSERT INTO `dede_area_copy` VALUES ('330', '忻州市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('331', '市辖区', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('332', '忻府区', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('333', '定襄县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('334', '五台县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('335', '代 县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('336', '繁峙县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('337', '宁武县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('338', '静乐县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('339', '神池县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('340', '五寨县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('341', '岢岚县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('342', '河曲县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('343', '保德县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('344', '偏关县', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('345', '原平市', '330', '0');
INSERT INTO `dede_area_copy` VALUES ('346', '临汾市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('347', '市辖区', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('348', '尧都区', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('349', '曲沃县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('350', '翼城县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('351', '襄汾县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('352', '洪洞县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('353', '古 县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('354', '安泽县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('355', '浮山县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('356', '吉 县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('357', '乡宁县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('358', '大宁县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('359', '隰 县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('360', '永和县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('361', '蒲 县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('362', '汾西县', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('363', '侯马市', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('364', '霍州市', '346', '0');
INSERT INTO `dede_area_copy` VALUES ('365', '吕梁市', '238', '0');
INSERT INTO `dede_area_copy` VALUES ('366', '市辖区', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('367', '离石区', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('368', '文水县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('369', '交城县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('370', '兴 县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('371', '临 县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('372', '柳林县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('373', '石楼县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('374', '岚 县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('375', '方山县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('376', '中阳县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('377', '交口县', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('378', '孝义市', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('379', '汾阳市', '365', '0');
INSERT INTO `dede_area_copy` VALUES ('380', '内蒙古自治区', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('381', '呼和浩特市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('382', '市辖区', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('383', '新城区', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('384', '回民区', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('385', '玉泉区', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('386', '赛罕区', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('387', '土默特左旗', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('388', '托克托县', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('389', '和林格尔县', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('390', '清水河县', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('391', '武川县', '381', '0');
INSERT INTO `dede_area_copy` VALUES ('392', '包头市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('393', '市辖区', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('394', '东河区', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('395', '昆都仑区', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('396', '青山区', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('397', '石拐区', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('398', '白云矿区', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('399', '九原区', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('400', '土默特右旗', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('401', '固阳县', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('402', '达尔罕茂明安联合旗', '392', '0');
INSERT INTO `dede_area_copy` VALUES ('403', '乌海市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('404', '市辖区', '403', '0');
INSERT INTO `dede_area_copy` VALUES ('405', '海勃湾区', '403', '0');
INSERT INTO `dede_area_copy` VALUES ('406', '海南区', '403', '0');
INSERT INTO `dede_area_copy` VALUES ('407', '乌达区', '403', '0');
INSERT INTO `dede_area_copy` VALUES ('408', '赤峰市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('409', '市辖区', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('410', '红山区', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('411', '元宝山区', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('412', '松山区', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('413', '阿鲁科尔沁旗', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('414', '巴林左旗', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('415', '巴林右旗', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('416', '林西县', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('417', '克什克腾旗', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('418', '翁牛特旗', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('419', '喀喇沁旗', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('420', '宁城县', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('421', '敖汉旗', '408', '0');
INSERT INTO `dede_area_copy` VALUES ('422', '通辽市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('423', '市辖区', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('424', '科尔沁区', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('425', '科尔沁左翼中旗', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('426', '科尔沁左翼后旗', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('427', '开鲁县', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('428', '库伦旗', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('429', '奈曼旗', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('430', '扎鲁特旗', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('431', '霍林郭勒市', '422', '0');
INSERT INTO `dede_area_copy` VALUES ('432', '鄂尔多斯市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('433', '东胜区', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('434', '达拉特旗', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('435', '准格尔旗', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('436', '鄂托克前旗', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('437', '鄂托克旗', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('438', '杭锦旗', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('439', '乌审旗', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('440', '伊金霍洛旗', '432', '0');
INSERT INTO `dede_area_copy` VALUES ('441', '呼伦贝尔市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('442', '市辖区', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('443', '海拉尔区', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('444', '阿荣旗', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('445', '莫力达瓦达斡尔族自治旗', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('446', '鄂伦春自治旗', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('447', '鄂温克族自治旗', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('448', '陈巴尔虎旗', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('449', '新巴尔虎左旗', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('450', '新巴尔虎右旗', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('451', '满洲里市', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('452', '牙克石市', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('453', '扎兰屯市', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('454', '额尔古纳市', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('455', '根河市', '441', '0');
INSERT INTO `dede_area_copy` VALUES ('456', '巴彦淖尔市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('457', '市辖区', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('458', '临河区', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('459', '五原县', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('460', '磴口县', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('461', '乌拉特前旗', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('462', '乌拉特中旗', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('463', '乌拉特后旗', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('464', '杭锦后旗', '456', '0');
INSERT INTO `dede_area_copy` VALUES ('465', '乌兰察布市', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('466', '市辖区', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('467', '集宁区', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('468', '卓资县', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('469', '化德县', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('470', '商都县', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('471', '兴和县', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('472', '凉城县', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('473', '察哈尔右翼前旗', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('474', '察哈尔右翼中旗', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('475', '察哈尔右翼后旗', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('476', '四子王旗', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('477', '丰镇市', '465', '0');
INSERT INTO `dede_area_copy` VALUES ('478', '兴安盟', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('479', '乌兰浩特市', '478', '0');
INSERT INTO `dede_area_copy` VALUES ('480', '阿尔山市', '478', '0');
INSERT INTO `dede_area_copy` VALUES ('481', '科尔沁右翼前旗', '478', '0');
INSERT INTO `dede_area_copy` VALUES ('482', '科尔沁右翼中旗', '478', '0');
INSERT INTO `dede_area_copy` VALUES ('483', '扎赉特旗', '478', '0');
INSERT INTO `dede_area_copy` VALUES ('484', '突泉县', '478', '0');
INSERT INTO `dede_area_copy` VALUES ('485', '锡林郭勒盟', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('486', '二连浩特市', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('487', '锡林浩特市', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('488', '阿巴嘎旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('489', '苏尼特左旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('490', '苏尼特右旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('491', '东乌珠穆沁旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('492', '西乌珠穆沁旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('493', '太仆寺旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('494', '镶黄旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('495', '正镶白旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('496', '正蓝旗', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('497', '多伦县', '485', '0');
INSERT INTO `dede_area_copy` VALUES ('498', '阿拉善盟', '380', '0');
INSERT INTO `dede_area_copy` VALUES ('499', '阿拉善左旗', '498', '0');
INSERT INTO `dede_area_copy` VALUES ('500', '阿拉善右旗', '498', '0');
INSERT INTO `dede_area_copy` VALUES ('501', '额济纳旗', '498', '0');
INSERT INTO `dede_area_copy` VALUES ('502', '辽宁省', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('503', '沈阳市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('504', '市辖区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('505', '和平区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('506', '沈河区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('507', '大东区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('508', '皇姑区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('509', '铁西区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('510', '苏家屯区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('511', '东陵区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('512', '新城子区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('513', '于洪区', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('514', '辽中县', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('515', '康平县', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('516', '法库县', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('517', '新民市', '503', '0');
INSERT INTO `dede_area_copy` VALUES ('518', '大连市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('519', '市辖区', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('520', '中山区', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('521', '西岗区', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('522', '沙河口区', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('523', '甘井子区', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('524', '旅顺口区', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('525', '金州区', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('526', '长海县', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('527', '瓦房店市', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('528', '普兰店市', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('529', '庄河市', '518', '0');
INSERT INTO `dede_area_copy` VALUES ('530', '鞍山市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('531', '市辖区', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('532', '铁东区', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('533', '铁西区', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('534', '立山区', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('535', '千山区', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('536', '台安县', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('537', '岫岩满族自治县', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('538', '海城市', '530', '0');
INSERT INTO `dede_area_copy` VALUES ('539', '抚顺市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('540', '市辖区', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('541', '新抚区', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('542', '东洲区', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('543', '望花区', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('544', '顺城区', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('545', '抚顺县', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('546', '新宾满族自治县', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('547', '清原满族自治县', '539', '0');
INSERT INTO `dede_area_copy` VALUES ('548', '本溪市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('549', '市辖区', '548', '0');
INSERT INTO `dede_area_copy` VALUES ('550', '平山区', '548', '0');
INSERT INTO `dede_area_copy` VALUES ('551', '溪湖区', '548', '0');
INSERT INTO `dede_area_copy` VALUES ('552', '明山区', '548', '0');
INSERT INTO `dede_area_copy` VALUES ('553', '南芬区', '548', '0');
INSERT INTO `dede_area_copy` VALUES ('554', '本溪满族自治县', '548', '0');
INSERT INTO `dede_area_copy` VALUES ('555', '桓仁满族自治县', '548', '0');
INSERT INTO `dede_area_copy` VALUES ('556', '丹东市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('557', '市辖区', '556', '0');
INSERT INTO `dede_area_copy` VALUES ('558', '元宝区', '556', '0');
INSERT INTO `dede_area_copy` VALUES ('559', '振兴区', '556', '0');
INSERT INTO `dede_area_copy` VALUES ('560', '振安区', '556', '0');
INSERT INTO `dede_area_copy` VALUES ('561', '宽甸满族自治县', '556', '0');
INSERT INTO `dede_area_copy` VALUES ('562', '东港市', '556', '0');
INSERT INTO `dede_area_copy` VALUES ('563', '凤城市', '556', '0');
INSERT INTO `dede_area_copy` VALUES ('564', '锦州市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('565', '市辖区', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('566', '古塔区', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('567', '凌河区', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('568', '太和区', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('569', '黑山县', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('570', '义 县', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('571', '凌海市', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('572', '北宁市', '564', '0');
INSERT INTO `dede_area_copy` VALUES ('573', '营口市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('574', '市辖区', '573', '0');
INSERT INTO `dede_area_copy` VALUES ('575', '站前区', '573', '0');
INSERT INTO `dede_area_copy` VALUES ('576', '西市区', '573', '0');
INSERT INTO `dede_area_copy` VALUES ('577', '鲅鱼圈区', '573', '0');
INSERT INTO `dede_area_copy` VALUES ('578', '老边区', '573', '0');
INSERT INTO `dede_area_copy` VALUES ('579', '盖州市', '573', '0');
INSERT INTO `dede_area_copy` VALUES ('580', '大石桥市', '573', '0');
INSERT INTO `dede_area_copy` VALUES ('581', '阜新市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('582', '市辖区', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('583', '海州区', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('584', '新邱区', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('585', '太平区', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('586', '清河门区', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('587', '细河区', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('588', '阜新蒙古族自治县', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('589', '彰武县', '581', '0');
INSERT INTO `dede_area_copy` VALUES ('590', '辽阳市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('591', '市辖区', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('592', '白塔区', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('593', '文圣区', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('594', '宏伟区', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('595', '弓长岭区', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('596', '太子河区', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('597', '辽阳县', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('598', '灯塔市', '590', '0');
INSERT INTO `dede_area_copy` VALUES ('599', '盘锦市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('600', '市辖区', '599', '0');
INSERT INTO `dede_area_copy` VALUES ('601', '双台子区', '599', '0');
INSERT INTO `dede_area_copy` VALUES ('602', '兴隆台区', '599', '0');
INSERT INTO `dede_area_copy` VALUES ('603', '大洼县', '599', '0');
INSERT INTO `dede_area_copy` VALUES ('604', '盘山县', '599', '0');
INSERT INTO `dede_area_copy` VALUES ('605', '铁岭市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('606', '市辖区', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('607', '银州区', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('608', '清河区', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('609', '铁岭县', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('610', '西丰县', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('611', '昌图县', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('612', '调兵山市', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('613', '开原市', '605', '0');
INSERT INTO `dede_area_copy` VALUES ('614', '朝阳市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('615', '市辖区', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('616', '双塔区', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('617', '龙城区', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('618', '朝阳县', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('619', '建平县', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('620', '喀喇沁左翼蒙古族自治县', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('621', '北票市', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('622', '凌源市', '614', '0');
INSERT INTO `dede_area_copy` VALUES ('623', '葫芦岛市', '502', '0');
INSERT INTO `dede_area_copy` VALUES ('624', '市辖区', '623', '0');
INSERT INTO `dede_area_copy` VALUES ('625', '连山区', '623', '0');
INSERT INTO `dede_area_copy` VALUES ('626', '龙港区', '623', '0');
INSERT INTO `dede_area_copy` VALUES ('627', '南票区', '623', '0');
INSERT INTO `dede_area_copy` VALUES ('628', '绥中县', '623', '0');
INSERT INTO `dede_area_copy` VALUES ('629', '建昌县', '623', '0');
INSERT INTO `dede_area_copy` VALUES ('630', '兴城市', '623', '0');
INSERT INTO `dede_area_copy` VALUES ('631', '吉林省', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('632', '长春市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('633', '市辖区', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('634', '南关区', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('635', '宽城区', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('636', '朝阳区', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('637', '二道区', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('638', '绿园区', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('639', '双阳区', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('640', '农安县', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('641', '九台市', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('642', '榆树市', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('643', '德惠市', '632', '0');
INSERT INTO `dede_area_copy` VALUES ('644', '吉林市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('645', '市辖区', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('646', '昌邑区', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('647', '龙潭区', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('648', '船营区', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('649', '丰满区', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('650', '永吉县', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('651', '蛟河市', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('652', '桦甸市', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('653', '舒兰市', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('654', '磐石市', '644', '0');
INSERT INTO `dede_area_copy` VALUES ('655', '四平市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('656', '市辖区', '655', '0');
INSERT INTO `dede_area_copy` VALUES ('657', '铁西区', '655', '0');
INSERT INTO `dede_area_copy` VALUES ('658', '铁东区', '655', '0');
INSERT INTO `dede_area_copy` VALUES ('659', '梨树县', '655', '0');
INSERT INTO `dede_area_copy` VALUES ('660', '伊通满族自治县', '655', '0');
INSERT INTO `dede_area_copy` VALUES ('661', '公主岭市', '655', '0');
INSERT INTO `dede_area_copy` VALUES ('662', '双辽市', '655', '0');
INSERT INTO `dede_area_copy` VALUES ('663', '辽源市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('664', '市辖区', '663', '0');
INSERT INTO `dede_area_copy` VALUES ('665', '龙山区', '663', '0');
INSERT INTO `dede_area_copy` VALUES ('666', '西安区', '663', '0');
INSERT INTO `dede_area_copy` VALUES ('667', '东丰县', '663', '0');
INSERT INTO `dede_area_copy` VALUES ('668', '东辽县', '663', '0');
INSERT INTO `dede_area_copy` VALUES ('669', '通化市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('670', '市辖区', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('671', '东昌区', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('672', '二道江区', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('673', '通化县', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('674', '辉南县', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('675', '柳河县', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('676', '梅河口市', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('677', '集安市', '669', '0');
INSERT INTO `dede_area_copy` VALUES ('678', '白山市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('679', '市辖区', '678', '0');
INSERT INTO `dede_area_copy` VALUES ('680', '八道江区', '678', '0');
INSERT INTO `dede_area_copy` VALUES ('681', '抚松县', '678', '0');
INSERT INTO `dede_area_copy` VALUES ('682', '靖宇县', '678', '0');
INSERT INTO `dede_area_copy` VALUES ('683', '长白朝鲜族自治县', '678', '0');
INSERT INTO `dede_area_copy` VALUES ('684', '江源县', '678', '0');
INSERT INTO `dede_area_copy` VALUES ('685', '临江市', '678', '0');
INSERT INTO `dede_area_copy` VALUES ('686', '松原市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('687', '市辖区', '686', '0');
INSERT INTO `dede_area_copy` VALUES ('688', '宁江区', '686', '0');
INSERT INTO `dede_area_copy` VALUES ('689', '前郭尔罗斯蒙古族自治县', '686', '0');
INSERT INTO `dede_area_copy` VALUES ('690', '长岭县', '686', '0');
INSERT INTO `dede_area_copy` VALUES ('691', '乾安县', '686', '0');
INSERT INTO `dede_area_copy` VALUES ('692', '扶余县', '686', '0');
INSERT INTO `dede_area_copy` VALUES ('693', '白城市', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('694', '市辖区', '693', '0');
INSERT INTO `dede_area_copy` VALUES ('695', '洮北区', '693', '0');
INSERT INTO `dede_area_copy` VALUES ('696', '镇赉县', '693', '0');
INSERT INTO `dede_area_copy` VALUES ('697', '通榆县', '693', '0');
INSERT INTO `dede_area_copy` VALUES ('698', '洮南市', '693', '0');
INSERT INTO `dede_area_copy` VALUES ('699', '大安市', '693', '0');
INSERT INTO `dede_area_copy` VALUES ('700', '延边朝鲜族自治州', '631', '0');
INSERT INTO `dede_area_copy` VALUES ('701', '延吉市', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('702', '图们市', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('703', '敦化市', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('704', '珲春市', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('705', '龙井市', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('706', '和龙市', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('707', '汪清县', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('708', '安图县', '700', '0');
INSERT INTO `dede_area_copy` VALUES ('709', '黑龙江省', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('710', '哈尔滨市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('711', '市辖区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('712', '道里区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('713', '南岗区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('714', '道外区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('715', '香坊区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('716', '动力区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('717', '平房区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('718', '松北区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('719', '呼兰区', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('720', '依兰县', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('721', '方正县', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('722', '宾 县', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('723', '巴彦县', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('724', '木兰县', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('725', '通河县', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('726', '延寿县', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('727', '阿城市', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('728', '双城市', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('729', '尚志市', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('730', '五常市', '710', '0');
INSERT INTO `dede_area_copy` VALUES ('731', '齐齐哈尔市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('732', '市辖区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('733', '龙沙区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('734', '建华区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('735', '铁锋区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('736', '昂昂溪区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('737', '富拉尔基区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('738', '碾子山区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('739', '梅里斯达斡尔族区', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('740', '龙江县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('741', '依安县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('742', '泰来县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('743', '甘南县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('744', '富裕县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('745', '克山县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('746', '克东县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('747', '拜泉县', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('748', '讷河市', '731', '0');
INSERT INTO `dede_area_copy` VALUES ('749', '鸡西市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('750', '市辖区', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('751', '鸡冠区', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('752', '恒山区', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('753', '滴道区', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('754', '梨树区', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('755', '城子河区', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('756', '麻山区', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('757', '鸡东县', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('758', '虎林市', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('759', '密山市', '749', '0');
INSERT INTO `dede_area_copy` VALUES ('760', '鹤岗市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('761', '市辖区', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('762', '向阳区', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('763', '工农区', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('764', '南山区', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('765', '兴安区', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('766', '东山区', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('767', '兴山区', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('768', '萝北县', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('769', '绥滨县', '760', '0');
INSERT INTO `dede_area_copy` VALUES ('770', '双鸭山市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('771', '市辖区', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('772', '尖山区', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('773', '岭东区', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('774', '四方台区', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('775', '宝山区', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('776', '集贤县', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('777', '友谊县', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('778', '宝清县', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('779', '饶河县', '770', '0');
INSERT INTO `dede_area_copy` VALUES ('780', '大庆市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('781', '市辖区', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('782', '萨尔图区', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('783', '龙凤区', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('784', '让胡路区', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('785', '红岗区', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('786', '大同区', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('787', '肇州县', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('788', '肇源县', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('789', '林甸县', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('790', '杜尔伯特蒙古族自治县', '780', '0');
INSERT INTO `dede_area_copy` VALUES ('791', '伊春市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('792', '市辖区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('793', '伊春区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('794', '南岔区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('795', '友好区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('796', '西林区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('797', '翠峦区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('798', '新青区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('799', '美溪区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('800', '金山屯区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('801', '五营区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('802', '乌马河区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('803', '汤旺河区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('804', '带岭区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('805', '乌伊岭区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('806', '红星区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('807', '上甘岭区', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('808', '嘉荫县', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('809', '铁力市', '791', '0');
INSERT INTO `dede_area_copy` VALUES ('810', '佳木斯市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('811', '市辖区', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('812', '永红区', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('813', '向阳区', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('814', '前进区', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('815', '东风区', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('816', '郊 区', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('817', '桦南县', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('818', '桦川县', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('819', '汤原县', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('820', '抚远县', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('821', '同江市', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('822', '富锦市', '810', '0');
INSERT INTO `dede_area_copy` VALUES ('823', '七台河市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('824', '市辖区', '823', '0');
INSERT INTO `dede_area_copy` VALUES ('825', '新兴区', '823', '0');
INSERT INTO `dede_area_copy` VALUES ('826', '桃山区', '823', '0');
INSERT INTO `dede_area_copy` VALUES ('827', '茄子河区', '823', '0');
INSERT INTO `dede_area_copy` VALUES ('828', '勃利县', '823', '0');
INSERT INTO `dede_area_copy` VALUES ('829', '牡丹江市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('830', '市辖区', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('831', '东安区', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('832', '阳明区', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('833', '爱民区', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('834', '西安区', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('835', '东宁县', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('836', '林口县', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('837', '绥芬河市', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('838', '海林市', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('839', '宁安市', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('840', '穆棱市', '829', '0');
INSERT INTO `dede_area_copy` VALUES ('841', '黑河市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('842', '市辖区', '841', '0');
INSERT INTO `dede_area_copy` VALUES ('843', '爱辉区', '841', '0');
INSERT INTO `dede_area_copy` VALUES ('844', '嫩江县', '841', '0');
INSERT INTO `dede_area_copy` VALUES ('845', '逊克县', '841', '0');
INSERT INTO `dede_area_copy` VALUES ('846', '孙吴县', '841', '0');
INSERT INTO `dede_area_copy` VALUES ('847', '北安市', '841', '0');
INSERT INTO `dede_area_copy` VALUES ('848', '五大连池市', '841', '0');
INSERT INTO `dede_area_copy` VALUES ('849', '绥化市', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('850', '市辖区', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('851', '北林区', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('852', '望奎县', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('853', '兰西县', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('854', '青冈县', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('855', '庆安县', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('856', '明水县', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('857', '绥棱县', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('858', '安达市', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('859', '肇东市', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('860', '海伦市', '849', '0');
INSERT INTO `dede_area_copy` VALUES ('861', '大兴安岭地区', '709', '0');
INSERT INTO `dede_area_copy` VALUES ('862', '呼玛县', '861', '0');
INSERT INTO `dede_area_copy` VALUES ('863', '塔河县', '861', '0');
INSERT INTO `dede_area_copy` VALUES ('864', '漠河县', '861', '0');
INSERT INTO `dede_area_copy` VALUES ('865', '上海市', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('866', '市辖区', '865', '0');
INSERT INTO `dede_area_copy` VALUES ('867', '黄浦区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('868', '卢湾区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('869', '徐汇区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('870', '长宁区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('871', '静安区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('872', '普陀区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('873', '闸北区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('874', '虹口区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('875', '杨浦区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('876', '闵行区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('877', '宝山区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('878', '嘉定区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('879', '浦东新区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('880', '金山区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('881', '松江区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('882', '青浦区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('883', '南汇区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('884', '奉贤区', '866', '0');
INSERT INTO `dede_area_copy` VALUES ('885', '县', '865', '0');
INSERT INTO `dede_area_copy` VALUES ('886', '崇明县', '885', '0');
INSERT INTO `dede_area_copy` VALUES ('887', '江苏省', '0', '0');
INSERT INTO `dede_area_copy` VALUES ('888', '南京市', '887', '0');
INSERT INTO `dede_area_copy` VALUES ('889', '市辖区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('890', '玄武区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('891', '白下区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('892', '秦淮区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('893', '建邺区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('894', '鼓楼区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('895', '下关区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('896', '浦口区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('897', '栖霞区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('898', '雨花台区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('899', '江宁区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('900', '六合区', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('901', '溧水县', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('902', '高淳县', '888', '0');
INSERT INTO `dede_area_copy` VALUES ('903', '无锡市', '887', '0');
INSERT INTO `dede_area_copy`
javascript封装加减乘除 javascript
/**
 * 加法运算,避免数据相加小数点后产生多位数和计算精度损失。
 * 
 * @param num1加数1 | num2加数2
 */
function numAdd(num1, num2) {
    var baseNum, baseNum1, baseNum2;
    try {
        baseNum1 = num1.toString().split(".")[1].length;
    } catch (e) {
        baseNum1 = 0;
    }
    try {
        baseNum2 = num2.toString().split(".")[1].length;
    } catch (e) {
        baseNum2 = 0;
    }
    baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
    return (num1 * baseNum + num2 * baseNum) / baseNum;
};
/**
 * 减法运算,避免数据相减小数点后产生多位数和计算精度损失。
 * 
 * @param num1被减数  |  num2减数
 */
function numSub(num1, num2) {
    var baseNum, baseNum1, baseNum2;
    var precision;// 精度
    try {
        baseNum1 = num1.toString().split(".")[1].length;
    } catch (e) {
        baseNum1 = 0;
    }
    try {
        baseNum2 = num2.toString().split(".")[1].length;
    } catch (e) {
        baseNum2 = 0;
    }
    baseNum = Math.pow(10, Math.max(baseNum1, baseNum2));
    precision = (baseNum1 >= baseNum2) ? baseNum1 : baseNum2;
    return ((num1 * baseNum - num2 * baseNum) / baseNum).toFixed(precision);
};
/**
 * 乘法运算,避免数据相乘小数点后产生多位数和计算精度损失。
 * 
 * @param num1被乘数 | num2乘数
 */
function numMulti(num1, num2) {
    var baseNum = 0;
    try {
        baseNum += num1.toString().split(".")[1].length;
    } catch (e) {
    }
    try {
        baseNum += num2.toString().split(".")[1].length;
    } catch (e) {
    }
    return Number(num1.toString().replace(".", "")) * Number(num2.toString().replace(".", "")) / Math.pow(10, baseNum);
};
/**
 * 除法运算,避免数据相除小数点后产生多位数和计算精度损失。
 * 
 * @param num1被除数 | num2除数
 */
function numDiv(num1, num2) {
    var baseNum1 = 0, baseNum2 = 0;
    var baseNum3, baseNum4;
    try {
        baseNum1 = num1.toString().split(".")[1].length;
    } catch (e) {
        baseNum1 = 0;
    }
    try {
        baseNum2 = num2.toString().split(".")[1].length;
    } catch (e) {
        baseNum2 = 0;
    }
    with (Math) {
        baseNum3 = Number(num1.toString().replace(".", ""));
        baseNum4 = Number(num2.toString().replace(".", ""));
        return (baseNum3 / baseNum4) * pow(10, baseNum2 - baseNum1);
    }
};
整合ios和android的推送代码,后台 php, 推送
<?php
class helper_push{
	const MAXTIMES = 3;
	static private $_times = 0;
	private $fp;
	const APIKEY = '';
	const SECRETKEY = '';
        const PWD = '';
	
	public function __construct(){
		
	}
	
	public function getLink(){
		$passphrase = PWD;
		$ctx = stream_context_create();
		stream_context_set_option($ctx, 'ssl', 'local_cert', DEDEDATA.'/ck.pem');
		stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
		$fp = stream_socket_client(
	        'ssl://gateway.push.apple.com:2195', $err,
		$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
		if (!$fp){//连接失败
			if(self::$_times < self::MAXTIMES){//失败次数小于5次,再次实例化
				self::$_times += 1;
				return $this->getLink();
			}else{//失败次数大于5次,记录操作失败记录
				return false;
			}
		}else{//连接成功
			$this->fp = $fp;
			return true;
		}		
	}
	
	public function closefp(){
		fclose($this->fp);
	}
	
	public function setPush($deviceToken,$message){
		if($this->is_serialized($deviceToken)){
			$user_id = $channel_id = '';
			$dt_arr = unserialize($deviceToken);
			$user_id = $dt_arr['user_id'];
			$channel_id = $dt_arr['channel_id'];
			$this->setAndroidPush($user_id,$channel_id,$message);
			unset($user_id,$channel_id,$dt_arr);
		}else{
			$this->setIOSPush($deviceToken, $message);
		}		
	}
	
	private function setIOSPush($deviceToken,$message){
		$body['aps'] = $message;
		$payload = json_encode($body);
		$msg = chr(0) . pack('n', 32) . pack('H*', $deviceToken) . pack('n', strlen($payload)) . $payload;
		$result = fwrite($this->fp, $msg, strlen($msg));
		if (!$result){//发送失败
			if(self::$_times < self::MAXTIMES){//失败次数小于5次,再次发送
				self::$_times += 1;
				$this->setPush($deviceToken, $message);
			}else{//失败次数大于5次,记录操作失败记录
				return false;
			}
		}else{//发送成功
			return true;
		}
	}
	/**
	 * 
	 * 已广播的形式发送推送通知
	 * @param array $message_arr
	 */
	public function a_broadcastPush($message_arr){
		require_once ( "Channel.class.php" ) ;
		$channel = new Channel(self::APIKEY,self::SECRETKEY);
		$push_type = 3;
		$optional[Channel::MESSAGE_TYPE] = 1;
		$message_str = '"description":"'.$message_arr['alert'].'",';
		unset($message_arr['alert'],$message_arr['badge'],$message_arr['sound']);
		$custom_content = '';
		foreach ($message_arr as $key=>$value){
			$custom_content .= '"'.$key.'":"'.$value.'",';
		}
		$custom_content = trim($custom_content,',');
		$message = '{ 
				"title": "'.diconv('中文', 'gbk', 'utf-8').'",
				'.$message_str.'
				"custom_content":{'.$custom_content.'},
				"notification_basic_style":7,
				"open_type":0
			}';
		unset($message_str,$custom_content);
		$message_key = "msg_key";
		$ret = $channel->pushMessage ( $push_type, $message, $message_key,$optional ) ;
		return $ret;
	}
	
	private function setAndroidPush($user_id,$channel_id,$message_arr){
		require_once ( "Channel.class.php" ) ;
		$channel = new Channel(self::APIKEY,self::SECRETKEY);
		$push_type = 1;
		$optional[Channel::USER_ID] = $user_id;
		$optional[Channel::CHANNEL_ID] = $channel_id;
		$optional[Channel::DEVICE_TYPE] = 3;
		$optional[Channel::MESSAGE_TYPE] = 1;

		$message_str = '"description":"'.$message_arr['alert'].'",';
		unset($message_arr['alert'],$message_arr['badge'],$message_arr['sound']);
		$custom_content = '';
		foreach ($message_arr as $key=>$value){
			$custom_content .= '"'.$key.'":"'.$value.'",';
		}
		$custom_content = trim($custom_content,',');
		$message = '{ 
				"title": "'.diconv('中文', 'gbk', 'utf-8').'",
				'.$message_str.'
				"custom_content":{'.$custom_content.'},
				"notification_basic_style":7,
				"open_type":0
			}';
		unset($message_str,$custom_content);
		$message_key = "msg_key";
		$ret = $channel->pushMessage ( $push_type, $message, $message_key, $optional ) ;
		if ( false === $ret ){
//			file_put_contents(dirname(__FILE__).'\push.log','Message not delivered, user_id:'.$user_id.' and channel_id:'.$channel_id.' and msg:'.$message,FILE_APPEND);
		}else{
//			file_put_contents(dirname(__FILE__).'\push.log','Message successfully delivered, user_id:'.$user_id.' and channel_id:'.$channel_id.' and msg:'.$message,FILE_APPEND);			
		}
	}
	
	private function is_serialized($data){
       $data = trim( $data );
       if ( 'N;' == $data )
           return true;
       if ( !preg_match( '/^([adObis]):/', $data, $badions ) )
           return false;
       switch ( $badions[1] ) {
           case 'a' :
           case 'O' :
           case 's' :
               if ( preg_match( "/^{$badions[1]}:[0-9]+:.*[;}]\$/s", $data ) )
                   return true;
               break;
           case 'b' :
           case 'i' :
           case 'd' :                           
               if ( preg_match( "/^{$badions[1]}:[0- E-]+;\$/", $data ) )
                   return true;
               break;
       }
       return false;		
	}
}
?>
常用eclipse快捷操作 eclipse
1、ctrl+shift+r:打开资源,输入工作空间内的文件名,快速查找
2、 ctrl+o:快速outline,主要适用于在当前类中快速查找定义的方法
3、ctrl+e:快速转换编辑器,主要适用于在已经打开的文件中快速查找需要的文件(如果文件打开的比较多,就更加)
4、shift+enter及ctrl+shift+enter: Shift+enter在当前行之下创建一个空白行,与光标是否在行末无关。Ctrl+shift+enter则在当前行之前插入空白行。
5、 Alt+方向键:这也是个节省时间的法宝。这个组合将当前行的内容往上或下移动。在try/catch部分,这个快捷方式尤其好使
6、 ctrl+m:大显示屏幕能够提高工作效率是大家都知道的。Ctrl+m是编辑器窗口最大化的快捷键。
7、F3:打开被调用的某个方法的定义之处,和按住ctrl+鼠标左键是同一个效果
8、Alt-left:就像Web浏览器的后退按钮一样,在利用F3跳转之后,特别有用。(用来返回原先编译的地方)
9、Alt-right arrow: 导航历史记录中向前。
10、ctrl+Q:回到最后一次编辑的地方。
11、ctrl+H:在工作组中搜索文件中的指定值
12、ctrl+shift+F:根据代码风格设定重新格式化代码
13、ctrl+/:快速注释
14、Ctrl+T:查看继承树
15、ctrl+方向键:跳过一个单次
16、ctrl+shift+方向键:选中某个单次

Ctrl+1 快速修复(最经典的快捷键,就不用多说了)
Ctrl+D: 删除当前行 
Ctrl+Alt+↓ 复制当前行到下一行(复制增加)
Ctrl+Alt+↑ 复制当前行到上一行(复制增加)
Alt+↓ 当前行和下面一行交互位置(特别实用,可以省去先剪切,再粘贴了)
Alt+↑ 当前行和上面一行交互位置(同上)
Alt+← 前一个编辑的页面
Alt+→ 下一个编辑的页面(当然是针对上面那条来说了)
Alt+Enter 显示当前选择资源(工程,or 文件 or文件)的属性
Shift+Enter 在当前行的下一行插入空行(这时鼠标可以在当前行的任一位置,不一定是最后)
Shift+Ctrl+Enter 在当前行插入空行(原理同上条)
Ctrl+Q 定位到最后编辑的地方
Ctrl+L 定位在某行 (对于程序超过100的人就有福音了)
Ctrl+M 最大化当前的Edit或View (再按则反之)
Ctrl+/ 注释当前行,再按则取消注释
Ctrl+O 快速显示 OutLine
Ctrl+T 快速显示当前类的继承结构
Ctrl+W 关闭当前Editer
Ctrl+K 参照选中的Word快速定位到下一个
Ctrl+E 快速显示当前Editer的下拉列表(如果当前页面没有显示的用黑体表示)
Ctrl+/(小键盘) 折叠当前类中的所有代码
Ctrl+×(小键盘) 展开当前类中的所有代码
Ctrl+Space 代码助手完成一些代码的插入(但一般和输入法有冲突,可以修改输入法的热键,也可以暂用Alt+/来代替)
Ctrl+Shift+E 显示管理当前打开的所有的View的管理器(可以选择关闭,激活等操作)
Ctrl+J 正向增量查找(按下Ctrl+J后,你所输入的每个字母编辑器都提供快速匹配定位到某个单词,如果没有,则在stutes line中显示没有找到了,查一个单词时,特别实用,这个功能Idea两年前就有了)
Ctrl+Shift+J 反向增量查找(和上条相同,只不过是从后往前查)
Ctrl+Shift+F4 关闭所有打开的Editer
Ctrl+Shift+X 把当前选中的文本全部变味小写
Ctrl+Shift+Y 把当前选中的文本全部变为小写
Ctrl+Shift+F 格式化当前代码
Ctrl+Shift+P 定位到对于的匹配符(譬如{}) (从前面定位后面时,光标要在匹配符里面,后面到前面,则反之)
编辑
作用域 功能 快捷键 
全局 查找并替换 Ctrl+F 
文本编辑器 查找上一个 Ctrl+Shift+K 
文本编辑器 查找下一个 Ctrl+K 
全局 撤销 Ctrl+Z 
全局 复制 Ctrl+C 
全局 恢复上一个选择 Alt+Shift+↓ 
全局 剪切 Ctrl+X 
全局 快速修正 Ctrl1+1 
全局 内容辅助 Alt+/ 
全局 全部选中 Ctrl+A 
全局 删除 Delete 
全局 上下文信息 Alt+?
Alt+Shift+?
Ctrl+Shift+Space 
Java编辑器 显示工具提示描述 F2 
Java编辑器 选择封装元素 Alt+Shift+↑ 
Java编辑器 选择上一个元素 Alt+Shift+← 
Java编辑器 选择下一个元素 Alt+Shift+→ 
文本编辑器 增量查找 Ctrl+J 
文本编辑器 增量逆向查找 Ctrl+Shift+J 
全局 粘贴 Ctrl+V 
全局 重做 Ctrl+Y 
查看
作用域 功能 快捷键 
全局 放大 Ctrl+= 
全局 缩小 Ctrl+- 
窗口
作用域 功能 快捷键 
全局 激活编辑器 F12 
全局 切换编辑器 Ctrl+Shift+W 
全局 上一个编辑器 Ctrl+Shift+F6 
全局 上一个视图 Ctrl+Shift+F7 
全局 上一个透视图 Ctrl+Shift+F8 
全局 下一个编辑器 Ctrl+F6 
全局 下一个视图 Ctrl+F7 
全局 下一个透视图 Ctrl+F8 
文本编辑器 显示标尺上下文菜单 Ctrl+W 
全局 显示视图菜单 Ctrl+F10 
全局 显示系统菜单 Alt+- 
导航
作用域 功能 快捷键 
Java编辑器 打开结构 Ctrl+F3 
全局 打开类型 Ctrl+Shift+T 
全局 打开类型层次结构 F4 
全局 打开声明 F3 
全局 打开外部javadoc Shift+F2 
全局 打开资源 Ctrl+Shift+R 
全局 后退历史记录 Alt+← 
全局 前进历史记录 Alt+→ 
全局 上一个 Ctrl+, 
全局 下一个 Ctrl+. 
Java编辑器 显示大纲 Ctrl+O 
全局 在层次结构中打开类型 Ctrl+Shift+H 
全局 转至匹配的括号 Ctrl+Shift+P 
全局 转至上一个编辑位置 Ctrl+Q 
Java编辑器 转至上一个成员 Ctrl+Shift+↑ 
Java编辑器 转至下一个成员 Ctrl+Shift+↓ 
文本编辑器 转至行 Ctrl+L 
搜索
作用域 功能 快捷键 
全局 出现在文件中 Ctrl+Shift+U 
全局 打开搜索对话框 Ctrl+H 
全局 工作区中的声明 Ctrl+G 
全局 工作区中的引用 Ctrl+Shift+G 
文本编辑
作用域 功能 快捷键 
文本编辑器 改写切换 Insert 
文本编辑器 上滚行 Ctrl+↑ 
文本编辑器 下滚行 Ctrl+↓ 
文件
作用域 功能 快捷键 
全局 保存 Ctrl+X 
Ctrl+S 
全局 打印 Ctrl+P 
全局 关闭 Ctrl+F4 
全局 全部保存 Ctrl+Shift+S 
全局 全部关闭 Ctrl+Shift+F4 
全局 属性 Alt+Enter 
全局 新建 Ctrl+N 
源代码
作用域 功能 快捷键 
Java编辑器 格式化 Ctrl+Shift+F 
Java编辑器 取消注释 Ctrl+\ 
Java编辑器 注释 Ctrl+/ 
Java编辑器 添加导入 Ctrl+Shift+M 
Java编辑器 组织导入 Ctrl+Shift+O 
Java编辑器 使用try/catch块来包围 未设置,太常用了,所以在这里列出,建议自己设置。
也可以使用Ctrl+1自动修正。 
运行
作用域 功能 快捷键 
全局 单步返回 F7 
全局 单步跳过 F6 
全局 单步跳入 F5 
全局 单步跳入选择 Ctrl+F5 
全局 调试上次启动 F11 
全局 继续 F8 
全局 使用过滤器单步执行 Shift+F5 
全局 添加/去除断点 Ctrl+Shift+B 
全局 显示 Ctrl+D 
全局 运行上次启动 Ctrl+F11 
全局 运行至行 Ctrl+R 
全局 执行 Ctrl+U 
php常用扩展方法 php
function is_serialized($data) {
       $data = trim( $data );
       if ( 'N;' == $data )
           return true;
       if ( !preg_match( '/^([adObis]):/', $data, $badions ) )
           return false;
       switch ( $badions[1] ) {
           case 'a' :
           case 'O' :
           case 's' :
               if ( preg_match( "/^{$badions[1]}:[0-9]+:.*[;}]\$/s", $data ) )
                   return true;
               break;
           case 'b' :
           case 'i' :
           case 'd' :                           
               if ( preg_match( "/^{$badions[1]}:[0- E-]+;\$/", $data ) )
                   return true;
               break;
       }
       return false;
   }


$d = new DateTime('2047-06-19 00:00:00');
echo $d->format('U');
sql平时注意点 sql
涉及到钱的数据,一般使用decimal字段
类似type的数据,一般使用tinyint
sql引擎(ENGINE),如果数据库主要是用于处理查询操作,使用MyISAM;如果数据库主要是用于处理事务处理操作,使用INNODB
settimeout javascript
<script language="javascript">  
    function show(name)  
    {alert("Hello World:" + name);}  
  
    function _show(name)  
    {  
        return function()  
        {  
            show(name);  
        }  
    }  
    setTimeout(_show(name),1000);  
</script> 
javascript常用扩展方法 javascript
Array.prototype.indexOf = function(val) {              
    for (var i = 0; i < this.length; i++) {  
        if (this[i] == val) return i;  
    }  
    return -1;  
};
Array.prototype.remove = function(val) {  
    var index = this.indexOf(val);  
    if (index > -1) {  
        this.splice(index, 1);  
    }  
};
function get_uri_arguments(){
	var _get = {},
    args = location.search.substr(1).split(/&/);
	for (var i=0; i<args.length; ++i) {
		var tmp = args[i].split(/=/);
		if (tmp[0] != "") {
			_get[decodeURIComponent(tmp[0])] = decodeURIComponent(tmp.slice(1).join("").replace("+", " "));
		}
	}
	return _get;
}

//数字千分位处理
function format_thousand(num){
	return (num+'').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,'$&,');
}
javascript base64编码 javascript, base64
/**
*
*  Base64 encode / decode
*
*  @author haitao.tu
*  @date   2010-04-26
*  @email  tuhaitao@foxmail.com
*
*/
 
function Base64() {
 
	// private property
	_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
 
	// public method for encoding
	this.encode = function (input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;
		input = _utf8_encode(input);
		while (i < input.length) {
			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);
			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;
			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}
			output = output +
			_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
			_keyStr.charAt(enc3) + _keyStr.charAt(enc4);
		}
		return output;
	}
 
	// public method for decoding
	this.decode = function (input) {
		var output = "";
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;
		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
		while (i < input.length) {
			enc1 = _keyStr.indexOf(input.charAt(i++));
			enc2 = _keyStr.indexOf(input.charAt(i++));
			enc3 = _keyStr.indexOf(input.charAt(i++));
			enc4 = _keyStr.indexOf(input.charAt(i++));
			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;
			output = output + String.fromCharCode(chr1);
			if (enc3 != 64) {
				output = output + String.fromCharCode(chr2);
			}
			if (enc4 != 64) {
				output = output + String.fromCharCode(chr3);
			}
		}
		output = _utf8_decode(output);
		return output;
	}
 
	// private method for UTF-8 encoding
	_utf8_encode = function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
		for (var n = 0; n < string.length; n++) {
			var c = string.charCodeAt(n);
			if (c < 128) {
				utftext += String.fromCharCode(c);
			} else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			} else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
		return utftext;
	}
 
	// private method for UTF-8 decoding
	_utf8_decode = function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
		while ( i < utftext.length ) {
			c = utftext.charCodeAt(i);
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			} else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			} else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
		}
		return string;
	}
}
javascript摸你md5加密 javascript, md5 http://www.nowamagic.net/librarys/veda/detail/423
/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }

/*
 * Perform a simple self-test to see if the VM is working
 */
function md5_vm_test()
{
  return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}

/*
 * Calculate the MD5 of an array of little-endian words, and a bit length
 */
function core_md5(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << ((len) % 32);
  x[(((len + 64) >>> 9) << 4) + 14] = len;

  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;

    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);

    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
  }
  return Array(a, b, c, d);

}

/*
 * These functions implement the four basic operations the algorithm uses.
 */
function md5_cmn(q, a, b, x, s, t)
{
  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Calculate the HMAC-MD5, of a key and some data
 */
function core_hmac_md5(key, data)
{
  var bkey = str2binl(key);
  if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
  return core_md5(opad.concat(hash), 512 + 128);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function bit_rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert a string to an array of little-endian words
 * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
 */
function str2binl(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
  return bin;
}

/*
 * Convert an array of little-endian words to a string
 */
function binl2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
  return str;
}

/*
 * Convert an array of little-endian words to a hex string.
 */
function binl2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of little-endian words to a base-64 string
 */
function binl2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}
placeholer支持IE,webkit javascript
function placeholerSupport(){
	//判断是否支持placeholder
	function isPlaceholer(){
		var input = document.createElement('input');
		return "placeholder" in input;
	}
	//不支持的代码
	if(!isPlaceholer()){
		//创建一个类
		function Placeholder(obj){
			this.input = obj;
			this.label = document.createElement('label');
			this.label.innerHTML = obj.getAttribute('placeholder');
			this.label.style.cssText = 'position:absolute;margin-top:10px; text-indent:4px;color:#999999; font-size:12px;';
			if(obj.value != ''){
				this.label.style.display = 'none';
			}
			this.init();
		}
		Placeholder.prototype = {
			//取位置
			getxy : function(obj){
				var left, top;
				if(document.documentElement.getBoundingClientRect){
					var html = document.documentElement,
					body = document.body,
					pos = obj.getBoundingClientRect(),
					st = html.scrollTop || body.scrollTop,
					sl = html.scrollLeft || body.scrollLeft,
					ct = html.clientTop || body.clientTop,
					cl = html.clientLeft || body.clientLeft;
					left = pos.left + sl - cl;
					top = pos.top + st - ct;
				}else{
					while(obj){
						left += obj.offsetLeft;
						top += obj.offsetTop;
						obj = obj.offsetParent;
					}
				}
				return{
					left: left,
					top : top
				}
			},
			//取宽高
			getwh : function(obj){
				return {
					w : obj.offsetWidth,
					h : obj.offsetHeight
				}
			},
			//添加宽高值方法
			setStyles : function(obj,styles){
				for(var p in styles){
					obj.style[p] = styles[p]+'px';
				}
			},
			init : function(){
				var label = this.label,
				input = this.input,
				xy = this.getxy(input),
				wh = this.getwh(input);
				this.setStyles(label, {'width':wh.w, 'height':wh.h, 'lineHeight':20, 'left':xy.left, 'top':xy.top});
				document.body.appendChild(label);
				label.onclick = function(){
					this.style.display = "none";
					input.focus();
				}
				input.onfocus = function(){
					label.style.display = "none";
				};	
				input.onblur = function(){
					if(this.value == ""){
						label.style.display = "block";
					}
				};
			}
		}
		var inpColl = document.getElementsByTagName('input'),
		textColl = document.getElementsByTagName('textarea');
		//html集合转化为数组
		function toArray(coll){
			for(var i = 0, a = [], len = coll.length; i < len; i++){
				a[i] = coll[i];
			}
			return a;
		}
		var inpArr = toArray(inpColl),
		textArr = toArray(textColl),
		placeholderArr = inpArr.concat(textArr);
		for (var i = 0; i < placeholderArr.length; i++){
			if (placeholderArr[i].getAttribute('placeholder')){
				new Placeholder(placeholderArr[i]);
			}
		}
	}
}
swfupload示例代码 swf, flash, javascript
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<head>
<title>SWFUpload</title>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload.queue.js"></script>
<script type="text/javascript" src="js/fileprogress.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
		window.onload = function() {
			var settings = {
				flash_url : "swfupload/swfupload.swf",//调用flash
				upload_url: "../upload.php",	//上传地址
				post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},//
				file_size_limit : "100 MB",//上传最大容量
				file_types : "*.*",//*.jpg
				file_types_description : "All Files",
				file_upload_limit : 3,  //配置上传个数最大值
				file_queue_limit : 0,
				custom_settings : {//bind submit and cancel
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,

				// Button settings
				button_image_url: "images/hello.png",
				button_width: "240",
				button_height: "50",
				button_placeholder_id: "spanButtonPlaceHolder",
//				button_text: '<span class="theFont">浏览</span>',
//				button_text_style: ".theFont { font-size: 16; }",
				button_text_left_padding: 12,
				button_text_top_padding: 3,
				
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	
			};

			var swfu = new SWFUpload(settings);
	     };
	</script>
</head>
<body>
<div id="header">
	<h1 id="logo"><a href="/">SWFUpload</a></h1>
	<div id="version">v2.2.0</div>
</div>
<div id="content">
	<form id="form1" action="index.php" method="post" enctype="multipart/form-data">
		<p>点击“浏览”按钮,选择您要上传的文档文件后,系统将自动上传并在完成后提示您。</p>
		<p>请勿上传包含中文文件名的文件!</p>
		<div class="fieldset flash" id="fsUploadProgress">
			<span class="legend">快速上传</span>
	  </div>
		<div id="divStatus">0 个文件已上传</div>
			<div>
				<span id="spanButtonPlaceHolder"></span>
				<input id="btnCancel" type="button" value="取消所有上传" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
			</div>
	</form>
</div>
</body>
</html>
在给定目录下替换所有指定的内容 php
class loopfile{
	private $file_dir = '';
	private $replace_value = '';
	private $find_value = '';
	private $suffix_filter = array();
	/**
	 * 
	 * 构造函数
	 * @param string $file_dir 指定需要进行替换操作的路径
	 * @param string $find_value 指定需要被替换的值
	 * @param string $replace_value 指定替换的值
	 * @param array $suffix_filter 筛选后缀类型,若为空,则不进行筛选
	 */
	public function __construct($file_dir, $find_value, $replace_value, $suffix_filter = array()){
		$this->file_dir = $file_dir;
		$this->find_value = $find_value;
		$this->replace_value = $replace_value;
		$this->suffix_filter = $suffix_filter;
			
		$this->doWithFiles();
	}
	/**
	 * 
	 * 进行替换操作
	 */
	private function doWithFiles(){
		$files =  array();
		$this->findAllFileInDir($this->file_dir, $files);
		if (!empty($files)){
			foreach ($files as $file_path){
				if ($this->suffixFilter($file_path)){
					$this->doWithOneFile($file_path);
				}
			}
			echo 'All files have finished!';
		}
	}
	/**
	 * 
	 * 找出在指定路径下,所有的文件名(路径),包括子目录下的文件名
	 * @param string $path 指定的路径
	 * @param array $files 存放文件名路径
	 */
	private function findAllFileInDir($path, &$files){
		if(is_dir($path)){
			$dp = dir($path);
			while ($file = $dp ->read()){
				if($file !="." && $file !=".."){
					$this->findAllFileInDir($path."/".$file, $files);
				}
			}
			$dp ->close();
		}
		if(is_file($path)){
			$files[] =  $path;
		}
	}
	/**
	 * 
	 * 筛选文件的后缀名,若筛选内容为空,则显示所有类型文件,若不为空,则只显示指定的后缀文件
	 * @param string $file_path 文件名路径
	 */
	private function suffixFilter($file_path){
		$file_path_arr = explode('.', $file_path);
		if (!empty($this->suffix_filter)){
			if (in_array($file_path_arr[1], $this->suffix_filter)){
				return true;
			}else{
				return false;
			}
		}else{
			return true;
		}
	}
	/**
	 * 
	 * 给定一个文件的路径,进行替换操作
	 * @param string $file_path 文件名路径
	 */
	private function doWithOneFile($file_path){
		$_contents = file_get_contents($file_path);
		$_contents = $this->findAndReplace($_contents);
		file_put_contents($file_path, $_contents);
		echo $file_path.' OK</br>';
	}
	/**
	 * 
	 * 替换操作
	 * @param string $contents 需要操作的内容
	 */
	private function findAndReplace($contents){
		return str_ireplace($this->find_value, $this->replace_value, $contents);
	}
}

$loopfile = new loopfile('E:/qlj/study/test','ljqian','qlj',array('txt'));
覆盖文件上传的按键 css, 前端技术
<style>
.btn {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	border: 1px solid #cccccc;
	color: #898989;
	-moz-border-radius: 4px;
}
.btn input {
	position: absolute;
	top: 0;
	right: 0;
	margin: 0;
	opacity: 0;
	filter: alpha(opacity = 0);
	cursor: pointer;
}
.file_add_box {
	clear: both;
}
</style>
<div class="file_add_box">
	<div class="btn">
		<span>导入通讯录</span>
		<input type="file" id="excelfile" name="excelfile" size="34">
	</div>
</div>
验证格式 javascript, 常用js方法, 验证格式
//验证邮箱格式
function isEmail(strEmail) {
	if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
		return true;
	else
		return false;
}
//验证手机或者电话格式
function checkphone(phonenumber){
	var telRegExp = /^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;固定号码格式0512-52525252
	var phoneRegExp = /^1[358]\d{9}$/;//手机号码格式13835142222
        var csRegExp = /^((\d{3})-)(\d{3})(-(\d{4}))?$/;//客服号码格式400-810-8288
	if (phoneRegExp.test(phonenumber) || telRegExp.test(phonenumber)||csRegExp.test(phonenumber)){
		return false;
	}else{
		return true;
	}
}
fullcalendar使用尝试 fullcalendar, javascript, jquery
<?php
gatekeeper();
$tasks = $vars['tasks'];
$events_str = '[]';
if ($tasks){
	$events_array = array();
	foreach ($tasks as $task){
		$id = $task->guid;
		$title = $task->title;
		$business_id = $task->container_guid;
		$start_date = date('Y-m-d H:i',$task->start_date);
		$end_date = date('Y-m-d H:i',$task->end_date);
		$priority = $task->priority;
		$backgroundColor = '';
		switch ($priority){
			case '1': $backgroundColor = '#0097F7';break;
			case '2': $backgroundColor = '#E8C608';break;
			case '3': $backgroundColor = '#E00000';break;
			default: $backgroundColor = '#0097F7';break;
		}
		/**
		 * id 可选,事件唯一标识,重复的事件具有相同的
		 * title 必须,事件在日历上显示的title 
		 * allDay 可选,是否是整日事件 
		 * start 必须,事件的开始时间 
		 * end 可选,结束时间 
		 * url 可选,当指定后,事件被点击将打开对应url 
		 * className 指定事件的样式 
		 * editable 是否可拖拽 
		 * source 指向次event的eventsource对象 
		 * color 背景和边框颜色 
		 * backgroundColor 背景颜色 
		 * borderColor 边框颜色 
		 * textColor 文本颜色 
		 */

		$temp = "{
			id:'$id',
			title:'$title',
			business_id:'$business_id',
			start:'$start_date',
			end:'$end_date',
			backgroundColor:'$backgroundColor'
		}";
		array_push($events_array, $temp);
	}
	$events_str = implode(',', $events_array);
	$events_str = '['.$events_str.']';
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo $CONFIG->wwwroot;?>mod/crm/views/default/css/fullcalendar.css">
<div id='t_calendar'></div>
<script type="text/javascript">

$(document).ready(function(){
	//初始化日历控件
		var t_calendar = $("#t_calendar").fullCalendar({
		header: {
			left: 'prev,next today',
			center: 'title',
			right: 'month,agendaWeek,agendaDay'
		},
		monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],  
		monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
		dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],  
        dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],  
        firstDay: 1,
        buttonText: {  
            today: '今天',  
            month: '月',  
            week: '周',  
            day: '日'
       	},
       	titleFormat:{//日历控件头部日期显示格式设置
       	    month: 'yyyy MMMM',                             
       	    week: "yyyy MMM d{ '—' d}", // Sep 7 - 13 2009
       	    day: 'yyyy,MMM d,dddd'                  
       	},
       	columnFormat: {day: "dddd"},
       	timeFormat: "HH:mm{ - HH:mm}",
       	allDayText: "全天",
       	axisFormat: "HH:mm",
       	firstHour: 0,
       	allDayDefault:false,//设置默认的时间显示,为false会在任务前显示时间,为true时则不显示
       	editable: true,
       	allDaySlot:false,
       	selectable: true,
       	selectHelper: true,
       	unselectAuto: false,
       	select: function(t_start, t_end){//点击空白处用于添加新的数据
           	var start_date = $.fullCalendar.formatDate(t_start, 'yyyy-MM-dd HH:mm');
           	var end_date = $.fullCalendar.formatDate(t_end, 'yyyy-MM-dd HH:mm');
           	var event = {start:start_date,end:end_date,allDay:false};
       		getAndHandleTaskForm(event,t_calendar);
       		t_calendar.fullCalendar('unselect');
        },
        eventClick: function(event){//点击已有数据,用于编辑
        	getAndHandleTaskForm(event,t_calendar);
        },
        eventDrop: function(event, delta,minuteDelta){//拖拉后的回调函数
        	changeTaskDate(event,delta,minuteDelta);
        },
        events:<?php echo $events_str ;?>
	});

});
//获取task的提交页面form表单,并进行针对日历控件的处理
function getAndHandleTaskForm(event,t_calendar){
	if (event.business_id == '' || event.business_id == undefined){//在日程中创建任务
		getAjaxTaskForm('','',event);
		$('#edittask').dialog({title:'新建任务'});
	}else{//在日程中编辑任务
		getAjaxTaskForm(event.business_id,event.id,'');
		$('#edittask').dialog({title:'编辑任务'});
	}
   	$('#edittask').dialog('open');
   	$('#sub_task_form').hide();
   	$('#ajax_sub_task').show();
   	$('#isAjax').val(1);
   	bindAjaxSubmitOnTaskForm(event,t_calendar);
}
//给获取过来的task表单绑定ajaxSubmit方法
function bindAjaxSubmitOnTaskForm(event,t_calendar){
	$('#task_form').submit(function(){
		$(this).ajaxSubmit({
			beforeSubmit:check,
			url:'<?php echo $CONFIG->wwwroot;?>pg/crm/action/edittask',
			type:'post',
			dataType:'json',
			async:false,
			success:function(data){
				$('#edittask').dialog('close');
				if(event.business_id != undefined){//不是新建任务,移除原有的任务显示
					t_calendar.fullCalendar("removeEvents",event.id);
				}
				var backgroundColor = crm_setBGcolor(data.priority);
				t_calendar.fullCalendar("renderEvent",{
					id: data.task_id,
					title:data.title,
					business_id:data.business_id,
					start:event.start,
					end:event.end,
					allDay:event.allDay,
					backgroundColor:backgroundColor
				},false);
				
			}
		});
		return false;
	});
	$('#ajax_sub_task').click(function(){
		$('#task_form').submit();
	});
}
//拖动任务后,改变任务的时间
function changeTaskDate(event,delta,minuteDelta){
	var task_id = event.id;
	var url = "<?php echo $CONFIG->wwwroot;?>pg/crm/action/changeTaskDate";
	var data = {task_id:task_id,delta:delta,minuteDelta:minuteDelta};
	$.ajax({
		url:url,
		data:data,
		type:'post',
		success:function(data){
			if(data == 'success'){
				show_message('日期修改成功! ','T');
			}
		}
	});
}
//根据优先级判断该输出的颜色
function crm_setBGcolor(priority){
	var backgroundColor = '';
	switch (priority){
		case '1': backgroundColor = '#0097F7';break;
		case '2': backgroundColor = '#E8C608';break;
		case '3': backgroundColor = '#E00000';break;
		default: backgroundColor = '#0097F7';break;
	}
	return backgroundColor;
}
</script>
<style type='text/css'>
	#t_calendar {
		width: 900px;
		margin: 0 auto;
		}

</style>
导出word格式 php, word, 导出
/**
 * 文件导出为word格式
 * @param string $filname             //输出的文件名
 * @param string $type                //编码类型
 * @param string $array              //excel的标题
 * @param string $data               //需要的数据data
 * eg.exportExcel(test, 'utf-8', array('测试','OK'),array(array('ceshishuju1','OK1'),array('ceshi2','OK2'),array('ceshi3',''),array('','OK4')));
 */
function exportWord($filename, $type = 'utf-8', $array, $data){
	header( "Pragma: public" );  
	header( "Expires: 0" ); // set expiration time  
	header( "Cache-Component: must-revalidate, post-check=0, pre-check=0" );  
	header( "Content-type:application/msword");  
	$filename=rawurldecode($filename);
	$filename=iconv("UTF-8","gb2312//IGNORE",$filename);
	header( 'Content-Disposition: attachment; filename="'.$filename.'"' );
	header( 'Content-Transfer-Encoding: binary' );
	echo '<html xmlns:v="urn:schemas-microsoft-com:vml"
			xmlns:o="urn:schemas-microsoft-com:office:office"
			xmlns:w="urn:schemas-microsoft-com:office:word">';
	echo "<META HTTP-EQUIV='Content-Type' CONTENT='text/html;charset=$type'>";
	echo '<table border="1" cellspacing="1" cellpadding="1"><tr align="center">';
	foreach ($array as $val) {
		echo "<td width='100'>$val</td>";
    }
    echo '</tr>';
    foreach ($data as $val) {
    	if(is_array($val)){
    		echo '<tr align="center">';
    	    foreach ($val as $v) {
    	    	echo '<td width="120" height="30">' . $v . '</td>';
            }
            echo '</td>';
		}else {
			echo '<tr align="center">';
			echo '<td width="120" height="30">' . $val . '</td>';
			echo '</td>';
		}
	}
	echo $html;
	echo '</html>';
	exit;
}
php导入导出excel方法 excel, php
<?php
//导出excel
/**
     * @param string $filname             //输出的文件名
     * @param string $type                //编码类型
     * @param string $array              //excel的标题
     * @param string $data               //需要的数据data
     * eg.exportExcel(test, 'utf-8', array('测试','OK'),array(array('ceshishuju1','OK1'),array('ceshi2','OK2'),array('ceshi3',''),array('','OK4')));
     **/
    function exportExcel($filname, $type = 'utf-8', $array, $data) {
        if (empty ($data)) {
            echo "<script>alert('sorry,no data!');history.go(-1);</script>";
            exit;
        }
        $filname = iconv("utf-8", "gb2312", $filname);
        header("Content-type:application/vnd.ms-excel;");
        header("Content-Disposition:attachment;filename=$filname.xls");
        echo "<META HTTP-EQUIV='Content-Type' CONTENT='text/html;charset=$type'>";
        echo '<table border="1" cellspacing="1" cellpadding="1"><tr align="center">';
        foreach ($array as $val) {
            echo "<td width='100'>$val</td>";
        }
        echo '</tr>';
        foreach ($data as $val) {
            if(is_array($val)){
                echo '<tr align="center">';
                foreach ($val as $v) {
                echo '<td width="120" height="30">' . $v . '</td>';
                }
                echo '</td>';
            }else {
                echo '<tr align="center">';
                echo '<td width="120" height="30">' . $val . '</td>';
                echo '</td>';
            }
        }
        echo '</table>';
        exit;
    }
?>

<?php  
//导入excel

    $excelfile = $_FILES['excelfile'];  
    $filename = $excelfile['name'];  
    $tmp_name = $excelfile['tmp_name'];  
    move_uploaded_file ($tmp_name,'/upload/'.$filename);  
//reader.php需要从 http://sourceforge.net/projects/phpexcelreader 下载
//reader.php中的require_once 'Spreadsheet/Excel/Reader/OLERead.php';这行代码需要进行修改
//修改为引用与它同文件下的oleread.inc      
    require_once ('reader.php');  
    $data = new Spreadsheet_Excel_Reader();  
    $data->setOutputEncoding('gbk');  
    $data->read('/upload/'.$filename);  
    $customs = array();  
// $data->sheets[0]['numRows']为Excel行数    
// $data->sheets[0]['numCols'] 为Excel列数  
    for($i = 2; $i <= $data->sheets[0]['numRows']; $i++) {//$i为2是由于第一行为各字段的标题  
        $id = mysql_real_escape_string($data->sheets[0]['cells'][$i][1]);  
        $title = mysql_real_escape_string($data->sheets[0]['cells'][$i][2]);  
        $tel = mysql_real_escape_string($data->sheets[0]['cells'][$i][3]);  
        $description = mysql_real_escape_string($data->sheets[0]['cells'][$i][4]);  
        array_push($customs, array('title'=>$title,'tel'=>$tel,'description'=>$description));  
    }  
        var_dump($customs);  
//打印出的数据格式是excel中每行内容组成的数组,在上述的代码中只打印1-4列的内容  
?> 
PHP获取字符串第一个字的大写首字母 php, 字符串大写首字母
//页面编码需要UTF-8
function pingyinFirstChar($sourcestr){
   $returnstr='';
   $i=0;
   $n=0;
   $str_length=strlen($sourcestr);//字符串的字节数
    while ($i<=$str_length) {
      $temp_str=substr($sourcestr,$i,1);
      $ascnum=Ord($temp_str);//得到字符串中第$i位字符的ascii码
       if ($ascnum>=224){  //如果ASCII位高与224,
       $returnstr=$returnstr.getHanziInitial(substr($sourcestr,$i,3)); //根据UTF-8编码规范,将3个连续的字符计为单个字符
         $i=$i+3;          //实际Byte计为3
      }else if($ascnum>=192){  //如果ASCII位高与192,
         $returnstr=$returnstr.getHanziInitial(substr($sourcestr,$i,2)); //根据UTF-8编码规范,将2个连续的字符计为单个字符
         $i=$i+2;          //实际Byte计为2
      }else if($ascnum>=65 && $ascnum<=90){  //如果是大写字母,
         $returnstr=$returnstr.substr($sourcestr,$i,1);
         $i=$i+1;          //实际的Byte数仍计1个
      }else{  //其他情况下,包括小写字母和半角标点符号,
         $returnstr=$returnstr.strtoupper(substr($sourcestr,$i,1));  //小写字母转换为大写
         $i=$i+1;          //实际的Byte数计1个
      }
   }
   return $returnstr;
}

  function getHanziInitial($s0){
   if(ord($s0) >= "1" and ord($s0) <= ord("z")){
      return strtoupper($s0);
   }
   $s = iconv("UTF-8", "gb2312//IGNORE", $s0); // 不要转换成GB2312内没有的字符哦,^_^
   $asc = @ord($s{0}) * 256 + @ord($s{1})-65536;
   if($asc >= -20319 and $asc <= -20284)return "A";
   if($asc >= -20283 and $asc <= -19776)return "B";
   if($asc >= -19775 and $asc <= -19219)return "C";
   if($asc >= -19218 and $asc <= -18711)return "D";
   if($asc >= -18710 and $asc <= -18527)return "E";
   if($asc >= -18526 and $asc <= -18240)return "F";
   if($asc >= -18239 and $asc <= -17923)return "G";
   if($asc >= -17922 and $asc <= -17418)return "H";
   if($asc >= -17417 and $asc <= -16475)return "J";
   if($asc >= -16474 and $asc <= -16213)return "K";
   if($asc >= -16212 and $asc <= -15641)return "L";
   if($asc >= -15640 and $asc <= -15166)return "M";
   if($asc >= -15165 and $asc <= -14923)return "N";
   if($asc >= -14922 and $asc <= -14915)return "O";
   if($asc >= -14914 and $asc <= -14631)return "P";
   if($asc >= -14630 and $asc <= -14150)return "Q";
   if($asc >= -14149 and $asc <= -14091)return "R";
   if($asc >= -14090 and $asc <= -13319)return "S";
   if($asc >= -13318 and $asc <= -12839)return "T";
   if($asc >= -12838 and $asc <= -12557)return "W";
   if($asc >= -12556 and $asc <= -11848)return "X";
   if($asc >= -11847 and $asc <= -11056)return "Y";
   if($asc >= -11055 and $asc <= -10247)return "Z";
   return $s0; // 返回原字符,不作转换。(标点、空格、繁体字都会直接返回)
}
div文字溢出用...表示 前端技术 关于文字内容溢出用点点点(…)省略号表示
.zxx_text_overflow{
width:27em; 
white-space:nowrap; 
text-overflow:ellipsis; 
-o-text-overflow:ellipsis; 
-moz-binding:url('ellipsis.xml#ellipsis'); 
overflow:hidden;
}
js实现trim的方法 javascript, trim, 常用js方法 JS trim去空格的最佳实践
if(!String.prototype.trim){
    String.prototype.trim = function(){ 
        return this.replace(/^\s+|\s+$/g, ''); 
    } 
} 
中文转拼音 php php 中文转拼音函数
    <?php  
    function Pinyin($_String, $_Code='UTF8'){ //GBK页面可改为gb2312,其他随意填写为UTF8  
            $_DataKey = "a|ai|an|ang|ao|ba|bai|ban|bang|bao|bei|ben|beng|bi|bian|biao|bie|bin|bing|bo|bu|ca|cai|can|cang|cao|ce|ceng|cha".   
                            "|chai|chan|chang|chao|che|chen|cheng|chi|chong|chou|chu|chuai|chuan|chuang|chui|chun|chuo|ci|cong|cou|cu|".   
                            "cuan|cui|cun|cuo|da|dai|dan|dang|dao|de|deng|di|dian|diao|die|ding|diu|dong|dou|du|duan|dui|dun|duo|e|en|er".   
                            "|fa|fan|fang|fei|fen|feng|fo|fou|fu|ga|gai|gan|gang|gao|ge|gei|gen|geng|gong|gou|gu|gua|guai|guan|guang|gui".   
                            "|gun|guo|ha|hai|han|hang|hao|he|hei|hen|heng|hong|hou|hu|hua|huai|huan|huang|hui|hun|huo|ji|jia|jian|jiang".   
                            "|jiao|jie|jin|jing|jiong|jiu|ju|juan|jue|jun|ka|kai|kan|kang|kao|ke|ken|keng|kong|kou|ku|kua|kuai|kuan|kuang".   
                            "|kui|kun|kuo|la|lai|lan|lang|lao|le|lei|leng|li|lia|lian|liang|liao|lie|lin|ling|liu|long|lou|lu|lv|luan|lue".   
                            "|lun|luo|ma|mai|man|mang|mao|me|mei|men|meng|mi|mian|miao|mie|min|ming|miu|mo|mou|mu|na|nai|nan|nang|nao|ne".   
                            "|nei|nen|neng|ni|nian|niang|niao|nie|nin|ning|niu|nong|nu|nv|nuan|nue|nuo|o|ou|pa|pai|pan|pang|pao|pei|pen".   
                            "|peng|pi|pian|piao|pie|pin|ping|po|pu|qi|qia|qian|qiang|qiao|qie|qin|qing|qiong|qiu|qu|quan|que|qun|ran|rang".   
                            "|rao|re|ren|reng|ri|rong|rou|ru|ruan|rui|run|ruo|sa|sai|san|sang|sao|se|sen|seng|sha|shai|shan|shang|shao|".   
                            "she|shen|sheng|shi|shou|shu|shua|shuai|shuan|shuang|shui|shun|shuo|si|song|sou|su|suan|sui|sun|suo|ta|tai|".   
                            "tan|tang|tao|te|teng|ti|tian|tiao|tie|ting|tong|tou|tu|tuan|tui|tun|tuo|wa|wai|wan|wang|wei|wen|weng|wo|wu".   
                            "|xi|xia|xian|xiang|xiao|xie|xin|xing|xiong|xiu|xu|xuan|xue|xun|ya|yan|yang|yao|ye|yi|yin|ying|yo|yong|you".   
                            "|yu|yuan|yue|yun|za|zai|zan|zang|zao|ze|zei|zen|zeng|zha|zhai|zhan|zhang|zhao|zhe|zhen|zheng|zhi|zhong|".   
                            "zhou|zhu|zhua|zhuai|zhuan|zhuang|zhui|zhun|zhuo|zi|zong|zou|zu|zuan|zui|zun|zuo";   
            $_DataValue = "-20319|-20317|-20304|-20295|-20292|-20283|-20265|-20257|-20242|-20230|-20051|-20036|-20032|-20026|-20002|-19990".   
                            "|-19986|-19982|-19976|-19805|-19784|-19775|-19774|-19763|-19756|-19751|-19746|-19741|-19739|-19728|-19725".   
                            "|-19715|-19540|-19531|-19525|-19515|-19500|-19484|-19479|-19467|-19289|-19288|-19281|-19275|-19270|-19263".   
                            "|-19261|-19249|-19243|-19242|-19238|-19235|-19227|-19224|-19218|-19212|-19038|-19023|-19018|-19006|-19003".   
                            "|-18996|-18977|-18961|-18952|-18783|-18774|-18773|-18763|-18756|-18741|-18735|-18731|-18722|-18710|-18697".   
                            "|-18696|-18526|-18518|-18501|-18490|-18478|-18463|-18448|-18447|-18446|-18239|-18237|-18231|-18220|-18211".   
                            "|-18201|-18184|-18183|-18181|-18012|-17997|-17988|-17970|-17964|-17961|-17950|-17947|-17931|-17928|-17922".   
                            "|-17759|-17752|-17733|-17730|-17721|-17703|-17701|-17697|-17692|-17683|-17676|-17496|-17487|-17482|-17468".   
                            "|-17454|-17433|-17427|-17417|-17202|-17185|-16983|-16970|-16942|-16915|-16733|-16708|-16706|-16689|-16664".   
                            "|-16657|-16647|-16474|-16470|-16465|-16459|-16452|-16448|-16433|-16429|-16427|-16423|-16419|-16412|-16407".   
                            "|-16403|-16401|-16393|-16220|-16216|-16212|-16205|-16202|-16187|-16180|-16171|-16169|-16158|-16155|-15959".   
                            "|-15958|-15944|-15933|-15920|-15915|-15903|-15889|-15878|-15707|-15701|-15681|-15667|-15661|-15659|-15652".   
                            "|-15640|-15631|-15625|-15454|-15448|-15436|-15435|-15419|-15416|-15408|-15394|-15385|-15377|-15375|-15369".   
                            "|-15363|-15362|-15183|-15180|-15165|-15158|-15153|-15150|-15149|-15144|-15143|-15141|-15140|-15139|-15128".   
                            "|-15121|-15119|-15117|-15110|-15109|-14941|-14937|-14933|-14930|-14929|-14928|-14926|-14922|-14921|-14914".   
                            "|-14908|-14902|-14894|-14889|-14882|-14873|-14871|-14857|-14678|-14674|-14670|-14668|-14663|-14654|-14645".   
                            "|-14630|-14594|-14429|-14407|-14399|-14384|-14379|-14368|-14355|-14353|-14345|-14170|-14159|-14151|-14149".   
                            "|-14145|-14140|-14137|-14135|-14125|-14123|-14122|-14112|-14109|-14099|-14097|-14094|-14092|-14090|-14087".   
                            "|-14083|-13917|-13914|-13910|-13907|-13906|-13905|-13896|-13894|-13878|-13870|-13859|-13847|-13831|-13658".   
                            "|-13611|-13601|-13406|-13404|-13400|-13398|-13395|-13391|-13387|-13383|-13367|-13359|-13356|-13343|-13340".   
                            "|-13329|-13326|-13318|-13147|-13138|-13120|-13107|-13096|-13095|-13091|-13076|-13068|-13063|-13060|-12888".   
                            "|-12875|-12871|-12860|-12858|-12852|-12849|-12838|-12831|-12829|-12812|-12802|-12607|-12597|-12594|-12585".   
                            "|-12556|-12359|-12346|-12320|-12300|-12120|-12099|-12089|-12074|-12067|-12058|-12039|-11867|-11861|-11847".   
                            "|-11831|-11798|-11781|-11604|-11589|-11536|-11358|-11340|-11339|-11324|-11303|-11097|-11077|-11067|-11055".   
                            "|-11052|-11045|-11041|-11038|-11024|-11020|-11019|-11018|-11014|-10838|-10832|-10815|-10800|-10790|-10780".   
                            "|-10764|-10587|-10544|-10533|-10519|-10331|-10329|-10328|-10322|-10315|-10309|-10307|-10296|-10281|-10274".   
                            "|-10270|-10262|-10260|-10256|-10254";   
            $_TDataKey   = explode('|', $_DataKey);   
            $_TDataValue = explode('|', $_DataValue);  
            $_Data = array_combine($_TDataKey, $_TDataValue);  
            arsort($_Data);   
            reset($_Data);  
            if($_Code!= 'gb2312') $_String = _U2_Utf8_Gb($_String);   
            $_Res = '';   
            for($i=0; $i<strlen($_String); $i++) {   
                    $_P = ord(substr($_String, $i, 1));   
                    if($_P>160) {   
                            $_Q = ord(substr($_String, ++$i, 1)); $_P = $_P*256 + $_Q - 65536;  
                    }   
                    $_Res .= _Pinyin($_P, $_Data);   
            }   
            return preg_replace("/[^a-z0-9]*/", '', $_Res);   
    }   
    function _Pinyin($_Num, $_Data){   
            if($_Num>0 && $_Num<160 ){  
                    return chr($_Num);  
            }elseif($_Num<-20319 || $_Num>-10247){  
                    return '';  
            }else{   
                    foreach($_Data as $k=>$v){ if($v<=$_Num) break; }   
                    return $k;   
            }   
    }  
    function _U2_Utf8_Gb($_C){   
            $_String = '';   
            if($_C < 0x80){  
                    $_String .= $_C;  
            }elseif($_C < 0x800) {   
                    $_String .= chr(0xC0 | $_C>>6);   
                    $_String .= chr(0x80 | $_C & 0x3F);   
            }elseif($_C < 0x10000){   
                    $_String .= chr(0xE0 | $_C>>12);   
                    $_String .= chr(0x80 | $_C>>6 & 0x3F);   
                    $_String .= chr(0x80 | $_C & 0x3F);   
            }elseif($_C < 0x200000) {   
                    $_String .= chr(0xF0 | $_C>>18);   
                    $_String .= chr(0x80 | $_C>>12 & 0x3F);   
                    $_String .= chr(0x80 | $_C>>6 & 0x3F);   
                    $_String .= chr(0x80 | $_C & 0x3F);   
            }   
            return iconv('UTF-8', 'GB2312', $_String);   
    }  
      
    //测试  
    echo Pinyin('中文字','gb2312'); //第二个参数“1”可随意设置即为utf8编码  
    ?>  
一个简单的javascript类 javascript
//这是一个构造函数,用以初始化新创建的"范围对象"
//注意,这里并没有创建并返回一个对象,仅仅是初始化
function Range(from,to){//构造函数函数名首字母大写
	//存放"范围对象"的起始位置和结束位置
	//这连个属性石不可继承的,每个对象都拥有唯一的属性
	this.from = from;
	this.to = to;
}
//原型对象定义方法,这些方法为每个范围对象所继承
(function(){
	//如果x在范围内,则返回true,否则返回false
	//这个方法可以比较数字范围,也可以比较字符串和日期范围
	this.includes = function(x){
		return this.from <= x && x<= this.to;
	},
	//对于范围内的每个数字都调用一次f
	//这个方法只可用做数字范围
	this.foreach = function(f){
		for(var x = Math.ceil(this.from);x <= this.to;x++)f(x);
	},
	//返回表示这个范围的字符串
	this.function(){
		return "(" + this.from + "..." + this.to + ")";
	}
}).call(Range.prototype);
//这里是使用"范围对象"的一些例子
var r = range(1,3);//创建一个范围对象
r.includes(2);//=>true:2在这个范围内
r.foreach(console.log);//输出1 2 3
console.log(r);//输出(1...3)
通过原型继承创建一个新对象 javascript
//inherit() 返回了一个继承自原型对象p的属性的新对象
//这里使用ECMAScript 5中的Object.create()函数
//如果不存在Object.create(),则退化使用其他方法
function inherit(p){
    if(p==null) throw TypeError();//p是一个对象,但不能使null
    if(Object.create)//如果Object.create()存在
         return Object.create(p);//直接使用它
    var t = typeof p;//否则进行进一步检测
    if(t !== "object" && t !== "function") throw TypeError();
    function f(){};//定义一个空构造函数
    f.prototype = p;//将其原型属性设置为p
    return new f();//使用f()创建p的继承对象
}
javascript仿java中的get,set方法 javascript
var test={
	myname:"",
	get:myget(){
		return this.myname;
	},
	set:myset(myname){
		this.myname=myname;
	}
};

test.myset="ljqian";
test.myget;
console.log(test.myget);
通过javascript控制xxx.js文件的引入 javascript
var js_page=document.createElement("script");
js_page.setAttribute("type","text/javascript");
js_page.setAttribute("src","xxx.js");
document.getElementsByTagName("head")[0].appendChild(js_page);
Global site tag (gtag.js) - Google Analytics