//
//  RiskAssessment.h
//  EC145
//
//  Created by Claus Richter on 4/30/14.
//
//

#import <UIKit/UIKit.h>

#import "VDTextFieldWithDropDown.h"
#import "VDTextFieldWithFixedDropDown.h"
#import "VDLabelWithDropDown.h"

#import <MessageUI/MFMailComposeViewController.h>

//@interface ViewController : UIViewController <MFMailComposeViewControllerDelegate, UITableViewDataSource, UITableViewDelegate> {







@interface RiskAssessment : UIViewController <MFMailComposeViewControllerDelegate, VDDropDownDelegate> {
    
    NSString *customer;
    NSString *serverpath;
    NSString *serverhost;
    NSMutableArray *answers;
    NSMutableArray *questions;
    NSMutableArray *questions_cat;
    
    
    NSMutableArray *crew;
    NSMutableArray *crew_sectioned;
    NSMutableArray *crew_types;
    
  
    
    NSMutableArray *riskass_forms;
    int currentForm;
    
    NSString *timeStamp;
    
    NSString *defaultEmailRiskAssessment;
    
    NSURLConnection *occUploadConnection;
    NSMutableData *_responseData;
    bool waiting_for_OCC;
    int request_ID;
    
}


- (IBAction)closeKeyboard:(id)sender;

@property (weak, nonatomic) IBOutlet UITextField *inputACRegistration;

@property (weak, nonatomic) IBOutlet UITextField *inputRemarks;

@property (weak, nonatomic) IBOutlet UILabel *mail_Remarks;

@property (weak, nonatomic) IBOutlet UILabel *labelMissionRiskScore;

@property (weak, nonatomic) IBOutlet UIView *viewMain;

- (IBAction)actionswitchToMainPage:(id)sender;

@property (weak, nonatomic) IBOutlet UIScrollView *scrollViewQuestions;


@property (weak, nonatomic) IBOutlet UIView *view0;

@property (weak, nonatomic) IBOutlet UIView *view1;

@property (weak, nonatomic) IBOutlet UIView *view2;

@property (weak, nonatomic) IBOutlet UIView *view3;

@property (weak, nonatomic) IBOutlet UIView *view4;

@property (weak, nonatomic) IBOutlet UIView *view5;

@property (weak, nonatomic) IBOutlet UIView *view6;

@property (weak, nonatomic) IBOutlet UIView *view7;

@property (weak, nonatomic) IBOutlet UIView *view8;

@property (weak, nonatomic) IBOutlet UIView *view9;

@property (weak, nonatomic) IBOutlet UIView *view10;


@property (weak, nonatomic) IBOutlet UIView *viewResult;

@property (weak, nonatomic) IBOutlet UILabel *recommendation;


@property (weak, nonatomic) IBOutlet UILabel *result_totalScore;

@property (weak, nonatomic) IBOutlet UILabel *result_PICName;



//  -----


@property (weak, nonatomic) IBOutlet UIView *viewNotCompleted;


@property (weak, nonatomic) IBOutlet UILabel *question1;

@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer1;




@property (weak, nonatomic) IBOutlet UILabel *question2;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer2;






@property (weak, nonatomic) IBOutlet UILabel *question3;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer3;






@property (weak, nonatomic) IBOutlet UILabel *question4;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer4;






@property (weak, nonatomic) IBOutlet UILabel *question5;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer5;






@property (weak, nonatomic) IBOutlet UILabel *question6;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer6;






@property (weak, nonatomic) IBOutlet UILabel *question7;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer7;






@property (weak, nonatomic) IBOutlet UILabel *question8;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer8;



// ---


@property (weak, nonatomic) IBOutlet UILabel *question9;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer9;






@property (weak, nonatomic) IBOutlet UILabel *question10;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer10;






@property (weak, nonatomic) IBOutlet UILabel *question11;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer11;






@property (weak, nonatomic) IBOutlet UILabel *question12;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer12;






@property (weak, nonatomic) IBOutlet UILabel *question13;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer13;






@property (weak, nonatomic) IBOutlet UILabel *question14;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer14;






@property (weak, nonatomic) IBOutlet UILabel *question15;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer15;






@property (weak, nonatomic) IBOutlet UILabel *question16;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer16;


@property (weak, nonatomic) IBOutlet UILabel *question17;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer17;






@property (weak, nonatomic) IBOutlet UILabel *question18;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer18;



// ------


@property (weak, nonatomic) IBOutlet UILabel *question19;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer19;






@property (weak, nonatomic) IBOutlet UILabel *question20;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer20;






@property (weak, nonatomic) IBOutlet UILabel *question21;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer21;






