<?php
/**
* @author moufer<moufer@163.com>
* @copyright www.modoer.com
* @version $Id 1 2008-08-29 16:35 $
*/
!defined('IN_MUDDER') && exit('Access Denied');

if(!function_exists('getItem')) {
    require_once(MUDDER_ROOT.'./'.$_modules['shop']['directory'].'/include/fun_item.php');
}

if(empty($shopid) || $shopid < 0) redirect('无效的商铺ID。');
if(!check_submit('mysubmit')) {

    $item = getItem($shopid);
    // 权限
    $editaccess = $item['ownerid'] == $user->uid;
    if(!$editaccess) {
        redirect('您没有权限编辑本信息。');
    }

} else {

    $post = array();
    $post['seccode'] = $seccode;
    $post['classcode'] = $classcode;
    $post['shopname'] = $shopname;
    $post['subname'] = $subname;
    $post['areacode'] = $areacode;
    $post['address'] = $address;
    $post['website'] = $website;
    $post['video'] = $video;
    $post['tel1'] = $tel1;
    $post['tel2'] = $tel2;
    $post['mobile'] = $mobile;
    $post['tags'] = $tags;
    $post['content'] = $content;

    updateItem($shopid, $post, $user->uid);
    redirect('商铺更新完毕！', 'index.php?ac=myitems');
}
?>