@@ -7,52 +7,44 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="65" id="KGk-i7-Jjw" customClass="CurrentOrderTableViewCell" customModule="ParseStarterProject_Swift" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="65"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="39" id="KGk-i7-Jjw" customClass="CurrentOrderTableViewCell" customModule="ParseStarterProject_Swift" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="39"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="64.5"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="38.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Our-G2-9c4">
<rect key="frame" x="8" y="8" width="42" height="21"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JlI-IS-9cA">
<rect key="frame" x="65" y="8" width="179" height="21"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="00j-rS-LtF">
<rect key="frame" x="65" y="37" width="42" height="21"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mr8-Xm-Rk8">
<rect key="frame" x="270" y="8" width="42" height="21"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
</tableViewCellContentView>
<animations/>
<connections>
<outlet property="extraDetails" destination="00j-rS-LtF" id="qFe-PF-maW"/>
<outlet property="name" destination="JlI-IS-9cA" id="ltC-Km-d0f"/>
<outlet property="orderNumber" destination="Our-G2-9c4" id="hQX-wV-5Pb"/>
<outlet property="quantity" destination="mr8-Xm-Rk8" id="Q3c-od-SNC"/>
</connections>
<point key="canvasLocation" x="345.5" y="363.5"/>
<point key="canvasLocation" x="345" y="350.5"/>
</tableViewCell>
</objects>
</document>
@@ -7,6 +7,8 @@
//
import UIKit
import Parse
import Bolts

class CurrentOrderViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

@@ -15,10 +17,15 @@ class CurrentOrderViewController: UIViewController, UITableViewDataSource, UITab
var itemsInProgress = ["c","d","e"]


var OrderNumber: [Int] = []
var quantity: [Int] = []
var name: [String] = []

override func viewDidLoad() {
super.viewDidLoad()
let nib = UINib(nibName: "CurrentOrderTableViewCell", bundle: nil)
tableView.registerNib(nib, forCellReuseIdentifier: "Cell")
self.runQuery()
//self.tableView!.registerClass(CurrentOrderTableViewCell.self, forCellReuseIdentifier: "Cell")
// Do any additional setup after loading the view.
}
@@ -29,35 +36,59 @@ class CurrentOrderViewController: UIViewController, UITableViewDataSource, UITab
}

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 65
}

func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 2
return 40
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
var itemSize = [itemsInNew.count, itemsInProgress.count]
return itemSize[section]
return OrderNumber.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell: CurrentOrderTableViewCell = self.tableView.dequeueReusableCellWithIdentifier("Cell") as! CurrentOrderTableViewCell;
cell.namely = "Suchit"
cell.name.text = name[indexPath.row]
cell.quantity.text = String(quantity[indexPath.row])
cell.orderNumber.text = String(OrderNumber[indexPath.row])
return cell
}

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

}

func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return a[section]
}


@IBOutlet weak var tableView: UITableView!

func runQuery()
{
var query = PFQuery(className: "VendorDatabase")
query.findObjectsInBackgroundWithBlock{ (objects: [PFObject]?, error: NSError?) -> Void in
if error == nil
{
if objects == nil
{
print("Bhenchod")
}
else
{
print ("bc")
for eachObject in objects!
{
if (eachObject["IDNumber"] as! Int) == 1
{
self.OrderNumber.append(eachObject["OrderNumber"] as! Int)
self.quantity.append(eachObject["Quantity"] as! Int)
self.name.append(eachObject["Name"] as! String)
}
self.tableView.reloadData()
}
}
}
}

}

// override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// var PickupVC = segue.destinationViewController as! PickupViewController
// if let indexPath = self.tableView.indexPathForSelectedRow
@@ -38,7 +38,7 @@
<rect key="frame" x="0.0" y="17" width="320" height="36"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
@@ -10,12 +10,17 @@ import UIKit
import Parse
class DoneViewController: UIViewController {


var Completed = [String]()
var OrderNumber: [Int] = []
var quantity: [Int] = []
var name: [String] = []

override func viewDidLoad() {
super.viewDidLoad()
let nib = UINib(nibName: "CurrentOrderTableViewCell", bundle: nil)
tableView.registerNib(nib, forCellReuseIdentifier: "Cell")

self.queryForCreditCard()
runQuery()
// Do any additional setup after loading the view.
}

@@ -25,12 +30,15 @@ class DoneViewController: UIViewController {
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return Completed.count
return OrderNumber.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell: CurrentOrderTableViewCell = self.tableView.dequeueReusableCellWithIdentifier("Cell") as! CurrentOrderTableViewCell
cell.name.text = name[indexPath.row]
cell.quantity.text = String(quantity[indexPath.row])
cell.orderNumber.text = String(OrderNumber[indexPath.row])
return cell
}

@@ -46,6 +54,36 @@ class DoneViewController: UIViewController {
}
}
}

