Exemplo n.º 1
0
<?php

require_once '../common/common.php';
$lng = param('lng');
// 传入用户的经度
$lat = param('lat');
// 纬度
if ($lng == null || $lat == null) {
    operation_fail("经纬度错误");
}
$distance = param("distance", 50);
$page = param("page", 1);
$tasks = TaskModel::getValidTasks($lng, $lat, $distance, $page);
$tasksTotalCount = TaskModel::getValidTasksCount();
json_put("tasks", $tasks);
json_put("total", $tasksTotalCount);
json_output();
?>


Exemplo n.º 2
0
<?php

require_once '../common/__html__.php';
require_once '../common/common.php';
require_once '../common/page.php';
$page = param("page", 1);
$tasks = TaskModel::getValidTasks($page);
$tasksTotalCount = TaskModel::getValidTasksCount();
?>

<div class="container">
    <div class="row">
        <div class="col-md-10 col-sm-10 col-md-offset-1 col-sm-offset-1">
            <table class="table table-striped">
                <thead>
                <tr>
                    <!--th>标题</th>
                    <th>描述</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th>地址</th>
                    <th>奖励</th-->
                </tr>
                </thead>
                <tbody>
                <?php 
$index = 1;
foreach ($tasks as $key => $value) {
    $id = $value['id'];
    $title = $value["title"];
    $startTime = $value["start_time"];