<?php
/*
	DESTOON Copyright (C)2008-2099 www.destoon.com
	This is NOT a freeware,Use is subject to license.txt
*/
require 'common.inc.php';
require_once DT_ROOT.'/include/post.func.php';
if($action=='liuyan'){
		if(!$post['itruename']) message('请填写姓名');
		if(!$post['itelephone']) message('请填写手机');
		if(!$post['icontent']) message('请填写内容');
		
    $post['title']="".$post['icontent'];
    $title=addslashes($post['title']);
    $catid=addslashes($post['catid']);
    $truename=addslashes($post['itruename']);
    $content=addslashes($post['icontent']);
    $amount=addslashes($post['inum']);
    $mobile=addslashes($post['itelephone']);
    $areaid=addslashes($post['areaid']);
    $totime=datetotime($post['totime']);
    $company='';
   // $address='';
   // $totime=0;		 
	
	$editdate = $adddate = timetodate($DT_TIME, 3);	
	$ip = DT_IP;
		
    $sqlk="catid,title,truename,mobile,company,areaid,totime,status,addtime,edittime,editdate,adddate,ip,amount";
    $sqlv="'$catid','$title','$truename','$mobile','$company','$areaid','$totime',2,'$DT_TIME','$DT_TIME','$editdate','$adddate','$ip','$amount'";



	$db->query("INSERT INTO {$DT_PRE}buy_6 ($sqlk) VALUES ($sqlv)");
	$itemid_buy = $db->insert_id();
	$content_table = content_table(6, $itemid_buy, 0, $DT_PRE."buy_data_6");
	$db->query("REPLACE INTO {$content_table} (itemid,content) VALUES ('$itemid_buy', '$content')");
	if($itemid_buy){
	    $item = $db->get_one("SELECT * FROM {$DT_PRE}buy_6 WHERE itemid=$itemid_buy");
	    $MOD = cache_read('module-6.php');
	    $linkurl = itemurl($item);
	    $db->query("UPDATE {$DT_PRE}buy_6 SET linkurl='$linkurl' WHERE itemid=$itemid_buy");
	    $ok=1;
	    $MOD = '';
	}	
	

}

require DT_ROOT.'/module/'.$module.'/index.inc.php';
?>