@property (weak, nonatomic) IBOutlet UILabel *question22;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer22;






@property (weak, nonatomic) IBOutlet UILabel *question23;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer23;






@property (weak, nonatomic) IBOutlet UILabel *question24;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer24;


// --//  --//  --//  --//  --//  --//  --//  --//  --//



@property (weak, nonatomic) IBOutlet UILabel *question25;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer25;






@property (weak, nonatomic) IBOutlet UILabel *question26;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer26;






@property (weak, nonatomic) IBOutlet UILabel *question27;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer27;






@property (weak, nonatomic) IBOutlet UILabel *question28;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer28;




@property (weak, nonatomic) IBOutlet UILabel *question29;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer29;






@property (weak, nonatomic) IBOutlet UILabel *question30;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer30;






@property (weak, nonatomic) IBOutlet UILabel *question31;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer31;






@property (weak, nonatomic) IBOutlet UILabel *question32;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer32;


@property (weak, nonatomic) IBOutlet UILabel *question33;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer33;






@property (weak, nonatomic) IBOutlet UILabel *question34;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer34;






@property (weak, nonatomic) IBOutlet UILabel *question35;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer35;





// --//  --//  --//  --//  --//  --//  --//  --//  --//



@property (weak, nonatomic) IBOutlet UILabel *question36;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer36;






@property (weak, nonatomic) IBOutlet UILabel *question37;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer37;






@property (weak, nonatomic) IBOutlet UILabel *question38;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer38;






@property (weak, nonatomic) IBOutlet UILabel *question39;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer39;






@property (weak, nonatomic) IBOutlet UILabel *question40;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer40;






@property (weak, nonatomic) IBOutlet UILabel *question41;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer41;


// --//  --//  --//  --//  --//  --//  --//  --//  --//


@property (weak, nonatomic) IBOutlet UILabel *question42;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer42;






@property (weak, nonatomic) IBOutlet UILabel *question43;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer43;






@property (weak, nonatomic) IBOutlet UILabel *question44;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer44;






@property (weak, nonatomic) IBOutlet UILabel *question45;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer45;






@property (weak, nonatomic) IBOutlet UILabel *question46;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer46;






@property (weak, nonatomic) IBOutlet UILabel *question47;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer47;


// --//  --//  --//  --//  --//  --//  --//  --//  --//


@property (weak, nonatomic) IBOutlet UILabel *question48;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer48;






@property (weak, nonatomic) IBOutlet UILabel *question49;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer49;






@property (weak, nonatomic) IBOutlet UILabel *question50;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer50;






@property (weak, nonatomic) IBOutlet UILabel *question51;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer51;






//  SETUP

// PIC

@property (weak, nonatomic) IBOutlet UILabel *question100;
@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer100;


// Tail Number


@property (weak, nonatomic) IBOutlet UILabel *question101;


@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer101;



@property (weak, nonatomic) IBOutlet UILabel *question102;

@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *answer102;


@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *listName;

@property (weak, nonatomic) IBOutlet VDTextFieldWithFixedDropDown *listName2;

@property (weak, nonatomic) IBOutlet UILabel *inputListName;




// Other Setup

@property (weak, nonatomic) IBOutlet UITextField *inputDate;


@property (weak, nonatomic) IBOutlet UITextField *inputTrip;





@property (weak, nonatomic) IBOutlet UIView *viewCategories;


// navigation

- (IBAction)buttonActionNextPage:(id)sender;

- (IBAction)buttonActionPreviousPage:(id)sender;

@property (weak, nonatomic) IBOutlet UILabel *labelQuestionsAnswered;

@property (weak, nonatomic) IBOutlet UIImageView *riskBar;

@property (weak, nonatomic) IBOutlet UIImageView *riskBarGreen;

@property (weak, nonatomic) IBOutlet UIImageView *riskBarYellow;

@property (weak, nonatomic) IBOutlet UIImageView *riskBarRed;

@property (weak, nonatomic) IBOutlet UIImageView *riskBarOrange;


// load save

- (IBAction)buttonActionLoadList:(id)sender;

- (IBAction)buttonActionSaveList:(id)sender;



// result page

- (IBAction)buttonCloseMailResult:(id)sender;

@property (weak, nonatomic) IBOutlet UIView *viewMailResult;

@property (weak, nonatomic) IBOutlet UIScrollView *scrollViewMailResults;

@property (weak, nonatomic) IBOutlet UITextView *textViewMail;

- (IBAction)buttonActionShowMailResults:(id)sender;


// mail


@property (weak, nonatomic) IBOutlet UILabel *mail_PIC;
@property (weak, nonatomic) IBOutlet UILabel *mail_TripNumber;


