<?php
	include("../utilities/UtilitiesManagers.php");
	include("../utilities/UtilitiesReporting.php");
	include("../utilities/UtilitiesClients.php");
	include("../utilities/UtilitiesEncryption.php");
	include("../utilities/UtilitiesSystem.php");
	include("../utilities/UtilitiesPDF.php");
	include("../include/session.php");
	global $database;
	
	date_default_timezone_set('America/New_York');
	$recID = $_GET["clientID"];

	$formSubmitType = "newClientRecord";
	if(isset($recID)){
		$clientsData = $clients->getClientData($recID);
		
		$name = $clientsData["client_name"];
		$clientStatus = $clientsData["status"];
		$ssn = $clientsData["social"];
		$ssn = $encryption->decrypt($ssn);
		
		$aliasMaidenName = $clientsData["alias_maidenName"];
		$SpouseOtherName = $clientsData["spouse_otherName"];
		$Phone = $clientsData["phone"];
		$WorkPhone = $clientsData["work_phone"];
		$Email = $clientsData["email_address"];
		$DLNumber = $clientsData["drivers_licenseNumber"];
		$PhoneComments = $clientsData["phone_comments"];
		$Employer = $clientsData["employer"];
		$Ethnicity = $clientsData["ethnicity"];
		$Birthday = $clientsData["birthdate"];
		$PrimaryAddress = $clientsData["primary_address"];
		$OtherAddr1 = $clientsData["other_address"];
		$OtherAddr2 = $clientsData["other_address2"];
		$OtherAddr3 = $clientsData["other_address3"];
		$OtherAddr4 = $clientsData["other_address4"];
		$City = $clientsData["city"];
		$State = $clientsData["state"];
		$Zip = $clientsData["zip"];
		$Children = $clientsData["children_info"];
		$TotalDollarAsisst = $clientsData["total_assist"];
		//
		$ChecksIssued = $clientsData["ChecksIssued"];
		$LastResults = $clientsData["last_results"];
		$FoodStamps = $clientsData["food_stamps"];
		$DatesFoodGiven = $clientsData["dates_foodGiven"];
		$NumberTimesFoodGiven = $clientsData["times_foodGiven"];
		$ChildcareScholarship = $clientsData["childcareScholarship"];
		$MKScholarship = $clientsData["mkScholarship"];
		$OtherDorcasPrograms = $clientsData["otherDorcasPrograms"];
		$EducationPrograms = $clientsData["educationCredits"];
		$ExternalPrograms = $clientsData["otherExternalPrograms"];
		//$notesAndHistory = $clientsData["notes_history"];
		$ReferredTo = $clientsData["ReferredTo"];
		$TakeHomePay = $clientsData["takehome_pay"];      
		$SpoouseOtherPay = $clientsData["spouse_otherPay"];    
		$AFDC = $clientsData["afdc"];
		$ChildSupport = $clientsData["child_support"];    
		$SocialSecurityIncome = $clientsData["social_securityReceived"];    
		$WIC = $clientsData["wic"];
		$SSIDIS = $clientsData["ssi_dis"];    
		$WorkFirst = $clientsData["work_first"];    
		$FoodStampsInc = $clientsData["food_stampsIncome"];     
		$TotalIncome = $clientsData["total_income"]; ;  
		$CreditCardPayments = $clientsData["CreditCardPayments"]; 
		$RentMortgage = $clientsData["rent_mortgage"]; 
		$RMType = $clientsData["rm_Type"];    
		$Water = $clientsData["water"];    
		$CableTV = $clientsData["cable_tv"];    
		$DayCare = $clientsData["daycare"];    
		$Electric = $clientsData["electric"];    
		$PowerCompAcctNum  = $clientsData["cpl_account"];   
		$CostOfHeat = $clientsData["cost_heat"];    
		$TypeOfHeat = $clientsData["type_heat"];    
		$OtherFixedExpenses = $clientsData["other_fixedExpenses"]; 
		$PhoneBill = $clientsData["phone_bill"];     
		$TotalFixedExpenses = $clientsData["total_fixedExpenses"];     
		$Food = $clientsData["food"];     
		$MedicalInsurance = $clientsData["medical_insurance"];     
		$NumberOfCars = $clientsData["number_cars"];   
		$MakeModel1 = $clientsData["makemodel_car1"];     
		$CarPayment1 = $clientsData["car_payment1"];     
		$MakeModel2 = $clientsData["makemodel_car2"];    
		$CarPayment2 = $clientsData["car_payment2"]; 
		$CarInsurancePayments = $clientsData["car_insurance"]; 
		$TotalOtherExpenses = $clientsData["total_otherExpenses"]; 
		$Deficit = $clientsData["Deficit"]; 
		$ChildSupportExpense 		= $clientsData["ChildSupportExpense"]; 
		$NaturalGasExpense 			= $clientsData["NaturalGasExpense"]; 
		$CellPhoneExpense 			= $clientsData["CellPhoneExpense"]; 
		$OtherMedicalExpense 		= $clientsData["OtherMedicalExpense"]; 
		$GasExpense 				= $clientsData["GasExpense"]; 
		$OtherTransportationExpense = $clientsData["OtherTransportationExpense"]; 
		$Gender 					= $clientsData["Gender"]; 
		/*
		Fields No Longer Used??
		special_programs
		holiday_programs
		housing_subsidies
		date   <-----Used in Client Activity Now
		*/
		$formSubmitType = "editClientRecord";
		$PDFFileName = "clientPDFs/" . $recID . ".pdf";
		switch($clientStatus)
		{
			case 1:
				$clientOK = "checked";
				break;
			case 2:
				$clientCaution = "checked";
				break;
			case 3:
				$clientCaution = "checked";
				break;
		}
		
		switch($Gender)
		{
			case 1:
				$genderMale = "checked";
				break;
			case 2:
				$genderFemale = "checked";
				break;
		}
	///////////////////////////////////////////////////////////////////////////////////////
	//GENERATE FINANCIAL REPORTS
		
		switch($clientStatus)
		{
			case 1:
				$clientStatusTxt = "Can Provide Assistance";
				break;
			case 2:
				$clientStatusTxt = "No Longer Provide Assistance";
				break;
			case 3:
				$clientStatusTxt = "Caution";
				break;
		}
	}
	
