Skip to content

Instantly share code, notes, and snippets.

View anthonycvella's full-sized avatar

Anthony Vella anthonycvella

View GitHub Profile
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
//
// CheckInViewController.m
// Hiskor
//
// Created by SuchyMac3 on 2/28/13.
// Copyright (c) 2013 ITP. All rights reserved.
//
#import "CheckInViewController.h"
#import "ZBarReaderViewController.h"
- (void)loadGames {
NSString *userID = [Lockbox stringForKey:kUserIDKeyString];
NSString *type = @"game";
NSLog(@"UserID: %@", userID);
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
userID, @"userID",
type, @"type",
nil];
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
<?php
function game() {
global $db;
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$userID = isset( $_POST['userID'] ) ? $_POST['userID'] : false ;
if ( !$userID ) {
header('Content-type: application/json');
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$gameID = generateID();
$createdOn = time();
$homeSchoolID = $_POST['homeSchoolID'];
$awaySchoolID = $_POST['awaySchoolID'];
$numberOfTickets = $_POST['numberOfTickets'];
$db->query("SELECT gameID FROM games WHERE `gameID`=?")->bind(1, $gameID)->execute();
if ($db->getTotalRows()) {
<?php
$query = $db->query("SELECT * FROM `schools`", false)->execute();
echo "<label for=\"username\">Home School:</label>";
echo "<select name=\"homeSchool\" class=\"addGameField\">";
if ($db->getTotalRows($query)) {
while ($result = $db->fetch($query)) {
echo "<option value=".$result['schoolID'].">".$result['schoolName']."</option>";
}
@anthonycvella
anthonycvella / LoginViewController.mm
Created February 13, 2013 18:14
Anthony Vella : Hiskor - Client/Server Architecture Code Note: I plan on moving my networking code to its own class once I finish working on my PHP backend.
//
// LoginViewController.m
// Hiskor
//
// Created by Anthony Vella on 1/29/13.
// Copyright (c) 2013 ITP. All rights reserved.
//
#import "LoginViewController.h"
#import "AFHTTPClient.h"
<?php if(isset($_SESSION['ticketCode'])) : ?>
<p><?php echo $_SESSION['ticketCode']; ?></p>
<p><?php echo $qr->draw(); unset($_SESSION['ticketCode']); ?></p>
<?php endif; ?>
<?php
session_start();
if(!isset($_SESSION['loggedIn']) || $_SESSION['loggedIn']!=1)
{
header("Location: login.php");
exit();
}
$included = 'true';