@property (weak, nonatomic) IBOutlet UILabel *mail_Date;

@property (weak, nonatomic) IBOutlet UILabel *mail_TailNumber;


@property (weak, nonatomic) IBOutlet UILabel *mail_LegNumber;


@property (weak, nonatomic) IBOutlet UILabel *mail_AssessmentName;

@property (weak, nonatomic) IBOutlet UILabel *mailScore;

@property (weak, nonatomic) IBOutlet UILabel *mail_Recommendation;





// email


- (IBAction)actionSendMailResults:(id)sender;


// check Bars


@property (weak, nonatomic) IBOutlet UIImageView *bar1;

@property (weak, nonatomic) IBOutlet UIImageView *bar2;


@property (weak, nonatomic) IBOutlet UIImageView *bar3;


@property (weak, nonatomic) IBOutlet UIImageView *bar4;


@property (weak, nonatomic) IBOutlet UIImageView *bar5;


@property (weak, nonatomic) IBOutlet UIImageView *bar6;


@property (weak, nonatomic) IBOutlet UIImageView *bar7;

@property (weak, nonatomic) IBOutlet UIImageView *bar8;


@property (weak, nonatomic) IBOutlet UIImageView *bar9;


@property (weak, nonatomic) IBOutlet UIImageView *bar10;


@property (weak, nonatomic) IBOutlet UILabel *label1;


@property (weak, nonatomic) IBOutlet UILabel *label2;


@property (weak, nonatomic) IBOutlet UILabel *label3;


@property (weak, nonatomic) IBOutlet UILabel *label4;


@property (weak, nonatomic) IBOutlet UILabel *label5;


@property (weak, nonatomic) IBOutlet UILabel *label6;


@property (weak, nonatomic) IBOutlet UILabel *label7;


@property (weak, nonatomic) IBOutlet UILabel *label8;


@property (weak, nonatomic) IBOutlet UILabel *label9;


@property (weak, nonatomic) IBOutlet UILabel *label10;


//dennis risk assessment BEGIN ----

@property (weak, nonatomic) IBOutlet UILabel *cat10;
@property (weak, nonatomic) IBOutlet UILabel *cat09;
@property (weak, nonatomic) IBOutlet UILabel *cat08;
@property (weak, nonatomic) IBOutlet UILabel *cat07;
@property (weak, nonatomic) IBOutlet UILabel *cat06;
@property (weak, nonatomic) IBOutlet UILabel *cat05;
@property (weak, nonatomic) IBOutlet UILabel *cat04;
@property (weak, nonatomic) IBOutlet UILabel *cat03;
@property (weak, nonatomic) IBOutlet UILabel *cat01;
@property (weak, nonatomic) IBOutlet UILabel *cat02;




- (IBAction)load_forms_from_server:(id)sender;

@property (weak, nonatomic) IBOutlet UIView *riskass_view;
@property (weak, nonatomic) IBOutlet UIScrollView *riskass_choice;
@property (weak, nonatomic) IBOutlet UIView *riskass_choice_view;
- (IBAction)loadAnotherForm:(id)sender;

//dennis END ----




// signature


@property (weak, nonatomic) IBOutlet UIButton *buttonSignRiskAssessment;


- (IBAction)actionShowRAresultPage:(id)sender;


@property (weak, nonatomic) IBOutlet UIView *viewSignature;

- (IBAction)buttonActionSignLoadManifest:(id)sender;

- (IBAction)buttonActionSignatureSign:(id)sender;

- (IBAction)buttonActionSignatureDelete:(id)sender;

- (IBAction)buttonActionSignatureCancel:(id)sender;

- (IBAction)buttonActionSignatureClear:(id)sender;


@property (weak, nonatomic) IBOutlet UIView *viewResultPage;

// save as image

- (IBAction)actionSaveLoadManifestAsImage:(id)sender;


@property (weak, nonatomic) IBOutlet UILabel *labelThresholdYellow;

@property (weak, nonatomic) IBOutlet UILabel *labelThresholdOrange;

@property (weak, nonatomic) IBOutlet UILabel *labelThresholdRed;

@property (strong, nonatomic) IBOutlet UIView *viewOPSControl;

@property (strong, nonatomic) IBOutlet UIButton *buttonSendRAtoOPS;
- (IBAction)actionSendRAtoOPS:(id)sender;



@property (strong, nonatomic) IBOutlet UIButton *buttonCheckResultFromOPS;
- (IBAction)actionCheckResultFromOPS:(id)sender;

@property (strong, nonatomic) IBOutlet UIButton *buttonOPSSignAndSendRA;

@property (strong, nonatomic) IBOutlet UILabel *labelOPSStatus;

@end
