Ejemplo n.º 1
0
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="//cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="../assets/js/integration/jquery.flexslider-min.js" type="text/javascript"></script>
    <script src="../assets/js/home.js" type="text/javascript"></script>
    <script src="../assets/js/vue.js" type="text/javascript"></script>
    <script src="../assets/js/casaseries.js" type="text/javascript"></script>
</head>
<body>
<?php 
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AttachmentDao.php';
include_once 'WechatArticle.php';
include_once 'WechatArticleDao.php';
$waDao = new WechatArticleDao();
$aDao = new AttachmentDao();
$type = $_GET['type'];
$series = $_GET['series'];
if (empty($type)) {
    // Default display list is 民宿风采
    $type = 2;
}
if (empty($series)) {
    // Now just "探庐系列 " has submenu.
    if ($type == 1) {
        $series = 1;
    } else {
        $series = 0;
    }
}
<?php

include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AttachmentDao.php';
include_once 'WechatArticle.php';
include_once 'WechatArticleDao.php';
$waDao = new WechatArticleDao();
$aDao = new AttachmentDao();
$a_id = $_POST['attachment_id'];
$wa_id = $_POST['id'];
$type = $_POST['type'];
$series = $_POST['series'];
if (empty($series)) {
    $series = 0;
}
$filepath = $_GET['filepath'];
$wa = new WechatArticle($wa_id, $a_id, $_POST['title'], $_POST['brief'], $_POST['address'], $type, $series, $_POST['deleted']);
$update_attachemnt = false;
if ($a_id) {
    $attachment_row = $aDao->getById($a_id);
    if ($attachment_row['filepath'] != $filepath) {
        // 更新了图片
        $update_attachemnt = true;
    }
} else {
    // 无图片
    $update_attachemnt = true;
}
if ($update_attachemnt) {
    $a_id = $aDao->addSimple($filepath);
    if (!$a_id) {
        echo '数据库添加图片失败!' . '</br>' . mysql_error();
Ejemplo n.º 3
0
<script src="../js/integration/jquery.min.js"></script>
<script src="../js/integration/json2.js"></script>
<script src="../backstage/js/all.js"></script>
<script src="js/wechat_article_edit.js?v=1.1"></script>
</head>
<body>
<?php 
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/controllers/check_admin_login_action.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/common/PropertyManager.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AttachmentDao.php';
include_once 'WechatArticle.php';
include_once 'WechatArticleDao.php';
include_once 'WechatSeriesDao.php';
$pm = new PropertyManager();
$wa = new WechatArticle();
$dao = new WechatArticleDao();
$aDao = new AttachmentDao();
$seriesDao = new WechatSeriesDao();
$filepath = "";
$id = $_GET['id'];
if ($id) {
    $wa = new WechatArticle($dao->getById($id));
    $a_row = $aDao->getById($wa->attachment_id);
    $filepath = $a_row['filepath'];
}
$series_rows = $seriesDao->getAll();
?>
<div id="container">
    <!-- nav bar start -->
    <?php 
include '../backstage/navigator.php';
Ejemplo n.º 4
0
        <a href="wechat_article_list.php?type=3">
            <span class="glyphicon glyphicon-list" aria-hidden="true"></span>主题民宿
        </a>
        <a href="wechat_article_list.php?deleted=1">
            <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>回收站
        </a>
    </div>
    <table class="table table-hover">
        <tr>
            <th>序号</th>
            <th>标题</th>
            <th>简介</th>
            <th>操作</th>
        </tr>
    <?php 
$dao = new WechatArticleDao();
$article_rows = $dao->getByType($_GET['type']);
if ($_GET['deleted']) {
    $article_rows = $dao->getAll($_GET['deleted']);
}
$number = 1;
while ($row = mysql_fetch_array($article_rows)) {
    ?>
        <tr>
            <td><?php 
    echo $number++;
    ?>
</td>
            <td><?php 
    echo $row['title'];
    ?>
<?php

include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AttachmentDao.php';
include_once 'WechatArticle.php';
include_once 'WechatArticleDao.php';
$id = $_GET['id'];
$type = $_GET['type'];
$deleted = $_GET['deleted'];
$option = $_GET['option'];
$dao = new WechatArticleDao();
$success = true;
if ($option == "recycle") {
    $success = $dao->recycle($id);
} else {
    if ($option == "recover") {
        $success = $dao->recover($id);
    }
}
if ($success) {
    header("Location:wechat_article_list.php?type={$type}&deleted={$deleted}");
} else {
    header("Location:../backstage/error.php?info=" . mysql_error());
}