Permalink
Browse files

latest

  • Loading branch information...
1 parent 8aebbac commit 6aaf0c84eaeef89617d0bd86c09c31925f20f72b @jovhenni19 committed Dec 17, 2013
Showing 887 changed files with 106,000 additions and 306 deletions.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -142,13 +142,6 @@ - (void)viewDidLoad
self.activityIndicatorCountry.hidden = NO;
NSString *urlString = @"http://keydiscoveryinc.com/agent_bridge/webservice/getdb_country.php";
-// NSURLRequest *urlRequest = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]];
-//
-// self.urlConnectionCountry = [[HTTPURLConnection alloc] initWithRequest:urlRequest delegate:self startImmediately:YES];
-
-// self.actionSheetCountry = [[UIActionSheet alloc] initWithTitle:@"Country" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:nil];
-
-
__block NSError *errorData = nil;
__block ASIHTTPRequest *requestCountry = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:urlString]];
[requestCountry setCompletionBlock:^{
@@ -175,39 +168,6 @@ - (void)viewDidLoad
[self.self.arrayOfCountry_ID addObject:[entry objectForKey:@"countries_id"]];
}
-// NSManagedObjectContext *context = ((ABridge_AppDelegate *)[[UIApplication sharedApplication] delegate]).managedObjectContext;
-// for (NSDictionary *entry in [json objectForKey:@"data"]) {
-// Country *country = nil;
-//
-// NSPredicate * predicate = [NSPredicate predicateWithFormat:@"countries_id == %@", [entry objectForKey:@"countries_id"]];
-// NSArray *result = [self fetchObjectsWithEntityName:@"Country" andPredicate:predicate];
-// if ([result count]) {
-// country = (Country*)[result firstObject];
-// }
-// else {
-// country = [NSEntityDescription insertNewObjectForEntityForName: @"Country" inManagedObjectContext: context];
-// }
-//
-// [country setValuesForKeysWithDictionary:entry];
-//
-// NSError *error = nil;
-// if (![context save:&error]) {
-// NSLog(@"Error on saving Property:%@",[error localizedDescription]);
-// }
-// else {
-// if (self.arrayOfCountry == nil) {
-// self.arrayOfCountry = [[NSMutableArray alloc] init];
-// }
-//
-// [self.arrayOfCountry addObject:country.countries_name];
-// if (self.arrayOfCountry_ID == nil) {
-// self.arrayOfCountry_ID = [[NSMutableArray alloc] init];
-// }
-//
-// [self.arrayOfCountry_ID addObject:country.countries_id];
-// }
-// }
-
dispatch_async(dispatch_get_main_queue(), ^{
self.buttonCountry.enabled = YES;
@@ -235,12 +195,6 @@ - (void)viewDidLoad
self.activityIndicatorState.hidden = NO;
urlString = @"http://keydiscoveryinc.com/agent_bridge/webservice/getdb_state.php";
-// urlRequest = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]];
-//
-// self.urlConnectionState = [[HTTPURLConnection alloc] initWithRequest:urlRequest delegate:self startImmediately:YES];
-
-// self.actionSheetState = [[UIActionSheet alloc] initWithTitle:@"State" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:nil];
-
__block ASIHTTPRequest *requestState = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:urlString]];
[requestState setCompletionBlock:^{
// Use when fetching text data
@@ -257,35 +211,6 @@ - (void)viewDidLoad
[self.self.arrayOfState addObject:[entry objectForKey:@"zone_name"]];
}
-// NSManagedObjectContext *context = ((ABridge_AppDelegate *)[[UIApplication sharedApplication] delegate]).managedObjectContext;
-// for (NSDictionary *entry in [json objectForKey:@"data"]) {
-// State *state = nil;
-//
-// NSPredicate * predicate = [NSPredicate predicateWithFormat:@"zone_id == %@", [entry objectForKey:@"zone_id"]];
-// NSArray *result = [self fetchObjectsWithEntityName:@"State" andPredicate:predicate];
-// if ([result count]) {
-// state = (State*)[result firstObject];
-// }
-// else {
-// state = [NSEntityDescription insertNewObjectForEntityForName: @"State" inManagedObjectContext: context];
-// }
-//
-// [state setValuesForKeysWithDictionary:entry];
-//
-// NSError *error = nil;
-// if (![context save:&error]) {
-// NSLog(@"Error on saving Property:%@",[error localizedDescription]);
-// }
-// else {
-// if (self.arrayOfState == nil) {
-// self.arrayOfState = [[NSMutableArray alloc] init];
-// }
-//
-// [self.arrayOfState addObject:state.zone_name];
-// }
-// }
-
-
dispatch_async(dispatch_get_main_queue(), ^{
self.buttonState.enabled = YES;
self.buttonState.backgroundColor = [UIColor whiteColor];
@@ -342,197 +267,6 @@ - (void) addPaddingAndBorder:(UITextField*)textField color:(UIColor*)color {
textField.layer.borderWidth = 1.0f;
}
-- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse *)response
-{
- if (connection == self.urlConnectionState) {
-
- self.arrayOfState = nil;
-
- self.urlConnectionState.response = (NSHTTPURLResponse*)response;
- self.urlConnectionState.responseData = [[NSMutableData alloc] init];
- }
- else if (connection == self.urlConnectionCountry) {
-
- self.arrayOfCountry = nil;
- self.arrayOfCountry_ID = nil;
-
- self.urlConnectionCountry.response = (NSHTTPURLResponse*)response;
- self.urlConnectionCountry.responseData = [[NSMutableData alloc] init];
- }
-
-}
-- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data
-{
- //NSLog(@"Did Receive Data %@", data);
- if (connection == self.urlConnectionState) {
-
- [self.urlConnectionState.responseData appendData:data];
-
- }
- else if (connection == self.urlConnectionCountry) {
-
- [self.urlConnectionCountry.responseData appendData:data];
- }
-}
-- (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error
-{
- // NSLog(@"Did Fail");
-
-// [self.activityIndicator stopAnimating];
-// self.activityIndicator.hidden = YES;
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"No Internet Connection" message:@"You have no Internet Connection available." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
- [alert show];
- [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
-}
-- (void)connectionDidFinishLoading:(NSURLConnection *)connection
-{
-
- if (connection == self.urlConnectionState) {
- NSError *error = nil;
- NSDictionary *json = [NSJSONSerialization JSONObjectWithData:self.urlConnectionState.responseData options:NSJSONReadingAllowFragments error:&error];
-
-// NSLog(@"Did Finish:%@", json);
-
- if ([[json objectForKey:@"data"] count]) {
-
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-
-// NSManagedObjectContext *context = ((ABridge_AppDelegate *)[[UIApplication sharedApplication] delegate]).managedObjectContext;
-// for (NSDictionary *entry in [json objectForKey:@"data"]) {
-// State *state = nil;
-//
-// NSPredicate * predicate = [NSPredicate predicateWithFormat:@"zone_id == %@", [entry objectForKey:@"zone_id"]];
-// NSArray *result = [self fetchObjectsWithEntityName:@"State" andPredicate:predicate];
-// if ([result count]) {
-// state = (State*)[result firstObject];
-// }
-// else {
-// state = [NSEntityDescription insertNewObjectForEntityForName: @"State" inManagedObjectContext: context];
-// }
-//
-// [state setValuesForKeysWithDictionary:entry];
-//
-// NSError *error = nil;
-// if (![context save:&error]) {
-// NSLog(@"Error on saving Property:%@",[error localizedDescription]);
-// }
-// else {
-// if (self.arrayOfState == nil) {
-// self.arrayOfState = [[NSMutableArray alloc] init];
-// }
-//
-// [self.arrayOfState addObject:state.zone_name];
-// }
-// }
-
- if (self.arrayOfState == nil) {
- self.arrayOfState = [[NSMutableArray alloc] init];
- }
-
- for (NSDictionary *entry in [json objectForKey:@"data"]) {
- [self.self.arrayOfState addObject:[entry objectForKey:@"zone_name"]];
- }
-
- dispatch_async(dispatch_get_main_queue(), ^{
- self.buttonState.enabled = YES;
- self.buttonState.backgroundColor = [UIColor whiteColor];
- self.activityIndicatorState.hidden = YES;
-
-// for (NSString *state_name in self.arrayOfState) {
-// [self.actionSheetState addButtonWithTitle:state_name];
-// }
-
- [self.pickerState reloadAllComponents];
-
- [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
- [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
- });
-
- });
- }
- }
- else if (connection == self.urlConnectionCountry) {
-
- NSError *error = nil;
- NSDictionary *json = [NSJSONSerialization JSONObjectWithData:self.urlConnectionCountry.responseData options:NSJSONReadingAllowFragments error:&error];
-
-// NSLog(@"Did Finish:%@", json);
-
- if ([[json objectForKey:@"data"] count]) {
-
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-
-// NSManagedObjectContext *context = ((ABridge_AppDelegate *)[[UIApplication sharedApplication] delegate]).managedObjectContext;
-// for (NSDictionary *entry in [json objectForKey:@"data"]) {
-// Country *country = nil;
-//
-// NSPredicate * predicate = [NSPredicate predicateWithFormat:@"countries_id == %@", [entry objectForKey:@"countries_id"]];
-// NSArray *result = [self fetchObjectsWithEntityName:@"Country" andPredicate:predicate];
-// if ([result count]) {
-// country = (Country*)[result firstObject];
-// }
-// else {
-// country = [NSEntityDescription insertNewObjectForEntityForName: @"Country" inManagedObjectContext: context];
-// }
-//
-// [country setValuesForKeysWithDictionary:entry];
-//
-// NSError *error = nil;
-// if (![context save:&error]) {
-// NSLog(@"Error on saving Property:%@",[error localizedDescription]);
-// }
-// else {
-// if (self.arrayOfCountry == nil) {
-// self.arrayOfCountry = [[NSMutableArray alloc] init];
-// }
-//
-// [self.arrayOfCountry addObject:country.countries_name];
-// if (self.arrayOfCountry_ID == nil) {
-// self.arrayOfCountry_ID = [[NSMutableArray alloc] init];
-// }
-//
-// [self.arrayOfCountry_ID addObject:country.countries_id];
-// }
-// }
-
- if (self.arrayOfCountry == nil) {
- self.arrayOfCountry = [[NSMutableArray alloc] init];
- }
-
- for (NSDictionary *entry in [json objectForKey:@"data"]) {
- [self.self.arrayOfCountry addObject:[entry objectForKey:@"countries_name"]];
- }
-
-
- if (self.arrayOfCountry_ID == nil) {
- self.arrayOfCountry_ID = [[NSMutableArray alloc] init];
- }
-
- for (NSDictionary *entry in [json objectForKey:@"data"]) {
- [self.self.arrayOfCountry_ID addObject:[entry objectForKey:@"countries_id"]];
- }
-
- dispatch_async(dispatch_get_main_queue(), ^{
- self.buttonCountry.enabled = YES;
- self.buttonCountry.backgroundColor = [UIColor whiteColor];
- self.activityIndicatorCountry.hidden = YES;
-
-
-// for (NSString *country_name in self.arrayOfCountry) {
-// [self.actionSheetCountry addButtonWithTitle:country_name];
-// }
-
- [self.pickerCountry reloadAllComponents];
-
- [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
- [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
-
- });
- });
- }
- }
-}
-
//- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
//
@@ -565,7 +299,7 @@ - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row f
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
if (pickerView == self.pickerCountry) {
[self.buttonCountry setTitle:[self.arrayOfCountry objectAtIndex:row] forState:UIControlStateNormal];
- [self reloadStateValues:[self.arrayOfCountry_ID objectAtIndex:row]];
+// [self reloadStateValues:[self.arrayOfCountry_ID objectAtIndex:row]];
self.viewPickerCountry.hidden = YES;
}
else if (pickerView == self.pickerState) {
@@ -50,6 +50,7 @@ - (void)viewDidLoad
self.aboutMeTitle.font = FONT_OPENSANS_REGULAR(FONT_SIZE_TITLE);
self.brokerageHeader.font = FONT_OPENSANS_REGULAR(FONT_SIZE_REGULAR);
self.designationHeader.font = FONT_OPENSANS_REGULAR(FONT_SIZE_REGULAR);
+ self.labelNoneSpecified.font = FONT_OPENSANS_REGULAR(FONT_SIZE_REGULAR);
self.textFieldBrokerage.font = FONT_OPENSANS_REGULAR(FONT_SIZE_REGULAR);
self.buttonSave.titleLabel.font = FONT_OPENSANS_BOLD(FONT_SIZE_SMALL);
@@ -150,6 +151,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:self.dataReceived options:NSJSONReadingAllowFragments error:&error];
NSLog(@"Did Finish:%@", json);
+ self.labelNoneSpecified.hidden = YES;
if ([[json objectForKey:@"data"] count]) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@@ -248,6 +250,9 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
});
}
+ else {
+ self.labelNoneSpecified.hidden = NO;
+ }
[self.activityIndicator stopAnimating];
self.activityIndicator.hidden = YES;
@@ -0,0 +1,17 @@
+//
+// ABridge_FeeCollectionViewController.h
+// AgentBridge
+//
+// Created by host24_iOS Dev on 12/17/13.
+// Copyright (c) 2013 host24_iOS Dev. All rights reserved.
+//
+
+#import "ABridge_ParentViewController.h"
+#import "ASIHTTPRequest.h"
+#import "ASIFormDataRequest.h"
+
+@interface ABridge_FeeCollectionViewController : ABridge_ParentViewController <UITextFieldDelegate, UIScrollViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate>
+
+@property (assign, nonatomic) NSInteger referral_id;
+
+@end
Oops, something went wrong.

0 comments on commit 6aaf0c8

Please sign in to comment.