コード例 #1
0
<?php

include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/CasaDao.php';
$id = $_GET['id'];
$deleted = $_GET['deleted'];
$option = $_GET['option'];
$casaDao = new CasaDao();
$success = true;
if ($option == "recycle") {
    $success = $casaDao->recycle($id);
} else {
    if ($option == "recover") {
        $success = $casaDao->recover($id);
    }
}
if ($success) {
    header("Location:../../website/backstage/casa_list.php?deleted={$deleted}");
} else {
    header('Location:../../website/backstage/error.php?info=操作失败!');
}
コード例 #2
0
ファイル: casa_list.php プロジェクト: dreamingodd/casarover
            <span class="glyphicon glyphicon-list" aria-hidden="true"></span>列表
        </a>
        <a href="casa_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>
            <th>操作</th>
        </tr>
    <?php 
$casaDao = new CasaDao();
$areaService = new AreaService();
$query = $casaDao->getAll($_GET['deleted']);
$casas = array();
while ($row = mysql_fetch_array($query)) {
    array_push($casas, new Casa($row));
}
// The compareCasaByCode method is in common_tools.php
// TODO 需要修改成通用的方法。
usort($casas, 'compareCasaByCode');
$number = 1;
foreach ($casas as $casa) {
    ?>
        <tr>
            <td><?php 
    echo $number++;
コード例 #3
0
ファイル: area_edit.php プロジェクト: dreamingodd/casarover
?>
" name="position" placeholder="从坐标拾取复制过来" />
            <h3>层级</h3>
            <input type="text" class="form-control" id="tier" name="tier" placeholder="显示层级" value="<?php 
echo $message->tier;
?>
" />
        </div>
        <br/>
        <div id="casa_select" class="vertical5 col-lg-12">
            <input type="hidden" name="recommendCasas" id="recommendCasas" value=""/>
            <div id="casa_select_left" class="col-lg-4">
                <select multiple class="form-control" style="height:180px">
                <?php 
// all areas
$casaDao = new CasaDao();
$all_rows = $casaDao->getByAreaId($area_id);
while ($row = mysql_fetch_array($all_rows)) {
    echo '<option value="' . $row['id'] . '">' . $row['name'] . '(' . $row['code'] . ')' . '</option>';
}
?>
                </select>
            </div>
            <div id="casa_select_middle" class="col-lg-1">
                <br/><br/>
                <span id="casa_move_right" class="glyphicon glyphicon-arrow-right"
                        style="font-size:50px; cursor:pointer; margin-left:10px;"></span>
                <span id="casa_move_left"  class="glyphicon glyphicon-arrow-left"
                        style="font-size:48px; cursor:pointer; margin-left:10px;"></span>
            </div>
            <div id="casa_select_right" class="col-lg-4">
コード例 #4
0
header("Content-Type: text/html; charset=utf-8");
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/common/common_tools.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/TagDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/CasaTagDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/CasaDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/CasaTagDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AttachmentDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/AreaDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/ContentDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/models/ContentAttachmentDao.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/services/CasaService.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/services/ContentService.php';
$casa_JSON_str = remove_slash($_REQUEST['casa_JSON_str']);
$casa = json_decode($casa_JSON_str);
$casaDao = new CasaDao();
$areaDao = new AreaDao();
$attachmentDao = new AttachmentDao();
$tagDao = new TagDao();
$casaTagDao = new CasaTagDao();
$contentDao = new ContentDao();
$contentAttachmentDao = new ContentAttachmentDao();
$casaService = new CasaService();
$contentService = new ContentService();
mysql_query('START TRANSACTION') or die(mysql_error());
$mode = 'edit';
if (empty($casa->id)) {
    $mode = 'add';
}
/** 1.添加基础民宿 */
if (!empty($casa->name) && !empty($casa->code) && !empty($casa->area)) {