?>

<script type="text/javascript" src="js/jquery.itextclear.js"></script>
<script type="text/javascript" src="js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="js/jquery.autogrowtextarea.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('input[type=text], input[type=password], input[type=url], input[type=email], input[type=number]', '.form').iTextClear();
	
	$("#form-children").autoGrow();
	$("#form-noteshistory").autoGrow();
	$("#form-ChecksIssued").autoGrow();
	$("#form-DatesFoodGiven").autoGrow();

	$(".calcExpenses").keydown(function(event) {
        // Allow: backspace, delete, tab and escape
        if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || 
             // Allow: Ctrl+A
            (event.keyCode == 65 && event.ctrlKey === true) || 
             // Allow: home, end, left, right
            (event.keyCode >= 35 && event.keyCode <= 39)) {
                 // let it happen, don't do anything
                 return;
        }
        else {
            // Ensure that it is a number and stop the keypress
            if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105 )) {
                event.preventDefault(); 
            }   
        }
    });

	
	$(".calcExpenses").blur(function(){
		var sum = 0;
		var numberRegex = /^[+-]?\d+(\.\d+)?([eE][+-]?\d+)?$/;

		$('.calcExpenses').each(function(){
			if(numberRegex.test($(this).val())) {
			   sum = sum + parseFloat($(this).val());
			}
		});
		// here, you have your sum
			$("#form-TotalOtherExpenses").val(sum);
			
		var deficit = 0;
		var income = 0;
		var expenses = 0;
		
		
		if(numberRegex.test($("#form-TotalIncome").val())){
			income = $("#form-TotalIncome").val();
		}else{
			$("#form-TotalIncome").val(0);
		}
		
		if(numberRegex.test($("#form-TotalOtherExpenses").val())){
			expenses = $("#form-TotalOtherExpenses").val();
		}else{
			$("#form-TotalOtherExpenses").val(0);
		}
		
		
		deficit = parseFloat(income) - parseFloat(expenses);
		$("#form-Deficit").val(deficit);
	});
	
	$(".clacIncome").blur(function(){
		var sum = 0;
		var numberRegex = /^[+-]?\d+(\.\d+)?([eE][+-]?\d+)?$/;

		$('.clacIncome').each(function(){
			if(numberRegex.test($(this).val())) {
			   sum = sum + parseFloat($(this).val());
			}
		});
		// here, you have your sum
			$("#form-TotalIncome").val(sum);
			
			
		var deficit = 0;
		var income = 0;
		var expenses = 0;
		
		
		if(numberRegex.test($("#form-TotalIncome").val())){
			income = $("#form-TotalIncome").val();
		}else{
			$("#form-TotalIncome").val(0);
		}
		
		if(numberRegex.test($("#form-TotalOtherExpenses").val())){
			expenses = $("#form-TotalOtherExpenses").val();
		}else{
			$("#form-TotalOtherExpenses").val(0);
		}
		

		deficit = parseFloat(income) - parseFloat(expenses);

		$("#form-Deficit").val(deficit);
		
	});
	$("#generatedClientReportWrapper").hide();
	$("#clientFinancialReport").click(function(){
		$.ajax({
			type: 'POST', 
			url: "views/generateFinancialReport.php",
			data: $('#clientForm').serialize(), 
			success: function(data) {
				$("#generatedClientReportWrapper").show();
				$("#generatedClientReport").html("<a id='generatedReport' href='views/"+data+"' target='_blank' class='button'>Click To View Report</a>");
				
		  }
		});
	});
	
	
	

});

