Example #1
0
    $json = new JSON();
    $tmp_data = $json->decode($_POST['topic_data']);
    $data = serialize($tmp_data);
    $base_style = $_POST['base_style'];
    $keywords = $_POST['keywords'];
    $description = $_POST['description'];
    if ($is_insert) {
        $sql = "INSERT INTO " . $ecs->table('topic') . " (title,start_time,end_time,data,intro,template,css,topic_img,title_pic,base_style, htmls,keywords,description)" . "VALUES ('{$_POST['topic_name']}','{$start_time}','{$end_time}','{$data}','{$_POST['topic_intro']}','{$_POST['topic_template_file']}','{$_POST['topic_css']}', '{$topic_img}', '{$title_pic}', '{$base_style}', '{$htmls}','{$keywords}','{$description}')";
    } else {
        $sql = "UPDATE " . $ecs->table('topic') . "SET title='{$_POST['topic_name']}',start_time='{$start_time}',end_time='{$end_time}',data='{$data}',intro='{$_POST['topic_intro']}',template='{$_POST['topic_template_file']}',css='{$_POST['topic_css']}', topic_img='{$topic_img}', title_pic='{$title_pic}', base_style='{$base_style}', htmls='{$htmls}', keywords='{$keywords}', description='{$description}'" . " WHERE topic_id='{$topic_id}' LIMIT 1";
    }
    $db->query($sql);
    clear_cache_files();
    /* 代码增加_start  By  www.68ecshop.com */
    if (!$is_insert) {
        clearhtml_file('topic', 0, $topic_id);
    }
    /* 代码增加_end  By  www.68ecshop.com */
    $links[] = array('href' => 'topic.php', 'text' => $_LANG['back_list']);
    sys_msg($_LANG['succed'], 0, $links);
} elseif ($_REQUEST['act'] == 'get_goods_list') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    $filters = $json->decode($_GET['JSON']);
    $arr = get_goods_list($filters);
    $opt = array();
    foreach ($arr as $key => $val) {
        $opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name']);
    }
    make_json_result($opt);
} elseif ($_REQUEST["act"] == "delete") {
Example #2
0
                     $db->query($sql);
                 } else {
                     $sql = "UPDATE " . $ecs->table('booking_goods') . " SET is_dispose = 3 WHERE  goods_id = '{$_REQUEST['goods_id']}'";
                     $db->query($sql);
                 }
             }
         }
     }
 }
 /* 代码增加_start  By  www.68ecshop.com */
 if ($is_insert) {
     $dir_clear = get_dir('category', $catgory_id);
     $prefix_clear = "category-" . $catgory_id;
     clearhtml_dir(ROOT_PATH . $dir_clear, $prefix_clear);
 } else {
     clearhtml_file('goods', $catgory_id, $goods_id);
 }
 /* 代码增加_end  By  www.68ecshop.com */
 /* 代码增加_start  Byjdy    为了便于新手朋友修改,这里采用增加代码的方法来修改,没有采用修改代码的方法 */
 $sql = "UPDATE " . $ecs->table('goods') . " SET is_catindex = '{$_REQUEST['is_catindex']}' WHERE goods_id = '{$goods_id}' LIMIT 1";
 $db->query($sql);
 /*存入条形码*/
 if ($_POST['txm_shu'] && $_POST['tiaoxingm']) {
     //如果txm_shu 和 tiaoxingm存在 就存入  不存在就不执行
     if (isset($_POST['txm_shu']) && isset($_POST['tiaoxingm']) || empty($_POST['txm_shu']) && empty($_POST['tiaoxingm'])) {
         $type = $_POST['txm_shu'];
         $bar_code = $_POST['tiaoxingm'];
         $db->query("DELETE FROM" . $ecs->table('bar_code') . "WHERE goods_id ='{$goods_id}'");
         //根据商品ID清空数据
         foreach ($type as $key => $value) {
             foreach ($bar_code as $k => $v) {
Example #3
0
    $smarty->assign('admin_id', $_SESSION['admin_id']);
    $smarty->display('menu.htm');
} elseif ($_REQUEST['act'] == 'clear_cache') {
    $sql = "UPDATE " . $GLOBALS['ecs']->table('brand') . "\n\t\t\t\t\t\tSET rand_ids = '',rand_date=''";
    $GLOBALS['db']->query($sql);
    $sql = "UPDATE " . $GLOBALS['ecs']->table('category') . "\n\t\t\t\t\t\tSET rand_ids = '',rand_date=''";
    $GLOBALS['db']->query($sql);
    clear_all_files();
    clearhtml_all();
    //代码增加   By  www.68ecshop.com
    sys_msg($_LANG['caches_cleared']);
} elseif ($_REQUEST['act'] == 'clear_html') {
    clearhtml_all();
    sys_msg('全部纯静态文件更新完成!');
} elseif ($_REQUEST['act'] == 'clear_index') {
    clearhtml_file('index', '0', '0');
    sys_msg('首页纯静态文件更新完成!');
} elseif ($_REQUEST['act'] == 'main') {
    //开店向导第一步
    if (isset($_SESSION['shop_guide']) && $_SESSION['shop_guide'] === true) {
        unset($_SESSION['shop_guide']);
        //销毁session
        ecs_header("Location: ./index.php?act=first\n");
        exit;
    }
    $gd = gd_version();
    /* 检查文件目录属性 */
    $warning = array();
    if ($_CFG['shop_closed']) {
        $warning[] = $_LANG['shop_closed_tips'];
    }
Example #4
0
function clearhtml_all()
{
    clearhtml_file('index', 0, 0);
    $handle = opendir(ROOT_PATH);
    $arr = array();
    while ($file = readdir($handle)) {
        $newpath = ROOT_PATH . $file;
        if (is_dir($newpath) && (strpos($newpath, PREFIX_CATEGORY) !== false || strpos($newpath, PREFIX_ARTICLECAT) !== false || strpos($newpath, PREFIX_TOPIC) !== false)) {
            $arr[] = $newpath;
        }
    }
    foreach ($arr as $dir) {
        clearhtml_dir($dir);
    }
}
Example #5
0
    if ($exc->edit("title='{$_POST['title']}', cat_id='{$_POST['article_cat']}', article_type='{$_POST['article_type']}', is_open='{$_POST['is_open']}', author='{$_POST['author']}', author_email='{$_POST['author_email']}', keywords ='{$_POST['keywords']}', file_url ='{$file_url}', open_type='{$open_type}', content='{$_POST['FCKeditor1']}', link='{$_POST['link_url']}', description = '{$_POST['description']}'", $_POST['id'])) {
        $link[0]['text'] = $_LANG['back_list'];
        $link[0]['href'] = 'article.php?act=list&' . list_link_postfix();
        $note = sprintf($_LANG['articleedit_succeed'], stripslashes($_POST['title']));
        admin_log($_POST['title'], 'edit', 'article');
        clear_cache_files();
        $article_id = $_POST['id'];
        $db->query("delete from " . $ecs->table('goods_article') . " WHERE article_id='{$article_id}'");
        if (isset($_POST['link_goods'])) {
            foreach ($_POST['link_goods'] as $key => $val) {
                $sql = 'replace INTO ' . $ecs->table('goods_article') . ' (goods_id, article_id) ' . "VALUES ('{$val}', '{$article_id}')";
                $db->query($sql);
            }
        }
        /* 代码增加_start  By  www.68ecshop.com */
        clearhtml_file('article', $_POST['article_cat'], $_POST['id']);
        /* 代码增加_end  By  www.68ecshop.com */
        sys_msg($note, 0, $link);
    } else {
        die($db->error());
    }
} elseif ($_REQUEST['act'] == 'edit_title') {
    check_authz_json('article_manage');
    $id = intval($_POST['id']);
    $title = json_str_iconv(trim($_POST['val']));
    /* 检查文章标题是否重复 */
    if ($exc->num("title", $title, $id) != 0) {
        make_json_error(sprintf($_LANG['title_exist'], $title));
    } else {
        if ($exc->edit("title = '{$title}'", $id)) {
            clear_cache_files();