This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plumbing Supply House API -- Super PHPlumbing Bros. Inc. | |
This script provides a RESTful API interface for a web application | |
Input: | |
$_GET['format'] = [ json | html | xml ] | |
$_GET['method'] = [] | |
Output: A formatted HTTP response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return array( | |
'0' => array( | |
'id' => 'CP12010', | |
'name' => '1 inch copper pipe.', | |
'image' => 'http://localhost:8888/assets/1_inch_copper_pipe.png', | |
'description' => '1 in. x 10 ft. Copper Type M Hard Temper Straight Pipe for a multitude of plumbing and heating purposes. It is NSF and ANSI Standard 61 certified. Made of hard-temper ASTM - B88 copper. For general plumbing and heating purposes. Alloy C12200 (DHP) meets industry standards and is NSF and ANSI Standard 61 certified. Meets or exceeds industry standards to deliver a high quality flow product. Plumbing and mechanical codes govern what types of products may be used for applications. Local codes should always be consulted for minimum requirements'), | |
'1' => array( | |
'id' => 'CP12020', | |
'name' => '1 1/4 inch copper pipe.', | |
'image' => 'http://localhost:8888/assets/1_1_4_inch_copper_pipe.png', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define HTTP responses // | |
$http_response_code = array( | |
200 => 'OK', | |
400 => 'Bad Request', | |
401 => 'Unauthorized', | |
403 => 'Forbidden', | |
404 => 'Not Found' | |
); | |
// Set HTTP Response // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plumbing Supply House API -- PHP Plumbing inc. | |
This script provides a RESTful API interface for a web application | |
Input: | |
$_GET['format'] = [ json | html | xml ] | |
$_GET['method'] = [] | |
Output: A formatted HTTP response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return array( | |
'0' => array( | |
'id' => 'PT12010', | |
'name' => 'Plunger.', | |
'image' => 'http://localhost:8888/assets/plunger.png', | |
'description' => 'Super-pliable industrial-rubber cup with tiered ridges forms ultra-tight seal on any size drain. The heavy-duty steel handle allows for maximum pressure forced down drain to source of clog. Designed to work effectively at any angle for hard-to-reach, low-clearance applications.'), | |
'1' => array( | |
'id' => 'PT12020', | |
'name' => 'Pipe Wrench.', | |
'image' => 'http://localhost:8888/assets/pipe_wrench.png', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bsn_id : String? = "" | |
var bsn_name : String? = "" | |
var bsn_image : String? = "" | |
var bsn_description : String? = "" | |
init(var bsn_id : String?, var bsn_name : String?, var bsn_image : String?, var bsn_description : String?) { | |
self.bsn_id = bsn_id | |
self.bsn_name = bsn_name | |
self.bsn_image = bsn_image | |
self.bsn_description = bsn_description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlumbingSupplyInventoryTableViewController: UITableViewController { | |
var inventoryUrlEndpoint : String = "" | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
var destViewController = segue.destinationViewController as PlumbingSupplyInventoryTableViewController | |
if segue.identifier == "plumbingTools" { | |
destViewController.title = "Plumbing Tools" | |
destViewController.inventoryUrlEndpoint = "http://localhost:8888/api/v1/plumbing_tools.json" | |
} | |
else if segue.identifier == "copperPipesAndFittings" { | |
destViewController.title = "Copper Pipes and Fittings" | |
destViewController.inventoryUrlEndpoint = "http://localhost:8888/api/v1/copper_pipes_and_fittings.json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var webActivityIndicator : UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.WhiteLarge) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.webActivityIndicator.color = UIColor.lightGrayColor() | |
self.webActivityIndicator.startAnimating() | |
self.webActivityIndicator.center = self.view.center | |
self.view.addSubview(self.webActivityIndicator) |
OlderNewer