Beispiel #1
0
         foreach ($img_list as $key => $gallery_img) {
             $gallery_img[$key]['img_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], false, 'gallery');
             $gallery_img[$key]['thumb_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], true, 'gallery');
         }
     } else {
         foreach ($img_list as $key => $gallery_img) {
             $gallery_img[$key]['thumb_url'] = '../' . (empty($gallery_img['thumb_url']) ? $gallery_img['img_url'] : $gallery_img['thumb_url']);
         }
     }
     //dump($goods);
 }
 /* 拆分商品名称样式 */
 $goods_name_style = explode('+', empty($goods['goods_name_style']) ? '+' : $goods['goods_name_style']);
 /* 创建 html editor */
 $goods['goods_desc'] = preg_replace('/src=images/', 'src=/images', $goods['goods_desc']);
 create_html_editor('goods_desc', $goods['goods_desc']);
 create_html_editor2('goods_shipai', 'goods_shipai', $goods['goods_shipai']);
 /* 模板赋值 */
 $smarty->assign('code', $code);
 $smarty->assign('ur_here', $is_add ? empty($code) ? $_LANG['02_goods_add'] : $_LANG['51_virtual_card_add'] : ($_REQUEST['act'] == 'edit' ? $_LANG['edit_goods'] : $_LANG['copy_goods']));
 $smarty->assign('action_link', isset($link) ? $link : list_link($is_add, $code));
 $smarty->assign('goods', $goods);
 $smarty->assign('goods_name_color', $goods_name_style[0]);
 $smarty->assign('goods_name_style', $goods_name_style[1]);
 //$smarty->assign('cat_list', cat_list(0, $goods['cat_id']));// 注释 2015-03-19 代理商跟主站的分类分开
 /*ccx 2015-03-18 代理商显示代理商自己的商品分类 start */
 $smarty->assign('cat_list', cat_list_ccx(0, $goods['cat_id']));
 /*ccx 2015-03-18 代理商显示代理商自己的商品分类 end */
 $smarty->assign('brand_list', get_brand_list());
 $smarty->assign('unit_list', get_unit_list());
 $smarty->assign('weight_unit', $is_add ? '1' : ($goods['goods_weight'] >= 1 ? '1' : '0.001'));
