diff --git a/AppConstants/MCAConstant.h b/AppConstants/MCAConstant.h index dbf6988..65e21fb 100644 --- a/AppConstants/MCAConstant.h +++ b/AppConstants/MCAConstant.h @@ -11,6 +11,7 @@ //Main URL #define URL_MAIN @"http://122.176.45.15:8080/careerdefine/api/" +#define URL_APPLESTORE @"https://itunes.apple.com/" //Message #define INVALID_PWD @"Please enter valid password." @@ -84,9 +85,18 @@ #define NOTIFICATION_NOTES_CATEGORY_SUCCESS @"notificationNotesCategorySuccess" #define NOTIFICATION_NOTES_CATEGORY_FAILED @"notificationNotesCategoryFailed" +#define NOTIFICATION_RESOURCE_CATEGORY_SUCCESS @"notificationResourceCategorySuccess" +#define NOTIFICATION_RESOURCE_CATEGORY_FAILED @"notificationResourceCategoryFailed" + #define NOTIFICATION_NOTES_SUCCESS @"notificationNotesSuccess" #define NOTIFICATION_NOTES_FAILED @"notificationNotesFailed" +#define NOTIFICATION_RESOURCE_SUCCESS @"notificationResourcesSuccess" +#define NOTIFICATION_RESOURCE_FAILED @"notificationResourcesFailed" + +#define NOTIFICATION_RESOURCE_BOOK_SUCCESS @"notificationResourcesBookSuccess" +#define NOTIFICATION_RESOURCE_BOOK_FAILED @"notificationResourcesBookFailed" + #define NOTIFICATION_USER_PROFILE_EDIT_SUCCESS @"notificationUserProfileEditSuccess" #define NOTIFICATION_USER_PROFILE_EDIT_FAILED @"notificationUserProfileEditFailed" diff --git a/AppCoreData/MCADBIntraction.h b/AppCoreData/MCADBIntraction.h index 71271ed..4429b1e 100644 --- a/AppCoreData/MCADBIntraction.h +++ b/AppCoreData/MCADBIntraction.h @@ -32,4 +32,10 @@ -(void)insertNotesCatList:(NSMutableArray*)arr_notesCatList; -(NSMutableArray*)retrieveNotesCatList:(id)sender; + +#pragma mark - RESOURCE_QUERY +-(void)insertResourceCatList:(NSMutableArray*)arr_resourceList; +-(NSMutableArray*)retrieveResourceCatList:(id)sender; + + @end diff --git a/AppCoreData/MCADBIntraction.m b/AppCoreData/MCADBIntraction.m index fec48f0..fce4977 100644 --- a/AppCoreData/MCADBIntraction.m +++ b/AppCoreData/MCADBIntraction.m @@ -430,4 +430,62 @@ -(NSMutableArray*)retrieveNotesCatList:(id)sender{ return arr_dbNotesCatList; } +#pragma mark - RESOURCE_CATEGORY QUERY +-(void)insertResourceCatList:(NSMutableArray*)arr_resourceList{ + + for (int i=0; i + +@interface RFRateMe : NSObject + ++(void)showRateAlert; ++(void)showRateAlertAfterTimesOpened:(int)times; ++(void)showRateAlertAfterDays:(int)days; + + +@end diff --git a/AppExternal/RFRateMe.m b/AppExternal/RFRateMe.m new file mode 100644 index 0000000..86810aa --- /dev/null +++ b/AppExternal/RFRateMe.m @@ -0,0 +1,148 @@ +// +// RFRateMe.m +// RFRateMeDemo +// +// Created by Ricardo Funk on 1/2/14. +// Copyright (c) 2014 Ricardo Funk. All rights reserved. +// + +#import "RFRateMe.h" +#import "UIAlertView+NSCookbook.h" +#import "MCAConstant.h" + +#define kNumberOfDaysUntilShowAgain 3 +#define kAppStoreAddress URL_APPLESTORE +#define kAppName @"Moblie College Admin" + +@implementation RFRateMe + ++(void)showRateAlert { + + //If rate was completed, we just return if True + BOOL rateCompleted = [[NSUserDefaults standardUserDefaults] boolForKey:@"RFRateCompleted"]; + if (rateCompleted) return; + + //Check if the user asked not to be prompted again for 3 days (remind me later) + BOOL remindMeLater = [[NSUserDefaults standardUserDefaults] boolForKey:@"RFRemindMeLater"]; + + if (remindMeLater) { + + NSDateFormatter *DateFormatter=[[NSDateFormatter alloc] init]; + [DateFormatter setDateFormat:@"yyyy-MM-dd"]; + + NSString *start = [[NSUserDefaults standardUserDefaults] objectForKey:@"RFStartDate"]; + NSString *end = [DateFormatter stringFromDate:[NSDate date]]; + + NSDateFormatter *f = [[NSDateFormatter alloc] init]; + [f setDateFormat:@"yyyy-MM-dd"]; + NSDate *startDate = [f dateFromString:start]; + NSDate *endDate = [f dateFromString:end]; + + NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; + NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit + fromDate:startDate + toDate:endDate + options:0]; + + if ((long)[components day] <= kNumberOfDaysUntilShowAgain) return; + + } + + //Show rate alert + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(kAppName, @"") + message:[NSString stringWithFormat:@"If you enjoy %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!",kAppName] + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Never ask me again", @"") + otherButtonTitles:NSLocalizedString(@"Rate it now", @""),NSLocalizedString(@"Remind me later",@""), nil]; + + [alertView showWithCompletion:^(UIAlertView *alertView, NSInteger buttonIndex) { + + switch (buttonIndex) { + case 0: + + NSLog(@"No, thanks"); + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"RFRateCompleted"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + break; + case 1: + + NSLog(@"Rate it now"); + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"RFRateCompleted"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:kAppStoreAddress]]; + + break; + case 2: + + NSLog(@"Remind me later"); + NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *now = [NSDate date]; + [[NSUserDefaults standardUserDefaults] setObject:[dateFormatter stringFromDate:now] forKey:@"RFStartDate"]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"RFRemindMeLater"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + break; + } + }]; +} + ++(void)showRateAlertAfterTimesOpened:(int)times { + //Thanks @kylnew for feedback and idea! + + BOOL rateCompleted = [[NSUserDefaults standardUserDefaults] boolForKey:@"RFRateCompleted"]; + if (rateCompleted) return; + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + int timesOpened = (int)[defaults integerForKey:@"timesOpened"]; + [defaults setInteger:timesOpened+1 forKey:@"timesOpened"]; + [defaults synchronize]; + NSLog(@"App has been opened %ld times", (long)[defaults integerForKey:@"timesOpened"]); + if([defaults integerForKey:@"timesOpened"] >= times){ + [RFRateMe showRateAlert]; + } + + +} + + ++(void)showRateAlertAfterDays:(int)times { + + BOOL rateCompleted = [[NSUserDefaults standardUserDefaults] boolForKey:@"RFRateCompleted"]; + if (rateCompleted) return; + + BOOL showAfterXdays = [[NSUserDefaults standardUserDefaults] boolForKey:@"RFShowAfterXDays"]; + + if (!showAfterXdays) { + NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *now = [NSDate date]; + [[NSUserDefaults standardUserDefaults] setObject:[dateFormatter stringFromDate:now] forKey:@"RFGeneralStartDate"]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"RFShowAfterXDays"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + } + + NSDateFormatter *DateFormatter=[[NSDateFormatter alloc] init]; + [DateFormatter setDateFormat:@"yyyy-MM-dd"]; + + NSString *start = [[NSUserDefaults standardUserDefaults] objectForKey:@"RFGeneralStartDate"]; + NSString *end = [DateFormatter stringFromDate:[NSDate date]]; + + NSDateFormatter *f = [[NSDateFormatter alloc] init]; + [f setDateFormat:@"yyyy-MM-dd"]; + NSDate *startDate = [f dateFromString:start]; + NSDate *endDate = [f dateFromString:end]; + + NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; + NSDateComponents *components = [gregorianCalendar components:NSDayCalendarUnit + fromDate:startDate + toDate:endDate + options:0]; + + if ((long)[components day] <= times) return; + + +} + +@end diff --git a/AppExternal/UIAlertView+NSCookbook.h b/AppExternal/UIAlertView+NSCookbook.h new file mode 100755 index 0000000..470c7ab --- /dev/null +++ b/AppExternal/UIAlertView+NSCookbook.h @@ -0,0 +1,31 @@ +// +// UIAlertView+NSCookbook.h +// SimpleAlertViewSampleApp +// +// Copyright (c) 2013 NSCookbook. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface UIAlertView (NSCookbook) + +- (void)showWithCompletion:(void(^)(UIAlertView *alertView, NSInteger buttonIndex))completion; + +@end diff --git a/AppExternal/UIAlertView+NSCookbook.m b/AppExternal/UIAlertView+NSCookbook.m new file mode 100755 index 0000000..9bf0f72 --- /dev/null +++ b/AppExternal/UIAlertView+NSCookbook.m @@ -0,0 +1,75 @@ +// +// UIAlertView+NSCookbook.m +// SimpleAlertViewSampleApp +// +// Copyright (c) 2013 NSCookbook. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "UIAlertView+NSCookbook.h" + +@interface NSCBAlertWrapper : NSObject + +@property (copy) void(^completionBlock)(UIAlertView *alertView, NSInteger buttonIndex); + +@end + +@implementation NSCBAlertWrapper + +#pragma mark - UIAlertViewDelegate + +// Called when a button is clicked. The view will be automatically dismissed after this call returns +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (self.completionBlock) + self.completionBlock(alertView, buttonIndex); +} + +// Called when we cancel a view (eg. the user clicks the Home button). This is not called when the user clicks the cancel button. +// If not defined in the delegate, we simulate a click in the cancel button +- (void)alertViewCancel:(UIAlertView *)alertView +{ + // Just simulate a cancel button click + if (self.completionBlock) + self.completionBlock(alertView, alertView.cancelButtonIndex); +} + +@end + + +static const char kNSCBAlertWrapper; +@implementation UIAlertView (NSCookbook) + +#pragma mark - Class Public + +- (void)showWithCompletion:(void(^)(UIAlertView *alertView, NSInteger buttonIndex))completion +{ + NSCBAlertWrapper *alertWrapper = [[NSCBAlertWrapper alloc] init]; + alertWrapper.completionBlock = completion; + self.delegate = alertWrapper; + + // Set the wrapper as an associated object + objc_setAssociatedObject(self, &kNSCBAlertWrapper, alertWrapper, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + // Show the alert as normal + [self show]; +} + +@end diff --git a/AppModel/MCAResourcesBookDHolder.h b/AppModel/MCAResourcesBookDHolder.h new file mode 100644 index 0000000..76c80af --- /dev/null +++ b/AppModel/MCAResourcesBookDHolder.h @@ -0,0 +1,16 @@ +// +// MCAResourcesBookDHolder.h +// MobileCollegeAdmin +// +// Created by Dongjie Zhang on 9/16/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import + +@interface MCAResourcesBookDHolder : NSObject + +@property(nonatomic,strong)NSString *str_book_name; +@property(nonatomic,strong)NSString *str_url; + +@end diff --git a/AppModel/MCAResourcesBookDHolder.m b/AppModel/MCAResourcesBookDHolder.m new file mode 100644 index 0000000..77bad59 --- /dev/null +++ b/AppModel/MCAResourcesBookDHolder.m @@ -0,0 +1,15 @@ +// +// MCAResourcesBookDHolder.m +// MobileCollegeAdmin +// +// Created by Dongjie Zhang on 9/16/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourcesBookDHolder.h" + +@implementation MCAResourcesBookDHolder + +@synthesize str_url, str_book_name; + +@end diff --git a/AppModel/MCAResourcesCatDHolder.h b/AppModel/MCAResourcesCatDHolder.h new file mode 100644 index 0000000..2961d9b --- /dev/null +++ b/AppModel/MCAResourcesCatDHolder.h @@ -0,0 +1,18 @@ +// +// MCAResourcesCatDHolder.h +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import + +@interface MCAResourcesCatDHolder : NSObject{ + +} +@property(nonatomic,strong)NSString *str_resourcesCatId; +@property(nonatomic,strong)NSString *str_resourcesCatImage; +@property(nonatomic,strong)NSString *str_resourcesCatName; + +@end diff --git a/AppModel/MCAResourcesCatDHolder.m b/AppModel/MCAResourcesCatDHolder.m new file mode 100644 index 0000000..5ec1cd7 --- /dev/null +++ b/AppModel/MCAResourcesCatDHolder.m @@ -0,0 +1,14 @@ +// +// MCAResourcesCatDHolder.m +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourcesCatDHolder.h" + +@implementation MCAResourcesCatDHolder +@synthesize str_resourcesCatId,str_resourcesCatImage,str_resourcesCatName; + +@end diff --git a/AppModel/MCAResourcesDHolder.h b/AppModel/MCAResourcesDHolder.h new file mode 100644 index 0000000..52c9e94 --- /dev/null +++ b/AppModel/MCAResourcesDHolder.h @@ -0,0 +1,18 @@ +// +// MCAResourcesDHolder.h +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import + +@interface MCAResourcesDHolder : NSObject{ + +} +@property(nonatomic,strong)NSString *str_resourcesDataId; +@property(nonatomic,strong)NSString *str_book_name; +@property(nonatomic,strong)NSString *str_url; + +@end diff --git a/AppModel/MCAResourcesDHolder.m b/AppModel/MCAResourcesDHolder.m new file mode 100644 index 0000000..ec1ec01 --- /dev/null +++ b/AppModel/MCAResourcesDHolder.m @@ -0,0 +1,13 @@ +// +// MCAResourcesDHolder.m +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourcesDHolder.h" + +@implementation MCAResourcesDHolder +@synthesize str_book_name, str_resourcesDataId, str_url; +@end diff --git a/AppRestIntraction/MCARestIntraction.h b/AppRestIntraction/MCARestIntraction.h index d55e6a0..f5a4fe8 100644 --- a/AppRestIntraction/MCARestIntraction.h +++ b/AppRestIntraction/MCARestIntraction.h @@ -10,6 +10,9 @@ #import "JSON.h" #import "MCALoginDHolder.h" #import "MCANotesDHolder.h" +#import "MCAResourcesDHolder.h" +#import "MCAResourcesCatDHolder.h" +#import "MCAResourcesBookDHolder.h" #import "MCASignUpDHolder.h" #import "MCANotesCatDHolder.h" #import "ASIFormDataRequest.h" @@ -35,7 +38,10 @@ MCARestIntraction *restIntraction; -(void)requestForDeleteOrCompleteTask:(NSString*)info :(NSString*)controller; -(void)requestForAddTask:(NSString*)info; -(void)requestForNotesCategory:(NSString*)info; +-(void)requestForResourcesCategory:(NSString*)info; -(void)requestForNotes:(NSString*)info; +-(void)requestForResources:(NSString*)info; +-(void)requestForResourcesBook:(NSString*)info; -(void)requestForUserProfileEdit:(NSString *)info; -(void)requestForChangePwd:(NSString *)info; diff --git a/AppRestIntraction/MCARestIntraction.m b/AppRestIntraction/MCARestIntraction.m index 8b48a19..274758a 100644 --- a/AppRestIntraction/MCARestIntraction.m +++ b/AppRestIntraction/MCARestIntraction.m @@ -657,7 +657,7 @@ -(void)requestNotesCategorySuccess:(ASIFormDataRequest*)request{ SBJSON *parser=[[SBJSON alloc]init]; NSDictionary *results = [parser objectWithString:responseString error:nil]; - NSMutableDictionary *responseDict = ((NSMutableDictionary *)[results objectForKey:@"data"]); +// NSMutableDictionary *responseDict = ((NSMutableDictionary *)[results objectForKey:@"data"]); NSMutableArray *arr_notesCategory = (NSMutableArray*)[results objectForKey:@"data"]; NSString *status_code = [results valueForKey:@"status_code"]; @@ -774,7 +774,196 @@ -(void)requestNotesSuccess:(ASIFormDataRequest*)request{ } } +#pragma mark resources catrgory + + +-(void)requestForResourcesCategory:(NSString*)info{ + NSURL *url = [NSURL URLWithString:URL_MAIN]; + ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url]; + + [request setPostValue:info forKey:@"data"]; + + [request setDelegate:self]; + [request setDidFailSelector:@selector(requestResourceCategoryFail:)]; + [request setDidFinishSelector:@selector(requestResourceCategorySuccess:)]; + [request startAsynchronous]; + +} +-(void)requestResourceCategoryFail:(ASIFormDataRequest*)request{ + + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_CATEGORY_FAILED object:@"Unable to get category at this movement."]; + }); +} +-(void)requestResourceCategorySuccess:(ASIFormDataRequest*)request{ + + NSString *responseString = [request responseString]; + responseString = [[responseString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]] componentsJoinedByString:@""]; + responseString = [responseString stringByReplacingOccurrencesOfString:@"\t" withString:@""]; + SBJSON *parser=[[SBJSON alloc]init]; + + NSDictionary *results = [parser objectWithString:responseString error:nil]; +// NSMutableDictionary *responseDict = ((NSMutableDictionary *)[results objectForKey:@"data"]); + NSMutableArray *arr_resourceCategory = (NSMutableArray*)[results objectForKey:@"data"]; + NSString *status_code = [results valueForKey:@"status_code"]; + + if ([status_code isEqualToString:@"S1001"]) + { + NSMutableArray *arr_resourcesCategoryList = [NSMutableArray new]; + + for (int i = 0; i < arr_resourceCategory.count; i++) { + + MCAResourcesCatDHolder *resourceDHolder = [MCAResourcesCatDHolder new]; + resourceDHolder.str_resourcesCatId = [[arr_resourceCategory valueForKey:@"resource_id"] objectAtIndex:i]; + resourceDHolder.str_resourcesCatName = [[arr_resourceCategory valueForKey:@"resource_name"] objectAtIndex:i]; + resourceDHolder.str_resourcesCatImage = [[arr_resourceCategory valueForKey:@"resource_cat_image"] objectAtIndex:i]; + [arr_resourcesCategoryList addObject:resourceDHolder]; + } + if (![[[NSUserDefaults standardUserDefaults]valueForKey:KEY_USER_TYPE] isEqualToString:@"p"]) + { + [arr_resourcesCategoryList removeObjectAtIndex:0]; + } + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_CATEGORY_SUCCESS object:arr_resourcesCategoryList]; + }); + } + else{ + + NSString *errMsg = [results valueForKey:@"msg"]; + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_CATEGORY_FAILED object:errMsg]; + }); + } +} + +#pragma mark - RESOURCES + +-(void)requestForResources:(NSString *)info{ + + NSURL *url = [NSURL URLWithString:URL_MAIN]; + ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url]; + + [request setPostValue:info forKey:@"data"]; + + [request setDelegate:self]; + [request setDidFailSelector:@selector(requestResourcesFail:)]; + [request setDidFinishSelector:@selector(requestResourcesSuccess:)]; + [request startAsynchronous]; +} +-(void)requestResourcesFail:(ASIFormDataRequest*)request{ + + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_FAILED object:@"Unable to get resource at this movement."]; + }); +} +-(void)requestResourcesSuccess:(ASIFormDataRequest*)request{ + + NSString *responseString = [request responseString]; + responseString = [[responseString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]] componentsJoinedByString:@""]; + responseString = [responseString stringByReplacingOccurrencesOfString:@"\t" withString:@""]; + SBJSON *parser=[[SBJSON alloc]init]; + + NSDictionary *results = [parser objectWithString:responseString error:nil]; + //NSMutableDictionary *responseDict = ((NSMutableDictionary *)[results objectForKey:@"data"]); + + NSMutableArray *arr_resources = (NSMutableArray*)[results objectForKey:@"data"]; + NSString *status_code = [results valueForKey:@"status_code"]; + + if ([status_code isEqualToString:@"S1001"]) + { + NSMutableArray *arr_resourcesList = [NSMutableArray new]; + + for (int i = 0; i < arr_resources.count; i++) + { + MCAResourcesDHolder *reDHolder = [MCAResourcesDHolder new]; + + reDHolder.str_resourcesDataId = [[arr_resources valueForKey:@"resource_data_id"] objectAtIndex:i]; + reDHolder.str_url = [[arr_resources valueForKey:@"resource_url"] objectAtIndex:i]; + reDHolder.str_book_name = [[arr_resources valueForKey:@"book_name"] objectAtIndex:i]; + [arr_resourcesList addObject:reDHolder]; + } + + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_SUCCESS object:arr_resourcesList]; + }); + } + else{ + + NSString *errMsg = [results valueForKey:@"msg"]; + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_FAILED object:errMsg]; + }); + } +} + +#pragma mark - RESOURCES_BOOK + +-(void)requestForResourcesBook:(NSString *)info{ + + NSURL *url = [NSURL URLWithString:URL_MAIN]; + ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url]; + + [request setPostValue:info forKey:@"data"]; + + [request setDelegate:self]; + [request setDidFailSelector:@selector(requestResourcesBookFail:)]; + [request setDidFinishSelector:@selector(requestResourcesBookSuccess:)]; + [request startAsynchronous]; +} +-(void)requestResourcesBookFail:(ASIFormDataRequest*)request{ + + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_FAILED object:@"Unable to get resource Book at this movement."]; + }); +} +-(void)requestResourcesBookSuccess:(ASIFormDataRequest*)request{ + + NSString *responseString = [request responseString]; + responseString = [[responseString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]] componentsJoinedByString:@""]; + responseString = [responseString stringByReplacingOccurrencesOfString:@"\t" withString:@""]; + SBJSON *parser=[[SBJSON alloc]init]; + + NSDictionary *results = [parser objectWithString:responseString error:nil]; + //NSMutableDictionary *responseDict = ((NSMutableDictionary *)[results objectForKey:@"data"]); + + NSMutableArray *arr_resourcesBook = (NSMutableArray*)[results objectForKey:@"data"]; + NSString *status_code = [results valueForKey:@"status_code"]; + + if ([status_code isEqualToString:@"S1001"]) + { + NSMutableArray *arr_resourcesBookList = [NSMutableArray new]; + + for (int i = 0; i < arr_resourcesBook.count; i++) + { + MCAResourcesBookDHolder *reDHolder = [MCAResourcesBookDHolder new]; + + reDHolder.str_url = [[arr_resourcesBook valueForKey:@"book_url"] objectAtIndex:i]; + reDHolder.str_book_name = [[arr_resourcesBook valueForKey:@"book_name"] objectAtIndex:i]; + [arr_resourcesBookList addObject:reDHolder]; + } + + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_BOOK_SUCCESS object:arr_resourcesBookList]; + }); + } + else{ + + NSString *errMsg = [results valueForKey:@"msg"]; + dispatch_async(dispatch_get_main_queue(), ^ + { + [[NSNotificationCenter defaultCenter]postNotificationName:NOTIFICATION_RESOURCE_BOOK_FAILED object:errMsg]; + }); + } +} #pragma mark - USER_PROFILE_EDIT -(void)requestForUserProfileEdit:(NSString *)info{ diff --git a/AppUI/AppController/MCAMoreViewController.m b/AppUI/AppController/MCAMoreViewController.m index 3a626e1..674eea2 100644 --- a/AppUI/AppController/MCAMoreViewController.m +++ b/AppUI/AppController/MCAMoreViewController.m @@ -34,6 +34,8 @@ - (void)viewDidLoad arr_moreImageList = [[NSMutableArray alloc]initWithObjects:@"setting.png",@"share.png",@"feedback.png",@"logout.png", nil]; tbl_moreOption.tableFooterView = [[UIView alloc] init]; + + [RFRateMe showRateAlertAfterTimesOpened:1]; } - (void)didReceiveMemoryWarning @@ -92,4 +94,5 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath * [self performSegueWithIdentifier:@"segue_setting" sender:nil]; } } + @end diff --git a/AppUI/AppController/tabBar/MCAResourceCell.h b/AppUI/AppController/tabBar/MCAResourceCell.h new file mode 100644 index 0000000..c36ecc1 --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourceCell.h @@ -0,0 +1,14 @@ +// +// MCAResourceCell.h +// MobileCollegeAdmin +// +// Created by Dongjie Zhang on 9/14/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import + +@interface MCAResourceCell : UITableViewCell + +@property (strong, nonatomic) IBOutlet UILabel *urlLabel; +@end diff --git a/AppUI/AppController/tabBar/MCAResourceCell.m b/AppUI/AppController/tabBar/MCAResourceCell.m new file mode 100644 index 0000000..9e3c8b8 --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourceCell.m @@ -0,0 +1,35 @@ +// +// MCAResourceCell.m +// MobileCollegeAdmin +// +// Created by Dongjie Zhang on 9/14/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourceCell.h" + +@implementation MCAResourceCell + + +- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier +{ + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + // Initialization code + } + return self; +} + +- (void)awakeFromNib +{ + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/AppUI/AppController/tabBar/MCAResourcesBookController.h b/AppUI/AppController/tabBar/MCAResourcesBookController.h new file mode 100644 index 0000000..80a5401 --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourcesBookController.h @@ -0,0 +1,21 @@ +// +// MCAResourcesBookController.h +// MobileCollegeAdmin +// +// Created by Dongjie Zhang on 9/16/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import +#import "MCAResourcesBookDHolder.h" + +@interface MCAResourcesBookController : UIViewController +{ + IBOutlet UITableView *tbl_book; + NSMutableArray *arr_book; + AryaHUD *HUD; +} + + + +@end diff --git a/AppUI/AppController/tabBar/MCAResourcesBookController.m b/AppUI/AppController/tabBar/MCAResourcesBookController.m new file mode 100644 index 0000000..0902262 --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourcesBookController.m @@ -0,0 +1,136 @@ +// +// MCAResourcesBookController.m +// MobileCollegeAdmin +// +// Created by Dongjie Zhang on 9/16/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourcesBookController.h" + +@interface MCAResourcesBookController () + +@end + +@implementation MCAResourcesBookController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + HUD = [AryaHUD new]; + [self.view addSubview:HUD]; + + arr_book = [NSMutableArray new]; + + self.navigationItem.title = @"Resources"; + + + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(resourceBookFailed:) name:NOTIFICATION_RESOURCE_BOOK_FAILED object:nil]; + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(resourceBookSuccess:) name:NOTIFICATION_RESOURCE_BOOK_SUCCESS object:nil]; + + [self getResourcesBook]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(void)getResourcesBook{ + + NSMutableDictionary * info = [NSMutableDictionary new]; + + [info setValue:@"get_book_for_parent" forKey:@"cmd"]; + [info setValue:@"en_us" forKey:@"language_code"]; + + NSString *str_jsonNotes = [NSString getJsonObject:info]; + [HUD showForTabBar]; + [self.view bringSubviewToFront:HUD]; + [self requestResourceBook:str_jsonNotes]; + +} +#pragma mark - API CALLING + +-(void)requestResourceBook:(NSString*)info{ + + if ([MCAGlobalFunction isConnectedToInternet]) { + + [[MCARestIntraction sharedManager] requestForResourcesBook:info]; + + }else{ + + [HUD hide]; + } +} + +#pragma mark - NSNOTIFICATION SELECTOR + +-(void)resourceBookSuccess:(NSNotification*)notification{ + + [HUD hide]; + arr_book = notification.object; + [tbl_book reloadData]; + //[self writeToFile:nil]; + +} +-(void)resourceBookFailed:(NSNotification*)notification{ + + [HUD hide]; +} + + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + return 42; + +} +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return arr_book.count; + +} +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + MCAResourcesBookDHolder *reDHolder = (MCAResourcesBookDHolder*)[arr_book objectAtIndex:indexPath.row]; + static NSString *cellIdentifier = @"resourcesBookCell"; + UITableViewCell *cell = nil; + cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) + { + cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:cellIdentifier]; + } + UILabel *lbl_catName = (UILabel *)[cell.contentView viewWithTag:2]; + lbl_catName.text = reDHolder.str_book_name; + + UIImageView *img=(UIImageView *)[cell.contentView viewWithTag:1]; + [img removeFromSuperview]; + img = nil; + img = [[UIImageView alloc]initWithFrame:CGRectMake(10, 8, 26, 26)]; + img.tag = 1; + [cell.contentView addSubview:img]; + UIImage *img_web = [UIImage imageNamed:@"web.png"]; + [img setImage:img_web]; + + tbl_book.separatorStyle = UITableViewCellSeparatorStyleSingleLine; + + return cell; + +} + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + MCAResourcesBookDHolder *reDHolder = (MCAResourcesBookDHolder*)[arr_book objectAtIndex:indexPath.row]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:reDHolder.str_url]]; +} +@end diff --git a/AppUI/AppController/tabBar/MCAResourcesCategoryViewController.h b/AppUI/AppController/tabBar/MCAResourcesCategoryViewController.h new file mode 100644 index 0000000..e88cebf --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourcesCategoryViewController.h @@ -0,0 +1,19 @@ +// +// MCAResourcesCategoryViewController.h +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import + +@interface MCAResourcesCategoryViewController : UIViewController{ + + IBOutlet UITableView *tbl_resourcesCategory; + + NSMutableArray *arr_resourcesCategory; + + AryaHUD *HUD; +} +@end diff --git a/AppUI/AppController/tabBar/MCAResourcesCategoryViewController.m b/AppUI/AppController/tabBar/MCAResourcesCategoryViewController.m new file mode 100644 index 0000000..b62c1a3 --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourcesCategoryViewController.m @@ -0,0 +1,190 @@ +// +// MCAResourcesCategoryViewController.m +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourcesCategoryViewController.h" +#import "MCAResourcesViewController.h" + +@interface MCAResourcesCategoryViewController () + +@end + +@implementation MCAResourcesCategoryViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + UIImage* img_book = [UIImage imageNamed:@"book.png"]; + CGRect img_bookFrame = CGRectMake(0, 0, img_book.size.width, img_book.size.height); + UIButton *btn_book = [[UIButton alloc] initWithFrame:img_bookFrame]; + [btn_book setBackgroundImage:img_book forState:UIControlStateNormal]; + [btn_book addTarget:self + action:@selector(btnBookDidClicked:) + forControlEvents:UIControlEventTouchUpInside]; + [btn_book setShowsTouchWhenHighlighted:YES]; + UIBarButtonItem *btnBar_book =[[UIBarButtonItem alloc] initWithCustomView:btn_book]; + if ([[[NSUserDefaults standardUserDefaults]valueForKey:KEY_USER_TYPE] isEqualToString:@"p"]){ + [self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:btnBar_book,nil]]; + } + + HUD = [AryaHUD new]; + [self.view addSubview:HUD]; + arr_resourcesCategory = [NSMutableArray new]; + + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(resourcesCategoryFailed:) name:NOTIFICATION_RESOURCE_CATEGORY_FAILED object:nil]; + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(resourcesCategorySuccess:) name:NOTIFICATION_RESOURCE_CATEGORY_SUCCESS object:nil]; + + [self getResourcesCategory:nil]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +#pragma mark - UITABLEVIEW DELEGATE AND DATASOURCE METHODS + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + return 42; + +} +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return arr_resourcesCategory.count; +} +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *cellIdentifier = @"resourcesCell"; + UITableViewCell *cell = nil; + cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) + { + cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:cellIdentifier]; + } + MCAResourcesCatDHolder *reDHolder = (MCAResourcesCatDHolder*)[arr_resourcesCategory objectAtIndex:indexPath.row]; + UILabel *lbl_catName = (UILabel *)[cell.contentView viewWithTag:2]; + lbl_catName.text = reDHolder.str_resourcesCatName; + + UIImageView *img_cat=(UIImageView *)[cell.contentView viewWithTag:1]; + [img_cat removeFromSuperview]; + img_cat = nil; + img_cat = [[UIImageView alloc]initWithFrame:CGRectMake(10, 8, 26, 26)]; + img_cat.tag = 1; + [cell.contentView addSubview:img_cat]; + + [img_cat setImageWithUrl:[NSURL URLWithString:reDHolder.str_resourcesCatImage] + andPlaceHoder:[UIImage imageNamed:PLACEHOLDER_IMAGE] + andNoImage:[UIImage imageNamed:NO_IMAGE]]; + + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + + return cell; + +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + + MCAResourcesCatDHolder *reDHolder = (MCAResourcesCatDHolder*)[arr_resourcesCategory objectAtIndex:indexPath.row];\ + if ([reDHolder.str_resourcesCatId isEqualToString:@"10"]) { + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Mobile College Admin" message:@"You have to purchase for this version. Do you want to purchase?" delegate:self cancelButtonTitle:@"NO" otherButtonTitles:@"Yes", nil]; + alert.backgroundColor = [UIColor blueColor]; + [alert show]; + } + else + [self performSegueWithIdentifier:@"segue_resources" sender:reDHolder]; + +} + + +-(void)alertView:(UIAlertView*)alterView clickedButtonAtIndex:(NSInteger)buttonIndex{ + if (buttonIndex == 1) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URL_APPLESTORE]]; + } +} + + +-(void)getResourcesCategory:(id)sender{ + + NSMutableDictionary * info = [NSMutableDictionary new]; + + [info setValue:@"get_resource_category" forKey:@"cmd"]; + [info setValue:@"en_us" forKey:@"language_code"]; + + NSString *str_jsonCategory = [NSString getJsonObject:info]; + [HUD showForTabBar]; + [self.view bringSubviewToFront:HUD]; + [self requestResourcesCategory:str_jsonCategory]; + +} + +-(void)requestResourcesCategory:(NSString*)info{ + + if ([MCAGlobalFunction isConnectedToInternet]) { + + [[MCARestIntraction sharedManager]requestForResourcesCategory:info]; + + }else{ + + [HUD hide]; + arr_resourcesCategory = [[MCADBIntraction databaseInteractionManager] retrieveResourceCatList: nil]; + if (![[[NSUserDefaults standardUserDefaults]valueForKey:KEY_USER_TYPE] isEqualToString:@"p"]) + { + for (int i = 0; i +#import "MCAResourceCell.h" + +@interface MCAResourcesDetailViewController : UIViewController +{ + IBOutlet UITableView* tbl_url; + NSMutableArray *arr_url; +} + +@property (strong, nonatomic)MCAResourceCell *detailCell; +@property(nonatomic, strong)MCAResourcesDHolder* reDHolder; +@property (strong, nonatomic)NSMutableArray *arr_resources; + + +@end diff --git a/AppUI/AppController/tabBar/MCAResourcesDetailViewController.m b/AppUI/AppController/tabBar/MCAResourcesDetailViewController.m new file mode 100644 index 0000000..5adb25f --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourcesDetailViewController.m @@ -0,0 +1,139 @@ +// +// MCAResourcesDetailViewController.m +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourcesDetailViewController.h" + +@interface MCAResourcesDetailViewController () + +@end + +@implementation MCAResourcesDetailViewController + +@synthesize reDHolder, detailCell, arr_resources; + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + arr_url = [NSMutableArray new]; + + self.navigationItem.title = reDHolder.str_book_name; + NSArray * arr_url_old = [reDHolder.str_url componentsSeparatedByString:@"]["]; + for(NSString* strl in arr_url_old){ + if ([strl rangeOfString:@"\\n"].location != NSNotFound) { + NSArray *arr_str = [strl componentsSeparatedByString:@"\\n"]; + for (NSString* strs in arr_str) { + NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@"\\[]\""]; + NSString *str = [[strs componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @""]; + [arr_url addObject:str]; + } + }else{ + NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@"\\[]\""]; + NSString *str = [[strl componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @""]; + [arr_url addObject:str]; + } + + } + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(didChangePreferredContentSize:) + name:UIContentSizeCategoryDidChangeNotification object:nil]; + tbl_url.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; + + // Do any additional setup after loading the view. +} + +- (void)didChangePreferredContentSize:(NSNotification *)notification +{ + [tbl_url reloadData]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return arr_url.count; + +} +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + + + + static NSString *cellIdentifier = @"urlCell"; + UITableViewCell *cell = nil; + cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) + { + cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:cellIdentifier]; + } + NSString* str = [arr_url objectAtIndex:indexPath.row]; + UIImageView *img_cat=(UIImageView *)[cell.contentView viewWithTag:1]; + [img_cat removeFromSuperview]; + img_cat = nil; + img_cat = [[UIImageView alloc]initWithFrame:CGRectMake(10, 8, 26, 26)]; + img_cat.tag = 1; + [cell.contentView addSubview:img_cat]; + UILabel *lbl_catName = (UILabel *)[cell.contentView viewWithTag:2]; + + if ([reDHolder.str_url rangeOfString:@"http"].location == NSNotFound) { + UIImage *img_book = [UIImage imageNamed:@"book.png"]; + [img_cat setImage:img_book]; + lbl_catName.text = str; + }else{ + UIImage *img_web = [UIImage imageNamed:@"web.png"]; + [img_cat setImage:img_web]; + lbl_catName.text = str; + }; + + lbl_catName.numberOfLines = 0; + lbl_catName.lineBreakMode = NSLineBreakByWordWrapping; + [lbl_catName sizeToFit]; + + tbl_url.separatorStyle = UITableViewCellSeparatorStyleSingleLine; + + return cell; +} + +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + NSString* str = [arr_url objectAtIndex:indexPath.row]; + CGSize widthSize = CGSizeMake(236,9999); + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping; + CGRect textRect = [str boundingRectWithSize:widthSize + options:NSStringDrawingUsesLineFragmentOrigin + attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.0f],NSParagraphStyleAttributeName: paragraphStyle.copy} + context:nil]; + CGSize size = textRect.size; + CGFloat height = MAX(size.height, 42.0f); + return height; +} + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + NSString *str = [arr_url objectAtIndex:indexPath.row]; + if ([str rangeOfString:@"http"].location!= NSNotFound) { + NSString *url = [str substringFromIndex:[str rangeOfString:@"http"].location]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; + } +} + + + +@end diff --git a/AppUI/AppController/tabBar/MCAResourcesViewController.h b/AppUI/AppController/tabBar/MCAResourcesViewController.h new file mode 100644 index 0000000..1d1a29e --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourcesViewController.h @@ -0,0 +1,21 @@ +// +// MCAResourcesViewController.h +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import +#import "MCAResourcesDetailViewController.h" + +@interface MCAResourcesViewController : UIViewController +{ + IBOutlet UITableView *tbl_resources; + NSMutableArray *arr_resources; + AryaHUD *HUD; +} + +@property(nonatomic,strong)MCAResourcesCatDHolder *reCatDHolder; + +@end diff --git a/AppUI/AppController/tabBar/MCAResourcesViewController.m b/AppUI/AppController/tabBar/MCAResourcesViewController.m new file mode 100644 index 0000000..e373f27 --- /dev/null +++ b/AppUI/AppController/tabBar/MCAResourcesViewController.m @@ -0,0 +1,147 @@ +// +// MCAResourcesViewController.m +// MobileCollegeAdmin +// +// Created by rashmi on 9/12/14. +// Copyright (c) 2014 arya. All rights reserved. +// + +#import "MCAResourcesViewController.h" + +@interface MCAResourcesViewController () + +@end + +@implementation MCAResourcesViewController +@synthesize reCatDHolder; + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + HUD = [AryaHUD new]; + [self.view addSubview:HUD]; + + arr_resources = [NSMutableArray new]; + + self.navigationItem.title = reCatDHolder.str_resourcesCatName; + + + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(resourceFailed:) name:NOTIFICATION_RESOURCE_FAILED object:nil]; + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(resourceSuccess:) name:NOTIFICATION_RESOURCE_SUCCESS object:nil]; + + [self getResources:reCatDHolder.str_resourcesCatId]; + // Do any additional setup after loading the view. +} +-(void)getResources:(id)sender{ + + NSMutableDictionary * info = [NSMutableDictionary new]; + + [info setValue:@"get_resource" forKey:@"cmd"]; + [info setValue:@"en_us" forKey:@"language_code"]; + [info setValue:sender forKey:@"resource_id"]; + + NSString *str_jsonNotes = [NSString getJsonObject:info]; + [HUD showForTabBar]; + [self.view bringSubviewToFront:HUD]; + [self requestResource:str_jsonNotes]; + +} +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +#pragma mark - API CALLING + +-(void)requestResource:(NSString*)info{ + + if ([MCAGlobalFunction isConnectedToInternet]) { + + [[MCARestIntraction sharedManager] requestForResources:info]; + + }else{ + + [HUD hide]; + } +} + +#pragma mark - NSNOTIFICATION SELECTOR + +-(void)resourceSuccess:(NSNotification*)notification{ + + [HUD hide]; + arr_resources = notification.object; + [tbl_resources reloadData]; + //[self writeToFile:nil]; + +} +-(void)resourceFailed:(NSNotification*)notification{ + + [HUD hide]; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + return 42; + +} +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return arr_resources.count; + +} +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + MCAResourcesDHolder *reDHolder = (MCAResourcesDHolder*)[arr_resources objectAtIndex:indexPath.row]; + static NSString *cellIdentifier = @"resourcesViewCell"; + UITableViewCell *cell = nil; + cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + if (!cell) + { + cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:cellIdentifier]; + } + MCAResourcesDHolder *reDholder = (MCAResourcesDHolder*)[arr_resources objectAtIndex:indexPath.row]; + UILabel *lbl_catName = (UILabel *)[cell.contentView viewWithTag:2]; + lbl_catName.text = reDholder.str_book_name; + + UIImageView *img_cat=(UIImageView *)[cell.contentView viewWithTag:1]; + [img_cat removeFromSuperview]; + img_cat = nil; + img_cat = [[UIImageView alloc]initWithFrame:CGRectMake(10, 8, 26, 26)]; + img_cat.tag = 1; + [cell.contentView addSubview:img_cat]; + UIImage *img_book = [UIImage imageNamed:@"book.png"]; + [img_cat setImage:img_book]; + + tbl_resources.separatorStyle = UITableViewCellSeparatorStyleSingleLine; + + return cell; + +} +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + MCAResourcesDHolder *reDHolder = (MCAResourcesDHolder*)[arr_resources objectAtIndex:indexPath.row]; + [self performSegueWithIdentifier:@"segue_url" sender:reDHolder]; +} + +#pragma mark - OTHER_METHOD + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ + + if ([segue.identifier isEqualToString:@"segue_url"]) { + MCAResourcesDetailViewController * reDetailCtr = (MCAResourcesDetailViewController*)[segue destinationViewController]; + reDetailCtr.reDHolder = (MCAResourcesDHolder*)sender; + } +} + +@end diff --git a/AppUI/AppController/tabBar/MCATaskViewController.m b/AppUI/AppController/tabBar/MCATaskViewController.m index 42b8167..b99aacd 100644 --- a/AppUI/AppController/tabBar/MCATaskViewController.m +++ b/AppUI/AppController/tabBar/MCATaskViewController.m @@ -1044,4 +1044,5 @@ -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ } } + @end diff --git a/Images.xcassets/book.imageset/Contents.json b/Images.xcassets/book.imageset/Contents.json new file mode 100644 index 0000000..e906f5d --- /dev/null +++ b/Images.xcassets/book.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "book.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "book@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Images.xcassets/book.imageset/book.png b/Images.xcassets/book.imageset/book.png new file mode 100644 index 0000000..079a17b Binary files /dev/null and b/Images.xcassets/book.imageset/book.png differ diff --git a/Images.xcassets/book.imageset/book@2x.png b/Images.xcassets/book.imageset/book@2x.png new file mode 100644 index 0000000..1fb4ec9 Binary files /dev/null and b/Images.xcassets/book.imageset/book@2x.png differ diff --git a/Images.xcassets/camera-1.imageset/Contents.json b/Images.xcassets/camera-1.imageset/Contents.json new file mode 100644 index 0000000..92c9f68 --- /dev/null +++ b/Images.xcassets/camera-1.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "camera.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "camera@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Images.xcassets/camera-1.imageset/camera.png b/Images.xcassets/camera-1.imageset/camera.png new file mode 100644 index 0000000..af8dab9 Binary files /dev/null and b/Images.xcassets/camera-1.imageset/camera.png differ diff --git a/Images.xcassets/camera-1.imageset/camera@2x.png b/Images.xcassets/camera-1.imageset/camera@2x.png new file mode 100644 index 0000000..5cebe92 Binary files /dev/null and b/Images.xcassets/camera-1.imageset/camera@2x.png differ diff --git a/Images.xcassets/web.imageset/Contents.json b/Images.xcassets/web.imageset/Contents.json new file mode 100644 index 0000000..ea0a81b --- /dev/null +++ b/Images.xcassets/web.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "web.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "web@2x.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Images.xcassets/web.imageset/web.png b/Images.xcassets/web.imageset/web.png new file mode 100644 index 0000000..4df2cbc Binary files /dev/null and b/Images.xcassets/web.imageset/web.png differ diff --git a/Images.xcassets/web.imageset/web@2x.png b/Images.xcassets/web.imageset/web@2x.png new file mode 100644 index 0000000..5194589 Binary files /dev/null and b/Images.xcassets/web.imageset/web@2x.png differ diff --git a/Main_Iphone.storyboard b/Main_Iphone.storyboard index 3be4054..2878a81 100644 --- a/Main_Iphone.storyboard +++ b/Main_Iphone.storyboard @@ -1,5 +1,5 @@ - + @@ -1384,7 +1384,7 @@ - + @@ -1456,7 +1456,7 @@ - + @@ -1525,7 +1525,7 @@ - + @@ -1796,7 +1796,7 @@ - + @@ -1840,7 +1840,7 @@ - + @@ -1942,7 +1942,7 @@ - + @@ -1991,7 +1991,7 @@ - + @@ -2014,20 +2014,116 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2125,7 +2221,7 @@ - + @@ -2136,16 +2232,22 @@ + + + + + + - + @@ -2186,7 +2288,7 @@ - + @@ -2207,7 +2309,7 @@ - + @@ -2516,7 +2618,7 @@ - + @@ -2622,7 +2724,7 @@ - + @@ -2673,7 +2775,116 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2703,8 +2914,8 @@ - - + + diff --git a/MobileCollegeAdmin.xcodeproj/project.pbxproj b/MobileCollegeAdmin.xcodeproj/project.pbxproj index 7c27901..d8c01f3 100644 --- a/MobileCollegeAdmin.xcodeproj/project.pbxproj +++ b/MobileCollegeAdmin.xcodeproj/project.pbxproj @@ -7,6 +7,16 @@ objects = { /* Begin PBXBuildFile section */ + 0A3824B119C39DE700662A39 /* MCAResourcesCatDHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A3824B019C39DE700662A39 /* MCAResourcesCatDHolder.m */; }; + 0A3824B419C39E0000662A39 /* MCAResourcesDHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A3824B319C39E0000662A39 /* MCAResourcesDHolder.m */; }; + 0A8BC6E019C39542007C2CB3 /* MCAResourcesCategoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A8BC6DF19C39542007C2CB3 /* MCAResourcesCategoryViewController.m */; }; + 0A8BC6E319C3955C007C2CB3 /* MCAResourcesDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A8BC6E219C3955C007C2CB3 /* MCAResourcesDetailViewController.m */; }; + 0A8BC6E619C395E2007C2CB3 /* MCAResourcesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A8BC6E519C395E2007C2CB3 /* MCAResourcesViewController.m */; }; + B6DF3B9119C69A44007AE61B /* MCAResourceCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B6DF3B9019C69A44007AE61B /* MCAResourceCell.m */; }; + B6E323F019C7902300C12AAF /* RFRateMe.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E323ED19C7902300C12AAF /* RFRateMe.m */; }; + B6E323F119C7902300C12AAF /* UIAlertView+NSCookbook.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E323EF19C7902300C12AAF /* UIAlertView+NSCookbook.m */; }; + B6E7966D19C8ADBD00858B66 /* MCAResourcesBookController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E7966C19C8ADBD00858B66 /* MCAResourcesBookController.m */; }; + B6E7967019C8B60500858B66 /* MCAResourcesBookDHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E7966F19C8B60500858B66 /* MCAResourcesBookDHolder.m */; }; CE0D694F1995DC5C009C0DBE /* MCADBIntraction.m in Sources */ = {isa = PBXBuildFile; fileRef = CE0D694E1995DC5C009C0DBE /* MCADBIntraction.m */; }; CE0D69521995FE9C009C0DBE /* MCAAddTaskViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE0D69511995FE9C009C0DBE /* MCAAddTaskViewController.m */; }; CE174993198D19C200F61135 /* AryaHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = CE174992198D19C200F61135 /* AryaHUD.m */; }; @@ -132,6 +142,26 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0A3824AF19C39DE700662A39 /* MCAResourcesCatDHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourcesCatDHolder.h; sourceTree = ""; }; + 0A3824B019C39DE700662A39 /* MCAResourcesCatDHolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourcesCatDHolder.m; sourceTree = ""; }; + 0A3824B219C39E0000662A39 /* MCAResourcesDHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourcesDHolder.h; sourceTree = ""; }; + 0A3824B319C39E0000662A39 /* MCAResourcesDHolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourcesDHolder.m; sourceTree = ""; }; + 0A8BC6DE19C39542007C2CB3 /* MCAResourcesCategoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourcesCategoryViewController.h; sourceTree = ""; }; + 0A8BC6DF19C39542007C2CB3 /* MCAResourcesCategoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourcesCategoryViewController.m; sourceTree = ""; }; + 0A8BC6E119C3955C007C2CB3 /* MCAResourcesDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourcesDetailViewController.h; sourceTree = ""; }; + 0A8BC6E219C3955C007C2CB3 /* MCAResourcesDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourcesDetailViewController.m; sourceTree = ""; }; + 0A8BC6E419C395E2007C2CB3 /* MCAResourcesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourcesViewController.h; sourceTree = ""; }; + 0A8BC6E519C395E2007C2CB3 /* MCAResourcesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourcesViewController.m; sourceTree = ""; }; + B6DF3B8F19C69A44007AE61B /* MCAResourceCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourceCell.h; sourceTree = ""; }; + B6DF3B9019C69A44007AE61B /* MCAResourceCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourceCell.m; sourceTree = ""; }; + B6E323EC19C7902300C12AAF /* RFRateMe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RFRateMe.h; sourceTree = ""; }; + B6E323ED19C7902300C12AAF /* RFRateMe.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RFRateMe.m; sourceTree = ""; }; + B6E323EE19C7902300C12AAF /* UIAlertView+NSCookbook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIAlertView+NSCookbook.h"; sourceTree = ""; }; + B6E323EF19C7902300C12AAF /* UIAlertView+NSCookbook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+NSCookbook.m"; sourceTree = ""; }; + B6E7966B19C8ADBD00858B66 /* MCAResourcesBookController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourcesBookController.h; sourceTree = ""; }; + B6E7966C19C8ADBD00858B66 /* MCAResourcesBookController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourcesBookController.m; sourceTree = ""; }; + B6E7966E19C8B60500858B66 /* MCAResourcesBookDHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAResourcesBookDHolder.h; sourceTree = ""; }; + B6E7966F19C8B60500858B66 /* MCAResourcesBookDHolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCAResourcesBookDHolder.m; sourceTree = ""; }; CE0D694D1995DC5C009C0DBE /* MCADBIntraction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCADBIntraction.h; sourceTree = ""; }; CE0D694E1995DC5C009C0DBE /* MCADBIntraction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCADBIntraction.m; sourceTree = ""; }; CE0D69501995FE9C009C0DBE /* MCAAddTaskViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCAAddTaskViewController.h; sourceTree = ""; }; @@ -364,6 +394,34 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0A5D5CFB19C37ACD00ACC5D6 /* Resources */ = { + isa = PBXGroup; + children = ( + 0A8BC6DE19C39542007C2CB3 /* MCAResourcesCategoryViewController.h */, + 0A8BC6DF19C39542007C2CB3 /* MCAResourcesCategoryViewController.m */, + 0A8BC6E419C395E2007C2CB3 /* MCAResourcesViewController.h */, + 0A8BC6E519C395E2007C2CB3 /* MCAResourcesViewController.m */, + 0A8BC6E119C3955C007C2CB3 /* MCAResourcesDetailViewController.h */, + 0A8BC6E219C3955C007C2CB3 /* MCAResourcesDetailViewController.m */, + B6DF3B8F19C69A44007AE61B /* MCAResourceCell.h */, + B6DF3B9019C69A44007AE61B /* MCAResourceCell.m */, + B6E7966B19C8ADBD00858B66 /* MCAResourcesBookController.h */, + B6E7966C19C8ADBD00858B66 /* MCAResourcesBookController.m */, + ); + name = Resources; + sourceTree = ""; + }; + B6E323F219C7902700C12AAF /* RFRateMe */ = { + isa = PBXGroup; + children = ( + B6E323EC19C7902300C12AAF /* RFRateMe.h */, + B6E323ED19C7902300C12AAF /* RFRateMe.m */, + B6E323EE19C7902300C12AAF /* UIAlertView+NSCookbook.h */, + B6E323EF19C7902300C12AAF /* UIAlertView+NSCookbook.m */, + ); + name = RFRateMe; + sourceTree = ""; + }; CE174990198D19A100F61135 /* HUD */ = { isa = PBXGroup; children = ( @@ -510,9 +568,10 @@ CE6E7D1A1990A8F6005470BC /* tabBar */ = { isa = PBXGroup; children = ( - CE2DFC2619AEE11A000D59EB /* notes */, CE6E7D1B1990A90E005470BC /* tasks */, CEF5375B19A70F9B00B72CD2 /* calendar */, + CE2DFC2619AEE11A000D59EB /* notes */, + 0A5D5CFB19C37ACD00ACC5D6 /* Resources */, CE84C2341962DDDD00A351FF /* more */, ); path = tabBar; @@ -694,6 +753,12 @@ CE2DFC2B19AEE7C6000D59EB /* MCANotesCatDHolder.m */, CEBD96E219B0513800A63CC5 /* MCANotesDHolder.h */, CEBD96E319B0513800A63CC5 /* MCANotesDHolder.m */, + 0A3824AF19C39DE700662A39 /* MCAResourcesCatDHolder.h */, + 0A3824B019C39DE700662A39 /* MCAResourcesCatDHolder.m */, + 0A3824B219C39E0000662A39 /* MCAResourcesDHolder.h */, + 0A3824B319C39E0000662A39 /* MCAResourcesDHolder.m */, + B6E7966E19C8B60500858B66 /* MCAResourcesBookDHolder.h */, + B6E7966F19C8B60500858B66 /* MCAResourcesBookDHolder.m */, ); path = AppModel; sourceTree = ""; @@ -711,6 +776,7 @@ CE84C2311962DB6200A351FF /* AppExternal */ = { isa = PBXGroup; children = ( + B6E323F219C7902700C12AAF /* RFRateMe */, CEAB94E219BB189A00D4EC9E /* Objective-Zip */, CE394C3319938D0C0080B5B8 /* MCACustomController */, CE2DFC4419AF1B0A000D59EB /* LocalStoredFolder */, @@ -896,6 +962,9 @@ LastUpgradeCheck = 0510; ORGANIZATIONNAME = arya; TargetAttributes = { + CE84C1EA1962D83800A351FF = { + DevelopmentTeam = J7KASTD2Y4; + }; CE84C20B1962D83800A351FF = { TestTargetID = CE84C1EA1962D83800A351FF; }; @@ -966,6 +1035,7 @@ CE27456919C031E400DDA5A8 /* MCATutorialViewController.m in Sources */, CE32DA7819AAF14A0037C555 /* NSMutableArray+convenience.m in Sources */, CE84C2371962DE1200A351FF /* MCALoginViewController.m in Sources */, + 0A8BC6E619C395E2007C2CB3 /* MCAResourcesViewController.m in Sources */, CEEDCAD5197F8BF30088511D /* SBJsonWriter.m in Sources */, CEEDCAC1197F8BE20088511D /* ASIInputStream.m in Sources */, CE278A1E19920D6700783592 /* SWUtilityButtonView.m in Sources */, @@ -981,9 +1051,11 @@ CE2DFC2919AEE193000D59EB /* MCANotesViewController.m in Sources */, CE2DFC2C19AEE7C6000D59EB /* MCANotesCatDHolder.m in Sources */, CE2AA3131999DE4900D43008 /* MCATaskDetailViewController.m in Sources */, + B6DF3B9119C69A44007AE61B /* MCAResourceCell.m in Sources */, CEF5375E19A70FB700B72CD2 /* MCACalendarViewController.m in Sources */, CE174993198D19C200F61135 /* AryaHUD.m in Sources */, CE278A2219920DEF00783592 /* CustomTableViewCell.m in Sources */, + 0A8BC6E019C39542007C2CB3 /* MCAResourcesCategoryViewController.m in Sources */, CE84C23A1962DE2E00A351FF /* MCARegistrationViewController.m in Sources */, CEEDCAC0197F8BE20088511D /* ASIHTTPRequest.m in Sources */, CE3B4FE619C18359001B07D4 /* MCASettingViewController.m in Sources */, @@ -993,6 +1065,7 @@ CE278A251992365A00783592 /* MCASignUpDHolder.m in Sources */, CEDB9B42198F61A6006B3C9B /* MCAGlobalData.m in Sources */, CEBD96E419B0513800A63CC5 /* MCANotesDHolder.m in Sources */, + 0A8BC6E319C3955C007C2CB3 /* MCAResourcesDetailViewController.m in Sources */, CE6E7D1E1990A963005470BC /* MCATaskViewController.m in Sources */, CE27456119C01FD000DDA5A8 /* MCATermUseViewController.m in Sources */, CEEDCABD197F8BE20088511D /* ASIDataDecompressor.m in Sources */, @@ -1000,7 +1073,9 @@ CE27456619C02C0900DDA5A8 /* MCAAppDelegate.m in Sources */, CEEDCAD0197F8BF30088511D /* NSObject+SBJSON.m in Sources */, CE2AE6311998881100B23FFF /* FMResultSet.m in Sources */, + B6E7967019C8B60500858B66 /* MCAResourcesBookDHolder.m in Sources */, CE32DA7619AAF14A0037C555 /* MCACalendarView.m in Sources */, + 0A3824B119C39DE700662A39 /* MCAResourcesCatDHolder.m in Sources */, CE278A1B19920D6700783592 /* SWLongPressGestureRecognizer.m in Sources */, CEEDCAC2197F8BE20088511D /* ASINetworkQueue.m in Sources */, CE278A1D19920D6700783592 /* SWUtilityButtonTapGestureRecognizer.m in Sources */, @@ -1013,7 +1088,9 @@ CE1805A0198656260087CA3D /* MCAStudentDHolder.m in Sources */, CE69728719C3057000DDE7F5 /* MCAChangePwdViewController.m in Sources */, CEEDCAE3197F962F0088511D /* MCALoginDHolder.m in Sources */, + B6E323F119C7902300C12AAF /* UIAlertView+NSCookbook.m in Sources */, CEA9D9D1197FEFFE009C3884 /* Reachability.m in Sources */, + B6E7966D19C8ADBD00858B66 /* MCAResourcesBookController.m in Sources */, CE36AE0219BD6B75004C047D /* MCADropboxNotesViewController.m in Sources */, CEEDCABB197F8BE20088511D /* ASIAuthenticationDialog.m in Sources */, CE394C3619938D300080B5B8 /* MCACustomButton.m in Sources */, @@ -1025,8 +1102,10 @@ CEBD96E119B04E0000A63CC5 /* MCANotesCategoryViewController.m in Sources */, CE2DFC4719AF1B51000D59EB /* MCALocalStoredFolder.m in Sources */, CEEDCABF197F8BE20088511D /* ASIFormDataRequest.m in Sources */, + 0A3824B419C39E0000662A39 /* MCAResourcesDHolder.m in Sources */, CEEDCAD1197F8BF30088511D /* NSString+SBJSON.m in Sources */, CE32DA7719AAF14A0037C555 /* UIView+convenience.m in Sources */, + B6E323F019C7902300C12AAF /* RFRateMe.m in Sources */, CE278A1A19920D6700783592 /* SWCellScrollView.m in Sources */, CE278A1919920D6700783592 /* NSMutableArray+SWUtilityButtons.m in Sources */, CE303986199F230D00D17A2B /* MCAMoreViewController.m in Sources */, @@ -1155,8 +1234,8 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CODE_SIGN_IDENTITY = "iPhone Developer: Rashmi Singh (2EC659949Q)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Rashmi Singh (2EC659949Q)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -1168,7 +1247,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "d3f12233-bb5b-4175-afc6-25d8b7e67767"; + PROVISIONING_PROFILE = ""; VALID_ARCHS = "armv7 armv7s arm64"; WRAPPER_EXTENSION = app; }; @@ -1178,8 +1257,8 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CODE_SIGN_IDENTITY = "iPhone Developer: Rashmi Singh (2EC659949Q)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Rashmi Singh (2EC659949Q)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -1191,7 +1270,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 7.0; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "d3f12233-bb5b-4175-afc6-25d8b7e67767"; + PROVISIONING_PROFILE = ""; VALID_ARCHS = "armv7 armv7s arm64"; WRAPPER_EXTENSION = app; }; diff --git a/MobileCollegeAdmin.xcodeproj/project.xcworkspace/xcshareddata/MobileCollegeAdmin.xccheckout b/MobileCollegeAdmin.xcodeproj/project.xcworkspace/xcshareddata/MobileCollegeAdmin.xccheckout index 92c032b..5c273d1 100644 --- a/MobileCollegeAdmin.xcodeproj/project.xcworkspace/xcshareddata/MobileCollegeAdmin.xccheckout +++ b/MobileCollegeAdmin.xcodeproj/project.xcworkspace/xcshareddata/MobileCollegeAdmin.xccheckout @@ -5,34 +5,34 @@ IDESourceControlProjectFavoriteDictionaryKey IDESourceControlProjectIdentifier - 68CF6F6B-CACE-414A-8AA0-272A0ECFA988 + FC9BBB01-76AD-41DC-AB1D-2911CA46075A IDESourceControlProjectName MobileCollegeAdmin IDESourceControlProjectOriginsDictionary - 3D6B56D3-4340-451A-A738-680BAD8FFD61 - https://github.com/devarya/MobileCollegeAdmin.git + C7273E58-1C2F-4D1E-BB49-6B36F495F7E0 + https://github.com/yufuchenArya/MobileCollegeAdmin.git IDESourceControlProjectPath MobileCollegeAdmin.xcodeproj/project.xcworkspace IDESourceControlProjectRelativeInstallPathDictionary - 3D6B56D3-4340-451A-A738-680BAD8FFD61 + C7273E58-1C2F-4D1E-BB49-6B36F495F7E0 ../.. IDESourceControlProjectURL - https://github.com/devarya/MobileCollegeAdmin.git + https://github.com/yufuchenArya/MobileCollegeAdmin.git IDESourceControlProjectVersion 110 IDESourceControlProjectWCCIdentifier - 3D6B56D3-4340-451A-A738-680BAD8FFD61 + C7273E58-1C2F-4D1E-BB49-6B36F495F7E0 IDESourceControlProjectWCConfigurations IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - 3D6B56D3-4340-451A-A738-680BAD8FFD61 + C7273E58-1C2F-4D1E-BB49-6B36F495F7E0 IDESourceControlWCCName MobileCollegeAdmin diff --git a/MobileCollegeAdmin.xcodeproj/project.xcworkspace/xcuserdata/BrianChen.xcuserdatad/UserInterfaceState.xcuserstate b/MobileCollegeAdmin.xcodeproj/project.xcworkspace/xcuserdata/BrianChen.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0b7c453 Binary files /dev/null and b/MobileCollegeAdmin.xcodeproj/project.xcworkspace/xcuserdata/BrianChen.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MobileCollegeAdmin.xcodeproj/xcuserdata/BrianChen.xcuserdatad/xcschemes/MobileCollegeAdmin.xcscheme b/MobileCollegeAdmin.xcodeproj/xcuserdata/BrianChen.xcuserdatad/xcschemes/MobileCollegeAdmin.xcscheme new file mode 100644 index 0000000..da1c538 --- /dev/null +++ b/MobileCollegeAdmin.xcodeproj/xcuserdata/BrianChen.xcuserdatad/xcschemes/MobileCollegeAdmin.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MobileCollegeAdmin.xcodeproj/xcuserdata/BrianChen.xcuserdatad/xcschemes/xcschememanagement.plist b/MobileCollegeAdmin.xcodeproj/xcuserdata/BrianChen.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..27c8bf2 --- /dev/null +++ b/MobileCollegeAdmin.xcodeproj/xcuserdata/BrianChen.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + MobileCollegeAdmin.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + CE84C1EA1962D83800A351FF + + primary + + + CE84C20B1962D83800A351FF + + primary + + + + + diff --git a/MobileCollegeAdmin/MobileCollegeAdmin-Prefix.pch b/MobileCollegeAdmin/MobileCollegeAdmin-Prefix.pch index 3cdba4c..6582614 100644 --- a/MobileCollegeAdmin/MobileCollegeAdmin-Prefix.pch +++ b/MobileCollegeAdmin/MobileCollegeAdmin-Prefix.pch @@ -13,6 +13,7 @@ #import "MCADBIntraction.h" #import "MCAGlobalFunction.h" #import "MCARestIntraction.h" +#import "RFRateMe.h" #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later."