<?php
//===================================================================
$re=$admin->check_shop_statu();
if($re=='close')
	;
elseif($re['user']<2||!$re['alluser']||!$re['biz']||$re['pronum']<5||$re['offernum']<5||$re['linknum']<3)
	msg('main.php?action=m&m=company&s=admin_openshop');
	
if(isset($_POST['domain']))
{
	$sql="select * from ".CDOMIN." where company_id='$bcid'";
	$db->query($sql);	 
	if ($db->num_rows()<=0)
	  $sql="insert into ".CDOMIN." (`domin`,`company_id`,`time`) values ('".trim($_POST['domain'])."','$bcid',".time().")";
	else
	  $sql="update ".CDOMIN." set domin='".trim($_POST['domain'])."',time=".time()." where company_id='$bcid'";
	$db->query($sql);
	
}

$sql="select domin from ".CDOMIN." where company_id='$bcid'";
$db->query($sql);
$domain=$db->fetchField('domin');
$tpl->assign("domin",$domain);
//====================================================================
$tpl->assign("config",$config);
$tpl->assign("lang",$lang);
$output=tplfetch("admin_add_domin.htm");
?>