Beispiel #2
0
    $smarty->assign('output_editor', create_html_editor('output', '', true));
    $smarty->assign('hint_editor', create_html_editor('hint', '', true));
    $smarty->display('problem_info.tpl');
} elseif ($_REQUEST['act'] == 'edit') {
    include_once ROOT_PATH . 'fckeditor/fckeditor.php';
    $problemId = isset($_GET['problemId']) ? intval($_GET['problemId']) : 0;
    $problem = $db->getRow("select * from problem where problemId = '{$problemId}'");
    if ($problem) {
        $action_link = array('href' => 'problems.php?act=list', 'text' => 'Problem List');
        $smarty->assign('action_link', $action_link);
        $smarty->assign('ur_here', 'Edit Problem');
        $smarty->assign('problem', $problem);
        $smarty->assign('html_editor', create_html_editor('description', $problem['description'], true, '90%'));
        $smarty->assign('input_editor', create_html_editor('input', $problem['input'], true));
        $smarty->assign('output_editor', create_html_editor('output', $problem['output'], true));
        $smarty->assign('hint_editor', create_html_editor('hint', $problem['hint'], true));
        $smarty->assign('form_act', 'update');
        $smarty->display('problem_info.tpl');
    } else {
        sys_msg("Wrong Problem Id");
    }
} elseif ($_REQUEST['act'] == 'insert' || $_REQUEST['act'] == 'update') {
    $problemName = isset($_POST['problemName']) ? htmlspecialchars(trim($_POST['problemName'])) : '';
    $timelimit = isset($_POST['timelimit']) ? intval($_POST['timelimit']) : 0;
    $memorylimit = isset($_POST['memorylimit']) ? intval($_POST['memorylimit']) : 0;
    $spj = isset($_POST['spj']) ? intval($_POST['spj']) : 0;
    $show = isset($_POST['show']) ? intval($_POST['show']) : 0;
    $description = isset($_POST['description']) ? trim($_POST['description']) : '';
    $input = isset($_POST['input']) ? trim($_POST['input']) : '';
    $output = isset($_POST['output']) ? trim($_POST['output']) : '';
    $sample_input = isset($_POST['sample_input']) ? htmlspecialchars(trim($_POST['sample_input'])) : '';
Beispiel #3
0
      </tr>
      <!--tr>
        <td class="narrow-label">上传文件</td>
        <td><input type="file" name="file">
          <span class="narrow-label">或输入文件地址
          <input name="file_url" type="text" value="<?php 
echo $file_url;
?>
" size="30" maxlength="255" />
          </span></td>
      </tr-->
    </table>
    <!--table width="100%" id="detail-table">
      <tr>
        <td><?php 
echo create_html_editor('content', $content);
?>
</td>
      </tr>
    </table-->
    <div class="button-div">
      <input type="hidden" name="add_time" value="<?php 
echo date('Y-m-d H:i:s');
?>
" />
      <input type="hidden" name="article_id" value="<?php 
echo $article_id;
?>
" />
      <input type="submit" value=" 提交 " class="button"  />
      <input type="reset" value=" 重置 " class="button" />
Beispiel #4
0
 $sql = "select distinct city,region_name from " . $ecs->table('virtual_goods_district') . " as d left join (select region_id,region_name from " . $ecs->table('region') . " ) as r on r.region_id = d.city";
 $city = $db->getAll($sql);
 $smarty->assign('city', $city);
 /* 获取商圈 */
 $sql = "select d.district_id,v.district_name from " . $GLOBALS['ecs']->table('virtual_district') . " as d \n            left join " . $GLOBALS['ecs']->table('goods') . " as g on  d.goods_id = g.goods_id\n            left join " . $GLOBALS['ecs']->table('virtual_goods_district') . " as v on v.district_id = d.district_id\n            where d.goods_id = '{$_REQUEST['goods_id']}' and d.supplier_id = {$supplier_id}";
 $district = $db->getAll($sql);
 $district_ids = '';
 foreach ($district as $key => $value) {
     $district_ids = $district_ids . $value['district_id'] . ',';
 }
 $smarty->assign('district_ids', substr($district_ids, 0, strlen($district_ids) - 1));
 $smarty->assign('district', $district);
 /* 拆分商品名称样式 */
 $goods_name_style = explode('+', empty($goods['goods_name_style']) ? '+' : $goods['goods_name_style']);
 /* 创建 html editor */
 create_html_editor('goods_desc', htmlspecialchars($goods['goods_desc']));
 /* 修改 by www.68ecshop.com 百度编辑器 */
 /* 模板赋值 */
 $action_link = array('href' => 'virtual_goods.php?act=list&extension_code=virtual_good', 'text' => '返回商品列表');
 $smarty->assign('code', $code);
 $smarty->assign('ur_here', $is_add ? empty($code) ? $_LANG['03_goods_add'] : $_LANG['51_virtual_card_add'] : ($_REQUEST['act'] == 'edit' ? $_LANG['edit_goods'] : $_LANG['copy_goods']));
 $smarty->assign('action_link', $action_link);
 $smarty->assign('goods', $goods);
 $smarty->assign('goods_name_color', $goods_name_style[0]);
 $smarty->assign('goods_name_style', $goods_name_style[1]);
 $smarty->assign('cat_list', cat_list(0, $goods['cat_id']));
 // 代码修改_start_derek20150129admin_goods  www.68ecshop.com
 $smarty->assign('goods_cat_id', $goods['cat_id']);
 $smarty->assign('brand_list', get_brand_list(true));
 // 代码修改_start_derek20150129admin_goods  www.68ecshop.com
 $smarty->assign('unit_list', get_unit_list());
Beispiel #5
0
            'act_id'  => 0,
            'start_time'    => date('Y-m-d', time() + 86400),
            'end_time'      => date('Y-m-d', time() + 4 * 86400),
            'price_ladder'  => array(array('amount' => 0, 'price' => 0))
        );
		create_html_editor('act_desc');
    }
    else
    {
        $group_buy_id = intval($_REQUEST['id']);
        if ($group_buy_id <= 0)
        {
            die('invalid param');
        }
        $group_buy = group_buy_info($group_buy_id);
		create_html_editor('act_desc',$group_buy['act_desc']);
    }
    $smarty->assign('group_buy', $group_buy);

    /* 模板赋值 */
    $smarty->assign('ur_here', $_LANG['add_group_buy']);
    $smarty->assign('action_link', list_link($_REQUEST['act'] == 'add'));
    $smarty->assign('cat_list', cat_list());
    $smarty->assign('brand_list', get_brand_list());

    /* 显示模板 */
    assign_query_info();
    $smarty->display('group_buy_info.htm');
}