function GenerateReport()
{
    document.clientForm.action = "views/generatefinancialreport.php"
	
    document.clientForm.submit();   
	
    return true;
}
</script>
	<?php
		if(isset($recID)){
	?>
	<h1 class="page-title">Client Record: <?php echo $name; ?></h1>	
	<?php
		}else{
	?>
	<h1 class="page-title">New Client</h1>
	<?php	}	?>
	<div class="container_12 clearfix leading">
		<div class="grid_12">
			
			<?php
				if(isset($recID)){
			?>
			<div class="tabs leading">
				<ul class="clearfix">
					<li><a href="#">Client Overview</a></li>
					<li><a href="#">Client Notes and History</a></li>
					<li><a href="#">Full Client Activity</a></li>
					<?php if($session->isAdmin()){ ?>
					<li><a href="#">Client Actions</a></li>
					<?php } ?>
				</ul>
				<section>
					<section class="clearfix">
					  <?php	echo $clients->getClientStatus($recID); ?>
					</section>
					
					<section class="clearfix">
					  <?php	echo $clients->getClientNotes($recID, $session->username); ?>
					</section>
					
					<section class="clearfix">
					  <?php	echo $clients->getActivity($recID, ""); ?>
					</section>
					
					<?php if($session->isAdmin()){ ?>
					<section class="clearfix">
					  <form class="form has-validation" action="process.php" method="POST">
					  
							<input type="hidden" name="clientID" value="<?php echo $_GET["clientID"];?>"/>
							<input type="hidden" name="deleteClient" value="1"/>
							
							<div class="form-inputReports"><input type="submit" class="button" value="Delete <?php echo $name; ?>" /></div>
					
					  </form>
					</section>
					<?php } ?>
				</section>
			</div>
			<br/>
			<br/>
			<?php	}	?>
			<form class="form" method="POST" name="clientForm" id="clientForm" action="process.php">
				<!-- BEGIN CLIENT STATUS/REPORTS BLOCK -->
				
				<?php
				if(isset($recID)){
				?>
				<div class="clearfix">
					<h4>Client Reports</h4>
				</div>
				
				<div class="clearfix">
					<label for="form-clientFinancialReport" class="form-label">Client Financial Report</label>
					<div class="form-inputReports">
					<!--<a target="_blank" href="views/generateFinancialReport.php?clientID=echo $recID; " id="clientFinancialReport" class="button">Generate Report</a></div>-->
					<a target="_blank" id="clientFinancialReport" class="button" >Generate Report</a></div>
					
				</div>
				
				<div class="clearfix" id="generatedClientReportWrapper">
					<label for="form-clientFinancialReport" class="form-label"><font color="red">Generated Client Report</font></label>
					<div class="form-inputReports" id="generatedClientReport">
					
					<!--<a target="_blank" href="views/generateFinancialReport.php?clientID=echo $recID; " id="clientFinancialReport" class="button">Generate Report</a></div>-->
					</div>
				</div>
				<!-- END CLIENT STATUS/REPORTS BLOCK-->		
				<?php } ?>	
				
				<div class="clearfix">
					<h4>Client Status</h4>
				</div>
		   
				<div class="clearfix">
					<label for="form-status" class="form-label">Status</label>
					
					<div class="form-input">
					
						<div class="radiogroup">
							<label>
								<input type="radio" name="canAssist" <?php echo $clientOK; ?> value="1" required="required"/> 
								OK
							</label>
							<br/><br/>
							<label>
								<input type="radio" name="canAssist" <?php echo $clientCaution; ?> value="3" required="required"/> 
								Caution
							</label>
						</div>
					</div>
				</div>
					
				<div class="clearfix">
					<h4>&nbsp;</h4>
				</div>
				
				<div class="clearfix">

							<label for="form-TotalDollarAsisst" class="form-label">Total Dollar Assistance To Date<em>*</em></label>

							<div class="form-input"><input type="text" id="form-TotalDollarAsisst" name="TotalDollarAsisst" value="<?php echo $TotalDollarAsisst; ?>" placeholder="Enter Total Dollar Assistance" /></div>

						</div>
				<div class="clearfix">

							<label for="form-ChecksIssued" class="form-label">Checks Issued</label>

							<div class="form-input form-textarea"><textarea id="form-ChecksIssued" name="ChecksIssued" rows="5"><?php echo $ChecksIssued; ?></textarea></div>

						</div>
						
				<div class="clearfix">

							<label for="form-LastResults" class="form-label">Last Results<em>*</em></label>

							<div class="form-input"><input type="text" id="form-LastResults" name="LastResults" value="<?php echo $LastResults; ?>" placeholder="Enter Last Results" /></div>

						</div>
				<div class="clearfix">
					<h4>Client Information</h4>
				</div>
						
				<div class="clearfix">
					<label for="form-ssn" class="form-label">SSN <em>*</em></label>
					<div class="form-input"><input type="text" id="form-ssn" name="ssn" value="<?php echo $ssn; ?>" placeholder="Enter SSN Number" /></div>
				</div>
				<!-- END SSN-->
				
				<!--
				<div class="clearfix">
					<label for="form-name" class="form-label">Todays Date <em>*</em></label>
					<div class="form-input"><input readonly="" type="text" id="form-name" name="name" placeholder="Enter your name" /></div>
				</div>
				 END Todays Date-->		
				
				<div class="clearfix">
					<label for="form-Gender" class="form-label">Gender</label>
					<div class="form-input">
						<div class="radiogroup">
							<label>
								<input type="radio" name="Gender" <?php echo $genderMale; ?> id="form-Gender" value="1" />
								Male
							</label> 
							<label>
								<input type="radio" name="Gender" <?php echo $genderFemale; ?> value="2" /> 
								Female
							</label>
						</div>
					</div>
				</div>
				<!-- END Gender Selection-->		
				
				<div class="clearfix">
					<label for="form-name" class="form-label">Name <em>*</em></label>
					<div class="form-input"><input type="text" id="form-name" name="name" value="<?php echo $name; ?>" placeholder="Enter Clients Name" /></div>
				</div>
				<!-- END -->
				
				<div class="clearfix">
					<label for="form-aliasMaidenName" class="form-label">Alias/Maiden Name <em>*</em></label>
					<div class="form-input"><input type="text" id="form-aliasMaidenName" name="aliasMaidenName" value="<?php echo $aliasMaidenName; ?>" placeholder="Enter Alias/Maiden Name" /></div>
				</div>
				<!-- END Alias/Maiden Name-->		
				
				<div class="clearfix">
					<label for="form-SpouseOtherName" class="form-label">Spouse/Other Name <em>*</em></label>
					<div class="form-input"><input type="text" id="form-SpouseOtherName" name="SpouseOtherName" value="<?php echo $SpouseOtherName; ?>" placeholder="Enter A Souce/Other Name" /></div>
				</div>
				<!-- END Spouse/Other Name-->
				
				<div class="clearfix">
					<label for="form-Phone" class="form-label">Phone <em>*</em></label>
					<div class="form-input"><input type="text" id="form-Phone" name="Phone" value="<?php echo $Phone; ?>"  placeholder="Enter A Phone Number" /></div>
				</div>
				<!-- END Phone-->
				
				<div class="clearfix">
					<label for="form-WorkPhone" class="form-label">Work Phone <em>*</em></label>
					<div class="form-input"><input type="text" id="form-WorkPhone" name="WorkPhone" value="<?php echo $WorkPhone; ?>" placeholder="Enter A Work Phone Number" /></div>
				</div>
				<!-- END Work Phone-->		
						
						
					
						
						<div class="clearfix">

							<label for="form-PhoneComments" class="form-label">Phone Comments <em>*</em></label>

							<div class="form-input"><input type="text" id="form-PhoneComments" name="PhoneComments" value="<?php echo $PhoneComments; ?>" placeholder="Enter Any Comments Regarding Phone Numbers" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-Email" class="form-label">Email</label>

							<div class="form-input"><input type="email" id="form-Email" name="Email" value="<?php echo $Email; ?>" placeholder="Enter An Email Address" /></div>

						</div>

						<div class="clearfix">

							<label for="form-Employer" class="form-label">Employer <em>*</em></label>

							<div class="form-input"><input type="text" id="form-Employer" name="Employer" value="<?php echo $Employer;?>" placeholder="Enter Current Employer" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-DLNumber" class="form-label">Drivers License Number: <em>*</em></label>

							<div class="form-input"><input type="text" id="form-DLNumber" name="DLNumber" value="<?php echo $DLNumber;?>" placeholder="Enter Drivers License Number" /></div>

						</div>

						<div class="clearfix">
                            <label for="form-Ethnicity" class="form-label">Ethnicity</label>
							<div class="form-input">
								<select id="form-Ethnicity" name="Ethnicity">
									<option>SELECT ETHNICITY</option>
									<?php $system->getEthnicity($Ethnicity); ?>
								</select>
							</div>
                        </div>
						
						
						
						
						<div class="clearfix">

							<label for="form-birthday" class="form-label">Birthdate <em>*</em></label>

							<div class="form-input"><input type="text" id="form-birthday" name="Birthday" value="<?php echo $Birthday; ?>" placeholder="Enter Birthday" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-PrimaryAddress" class="form-label">Primary Address <em>*</em></label>

							<div class="form-input"><input type="text" id="form-PrimaryAddress" name="PrimaryAddress" value="<?php echo $PrimaryAddress; ?>" placeholder="Enter Primary Address" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherAddr1" class="form-label">Other Address <em>*</em></label>

							<div class="form-input"><input type="text" id="form-OtherAddr1" name="OtherAddr1" value="<?php echo $OtherAddr1; ?>" placeholder="Enter Other Address" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherAddr2" class="form-label">Other Address <em>*</em></label>

							<div class="form-input"><input type="text" id="form-OtherAddr2" name="OtherAddr2" value="<?php echo $OtherAddr2; ?>" placeholder="Enter Other Address" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherAddr3" class="form-label">Other Address <em>*</em></label>

							<div class="form-input"><input type="text" id="form-OtherAddr3" name="OtherAddr3" value="<?php echo $OtherAddr3; ?>" placeholder="Enter Other Address" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherAddr4" class="form-label">Other Address <em>*</em></label>

							<div class="form-input"><input type="text" id="form-OtherAddr4" name="OtherAddr4" value="<?php echo $OtherAddr4; ?>" placeholder="Enter Other Address" /></div>

						</div>
						
						<div class="clearfix">
                            <label for="form-City" class="form-label">City</label>
							<div class="form-input">
								<select id="form-City" name="City">
									<?php $system->getCities($City); ?>
								</select>
							</div>
                        </div>
							
							
							
						
						<div class="clearfix">

							<label for="form-State" class="form-label">State<em>*</em></label>

							<div class="form-input"><input type="text" id="form-State" name="State" value="<?php echo $State; ?>" placeholder="Enter State" /></div>

						</div>	
			
						<div class="clearfix">

							<label for="form-Zip" class="form-label">Zip<em>*</em></label>

							<div class="form-input"><input type="text" id="form-Zip" name="Zip" value="<?php echo $Zip; ?>" placeholder="Enter Zip" /></div>

						</div>

						<div class="clearfix">

							<label for="form-Children" class="form-label">Children</label>

							<div class="form-input form-textarea"><textarea id="form-Children" name="Children" rows="5"><?php echo $Children; ?></textarea></div>

						</div>

						
						
						
						
						
						<div class="clearfix">

							<label for="form-FoodStamps" class="form-label">Food Stamps<em>*</em></label>

							<div class="form-input"><input type="text" id="form-FoodStamps" name="FoodStamps" value="<?php echo $FoodStamps; ?>" placeholder="Enter Food Stamps Value" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-DatesFoodGiven" class="form-label">Dates Food Given<em>*</em></label>
							<div class="form-input form-textarea"><textarea id="form-DatesFoodGiven" name="DatesFoodGiven" rows="5"><?php echo $DatesFoodGiven; ?></textarea></div>
						</div>
						
						<div class="clearfix">

							<label for="form-NumberTimesFoodGiven" class="form-label">Number Of Times Food Given<em>*</em></label>

							<div class="form-input"><input type="text" id="form-NumberTimesFoodGiven" name="NumberTimesFoodGiven" value="<?php echo $NumberTimesFoodGiven; ?>" placeholder="Enter Number Of Times Food Given" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-ChildcareScholarship" class="form-label">Childcare Scholarship Program<em>*</em></label>

							<div class="form-input"><input type="text" id="form-ChildcareScholarship" name="ChildcareScholarship" value="<?php echo $ChildcareScholarship; ?>" placeholder="Enter Childcare Scholarship Program Value" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-MKScholarship" class="form-label">MK Scholarship Program<em>*</em></label>

							<div class="form-input"><input type="text" id="form-MKScholarship" name="MKScholarship" value="<?php echo $MKScholarship; ?>" placeholder="Enter MK Scholarship Program" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherDorcasPrograms" class="form-label">Other Dorcas Programs<em>*</em></label>

							<div class="form-input"><input type="text" id="form-OtherDorcasPrograms" name="OtherDorcasPrograms" value="<?php echo $OtherDorcasPrograms; ?>" placeholder="Enter Other Dorcas Program" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-EducationPrograms" class="form-label">Education Credits<em>*</em></label>

							<div class="form-input"><input type="text" id="form-EducationPrograms" name="EducationPrograms" value="<?php echo $EducationPrograms; ?>" placeholder="Enter Education Credits" /></div>

						</div>
						
						
						<div class="clearfix">

							<label for="form-ExternalPrograms" class="form-label">Other External Programs<em>*</em></label>

							<div class="form-input"><input type="text" id="form-ExternalPrograms" name="ExternalPrograms" value="<?php echo $ExternalPrograms; ?>" placeholder="Enter Other External Programs" /></div>

						</div>
						
						
						
						
						
						
						<div class="clearfix">
							<label for="form-notesAndHistory" class="form-label">Notes and History</label>
							<div class="form-input form-textarea"><textarea id="form-notesAndHistory" name="notesAndHistory" rows="5"><?php echo $notesAndHistory; ?></textarea></div>
						</div>
						<div class="clearfix">

							<label for="form-ReferredTo" class="form-label">Referred To:<em>*</em></label>

							<div class="form-input"><input type="text" id="form-ReferredTo" name="ReferredTo" value="<?php echo $ReferredTo;?>" placeholder="Enter Referred To" /></div>

						</div>
						
						<div class="clearfix">

							<h4>Monthly Incomes</h4>
						</div>
						
						<div class="clearfix">

							<label for="form-TakeHomePay" class="form-label">Take Home Pay<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-TakeHomePay" name="TakeHomePay" value="<?php echo $TakeHomePay;?>" placeholder="Enter Take Home Pay" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-SpoouseOtherPay" class="form-label">Spouse/Other Pay<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-SpoouseOtherPay" name="SpoouseOtherPay" value="<?php echo $SpoouseOtherPay; ?>" placeholder="Enter Spouse/Other Pay" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-AFDC" class="form-label">AFDC<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-AFDC" name="AFDC" value="<?php echo $AFDC; ?>" placeholder="Enter AFDC" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-ChildSupport" class="form-label">Child Support/Alimony<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-ChildSupport" name="ChildSupport" value="<?php echo $ChildSupport; ?>" placeholder="Enter Child Support Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-SocialSecurityIncome" class="form-label">Social Security (Income)<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-SocialSecurityIncome" name="SocialSecurityIncome" value="<?php echo $SocialSecurityIncome; ?>" placeholder="Enter Social Security Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-WIC" class="form-label">WIC<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-WIC" name="WIC" value="<?php echo $WIC; ?>" placeholder="Enter WIC Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-SSIDIS" class="form-label">SSI/DIS<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-SSIDIS" name="SSIDIS" value="<?php echo $SSIDIS; ?>" placeholder="Enter SSI/DIS Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-WorkFirst" class="form-label">Work First<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-WorkFirst" name="WorkFirst" value="<?php echo $WorkFirst; ?>" placeholder="Enter Work First Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-FoodStampsInc" class="form-label">Food Stamps (Income)<em>*</em></label>

							<div class="form-input"><input class="calcMe clacIncome" type="text" id="form-FoodStampsInc" name="FoodStampsInc" value="<?php echo $FoodStampsInc; ?>" placeholder="Enter Food Stamps Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-TotalIncome" class="form-label"><font color="red">Total Income</font></label>

							<div class="form-input">
							<input type="text" readonly="" id="form-TotalIncome" name="TotalIncome" value="<?php echo $TotalIncome; ?>" placeholder="Enter Total Income" />
							</div>
						</div>
						
						<div class="clearfix">
							<h4>Expenses</h4>
						</div>
						
						<div class="clearfix">

							<label for="form-RentMortgage" class="form-label">Rent Mortgage<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-RentMortgage" name="RentMortgage" value="<?php  echo $RentMortgage;?>" placeholder="Enter Rent/Mortgage Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-Water" class="form-label">Water<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-Water" name="Water" value="<?php echo $Water; ?>" placeholder="Enter Amount Spent On Water" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-DayCare" class="form-label">Day Care<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-DayCare" name="DayCare" value="<?php echo $DayCare; ?>" placeholder="Enter Amount Spent On Day Care" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-ChildSupportExpense" class="form-label">Child Support<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-ChildSupportExpense" name="ChildSupportExpense" value="<?php echo $ChildSupportExpense; ?>" placeholder="Enter Amount Spent On Child Support" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-Electric" class="form-label">Electric<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-Electric" name="Electric" value="<?php echo $Electric; ?>" placeholder="Enter Amount Spent On Electric" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-NaturalGasExpense" class="form-label">Natural Gas<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-NaturalGasExpense" name="NaturalGasExpense" value="<?php echo $NaturalGasExpense; ?>" placeholder="Enter Amount Spent On Natural Gas" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-CableTV" class="form-label">Cable TV<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-CableTV" name="CableTV" value="<?php echo $CableTV; ?>" placeholder="Enter Amount Spent On Cable" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-PhoneBill" class="form-label">Phone Bill<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-PhoneBill" name="PhoneBill" value="<?php echo $PhoneBill; ?>" placeholder="Enter Amount Spent On Phone Bill" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-CellPhoneExpense" class="form-label">Cell Phone Bill<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-CellPhoneExpense" name="CellPhoneExpense" value="<?php echo $CellPhoneExpense; ?>" placeholder="Enter Amount Spent On Cell Phone Bill" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-Food" class="form-label">Food<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-Food" name="Food" value="<?php echo $Food; ?>" placeholder="Enter Amount Spent On Food" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-MedicalInsurance" class="form-label">Medical Insurance<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-MedicalInsurance" name="MedicalInsurance" value="<?php echo $MedicalInsurance; ?>" placeholder="Enter Amount Spent On Medical Insurance" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherMedicalExpense" class="form-label">Other Medical Insurance<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-OtherMedicalExpense" name="OtherMedicalExpense" value="<?php echo $OtherMedicalExpense; ?>" placeholder="Enter Amount Spent On Other Medical Insurance" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-CarPayment1" class="form-label">Car Payment #1<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-CarPayment1" name="CarPayment1" value="<?php echo $CarPayment1; ?>" placeholder="Enter Car Payment For Car #1" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-CarPayment2" class="form-label">Car Payment #2<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-CarPayment2" name="CarPayment2" value="<?php echo $CarPayment2; ?>" placeholder="Enter Car Payment For Car #2" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-CarInsurancePayments" class="form-label">Car Insurance Payments<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-CarInsurancePayments" name="CarInsurancePayments" value="<?php echo $CarInsurancePayments; ?>" placeholder="Enter Car Insurance Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-GasExpense" class="form-label">Gasoline<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-GasExpense" name="GasExpense" value="<?php echo $GasExpense; ?>" placeholder="Enter Gas Amount" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherTransportationExpense" class="form-label">Other Transportation Expense<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-OtherTransportationExpense" name="OtherTransportationExpense" value="<?php echo $OtherTransportationExpense; ?>" placeholder="Enter Other Transportation Amounts" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-CreditCardPayments" class="form-label">Credit Card Payments<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-CreditCardPayments" name="CreditCardPayments" value="<?php  echo $CreditCardPayments;?>" placeholder="Enter Credit Card Payments" /></div>

						</div>
						
						<div class="clearfix">

							<label for="form-OtherFixedExpenses" class="form-label">Other Fixed Expenses<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-OtherFixedExpenses" name="OtherFixedExpenses" value="<?php echo $OtherFixedExpenses; ?>" placeholder="Enter Other Fixed Expenses Total Amount" /></div>

						</div>
						
						
						
						<!--
						<div class="clearfix">

							<label for="form-RMType" class="form-label">RM Type<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-RMType" name="RMType" value="<?php echo $RMType; ?>" placeholder="Enter RM Type" /></div>

						</div>
						-->
						<!--
						<div class="clearfix">

							<label for="form-PowerCompAcctNum" class="form-label">Power Company Account Number<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-PowerCompAcctNum" name="PowerCompAcctNum" value="<?php echo $PowerCompAcctNum; ?>" placeholder="Enter Power Company Account Number" /></div>

						</div>
						-->
						<!--
						<div class="clearfix">

							<label for="form-CostOfHeat" class="form-label">Cost Of Heat<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-CostOfHeat" name="CostOfHeat" value="<?php echo $CostOfHeat; ?>" placeholder="Enter Cost Of Heat" /></div>

						</div>
						-->
						<!--
						<div class="clearfix">

							<label for="form-TypeOfHeat" class="form-label">Type Of Heat<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-TypeOfHeat" name="TypeOfHeat" value="<?php echo $TypeOfHeat; ?>" placeholder="Enter Type Of Heating" /></div>

						</div>
						-->
						
						
						
						
						<!--
						<div class="clearfix">

							<label for="form-TotalFixedExpenses" class="form-label">Total Fixed Expenses<em>*</em></label>

							<div class="form-input"><input type="text" id="form-TotalFixedExpenses" name="TotalFixedExpenses" value="<?php// echo $TotalFixedExpenses; ?>" placeholder="Enter Total Fixed Expenses" /></div>

						</div>
					-->
						
						<!--
						<div class="clearfix">

							<label for="form-NumberOfCars" class="form-label">Number of Family Cars<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-NumberOfCars" name="NumberOfCars" value="<?php echo $NumberOfCars; ?>" placeholder="Enter Number Of Cars In Family" /></div>

						</div>
						-->
						<!--
						<div class="clearfix">

							<label for="form-MakeModel1" class="form-label">Make/Model Car #1<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-MakeModel1" name="MakeModel1" value="<?php echo $MakeModel1; ?>" placeholder="Enter Make/Model of Car #1" /></div>

						</div>
						-->
						
					   <!--
						<div class="clearfix">

							<label for="form-MakeModel2" class="form-label">Make/Model Car #2<em>*</em></label>

							<div class="form-input"><input class="calcMe calcExpenses" type="text" id="form-MakeModel2" name="MakeModel2" value="<?php echo $MakeModel2;?>" placeholder="Enter Make/Model of Car #2" /></div>

						</div>
					   -->
					   
						
						
					   
						<div class="clearfix">

							<label for="form-TotalOtherExpenses" class="form-label"><font color="red">Total Expenses</font></label>

							<div class="form-input"><input readonly="" type="text" id="form-TotalOtherExpenses" name="TotalOtherExpenses" value="<?php echo $TotalOtherExpenses; ?>" placeholder="Enter Total Other Expenses Amount" /></div>

						</div>
					   
						<div class="clearfix">
							<h4>Budget Analysis</h4>
						</div>
						
						<div class="clearfix">

							<label for="form-Deficit" class="form-label"><font color="red">Budget Analysis</font></label>

							<div class="form-input"><input readonly="" type="text" id="form-Deficit" name="Deficit" value="<?php echo $Deficit; ?>"  /></div>

						</div>
						
						
						
						<div class="form-action clearfix">
							<input type="hidden" name="<?php echo $formSubmitType; ?>" value="1">
							<input type="hidden" name="username" value="<?php echo $session->username; ?>">
							<input type="hidden" name="clientID" value="<?php echo $_GET["clientID"]; ?>">
							<button class="button" type="submit">OK</button>

							

						</div>

					</form>
				</div>
			</div>