codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
// // FinancialImpactViewController.m // Equine // // Created by Ali on 12/14/12. // Copyright 2012 __MyCompanyName__. All rights reserved. // #import "FinancialImpactViewController.h" #import "EconomicDataViewController.h" #import "RiskViewController.h" #import "ProbabilitiesViewController.h" #import "MainViewController.h" @implementation FinancialImpactViewController @synthesize costOfVaccinationUVHL; @synthesize costOfDaysOfTrainginUVHL; @synthesize costofTreatmentUVHL; @synthesize number; @synthesize tblSimpleTable; @synthesize myArray; @synthesize tableImageView; @synthesize titleLabel; @synthesize title; @synthesize btn; @synthesize costOfVaccinationAVHL; @synthesize costOfDaysOfTrainginAVHL; @synthesize costofTreatmentAVHL; @synthesize SAnnvaccinatedTotal; @synthesize SAnnvaccinatedTotalWG; @synthesize costOfVaccinationAWGVHL; @synthesize costOfDaysOfTrainginAWGVHL; @synthesize costofTreatmentAWGVHL; @synthesize costOfVaccinationSAVHL; @synthesize costOfDaysOfTrainginSAVHL; @synthesize costofTreatmentSAVHL; @synthesize costOfVaccinationSAWGVHL; @synthesize costOfDaysOfTrainginSAWGVHL; @synthesize costofTreatmentSAWGVHL; @synthesize unvaccinatedTotal; @synthesize AnnvaccinatedTotal; @synthesize AnnvaccinatedTotalWG; @synthesize firstView; @synthesize secondView; @synthesize thirdView; @synthesize fourView; @synthesize fiveView; @synthesize SixView,popBgOne,popUpOne,closeButton; @synthesize SevenView; @synthesize EightView; @synthesize NineView,graphButton; @synthesize TenView; @synthesize ElevenView; @synthesize TwelveView; @synthesize ThirteenView; @synthesize FourteenView; @synthesize FifteenView; @synthesize labelOne; @synthesize labelTwo; @synthesize labelThree; @synthesize labelFour; @synthesize maximumValue; @synthesize maximumGraphValue; @synthesize valueOne; @synthesize valueTwo; @synthesize valueThree; @synthesize thirdViewBorder; @synthesize testLabel; @synthesize subViewLand,subView; @synthesize line1; @synthesize line2; @synthesize line3; @synthesize line4; @synthesize line5,l1,l2,l3,l4,l5; @synthesize graphViewOne; @synthesize graphViewTwo; @synthesize V1; @synthesize V2,TextLabel,TextLabelS,TextLabelA,finalMaximum; -(void)closeButtonAction{ [self hideItems]; popBgOne.hidden=YES; popUpOne.hidden=YES; closeButton.hidden=YES; showUpdatesButton.enabled=TRUE; line1.hidden=YES; line2.hidden=YES; line3.hidden=YES; line4.hidden=YES; line5.hidden=YES; TextLabelAValue.hidden=YES; TextLabelBValue.hidden=YES; l1.hidden=YES; l2.hidden=YES; l3.hidden=YES; l4.hidden=YES; l5.hidden=YES; TextLabel.hidden=YES; TextLabelS.hidden=YES; TextLabelA.hidden=YES; firstView.hidden=NO; secondView.hidden=NO; thirdView.hidden=NO; fourView.hidden=NO; fiveView.hidden=NO; SixView.hidden=NO; SevenView.hidden=NO; EightView.hidden=NO; NineView.hidden=NO; TenView.hidden=NO; ElevenView.hidden=NO; TwelveView.hidden=NO ; ThirteenView.hidden=NO; FourteenView.hidden=NO; FifteenView.hidden=NO; firstView.alpha=1; secondView.alpha=1; thirdView.alpha=1; fourView.alpha=1; fiveView.alpha=1; SixView.alpha=1; SevenView.alpha=1; EightView.alpha=1; NineView.alpha=1; TenView.alpha=1; ElevenView.alpha=1; TwelveView.alpha=1 ; ThirteenView.alpha=1; FourteenView.alpha=1; FifteenView.alpha=1; graphViewOne.hidden=YES; graphViewTwo.hidden=YES; } -(IBAction)graphButtonAction{ appDelegate=[[UIApplication sharedApplication]delegate]; popBgOne.hidden=NO; popUpOne.hidden=NO; closeButton.hidden=NO; showUpdatesButton.enabled=FALSE; line1.hidden=NO; line2.hidden=NO; line3.hidden=NO; line4.hidden=NO; line5.hidden=NO; TextLabelAValue.hidden=NO; TextLabelBValue.hidden=NO; l1.hidden=NO; l2.hidden=NO; l3.hidden=NO; l4.hidden=NO; l5.hidden=NO; TextLabel.hidden=NO; TextLabelS.hidden=NO; TextLabelA.hidden=NO; NSLog(@"Anuaaly No Guarantee %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee); if (appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee*number>appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee*number) { maximumGraphValue=appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee*number; } else { maximumGraphValue=appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee*number; } NSLog(@"Maxim Graph Value is %.2f",maximumGraphValue); if (maximumGraphValue>5 && maximumGraphValue<10) { maximumGraphValue=10; int newvalue=10/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>10 && maximumGraphValue<15) { maximumGraphValue=16; int newvalue=16/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; NSLog(@"Value 1 %d",newvalue); NSLog(@"Value 2 %d",newvalue1); NSLog(@"Value 3 %d",newvalue2); NSLog(@"Value 4 %d",newvalue3); } else if (maximumGraphValue>15 && maximumGraphValue<25) { maximumGraphValue=24; int newvalue=24/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>25 && maximumGraphValue<40) { maximumGraphValue=40; int newvalue=40/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>40 && maximumGraphValue<60) { maximumGraphValue=60; int newvalue=60/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>60 && maximumGraphValue<90) { maximumGraphValue=100; int newvalue=100/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>90 && maximumGraphValue<110) { maximumGraphValue=120; int newvalue=120/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>110 && maximumGraphValue<200) { maximumGraphValue=200; int newvalue=200/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>200 && maximumGraphValue<500) { maximumGraphValue=400; int newvalue=400/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>500 && maximumGraphValue<1000) { maximumGraphValue=1000; int newvalue=1000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>1000 && maximumGraphValue<1500) { maximumGraphValue=1600; int newvalue=1600/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>1500 && maximumGraphValue<2000) { maximumGraphValue=2000; int newvalue=2000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>2000 && maximumGraphValue<4000) { maximumGraphValue=4000; int newvalue=4000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>4000 && maximumGraphValue<6000) { maximumGraphValue=6000; int newvalue=6000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumGraphValue>6000 && maximumGraphValue<10000) { maximumGraphValue=10000; int newvalue=10000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else { maximumGraphValue=30; int newvalue=maximumGraphValue/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; l2.text=[NSString stringWithFormat:@"$%d",newvalue]; l3.text=[NSString stringWithFormat:@"$%d",newvalue1]; l4.text=[NSString stringWithFormat:@"$%d",newvalue2]; l5.text=[NSString stringWithFormat:@"$%d",newvalue3]; } float h3=(appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee*number)*100/maximumGraphValue; NSLog(@"height3 New Workign is %f",h3); int h3new=h3*1.2; int height3=(int)roundf(h3new); NSLog(@"height3 New Workign is %d",height3); graphViewOne=[[UIView alloc] initWithFrame:CGRectMake(370,390,100,-height3)]; graphViewOne.backgroundColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:graphViewOne]; float test=appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee*number; TextLabelAValue= [[UILabel alloc] initWithFrame:CGRectMake(345,390,100,24)]; TextLabelAValue.backgroundColor = [UIColor clearColor]; TextLabelAValue.textAlignment=UITextAlignmentRight; TextLabelAValue.text =[NSString stringWithFormat:@"%.2f",test]; TextLabelAValue.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:TextLabelAValue]; float h4=(appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee*number)*100/maximumGraphValue; NSLog(@"height3 New Workign is %f",h3); //int h4new=h3*1.6; int h4new=h4*1.2; int height4=(int)roundf(h4new); NSLog(@"height3 New Workign is %d",height4); graphViewTwo=[[UIView alloc] initWithFrame:CGRectMake(600,390,100,-height4)]; //graphViewTwo.backgroundColor=[UIColor blueColor]; graphViewTwo.backgroundColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:graphViewTwo]; float testb=appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee*number; TextLabelBValue= [[UILabel alloc] initWithFrame:CGRectMake(555,390,100,24)]; TextLabelBValue.backgroundColor = [UIColor clearColor]; TextLabelBValue.textAlignment=UITextAlignmentRight; TextLabelBValue.text =[NSString stringWithFormat:@"%.2f",testb]; TextLabelBValue.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:TextLabelBValue]; firstView.alpha=0; secondView.alpha=0; thirdView.alpha=0; fourView.alpha=0; fiveView.alpha=0; SixView.alpha=0; SevenView.alpha=0; EightView.alpha=0; NineView.alpha=0; TenView.alpha=0; ElevenView.alpha=0; TwelveView.alpha=0; ThirteenView.alpha=0; FourteenView.alpha=0; FifteenView.alpha=0; firstView.hidden=TRUE; secondView.hidden=TRUE; thirdView.hidden=TRUE; fourView.hidden=TRUE; fiveView.hidden=TRUE; SixView.hidden=TRUE; SevenView.hidden=TRUE; EightView.hidden=TRUE; NineView.hidden=TRUE; TenView.hidden=TRUE; ElevenView.hidden=TRUE; TwelveView.hidden=TRUE ; ThirteenView.hidden=TRUE; FourteenView.hidden=TRUE; FifteenView.hidden=TRUE; } -(IBAction)economicDataButtonAction{ EconomicDataViewController*targetContrlloer=[[EconomicDataViewController alloc] init]; [self.navigationController pushViewController:targetContrlloer animated:YES]; } -(IBAction)riskButtonAction{ RiskViewController*targetContrlloer=[[RiskViewController alloc] init]; [self.navigationController pushViewController:targetContrlloer animated:YES]; } -(IBAction)financialImpactButtonAction{ /* FinancialImpactViewController*targetContrlloer=[[FinancialImpactViewController alloc] init]; [self.navigationController pushViewController:targetContrlloer animated:YES]; */ } -(IBAction)probabilitiesButtonAction{ ProbabilitiesViewController*targetContrlloer=[[ProbabilitiesViewController alloc] init]; [self.navigationController pushViewController:targetContrlloer animated:YES]; } -(IBAction)homeButtonAction{ MainViewController*targetContrlloer=[[MainViewController alloc] init]; [self.navigationController pushViewController:targetContrlloer animated:YES]; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { appDelegate=[[UIApplication sharedApplication]delegate]; flag=1; TextLabelAValue.alpha=0; TextLabelBValue.alpha=0; subView.backgroundColor=[UIColor clearColor]; popBgOne=[[UIImageView alloc] initWithFrame:CGRectMake(0,0,1024,768)]; UIImage*image=[UIImage imageNamed:@"bgPopupback.png"]; popBgOne.image=image; [self.view addSubview:popBgOne] ; popUpOne=[[UIImageView alloc] initWithFrame:CGRectMake(105,80,824,411)]; UIImage*image1=[UIImage imageNamed:@"popup3NewU.png"]; popUpOne.image=image1; [self.view addSubview:popUpOne] ; closeButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; closeButton.frame = CGRectMake(890,91,25,25); //UIImage*closeImage1=[UIImage imageNamed:@"close.png"]; [closeButton setImage:[UIImage imageNamed:@"close.png"] forState:UIControlStateNormal]; [closeButton addTarget:self action:@selector(closeButtonAction) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:closeButton]; line1=[[UIImageView alloc] initWithFrame:CGRectMake(250,390,530,2)]; UIImage*imageline1=[UIImage imageNamed:@"single_line.png"]; line1.image=imageline1; [self.view addSubview:line1]; l1 = [[UILabel alloc] initWithFrame:CGRectMake(140,381,100,20)]; l1.backgroundColor = [UIColor clearColor]; l1.textAlignment=UITextAlignmentRight; l1.text =@"$0"; l1.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:l1]; TextLabel= [[UILabel alloc] initWithFrame:CGRectMake(220,221,140,24)]; TextLabel.backgroundColor = [UIColor clearColor]; TextLabel.textAlignment=UITextAlignmentRight; TextLabel.text =@"Benefit per horse"; TextLabel.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:TextLabel]; TextLabelA= [[UILabel alloc] initWithFrame:CGRectMake(330,410,210,24)]; TextLabelA.backgroundColor = [UIColor clearColor]; TextLabelA.textAlignment=UITextAlignmentRight; TextLabelA.text =@"Annually vaccinated horse"; TextLabelA.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:TextLabelA]; TextLabelS= [[UILabel alloc] initWithFrame:CGRectMake(565,410,245,24)]; TextLabelS.backgroundColor = [UIColor clearColor]; TextLabelS.textAlignment=UITextAlignmentRight; TextLabelS.text =@"Semi-annually vaccinated horse"; TextLabelS.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:TextLabelS]; line2=[[UIImageView alloc] initWithFrame:CGRectMake(250,360,530,2)]; UIImage*imageline2=[UIImage imageNamed:@"single_line.png"]; line2.image=imageline2; [self.view addSubview:line2]; l2 = [[UILabel alloc] initWithFrame:CGRectMake(140,347,100,24)]; l2.backgroundColor = [UIColor clearColor]; l2.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; l2.textAlignment=UITextAlignmentRight; l2.text =@"$2"; [self.view addSubview:l2]; line3=[[UIImageView alloc] initWithFrame:CGRectMake(250,330,530,2)]; UIImage*imageline3=[UIImage imageNamed:@"single_line.png"]; line3.image=imageline3; [self.view addSubview:line3]; l3 = [[UILabel alloc] initWithFrame:CGRectMake(140,319,100,24)]; l3.backgroundColor = [UIColor clearColor]; l3.textAlignment=UITextAlignmentRight; l3.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; l3.text =@"$4"; [self.view addSubview:l3]; line4=[[UIImageView alloc] initWithFrame:CGRectMake(250,300,530,2)]; UIImage*imageline4=[UIImage imageNamed:@"single_line.png"]; line4.image=imageline4; [self.view addSubview:line4]; l4 = [[UILabel alloc] initWithFrame:CGRectMake(140,288,100,24)]; l4.backgroundColor = [UIColor clearColor]; l4.textAlignment=UITextAlignmentRight; l4.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; l4.text =@"$6"; [self.view addSubview:l4]; line5=[[UIImageView alloc] initWithFrame:CGRectMake(250,270,530,2)]; UIImage*imageline5=[UIImage imageNamed:@"single_line.png"]; line5.image=imageline5; [self.view addSubview:line5]; l5 = [[UILabel alloc] initWithFrame:CGRectMake(140,258,100,24)]; l5.backgroundColor = [UIColor clearColor]; l5.textAlignment=UITextAlignmentRight; l5.text =@"$8"; l5.textColor=[UIColor colorWithRed:(33/255.f) green:(123/255.f) blue:(189/255.f) alpha:1]; [self.view addSubview:l5]; TextLabelAValue.hidden=YES; TextLabelBValue.hidden=YES; subView.hidden=YES; popBgOne.hidden=YES; popUpOne.hidden=YES; closeButton.hidden=YES; line1.hidden=YES; line2.hidden=YES; line3.hidden=YES; line4.hidden=YES; line5.hidden=YES; l1.hidden=YES; l2.hidden=YES; l3.hidden=YES; l4.hidden=YES; l5.hidden=YES; TextLabel.hidden=YES; TextLabelS.hidden=YES; TextLabelA.hidden=YES; tblSimpleTable.hidden=YES; tableImageView.hidden=YES; tblSimpleTable.backgroundColor=[UIColor clearColor]; title=@"Yes, same vaccination strategy on entire premise"; titleLabel.text=@"Yes, same vaccination strategy on entire premise"; testLabel.transform = CGAffineTransformMakeRotation(M_PI_2*3); // 90 degress myArray = [[NSArray alloc] initWithObjects:@"Yes, same vaccination strategy on entire premise",@"No, mixed population (vaccinated and unvaccinated)",nil]; //appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee=appDelegate.Cost_1_Vaccine_Dose; //appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee=appDelegate.Cost_1_Vaccine_Dose; NSLog(@"Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee %.2f",appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee); appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_No_Guarantee=appDelegate.Cost_1_Vaccine_Dose*2; NSLog(@"Same_Vaccination_Cost_Vaccination_SemiAnnually_No_Guarantee %.2f",appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_No_Guarantee); // prevoious working appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_With_Guarantee=appDelegate.Cost_1_Vaccine_Dose*2; appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_With_Guarantee=appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_No_Guarantee; NSLog(@"Same_Vaccination_Cost_Vaccination_SemiAnnually_With_Guarantee %.2f",appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_With_Guarantee); appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated= ((appDelegate.Cost_1_Day_Off_Training * appDelegate.Days_Off_Training_Unvaccinated_SevereEI*appDelegate.Same_Vaccination_SevereEI_Unvaccinated) + (appDelegate.Cost_1_Day_Off_Training *appDelegate.Days_Off_Training_Unvaccinated_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_Unvaccinated) + (appDelegate.Cost_1_Day_Off_Training *appDelegate.Days_Off_Training_Unvaccinated_MildEI*appDelegate.Same_Vaccination_MildEI_Unvaccinated))/100; NSLog(@"Same_Vaccination_Cost_DaysOffTraining_Unvaccinated %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated); ///my comment appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Same_Vaccination_ModerateEI_Annually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Same_Vaccination_MildEI_Annually))/100; //new comment appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Same_Vaccination_MildEI_Annually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_Annually))/100; appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training * ((appDelegate.Days_Off_Training_Vaccinated_SevereEI *appDelegate.Same_Vaccination_SevereEI_Annually) + (appDelegate.Days_Off_Training_Vaccinated_ModerateEI * appDelegate.Same_Vaccination_ModerateEI_Annually) + (appDelegate.Days_Off_Training_Vaccinated_MildEI * appDelegate.Same_Vaccination_MildEI_Annually))) * appDelegate.Same_Vaccination_Horses_Per_Premise)/100; NSLog(@"Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee); //new comment appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Same_Vaccination_MildEI_Annually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_Annually))/100; appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee=appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee; NSLog(@"Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee); // new comment appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Same_Vaccination_MildEI_SemiAnnually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_SemiAnnually))/100; appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training * ((appDelegate.Days_Off_Training_Vaccinated_SevereEI * appDelegate.Same_Vaccination_SevereEI_SemiAnnually) + (appDelegate.Days_Off_Training_Vaccinated_ModerateEI * appDelegate.Same_Vaccination_ModerateEI_SemiAnnually) + (appDelegate.Days_Off_Training_Vaccinated_MildEI * appDelegate.Same_Vaccination_MildEI_SemiAnnually))) * appDelegate.Same_Vaccination_Horses_Per_Premise)/100; NSLog(@"Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee); //new comment appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Same_Vaccination_MildEI_SemiAnnually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_SemiAnnually))/100; appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee=appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee; NSLog(@"My Data Working is %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee); NSLog(@"Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee); appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated=((appDelegate.Cost_Treatment_SevereEI*appDelegate.Same_Vaccination_SevereEI_Unvaccinated)+(appDelegate.Cost_Treatment_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_Unvaccinated)+(appDelegate.Cost_Treatment_MildEI*appDelegate.Same_Vaccination_MildEI_Unvaccinated))/100; NSLog(@"Same_Vaccination_Cost_Treatment_Unvaccinated %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated); float one=appDelegate.Cost_Treatment_ModerateEI; NSLog(@"One is %.2f",one); float two=appDelegate.Same_Vaccination_ModerateEI_Annually; NSLog(@"two is %.2f",two); float three=appDelegate.Cost_Treatment_MildEI; NSLog(@"Three is %.2f",three); float four=appDelegate.Same_Vaccination_MildEI_Annually;; NSLog(@"Four is %.2f",four); appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee=0; //my comments appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee=(appDelegate.Cost_Treatment_ModerateEI*appDelegate.Same_Vaccination_MildEI_Annually)/100; // new comment appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee=((appDelegate.Cost_Treatment_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_Annually)+(appDelegate.Cost_Treatment_MildEI*appDelegate.Same_Vaccination_MildEI_Annually))/100; appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee=(((appDelegate.Cost_Treatment_SevereEI * appDelegate.Same_Vaccination_SevereEI_Annually) + (appDelegate.Cost_Treatment_ModerateEI * appDelegate.Same_Vaccination_ModerateEI_Annually) + (appDelegate.Cost_Treatment_MildEI * appDelegate.Same_Vaccination_MildEI_Annually)) * appDelegate.Same_Vaccination_Horses_Per_Premise)/100; NSLog(@"Same_Vaccination_ModerateEI_Annually %.2f",appDelegate.Same_Vaccination_ModerateEI_Annually); NSLog(@"Same_Vaccination_Cost_Treatment_Annually_No_Guarantee is %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee); // new comment appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee=(appDelegate.Cost_Treatment_ModerateEI*appDelegate.Same_Vaccination_ModerateEI_SemiAnnually)/100; appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee=(((appDelegate.Cost_Treatment_SevereEI * appDelegate.Same_Vaccination_SevereEI_SemiAnnually) + (appDelegate.Cost_Treatment_ModerateEI * appDelegate.Same_Vaccination_ModerateEI_SemiAnnually) + (appDelegate.Cost_Treatment_MildEI * appDelegate.Same_Vaccination_MildEI_SemiAnnually)) * appDelegate.Same_Vaccination_Horses_Per_Premise)/100; NSLog(@"Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee is %.2f",appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee); appDelegate.Mixed_Population_Cost_DaysOffTraining_Unvaccinated=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Unvaccinated_SevereEI*appDelegate.Mixed_Population_SevereEI_Unvaccinated)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Unvaccinated_MildEI*appDelegate.Mixed_Population_ModerateEI_Unvaccinated)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Unvaccinated_MildEI*appDelegate.Mixed_Population_MildEI_Unvaccinated))/100; NSLog(@"Mixed_Population_Cost_DaysOffTraining_Unvaccinated is %.2f",appDelegate.Mixed_Population_Cost_DaysOffTraining_Unvaccinated); // new comment appDelegate.Mixed_Population_Cost_DaysOffTraining_Annually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Mixed_Population_ModerateEI_Annually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Mixed_Population_MildEI_Annually))/100; appDelegate.Mixed_Population_Cost_DaysOffTraining_Annually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training * ((appDelegate.Days_Off_Training_Vaccinated_SevereEI * appDelegate.Mixed_Population_SevereEI_Annually) + (appDelegate.Days_Off_Training_Vaccinated_ModerateEI * appDelegate.Mixed_Population_ModerateEI_Annually) + (appDelegate.Days_Off_Training_Vaccinated_MildEI * appDelegate.Mixed_Population_MildEI_Annually))) * appDelegate.Same_Vaccination_Horses_Per_Premise)/100; //appDelegate.Mixed_Population_Cost_DaysOffTraining_Annually_With_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Mixed_Population_ModerateEI_Annually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Mixed_Population_MildEI_Annually))/100; appDelegate.Mixed_Population_Cost_DaysOffTraining_Annually_With_Guarantee=appDelegate.Mixed_Population_Cost_DaysOffTraining_Annually_No_Guarantee; NSLog(@"Mixed_Population_Cost_DaysOffTraining_Annually_With_Guarantee is %.2f",appDelegate.Mixed_Population_Cost_DaysOffTraining_Annually_With_Guarantee); // new appDelegate.Mixed_Population_Cost_DaysOffTraining_SemiAnnually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Mixed_Population_ModerateEI_SemiAnnually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Mixed_Population_MildEI_SemiAnnually))/100; appDelegate.Mixed_Population_Cost_DaysOffTraining_SemiAnnually_No_Guarantee=((appDelegate.Cost_1_Day_Off_Training * ((appDelegate.Days_Off_Training_Vaccinated_SevereEI * appDelegate.Mixed_Population_SevereEI_SemiAnnually) + (appDelegate.Days_Off_Training_Vaccinated_ModerateEI * appDelegate.Mixed_Population_ModerateEI_SemiAnnually) + (appDelegate.Days_Off_Training_Vaccinated_MildEI * appDelegate.Mixed_Population_MildEI_SemiAnnually))) * appDelegate.Same_Vaccination_Horses_Per_Premise)/100; NSLog(@"Mixed_Population_Cost_DaysOffTraining_SemiAnnually_No_Guarantee is %.2f",appDelegate.Mixed_Population_Cost_DaysOffTraining_SemiAnnually_No_Guarantee); // new comment appDelegate.Mixed_Population_Cost_DaysOffTraining_SemiAnnually_With_Guarantee=((appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_MildEI*appDelegate.Mixed_Population_ModerateEI_SemiAnnually)+(appDelegate.Cost_1_Day_Off_Training*appDelegate.Days_Off_Training_Vaccinated_ModerateEI*appDelegate.Mixed_Population_MildEI_SemiAnnually))/100; appDelegate.Mixed_Population_Cost_DaysOffTraining_SemiAnnually_With_Guarantee=appDelegate.Mixed_Population_Cost_DaysOffTraining_SemiAnnually_No_Guarantee; NSLog(@"Mixed_Population_Cost_DaysOffTraining_SemiAnnually_With_Guarantee is %.2f",appDelegate.Mixed_Population_Cost_DaysOffTraining_SemiAnnually_With_Guarantee); appDelegate.Mixed_Population_Cost_Treatment_Unvaccinated=((appDelegate.Cost_Treatment_SevereEI*appDelegate.Mixed_Population_SevereEI_Unvaccinated)+(appDelegate.Cost_Treatment_ModerateEI*appDelegate.Mixed_Population_ModerateEI_Unvaccinated)+(appDelegate.Cost_Treatment_MildEI*appDelegate.Mixed_Population_MildEI_Unvaccinated))/100; NSLog(@"Mixed_Population_Cost_Treatment_Unvaccinated is %.2f",appDelegate.Mixed_Population_Cost_Treatment_Unvaccinated); //appDelegate.Mixed_Population_Cost_Treatment_Annually_No_Guarantee=((appDelegate.Cost_Treatment_ModerateEI*appDelegate.Mixed_Population_MildEI_Annually)+(appDelegate.Cost_Treatment_MildEI*appDelegate.Mixed_Population_MildEI_Annually))/100; // this is the new comment to check appDelegate.Mixed_Population_Cost_Treatment_Annually_No_Guarantee=((appDelegate.Cost_Treatment_ModerateEI*appDelegate.Mixed_Population_MildEI_Annually)+(appDelegate.Cost_Treatment_MildEI*appDelegate.Mixed_Population_MildEI_Annually))/100; // new comment appDelegate.Mixed_Population_Cost_Treatment_Annually_No_Guarantee=((appDelegate.Cost_Treatment_ModerateEI*appDelegate.Mixed_Population_ModerateEI_Annually)+(appDelegate.Cost_Treatment_MildEI*appDelegate.Mixed_Population_MildEI_Annually))/100; appDelegate.Mixed_Population_Cost_Treatment_Annually_No_Guarantee=(((appDelegate.Cost_Treatment_SevereEI *appDelegate.Mixed_Population_SevereEI_Annually) + (appDelegate.Cost_Treatment_ModerateEI *appDelegate.Mixed_Population_ModerateEI_Annually) + (appDelegate.Cost_Treatment_MildEI * appDelegate.Mixed_Population_MildEI_Annually)) * appDelegate.Same_Vaccination_Horses_Per_Premise)/100; NSLog(@"Mixed_Population_Cost_Treatment_Annually_No_Guarantee is %.2f",appDelegate.Mixed_Population_Cost_Treatment_Annually_No_Guarantee); costOfVaccinationUVHL.text=[NSString stringWithFormat:@"$%.2f", appDelegate.Same_Vaccination_Cost_Vaccination_Unvaccinated]; costOfDaysOfTrainginUVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated]; costofTreatmentUVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated]; costOfVaccinationAVHL.text=[NSString stringWithFormat:@"$%.2f", appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee]; costOfDaysOfTrainginAVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee]; costofTreatmentAVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee]; NSLog(@"Same_Vaccination_Cost_Treatment_Annually_No_Guarantee is %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee); costOfVaccinationAWGVHL.text=[NSString stringWithFormat:@"%.2f", appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee]; costOfDaysOfTrainginAWGVHL.text=[NSString stringWithFormat:@"%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee]; costOfVaccinationSAVHL.text=[NSString stringWithFormat:@"$%.2f", appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_No_Guarantee]; costOfDaysOfTrainginSAVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee]; costofTreatmentSAVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee]; costOfVaccinationSAWGVHL.text=[NSString stringWithFormat:@"$%.2f", appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_With_Guarantee]; costOfDaysOfTrainginSAWGVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee]; costofTreatmentSAWGVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_With_Guarantee]; float firsttotal=appDelegate.Same_Vaccination_Cost_Vaccination_Unvaccinated+appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated+appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated; float secondTotal= appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee+appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee+appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee; float thirdTotal= appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee+appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee+appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee; V1=secondTotal-thirdTotal; unvaccinatedTotal.text=[NSString stringWithFormat:@"$%.2f",firsttotal]; AnnvaccinatedTotal.text=[NSString stringWithFormat:@"$%.2f",secondTotal]; AnnvaccinatedTotalWG.text=[NSString stringWithFormat:@"$%.2f",thirdTotal];; appDelegate.itemOneValue=firsttotal; appDelegate.itemTwoValue=secondTotal; appDelegate.itemThreeValue=thirdTotal; float fourtotal=appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_No_Guarantee+appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee+appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee; SAnnvaccinatedTotal.text=[NSString stringWithFormat:@"$%.2f",fourtotal]; appDelegate.itemFourValue=fourtotal; float five=appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_With_Guarantee+appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee+appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_With_Guarantee; appDelegate.itemFiveValue=five; [numberOfHorsesTextField setKeyboardType:UIKeyboardTypeNumberPad]; SAnnvaccinatedTotalWG.text=[NSString stringWithFormat:@"$%.2f",five]; [numberOfHorsesTextField addTarget:self action:@selector(textFieldTextDidChange:) forControlEvents:UIControlEventEditingChanged]; V2=five-fourtotal; numberOfHorsesTextField.text=@"1"; number=1; appDelegate.Mixed_Population_Cost_Vaccination_SemiAnnually_No_Guarantee=appDelegate.Cost_1_Vaccine_Dose*2; NSLog(@"My Testing Values is %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee); costofTreatmentAWGVHL.text=[NSString stringWithFormat:@"%.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee]; float firsttotaltest=appDelegate.Same_Vaccination_Cost_Vaccination_Unvaccinated+appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated+appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated; NSLog(@"firsttotal Percentage is %.2f",firsttotaltest); /*************************************************************************************************/ /*************************************************************************************************/ maximumValue=firsttotal; //int maximumValue2=secondTotal; NSLog(@"Maximum Value is %d",maximumValue); if (maximumValue>500 && maximumValue<1000) { maximumValue=1000; int newvalue=1000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>1000 && maximumValue<2000) { maximumValue=2000; int newvalue=2000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>2000 && maximumValue<3000) { maximumValue=3000; int newvalue=3000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>3000 && maximumValue<5000) { maximumValue=5000; int newvalue=5000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>5000 && maximumValue<10000) { maximumValue=10000; int newvalue=10000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>10000 && maximumValue<15000) { maximumValue=15000; int newvalue=15000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>15000 && maximumValue<20000) { maximumValue=20000; int newvalue=20000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>20000 && maximumValue<30000) { maximumValue=30000; int newvalue=30000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>30000 && maximumValue<50000) { maximumValue=50000; int newvalue=50000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>50000 && maximumValue<70000) { maximumValue=70000; int newvalue=70000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>70000 && maximumValue<90000) { maximumValue=90000; int newvalue=90000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>90000 && maximumValue<120000) { maximumValue=120000; int newvalue=120000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>120000 && maximumValue<150000) { maximumValue=150000; int newvalue=150000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else if (maximumValue>150000 && maximumValue<200000) { maximumValue=200000; int newvalue=200000/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } else { maximumValue=500; int newvalue=500/4; int newvalue1=newvalue+newvalue; int newvalue2=newvalue+newvalue1; int newvalue3=newvalue+newvalue2; labelOne.text=[NSString stringWithFormat:@"$%d",newvalue]; labelTwo.text=[NSString stringWithFormat:@"$%d",newvalue1]; labelThree.text=[NSString stringWithFormat:@"$%d",newvalue2]; labelFour.text=[NSString stringWithFormat:@"$%d",newvalue3]; } /***********************************/ float h3=(appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated*100)/maximumValue; int h3new=h3*1.6; int height3=(int)roundf(h3new); valueOne=(int)roundf(appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated); ////thirdView=[[UIView alloc] initWithFrame:CGRectMake(190,360,100,-height3)]; thirdView=[[UIView alloc] initWithFrame:CGRectMake(285,300,50,-height3)]; thirdView.backgroundColor=[UIColor colorWithRed:(102/255.f) green:(107/255.f) blue:(40/255.f) alpha:1]; [self.view addSubview:thirdView]; /***********************************************************/ NSLog(@"View Six Value is %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee); float h6=(appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee*100)/maximumValue; int h6new=h6*1.6; int height6=(int)roundf(h6new); NSLog(@"View Six Value h6 is %.2f",h6); SixView=[[UIView alloc] initWithFrame:CGRectMake(440,300,50,-height6)]; SixView.backgroundColor=[UIColor colorWithRed:(102/255.f) green:(107/255.f) blue:(40/255.f) alpha:1]; [self.view addSubview:SixView]; /****************************************************/ NSLog(@"View Six Value is %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee); float h9=(appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee*100)/maximumValue; int h9new=h9*1.6; int height9=(int)roundf(h9new); NSLog(@"View Six Value h9 is %.2f",h9); NineView=[[UIView alloc] initWithFrame:CGRectMake(570,300,50,-height9)]; NineView.backgroundColor=[UIColor colorWithRed:(102/255.f) green:(107/255.f) blue:(40/255.f) alpha:1]; [self.view addSubview:NineView]; /****************************************************************************/ NSLog(@"View Six Value is %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee); float h12=(appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_No_Guarantee*100)/maximumValue; int h12new=h12*1.6; int height12=(int)roundf(h12new); NSLog(@"View Six height12 is %.2f",h12); TwelveView=[[UIView alloc] initWithFrame:CGRectMake(720,300,50,-height12)]; TwelveView.backgroundColor=[UIColor colorWithRed:(102/255.f) green:(107/255.f) blue:(40/255.f) alpha:1]; [self.view addSubview:TwelveView]; /********************************************************/ float h15=(appDelegate.Same_Vaccination_Cost_Treatment_SemiAnnually_With_Guarantee*100)/maximumValue; int h15new=h15*1.6; int height15=(int)roundf(h15new); NSLog(@"View Six height15 is %.2f",h15); FifteenView=[[UIView alloc] initWithFrame:CGRectMake(850,300,50,-height15)]; FifteenView.backgroundColor=[UIColor colorWithRed:(102/255.f) green:(107/255.f) blue:(40/255.f) alpha:1]; [self.view addSubview:FifteenView]; /******************************************************/ int yvalue2=300-height3; //int height2=(int)roundf(appDelegate.Same_Vaccination_ModerateEI_Unvaccinated); float h2=(appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated*100)/maximumValue; valueTwo=(int)roundf(appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated); NSLog(@"Second H2 is %f.2f",h2); int h2new=h2*1.6; int height2=(int)roundf(h2new); secondView=[[UIView alloc] initWithFrame:CGRectMake(285,yvalue2,50,-height2)]; secondView.backgroundColor=[UIColor colorWithRed:(184/255.f) green:(188/255.f) blue:(103/255.f) alpha:1]; [self.view addSubview:secondView]; /**********************************************************/ int yvalue5=300-height6; float h5=(appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee*100)/maximumValue; NSLog(@"Second H5 is %f.2f",h5); int h5new=h5*1.6; int height5=(int)roundf(h5new); //int height2=40; fiveView=[[UIView alloc] initWithFrame:CGRectMake(440,yvalue5,50,-height5)]; fiveView.backgroundColor=[UIColor colorWithRed:(184/255.f) green:(188/255.f) blue:(103/255.f) alpha:1]; [self.view addSubview:fiveView]; /***********************************************************/ int yvalue8=300-height9; float h8=(appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee*100)/maximumValue; NSLog(@"Second H8 is %f.2f",h8); int h8new=h8*1.6; int height8=(int)roundf(h8new); //int height2=40; EightView=[[UIView alloc] initWithFrame:CGRectMake(570,yvalue8,50,-height8)]; EightView.backgroundColor=[UIColor colorWithRed:(184/255.f) green:(188/255.f) blue:(103/255.f) alpha:1]; [self.view addSubview:EightView]; /*****************************************************************/ int yvalue11=300-height12; float h11=(appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_No_Guarantee*100)/maximumValue; NSLog(@"Second h11 is %f.2f",h11); int h11new=h11*1.6; int height11=(int)roundf(h11new); ElevenView=[[UIView alloc] initWithFrame:CGRectMake(720,yvalue11,50,-height11)]; ElevenView.backgroundColor=[UIColor colorWithRed:(184/255.f) green:(188/255.f) blue:(103/255.f) alpha:1]; [self.view addSubview:ElevenView]; /*************************************************************/ int yvalue14=300-height15; float h14=(appDelegate.Same_Vaccination_Cost_DaysOffTraining_SemiAnnually_With_Guarantee*100)/maximumValue; NSLog(@"Second h14 is %f.2f",h14); int h14new=h14*1.6; int height14=(int)roundf(h14new); FourteenView=[[UIView alloc] initWithFrame:CGRectMake(850,yvalue14,50,-height14)]; FourteenView.backgroundColor=[UIColor colorWithRed:(184/255.f) green:(188/255.f) blue:(103/255.f) alpha:1]; [self.view addSubview:FourteenView]; /**************************************************************/ int totalheight=height2+height3; int yvalue1=300-totalheight; float h1=(appDelegate.Same_Vaccination_Cost_Vaccination_UnvaccinatedNumber*100)/firsttotal; valueThree=(int)roundf(appDelegate.Same_Vaccination_Cost_Vaccination_UnvaccinatedNumber); NSLog(@"h1 values is %.2f ",h1); int height1=(int)roundf(h1); //int height1=(int)roundf(appDelegate.Same_Vaccination_SevereEI_Unvaccinated); //int height1=20; firstView=[[UIView alloc] initWithFrame:CGRectMake(290,yvalue1,50,-height1)]; firstView.backgroundColor=[UIColor colorWithRed:(225/255.f) green:(222/255.f) blue:(117/255.f) alpha:1]; [self.view addSubview:firstView]; /***************************************************************************/ int totalheightone=height5+height6; int yvalue4=300-totalheightone; float h4=(appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee*100)/maximumValue; //int h4new=h4*1.6; int height4=(int)roundf(h4); fourView=[[UIView alloc] initWithFrame:CGRectMake(440,yvalue4,50,-height4)]; fourView.backgroundColor=[UIColor colorWithRed:(225/255.f) green:(222/255.f) blue:(117/255.f) alpha:1]; [self.view addSubview:fourView]; /***************************************************************************************/ int totalheighttwo=height8+height9; int yvalue7=300-totalheighttwo; float h7=(appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee*100)/maximumValue; int h7new=h7*1.6; int height7=(int)roundf(h7new); SevenView=[[UIView alloc] initWithFrame:CGRectMake(570,yvalue7,50,-height7)]; SevenView.backgroundColor=[UIColor colorWithRed:(225/255.f) green:(222/255.f) blue:(117/255.f) alpha:1]; [self.view addSubview:SevenView]; /****************************************************************************************/ int totalheightthree=height11+height12; int yvalue10=300-totalheightthree; float h10=(appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_No_Guarantee*100)/maximumValue; int h10new=h10*1.6; NSLog(@"h10 values is %.2f ",h10); int height10=(int)roundf(h10new); TenView=[[UIView alloc] initWithFrame:CGRectMake(720,yvalue10,50,-height10)]; TenView.backgroundColor=[UIColor colorWithRed:(225/255.f) green:(222/255.f) blue:(117/255.f) alpha:1]; [self.view addSubview:TenView]; /*****************************************************************************************/ int totalheightfour=height14+height15; int yvalue13=300-totalheightfour; float h13=(appDelegate.Same_Vaccination_Cost_Vaccination_SemiAnnually_With_Guarantee*100)/maximumValue; //int h13new=h13*1.6; int height13=(int)roundf(h13); ThirteenView=[[UIView alloc] initWithFrame:CGRectMake(850,yvalue13,50,-height13)]; ThirteenView.backgroundColor=[UIColor colorWithRed:(225/255.f) green:(222/255.f) blue:(117/255.f) alpha:1]; [self.view addSubview:ThirteenView]; /*****************************************************************************************/ [super viewDidLoad]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [myArray count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } cell.textLabel.font=[UIFont fontWithName:@"Arial" size:13]; cell.textLabel.textAlignment=UITextAlignmentLeft; cell.textLabel.text = [myArray objectAtIndex:indexPath.row]; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { title=[myArray objectAtIndex:indexPath.row]; NSLog(@"This is professionTitle Selected %@",title); if ([title isEqualToString:@"Yes, same vaccination strategy on entire premise"]) { } else { } titleLabel.text=title; tblSimpleTable.hidden=YES; tableImageView.hidden=YES; } -(IBAction)btnClicked{ flag=0; tblSimpleTable.hidden=NO; tableImageView.hidden=NO; } /* -(IBAction)showUpdatesButtonAction1{ appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee=appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee*number; NSLog(@"Value 1 %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee); appDelegate.Same_Vaccination_Cost_Vaccination_Unvaccinated=appDelegate.Same_Vaccination_Cost_Vaccination_Unvaccinated*number; NSLog(@"Value 2 %.2f",appDelegate.Same_Vaccination_Cost_Vaccination_Unvaccinated); costOfVaccinationUVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Vaccination_Unvaccinated]; appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated=appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated*number; NSLog(@"Value 3 %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated); costOfDaysOfTrainginUVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Unvaccinated]; appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated=appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated*number; NSLog(@"Value 4 %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated); costofTreatmentUVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Treatment_Unvaccinated]; appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee=appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee*number; NSLog(@"Value 5 %.2f",appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee); costOfVaccinationAVHL.text=[NSString stringWithFormat:@"$%.2f", appDelegate.Same_Vaccination_Cost_Vaccination_Annually_No_Guarantee]; appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee=appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee*number; NSLog(@"Value 6 %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee); costOfDaysOfTrainginAVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_No_Guarantee]; //appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee=appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee*number; NSLog(@"Value 7 %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee); costofTreatmentAVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_No_Guarantee]; appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee=appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee*number; NSLog(@"Value 8 %.2f",appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee); costOfVaccinationAWGVHL.text=[NSString stringWithFormat:@"$%.2f", appDelegate.Same_Vaccination_Cost_Vaccination_Annually_With_Guarantee]; appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee=appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee*number; NSLog(@"Value 9 %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee); costOfDaysOfTrainginAWGVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee]; NSLog(@"Value 10 %.2f",appDelegate.Same_Vaccination_Cost_DaysOffTraining_Annually_With_Guarantee); appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee=appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee*number; NSLog(@"Value 11 %.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee); costofTreatmentAWGVHL.text=[NSString stringWithFormat:@"$%.2f",appDelegate.Same_Vaccination_Cost_Treatment_Annually_With_Guarantee]; appDelegate.Same_Vaccination_Cost_Vaccination_Semi
Private
[
?
]
Run code
Submit