/*------------------------------------------------------ */
Beispiel #6
0
    admin_log($_POST['title'], 'add', 'article');
    clear_cache_files();
    // 清除相关的缓存文件
    sys_msg($_LANG['articleadd_succeed'], 0, $link);
}
/*------------------------------------------------------ */
//-- 编辑
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('article_manage');
    /* 取文章数据 */
    $sql = "SELECT * FROM " . $ecs->table('article') . " WHERE article_id='{$_REQUEST['id']}'";
    $article = $db->GetRow($sql);
    /* 创建 html editor */
    create_html_editor('FCKeditor1', $article['content']);
    /* 取得分类、品牌 */
    $smarty->assign('goods_cat_list', cat_list());
    $smarty->assign('brand_list', get_brand_list());
    /* 取得关联商品 */
    $goods_list = get_article_goods($_REQUEST['id']);
    $smarty->assign('goods_list', $goods_list);
    $smarty->assign('article', $article);
    $smarty->assign('cat_select', article_cat_list(0, $article['cat_id']));
    $smarty->assign('ur_here', $_LANG['article_edit']);
    $smarty->assign('action_link', array('text' => $_LANG['03_article_list'], 'href' => 'article.php?act=list&' . list_link_postfix()));
    $smarty->assign('form_action', 'update');
    assign_query_info();
    $smarty->display('article_info.htm');
}
if ($_REQUEST['act'] == 'update') {
Beispiel #7
0
    admin_log($_POST['title'], 'add', $sql);
    clear_cache_files();
    // 清除相关的缓存文件
    sys_msg("添加“" . $_POST['title'] . "”成功!", 0, $link);
}
/*------------------------------------------------------ */
//-- 编辑
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('education_manage');
    /* 取文章数据 */
    $sql = "SELECT * FROM " . $ecs->table('education') . " WHERE education_id='{$_REQUEST['id']}'";
    $education = $db->GetRow($sql);
    /* 创建 html editor */
    create_html_editor('FCKeditor1', $education['content']);
    $smarty->assign('education', $education);
    $smarty->assign('ur_here', "编辑文章");
    $smarty->assign('action_link', array('text' => "文章列表", 'href' => 'education.php?act=list&' . list_link_postfix()));
    $smarty->assign('form_action', 'update');
    assign_query_info();
    $smarty->display('education_info.htm');
}
if ($_REQUEST['act'] == 'update') {
    /* 权限判断 */
    admin_priv('education_manage');
    /*检查文章名是否相同*/
    $is_only = $exc->is_only('title', $_POST['title'], $_POST['id']);
    if (!$is_only) {
        sys_msg(sprintf("此文章已经存在", stripslashes($_POST['title'])), 1);
    }
Beispiel #8
0
    admin_log($_POST['title'], 'add', 'article');
    clear_cache_files();
    // 清除相关的缓存文件
    sys_msg($_LANG['articleadd_succeed'], 0, $link);
}
/*------------------------------------------------------ */
//-- 编辑
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('article_manage');
    /* 取文章数据 */
    $sql = "SELECT * FROM " . $ecs->table('article') . " WHERE article_id='{$_REQUEST['id']}'";
    $article = $db->GetRow($sql);
    /* 创建 html editor */
    create_html_editor('FCKeditor1', htmlspecialchars($article['content']));
    /* 修改 by www.68ecshop.com 百度编辑器 */
    /* 取得分类、品牌 */
    $smarty->assign('goods_cat_list', cat_list());
    $smarty->assign('brand_list', get_brand_list());
    /* 取得关联商品 */
    $goods_list = get_article_goods($_REQUEST['id']);
    $smarty->assign('goods_list', $goods_list);
    $smarty->assign('article', $article);
    $smarty->assign('cat_select', article_cat_list(0, $article['cat_id']));
    $smarty->assign('ur_here', $_LANG['article_edit']);
    $smarty->assign('action_link', array('text' => $_LANG['03_article_list'], 'href' => 'article.php?act=list&' . list_link_postfix()));
    $smarty->assign('form_action', 'update');
    assign_query_info();
    $smarty->display('article_info.htm');
}
Beispiel #9
0
        $db->query($sql);
        $links[] = array('text' => $_LANG['magazine_list'], 'href' => 'magazine_list.php?act=list');
        $links[] = array('text' => $_LANG['add_new'], 'href' => 'magazine_list.php?act=add');
        sys_msg($_LANG['edit_ok'], 0, $links);
    }
} elseif ($_REQUEST['act'] == 'edit') {
    /* 修改 by www.68ecshop.com 百度编辑器 begin */
    //include_once(ROOT_PATH.'includes/fckeditor/fckeditor.php'); // 包含 html editor 类文件
    /* 修改 by www.68ecshop.com 百度编辑器 end */
    $id = intval($_REQUEST['id']);
    if (empty($_POST['step'])) {
        $rt = $db->getRow("SELECT * FROM " . $ecs->table('mail_templates') . " WHERE type = 'magazine' AND template_id = '{$id}'");
        $smarty->assign(array('id' => $id, 'act' => 'edit', 'magazine_name' => $rt['template_subject'], 'magazine_content' => $rt['template_content']));
        $smarty->assign(array('ur_here' => $_LANG['magazine_list'], 'act' => 'edit'));
        $smarty->assign('action_link', array('text' => $_LANG['go_list'], 'href' => 'magazine_list.php?act=list'));
        create_html_editor('magazine_content', htmlspecialchars($rt['template_content']));
        /* 修改 by www.68ecshop.com 百度编辑器 */
        assign_query_info();
        $smarty->display('magazine_list_add.htm');
    } elseif ($_POST['step'] == 2) {
        $magazine_name = trim($_POST['magazine_name']);
        $magazine_content = trim($_POST['magazine_content']);
        $magazine_content = str_replace('src=\\"', 'src=\\"http://' . $_SERVER['HTTP_HOST'], $magazine_content);
        $time = gmtime();
        $db->query("UPDATE " . $ecs->table('mail_templates') . " SET is_html = 1, template_subject = '{$magazine_name}', template_content = '{$magazine_content}', last_modify = '{$time}' WHERE type = 'magazine' AND template_id = '{$id}'");
        $links[] = array('text' => $_LANG['magazine_list'], 'href' => 'magazine_list.php?act=list');
        sys_msg($_LANG['edit_ok'], 0, $links);
    }
} elseif ($_REQUEST['act'] == 'del') {
    $id = intval($_REQUEST['id']);
    $db->query("DELETE  FROM " . $ecs->table('mail_templates') . " WHERE type = 'magazine' AND template_id = '{$id}' LIMIT 1");
Beispiel #10
0
    if ($_REQUEST['act'] == 'add') {
        $smarty->assign('ur_here', 'Add News');
        $smarty->assign('form_act', 'insert');
        $smarty->assign('html_editor', create_html_editor('content', '', true));
    } else {
        $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
        $news = $db->getRow("select * from news where id='{$id}'");
        if (!$news) {
            sys_msg('There is no such news');
            exit;
        }
        $smarty->assign('ur_here', 'Edit News');
        $smarty->assign('news', $news);
        $smarty->assign('id', $id);
        $smarty->assign('form_act', 'update');
        $smarty->assign('html_editor', create_html_editor('content', $news['content'], true));
    }
    $smarty->display('news_info.tpl');
} elseif ($_REQUEST['act'] == 'update' || $_REQUEST['act'] == 'insert') {
    $title = isset($_POST['title']) ? htmlspecialchars(trim($_POST['title'])) : '';
    $content = isset($_POST['content']) ? trim($_POST['content']) : '';
    $nowtime = time();
    if (empty($title) || empty($content)) {
        sys_msg('Please provide full information');
    }
    $links[] = array('text' => 'News List', 'href' => 'news.php?act=list');
    if ($_REQUEST['act'] == 'insert') {
        $sql = "insert into news (title,content,addtime) values ('{$title}', '{$content}','{$nowtime}')";
        $db->query($sql);
        clear_all_files();
        sys_msg('News is added!', 0, $links);
Beispiel #11
0
}
if ($_POST['submit2']) {
    $FCKvalue = $_POST['index_top'];
    $sql = "select * from ecs_myconfig where name = 'myindex2'";
    $result = mysql_query($sql);
    $num = mysql_num_rows($result);
    if ($num == 0) {
        $sql = "insert into ecs_myconfig set name = 'myindex2', value = '{$FCKvalue}'";
    } else {
        $sql = "update ecs_myconfig set value = '{$FCKvalue}' where name = 'myindex2'";
    }
    $query = mysql_query($sql);
    if ($query) {
        echo "<script>alert('保存成功!')</script>";
        echo "<script>self.location='myindex.php'</script>";
        exit;
    }
}
/*提取首页自定义区域内容*/
$sql = "select * from ecs_myconfig where name = 'myindex'";
$result = mysql_query($sql);
$lin = mysql_fetch_array($result);
/* 创建 html editor */
create_html_editor('goods_desc', $lin[1]);
/*提取首页top内容 2009-9-20*/
$sql = "select * from ecs_myconfig where name = 'myindex2'";
$result = mysql_query($sql);
$lin = mysql_fetch_array($result);
/* 创建 html editor 2009-9-20*/
create_html_editor2('index_top', $lin[1]);
$smarty->display('myindex.htm');
Beispiel #12
0
$sess_id = $GLOBALS['sess']->get_session_id();
$auth = mktime();
$ac = md5($certi_id . 'SHOPEX_SMS' . $auth);
$url = 'http://service.shopex.cn/sms/index.php?certificate_id=' . $certi_id . '&sess_id=' . $sess_id . '&auth=' . $auth . '&ac=' . $ac;
/*------------------------------------------------------ */
//-- 列表编辑 ?act=list_edit
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list_edit') {
    //include_once(ROOT_PATH . 'includes/fckeditor/fckeditor.php'); // 包含 html editor 类文件
    admin_priv('shop_header');
    $group_list = get_shop_header();
    //echo "<pre>";
    //print_r($group_list);
    $smarty->assign('color', $group_list['shop_header_color']);
    /* 创建 html editor */
    create_html_editor('shop_header_text', htmlspecialchars($group_list['shop_header_text']));
    assign_query_info();
    $smarty->display('shop_header.htm');
} elseif ($_REQUEST['act'] == 'post') {
    $sql = "UPDATE " . $ecs->table('supplier_shop_config') . " SET value = '{$_POST['shop_header_color']}' WHERE code = 'shop_header_color' AND supplier_id=" . $_SESSION['supplier_id'];
    $db->query($sql);
    $sql = "UPDATE " . $ecs->table('supplier_shop_config') . " SET value = '{$_POST['shop_header_text']}' WHERE code = 'shop_header_text' AND supplier_id=" . $_SESSION['supplier_id'];
    $db->query($sql);
    $links[] = array('text' => '返回头部自定义', 'href' => 'shop_header.php?act=list_edit');
    sys_msg('设置成功!', 0, $links);
    /* 清除缓存 */
    clear_all_files();
} elseif ($_REQUEST['act'] == 'send_test_email') {
    /* 检查权限 */
    check_authz_json('shop_config');
    /* 取得参数 */
Beispiel #13
0
        }
    }
    admin_log($_POST['packing_name'], 'add', 'packing');
    $link[] = array('text' => $_LANG['back_list'], 'href' => 'packing.php?act=list');
    $link[] = array('text' => $_LANG['continue_add'], 'href' => 'packing.php?act=add');
    sys_msg($_LANG['add_succeed'], 0, $link);
} elseif ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('packing_manage');
    $packing = get_packing_info($_REQUEST['id']);
    // 商品组合信息
    $packing_goods_list = get_packing_goods($_REQUEST['id']);
    // 组合商品列表
    $packing['article'] = htmlspecialchars_decode(get_packing_article($_REQUEST['id']));
    // 商品组合描述
    create_html_editor('article', $packing['article']);
    $smarty->assign('packing', $packing);
    $smarty->assign('ur_here', $_LANG['packing_edit']);
    $smarty->assign('action_link', array('text' => $_LANG['00_packing_list'], 'href' => 'packing.php?act=list&' . list_link_postfix()));
    $smarty->assign('cat_list', cat_list());
    $smarty->assign('brand_list', get_brand_list());
    $smarty->assign('form_action', 'update');
    $smarty->assign('packing_goods_list', $packing_goods_list);
    assign_query_info();
    $smarty->display('packing_info.htm');
} elseif ($_REQUEST['act'] == 'update') {
    /* 权限判断 */
    admin_priv('packing_manage');
    $packing_id = intval($_POST['id']);
    /* 处理提交数据 */
    if (empty($_POST['packing_price'])) {
    }
    //产品主图----end
    $insert_product_desp['language_id'] = $_REQUEST['language_id'];
    $insert_product_desp['products_name'] = addslashes($_REQUEST['products_name']);
    $insert_product_desp['products_description'] = addslashes($_REQUEST['products_description']);
    $insert_product_desp['products_short_description'] = addslashes($_REQUEST['products_short_description']);
    $site_name = 'all';
    //添加记录
    $products_id = addProductBackEver(array('products' => $insert_product, 'site_name' => $site_name, 'products_description' => $insert_product_desp, 'categories_id' => $products_cat));
    $msg = '添加产品成功。';
    if ($is_set_attr) {
        include 'includes/aliexpress_attr_handle.php';
    }
}
$FCKeditor = create_html_editor('products_description', '');
$FCKeditor_short_desp = create_html_editor('products_short_description', '', 160);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add product</title>
<script language="javascript" src="<?php 
echo JS_JUQERY;
?>
"></script>
<style type="text/css">
html,body{font-family:tahoma,arial,宋体,sans-serif;font-size:12px;padding:0px;margin:0px;}