func runQuery()
{
var query = PFQuery(className: "VendorDatabase")
query.findObjectsInBackgroundWithBlock{ (objects: [PFObject]?, error: NSError?) -> Void in
if error == nil
{
if objects == nil
{
print("Bhenchod")
}
else
{
print ("bc")
for eachObject in objects!
{
if (eachObject["IDNumber"] as! Int) == 3
{
self.OrderNumber.append(eachObject["OrderNumber"] as! Int)
self.quantity.append(eachObject["Quantity"] as! Int)
self.name.append(eachObject["Name"] as! String)
}
self.tableView.reloadData()
}
}
}
}

}


@IBOutlet weak var tableView: UITableView!

@@ -20,7 +20,7 @@
<rect key="frame" x="0.0" y="22" width="320" height="32"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="sHj-DW-X0Y">
@@ -0,0 +1,94 @@
//
// NewOrdersViewController.swift
// ParseStarterProject-Swift
//
// Created by Avirudh Theraja on 10/25/15.
// Copyright © 2015 Parse. All rights reserved.
//
import UIKit
import Parse

class NewOrdersViewController: UIViewController {
var OrderNumber: [Int] = []
var quantity: [Int] = []
var name: [String] = []

override func viewDidLoad() {
super.viewDidLoad()
let nib = UINib(nibName: "CurrentOrderTableViewCell", bundle: nil)
tableView.registerNib(nib, forCellReuseIdentifier: "Cell")
self.runQuery()
//self.tableView!.registerClass(CurrentOrderTableViewCell.self, forCellReuseIdentifier: "Cell")
// Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 40
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return OrderNumber.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell: CurrentOrderTableViewCell = self.tableView.dequeueReusableCellWithIdentifier("Cell") as! CurrentOrderTableViewCell;
cell.name.text = name[indexPath.row]
cell.quantity.text = String(quantity[indexPath.row])
cell.orderNumber.text = String(OrderNumber[indexPath.row])
return cell
}

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

}



@IBOutlet weak var tableView: UITableView!

func runQuery()
{
var query = PFQuery(className: "VendorDatabase")
query.findObjectsInBackgroundWithBlock{ (objects: [PFObject]?, error: NSError?) -> Void in
if error == nil
{
if objects == nil
{
print("Bhenchod")
}
else
{
print ("bc")
for eachObject in objects!
{
if (eachObject["IDNumber"] as! Int) == 0
{
self.OrderNumber.append(eachObject["OrderNumber"] as! Int)
self.quantity.append(eachObject["Quantity"] as! Int)
self.name.append(eachObject["Name"] as! String)
}
self.tableView.reloadData()
}
}
}
}

}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/

}
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="NewOrdersViewController" customModule="ParseStarterProject_Swift" customModuleProvider="target">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</objects>
</document>
@@ -7,18 +7,24 @@
//
import UIKit
import Parse

class PickupViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

override func viewDidLoad() {
super.viewDidLoad()
let nib = UINib(nibName: "CurrentOrderTableViewCell", bundle: nil)
tableView.registerNib(nib, forCellReuseIdentifier: "Cell")
runQuery()
// Do any additional setup after loading the view.
}

var itemsToBePickedUp = ["aa","lp"]

var OrderNumber: [Int] = []
var quantity: [Int] = []
var name: [String] = []

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
@@ -27,12 +33,45 @@ class PickupViewController: UIViewController, UITableViewDataSource, UITableView
@IBOutlet weak var tableView: UITableView!

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return itemsToBePickedUp.count
return OrderNumber.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell: CurrentOrderTableViewCell = self.tableView.dequeueReusableCellWithIdentifier("Cell") as! CurrentOrderTableViewCell
cell.name.text = name[indexPath.row]
cell.quantity.text = String(quantity[indexPath.row])
cell.orderNumber.text = String(OrderNumber[indexPath.row])
return cell
}

func runQuery()
{
var query = PFQuery(className: "VendorDatabase")
query.findObjectsInBackgroundWithBlock{ (objects: [PFObject]?, error: NSError?) -> Void in
if error == nil
{
if objects == nil
{
print("Bhenchod")
}
else
{
print ("bc")
for eachObject in objects!
{
if (eachObject["IDNumber"] as! Int) == 2
{
self.OrderNumber.append(eachObject["OrderNumber"] as! Int)
self.quantity.append(eachObject["Quantity"] as! Int)
self.name.append(eachObject["Name"] as! String)
}
self.tableView.reloadData()
}
}
}
}

}

}
@@ -38,7 +38,7 @@
<rect key="frame" x="0.0" y="14" width="320" height="51"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>