<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Resturant Coupons</title> <link rel="stylesheet" href="css/main.css" type="text/css" /> </head> <body> <?php ini_set('display_errors', true); // for the Parse object require "autoload.php"; // this should be somewhere above the HTML files on the server include "variables.php"; // for Parse initialization // must have Parse\ in front of all of these; bad documentation Parse\ParseClient::initialize($app_id, $rest_key, $master_key); use Parse\ParseObject; use Parse\ParseQuery; // local Parse library include "class.library.php"; include "layout.php"; $parse_library = new parseLibrary(); # any messages sent to this page? $sent_msg = isset($_GET['login_msg']) ? $_GET['login_msg'] : 0; #order the books available $order_by = isset($_GET['order_by']) ? $_GET['order_by'] : "subject"; // start the main layout of the page startMainLayout(); if (isset($_POST['email'], $_POST['password'])) { # can check email/password for junk # do this with JS on the front end but, doesn't hurt to do it again
<?php require 'autoload.php'; require 'src\\Parse\\ParseClient.php'; require 'src\\Parse\\ParseObject.php'; require 'src\\Parse\\ParseQuery.php'; //require 'src\Parse\ParseObject.php'; Parse\ParseClient::initialize('yourkey', 'yourkey', 'yourkey'); try { $query = new Parse\ParseQuery("tablename"); $query->descending("column_name"); $query->limit('1'); //$query->equalTo("objectId", "RFyDtYzQNv"); $results = $query->find(); ///to find month and year $month = date('M'); if ($month == 'Jan') { $year = date('Y', strtotime('last year')); } else { $year = date('Y'); } echo $year; foreach ($results as $row) { $deviceToken = $row->deviceToken; // field name : deviceToken $starCount = $row->starCount; // field name : starCount $videoTitle = $row->videoTitle; // field name : videoTitle $videoTotalDuretion = $row->videoTotalDuretion; // field name : videoTotalDuretion