.wrap{border:1px solid #ccc;margin:50px 100px 150px;}
table{width:100%;border-collapse:collapse;border:1px solid #ccc;}
Beispiel #15
0
        $sql = "INSERT INTO " . $ecs->table('mail_templates') . " (template_code, is_html,template_subject, template_content, last_modify, type) VALUES('" . md5($magazine_name . $time) . "',1, '{$magazine_name}', '{$magazine_content}', '{$time}', 'magazine')";
        $db->query($sql);
        $links[] = array('text' => $_LANG['magazine_list'], 'href' => 'magazine_list.php?act=list');
        $links[] = array('text' => $_LANG['add_new'], 'href' => 'magazine_list.php?act=add');
        sys_msg($_LANG['edit_ok'], 0, $links);
    }
} elseif ($_REQUEST['act'] == 'edit') {
    include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php';
    // 包含 html editor 类文件
    $id = intval($_REQUEST['id']);
    if (empty($_POST['step'])) {
        $rt = $db->getRow("SELECT * FROM " . $ecs->table('mail_templates') . " WHERE type = 'magazine' AND template_id = '{$id}'");
        $smarty->assign(array('id' => $id, 'act' => 'edit', 'magazine_name' => $rt['template_subject'], 'magazine_content' => $rt['template_content']));
        $smarty->assign(array('ur_here' => $_LANG['magazine_list'], 'act' => 'edit'));
        $smarty->assign('action_link', array('text' => $_LANG['go_list'], 'href' => 'magazine_list.php?act=list'));
        create_html_editor('magazine_content', $rt['template_content']);
        assign_query_info();
        $smarty->display('magazine_list_add.htm');
    } elseif ($_POST['step'] == 2) {
        $magazine_name = trim($_POST['magazine_name']);
        $magazine_content = trim($_POST['magazine_content']);
        $magazine_content = str_replace('src=\\"', 'src=\\"http://' . $_SERVER['HTTP_HOST'], $magazine_content);
        $time = gmtime();
        $db->query("UPDATE " . $ecs->table('mail_templates') . " SET is_html = 1, template_subject = '{$magazine_name}', template_content = '{$magazine_content}', last_modify = '{$time}' WHERE type = 'magazine' AND template_id = '{$id}'");
        $links[] = array('text' => $_LANG['magazine_list'], 'href' => 'magazine_list.php?act=list');
        sys_msg($_LANG['edit_ok'], 0, $links);
    }
} elseif ($_REQUEST['act'] == 'del') {
    $id = intval($_REQUEST['id']);
    $db->query("DELETE  FROM " . $ecs->table('mail_templates') . " WHERE type = 'magazine' AND template_id = '{$id}' LIMIT 1");
    $links[] = array('text' => $_LANG['magazine_list'], 'href' => 'magazine_list.php?act=list');
Beispiel #16
0
    $res = save_notice_attach($notice_id, $_FILES["file1"], $_SESSION[admin_name]);
    if ($res["error"] == 0) {
        $res = save_notice_attach($notice_id, $_FILES["file2"], $_SESSION[admin_name]);
        if ($res["error"] == 0) {
            $res = save_notice_attach($notice_id, $_FILES["file3"], $_SESSION[admin_name]);
            if ($res["error"] == 0) {
            } else {
                $smarty->assign("error", $_FILES["file3"]["name"] . "附件上传失败!" . $res["msg"]);
            }
        } else {
            $smarty->assign("error", $_FILES["file2"]["name"] . "附件上传失败!" . $res["msg"]);
        }
    } else {
        $smarty->assign("error", $_FILES["file1"]["name"] . "附件上传失败!" . $res["msg"]);
    }
    create_html_editor('FCKeditor1');
    $smarty->display('notice_list.htm');
    exit;
} elseif ($_REQUEST['act'] == 'ajax_delete') {
    $id = !empty($_REQUEST['notice_id']) ? intval($_REQUEST['notice_id']) : 0;
    if ($id != 0) {
        //删除附件
        $sql = "select * from " . $ecs->table("notice_attach") . " where notice_id=" . $id;
        $rows = $db->getAll($sql);
        foreach ($rows as $row) {
            @unlink(ROOT_PATH . $row["path"]);
        }
        //删除附件
        $db->query("DELETE FROM " . $ecs->table("notice_attach") . " where notice_id=" . $id);
        //删除记录
        $sql = "delete from " . $ecs->table("notice") . " where notice_id=" . $id;
Beispiel #17
0
 * ----------------------------------------------------------------------------
 * http://www.phpally.com
 * Jacklee的博客 致力于php技术
 * ----------------------------------------------------------------------------
 * 作者: Jacklee
 * 邮箱: jack349392900#gmail.com
 * 创建时间: 2014-05-01
 * 最后修改时间: 2014-05-01
 */
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
/* 模板赋值 */
$smarty->assign('ur_here', $_LANG['sendmail']);
if ($_REQUEST['act'] == 'sendmail') {
    $email = trim($_REQUEST['email']);
    include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php';
    //类文件
    create_html_editor('content', '');
    $smarty->assign('email', $email);
    $smarty->display('sendmail.htm');
}
if ($_REQUEST['act'] == 'send_act') {
    $email = trim($_REQUEST['email']);
    $subject = trim($_REQUEST['subject']);
    $content = trim($_REQUEST['content']);
    if (send_mail($_CFG['shop_name'], $email, $subject, $content, 1)) {
        sys_msg($_LANG['send_sucess'], 0);
    } else {
        sys_msg($_LANG['send_failure'], 1);
    }
}
    //产品详情1
    $preg = '~<td class="news3">&nbsp;Product Specifications</td>(?:\\s|.)+?<td height="165" valign="top" style="color:#333333;">((?:\\s|.)+?)</td>~';
    preg_match($preg, $content, $arr);
    $pro_desp = $arr[1];
    //print_r($arr);
    //产品详情2
    $preg = '~<td class="news3">&nbsp;User Guide</td>(?:\\s|.)+?<td height="165" valign="top" style="color:#333333;">((?:\\s|.)+?)</td>~';
    preg_match($preg, $content, $arr);
    $pro_desp2 = $arr[1];
    //print_r($arr);
    $insert_product_desp['products_description'] = $pro_desp . $pro_desp2 . '<img src="/images/' . $save_img_dir . '/' . basename($pic_desp);
    //添加记录
    addProductBackEver(array('products' => $insert_product, 'products_description' => $insert_product_desp, 'categories_id' => $products_cat));
    $msg = '添加产品成功。';
}
$FCKeditor = create_html_editor('test', '');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add product</title>
<style type="text/css">
html,body{font-family:tahoma,arial,宋体,sans-serif;font-size:12px;padding:0px;margin:0px;}
.wrap{border:1px solid #ccc;margin:50px 100px;}
table{width:100%;border-collapse:collapse;border:1px solid #ccc;}
td{padding:5px 10px;border:1px solid #ccc;}
.align_right{text-align:right;}
</style>
</head>
Beispiel #19
0
        $topic['data'] = addcslashes($topic['data'], "'");
        if (empty($topic['topic_img']) && empty($topic['htmls'])) {
            $topic['topic_type'] = 0;
        } elseif ($topic['htmls'] != '') {
            $topic['topic_type'] = 2;
        } elseif (preg_match('/.swf$/i', $topic['topic_img'])) {
            $topic['topic_type'] = 1;
        } else {
            $topic['topic_type'] = '';
        }
        $smarty->assign('topic', $topic);
        $smarty->assign('act', 'update');
    } else {
        $topic = array('title' => '', 'topic_type' => 0, 'url' => 'http://');
        $smarty->assign('topic', $topic);
        create_html_editor('topic_intro');
        $smarty->assign('act', 'insert');
    }
    $smarty->display('topic_edit.htm');
} elseif ($_REQUEST['act'] == 'insert' || $_REQUEST['act'] == 'update') {
    admin_priv('topic_manage');
    $is_insert = $_REQUEST['act'] == 'insert';
    $topic_id = empty($_POST['topic_id']) ? 0 : intval($_POST['topic_id']);
    $topic_type = empty($_POST['topic_type']) ? 0 : intval($_POST['topic_type']);
    switch ($topic_type) {
        case '0':
        case '1':
            // 主图上传
            if ($_FILES['topic_img']['name'] && $_FILES['topic_img']['size'] > 0) {
                /* 检查文件合法性 */
                if (!get_file_suffix($_FILES['topic_img']['name'], $allow_suffix)) {
Beispiel #20
0
    admin_log($_POST['title'], 'add', $sql);
    clear_cache_files();
    // 清除相关的缓存文件
    sys_msg("添加系统相关成功", 0, $link);
}
/*------------------------------------------------------ */
//-- 编辑
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('problems_manage');
    /* 取问题数据 */
    $sql = "SELECT * FROM " . $ecs->table('problems') . " WHERE problems_id='{$_REQUEST['id']}'";
    $problems = $db->GetRow($sql);
    /* 创建 html editor */
    create_html_editor('FCKeditor1', $problems['content']);
    $smarty->assign('problems', $problems);
    $smarty->assign('ur_here', "编辑问题");
    $smarty->assign('action_link', array('text' => "问题列表", 'href' => 'problems.php?act=list&' . list_link_postfix()));
    $smarty->assign('form_action', 'update');
    assign_query_info();
    $smarty->display('problems_info.htm');
}
if ($_REQUEST['act'] == 'update') {
    /* 权限判断 */
    admin_priv('problems_manage');
    /*检查问题名是否相同*/
    $is_only = $exc->is_only('title', $_POST['title'], $_POST['id']);
    if (!$is_only) {
        sys_msg(sprintf("此问题已经存在", stripslashes($_POST['title'])), 1);
    }