Ejemplo n.º 1
0
 public function showWelcome()
 {
     $posters = Poster::where('daily_id', '=', 0)->get();
     $topics = Topic::where('topic_url', '!=', '')->orderBy('created_at', 'desc')->get();
     $daily = poster::where('daily_id', '=', 1)->get();
     foreach ($daily as $recommend) {
         $gift = Gift::find($recommend->info_url);
         $recommend->content = $gift->content;
         $recommend->scan_num = $gift->scan_num;
         $recommend->focus_num = $gift->focus_num;
     }
     foreach ($posters as $poster) {
         $poster->photo_url = StaticController::imageWH($poster->photo_url);
     }
     foreach ($topics as $topic) {
         $topic->topic_url = StaticController::imageWH($topic->topic_url);
     }
     foreach ($daily as $day) {
         $day->photo_url = StaticController::imageWH($day->photo_url);
     }
     if (Request::wantsJson()) {
         return Response::json(array('errCode' => 0, 'message' => '返回首页首页数据', 'posters' => $posters, 'topics' => $topics, 'recommendations' => $daily));
     }
     return View::make('index.home')->with(array('posters' => $posters, 'topics' => $topics, 'recommendations' => $daily));
 }
Ejemplo n.º 2
0
 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE   |
 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.    |
 |                                                                         |
 +-------------------------------------------------------------------------+
*/
require_once "../../include/session.php";
require_once "include/fields.php";
require_once "include/post.php";
require_once "include/post_class.php";
if (!isset($_POST["startdate"])) {
    $_POST["startdate"] = dateToString(mktime(0, 0, 0, date("m"), 1, date("y")));
}
if (!isset($_POST["enddate"])) {
    $_POST["enddate"] = dateToString(mktime(0, 0, 0));
}
$poster = new poster($db, stringToDate($_POST["startdate"]), stringToDate($_POST["enddate"]));
$poster->getSections();
if (isset($_POST["cmd"])) {
    $statusmessage = $poster->process($_POST);
}
$pageTitle = "Post Records";
$phpbms->cssIncludes[] = "pages/bms/post.css";
$phpbms->jsIncludes[] = "modules/bms/javascript/post.js";
//Form Elements
//==============================================================
$theform = new phpbmsForm();
$theinput = new inputDatePicker("startdate", dateToString($poster->startdate, "SQL"), "start date");
$theform->addField($theinput);
$theinput = new inputDatePicker("enddate", dateToString($poster->enddate, "SQL"), "end date");
$theform->addField($theinput);
$theform->jsMerge();