<?php
//小区图片
require('path.inc.php');
$sql ="select * from FK_B_Images";
$query_mssql->open($sql);
$result = array();

while ($rs = $query_mssql->next()) {
	$creater = $query_mssql2->getValue('select Brokers_LoginName from FK_User_Brokers where Brokers_LoginNum =\''.$rs['Images_LoginNum'].'\'');
	$created = $rs['Add_Time']?MyDate::transform('timestamp',$rs['Add_Time']):"";
	$fieldArray = array(
		'id'=>$rs['Images_ID'],
		'pic_url'=>'borough/picture/'.$rs['Images_Url'],
		'pic_desc'=>$rs['Images_Content'],
		'borough_id'=>$rs['Borough_ID'],
		'creater'=>$creater,
		'addtime'=>$created,
		);
	$query->insert('fke_borough_pic',$fieldArray);
	$sourcePath = "d:/系统/Borough/".$rs['Images_Url'];
	$destinPath = "d:/AppServ/www/系统/upfile/borough/picture/".$rs['Images_Url'];
	copy($sourcePath,$destinPath);
}

$sql ="select * from FK_B_Model";
$query_mssql->open($sql);
$result = array();

while ($rs = $query_mssql->next()) {
	$creater = $query_mssql2->getValue('select Brokers_LoginName from FK_User_Brokers where Brokers_LoginNum =\''.$rs['Model_LoginNum'].'\'');
	$created = $rs['Add_Time']?MyDate::transform('timestamp',$rs['Add_Time']):"";
	$fieldArray = array(
		'id'=>$rs['Model_ID'],
		'pic_url'=>'borough/drawing/'.$rs['Model_Url'],
		'pic_desc'=>$rs['Model_Content'],
		'borough_id'=>$rs['Borough_ID'],
		'creater'=>$creater,
		'addtime'=>$created,
		);
	$query->insert('fke_borough_draw',$fieldArray);
	$sourcePath = "d:/系统/Borough/".$rs['Model_Url'];
	$destinPath = "d:/AppServ/www/系统/upfile/borough/drawing/".$rs['Model_Url'];
	copy($sourcePath,$destinPath);
}
print_r("导入完成");
exit;
?>