403Webshell
Server IP : 10.200.247.200  /  Your IP : 216.73.217.19
Web Server : Apache
System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64
User : jeremy ( 1001)
PHP Version : 8.4.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/coaching_sites/usbusinessfundingsolutions.com/member/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/coaching_sites/usbusinessfundingsolutions.com/member/client-profile_old_2022_03_23.php
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/php_header.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/phpCrypto.php');

$profiles = array();

$document_id = 0;
if(!empty($_GET['id'])) {
	$document_id = $_GET['id'];
} else {
	$profiles = $db->get_results("SELECT id,date_entered
								FROM lc2synment_lc.client_profile
								WHERE client_id = '".$db->clean($_SESSION['Client']['id'])."'");
	if(!empty($profiles)) {
		$document_id = $profiles[0]->id;
	}
}
	
$title = 'Client Profile'; 
$body_id = 'client_profile'; 

if(!empty($_POST)) {
	$profile_id = $_POST['profile_id'];
	$client_id = $_POST['client_id'];
	
	if(!empty($_POST['ClientProfile'])) {
		$update = 'date_entered=NOW()';
		foreach($_POST['ClientProfile'] as $k=>$v) {
			//if(!empty($v) && $v!='0.00') {
				$update .= ($update=='') ? $k."='".$db->clean($v)."'" : ",".$k."='".$db->clean($v)."'";
			//}
		}
		if($update!='') {
			$db->query("UPDATE lc2synment_lc.client_profile SET {$update} WHERE id='".$db->clean($profile_id)."'");
		}
	}
	
	if(!empty($_POST['ClientInfo'])) {
		$update = '';
		foreach($_POST['ClientInfo'] as $k=>$v) {
			if($k=='phone_1') {
				$v = preg_replace('/[^0-9]/','',$v);
			}
			//if(!empty($v) && $v!='0.00') {
				$update .= ($update=='') ? $k."='".$db->clean($v)."'" : ",".$k."='".$db->clean($v)."'";
			//}
		}
		if($update!='') {
			$db->query("UPDATE lc2synment_lc.lc_reseller SET {$update} WHERE id='".$db->clean($client_id)."'");
		}
	}
	
	if(!empty($_POST['Partner'])) {
		foreach($_POST['Partner'] as $partner=>$data) {
			$update = '';
			foreach($data as $k=>$v) {
				if($k=='id') { continue; }
				//if(!empty($v) && $v!='0.00') {
					if($k=='phone') {
						$v = preg_replace('/[^0-9]/','',$v);
					}
					$update .= ($update=='') ? $k."='".$db->clean($v)."'" : ",".$k."='".$db->clean($v)."'";
				//}
			}
			if($update!='') {
				$db->query("UPDATE lc2synment_lc.partners SET {$update} WHERE id='".$db->clean($data['id'])."'");
			}
		}
	}
	if(!empty($_POST['NewPartner'])) {
		foreach($_POST['NewPartner'] as $partner) {
			$db->query("INSERT INTO lc2synment_lc.partners
						(
							client_id
							,type
							,gender
							,age
							,first
							,last
							,email
							,phone
							,occupation
							,income
						) VALUES (
							'".$db->clean($client_id)."'
							,'".$db->clean($partner['type'])."'
							,'".$db->clean($partner['gender'])."'
							,'".$db->clean($partner['age'])."'
							,'".$db->clean($partner['first'])."'
							,'".$db->clean($partner['last'])."'
							,'".$db->clean($partner['email'])."'
							,'".$db->clean($partner['phone'])."'
							,'".$db->clean($partner['occupation'])."'
							,'".$db->clean($partner['income'])."'
						)");
		}
	}
	if(!empty($_POST['DeletePartner'])) {
		foreach($_POST['DeletePartner'] as $k=>$v) {
			$db->query("DELETE FROM lc2synment_lc.partners
						WHERE id='".$db->clean($k)."'");
		}
	}
	
	$db->query("DELETE FROM lc2synment_lc.client_profile_others WHERE cp_id='".$db->clean($profile_id)."'");
	if(!empty($_POST['others'])) {
		$update = '';
		foreach($_POST['others'] as $k=>$v) {
			$update .= ($update=='') ? "('".$db->clean($profile_id)."','".$db->clean($k)."','".$db->clean($v)."')" : ",('".$db->clean($profile_id)."','".$db->clean($k)."','".$db->clean($v)."')";
		}
		if($update!='') {
			$db->query("INSERT INTO lc2synment_lc.client_profile_others (cp_id,type,value) VALUES {$update}");
		}
	}
	
	$db->query("DELETE FROM lc2synment_lc.client_profile_categories WHERE cp_id='".$db->clean($profile_id)."'");
	$db->query("DELETE FROM lc2synment_lc.client_profile_subcategories WHERE cp_id='".$db->clean($profile_id)."'");
	$db->query("DELETE FROM lc2synment_lc.client_profile_minorities WHERE cp_id='".$db->clean($profile_id)."'");
	$db->query("DELETE FROM lc2synment_lc.client_profile_industries WHERE cp_id='".$db->clean($profile_id)."'");
	if(!empty($_POST['ProfileCategory'])) {
		foreach($_POST['ProfileCategory'] as $type=>$data) {
			$update = '';
			foreach($data as $k=>$v) {
				$update .= ($update=='') ? "('".$db->clean($profile_id)."','".$db->clean($v)."')" : ",('".$db->clean($profile_id)."','".$db->clean($v)."')";
			}
			if($update != '') {
				$db->query("INSERT INTO lc2synment_lc.client_profile_".$type." VALUES {$update}");
			}
		}
	}
	$mysql_error = $db->error();
	$success = (empty($mysql_error)) ? 1 : 0;
	
	header("Location: client-profile.php?success={$success}");
}
if(isset($_GET['success'])) {
	if($_GET['success']==1) {
		$message = array('Your profile was saved successfully.','success');
	} else {
		$message = array('Your profile was NOT saved successfully. Please try again, or contact customer support for help.','failure');
	}
}
$profile = array();

$res = $db->get_results("SELECT p.*,r.first,r.last,r.phone_1,r.address1,r.city,r.state,r.zip,r.email,ca.leaddb,ca.leadid FROM lc2synment_lc.client_profile p LEFT JOIN lc2synment_lc.lc_reseller r ON r.id=p.client_id LEFT JOIN coaching_allocator.leads ca ON ca.synergy_client_id=r.id WHERE p.id='{$document_id}'");
$profile = $res[0];

if($profile->age=='65' && $profile->date_entered='0000-00-00 00:00:00') {
	$profile->age = '';
}

/*//check if education
$res2 = $db->get_results("SELECT lp.profile_category_id FROM lc2{$profile->leaddb}_lc.lead_profile lp LEFT JOIN lc2{$profile->leaddb}_lc.lc_leads l ON l.id=lp.lead_id WHERE l.customerID='".$db->clean($profile->leadid)."'");
if($res2[0]->profile_category_id==2) {
	header("Location: view-profile-edu.php?id={$document_id}");
	exit(0);
}*/

$profile_arr = get_object_vars($profile);
$cp_id = $profile->id;
$partners = $db->get_results("SELECT * FROM lc2synment_lc.partners WHERE client_id='{$profile->client_id}'");
if(empty($partners)) {
	$partners = array();
}
$categories = array();
$categories['categories'] = $db->get_results("SELECT categories_id as id,name FROM grdb.grd_categories WHERE name<>'ALL' ORDER BY priority,categories_id");
$categories['subcategories'] = $db->get_results("SELECT subcategories_id as id,name FROM grdb.grd_subcategories WHERE name<>'ALL' ORDER BY priority,subcategories_id");
$categories['minorities'] = $db->get_results("SELECT minorities_id as id,name FROM grdb.grd_minorities WHERE name<>'All' ORDER BY priority,minorities_id");
$categories['industries'] = $db->get_results("SELECT industries_id as id,name FROM grdb.grd_industries  WHERE name<>'ALL' ORDER BY priority,industries_id");

$client_cats = array();
$foo = $db->get_results("SELECT cat_id FROM lc2synment_lc.client_profile_categories WHERE cp_id='{$cp_id}'");
if(!empty($foo)) {
	foreach($foo as $bar) {
		$client_cats['categories'][$bar->cat_id] = '1';
	}
} else {
	$client_cats['categories'] = array();
}
$foo = $db->get_results("SELECT subcat_id as cat_id FROM lc2synment_lc.client_profile_subcategories WHERE cp_id='{$cp_id}'");
if(!empty($foo)) {
	foreach($foo as $bar) {
		$client_cats['subcategories'][$bar->cat_id] = '1';
	}
} else {
	$client_cats['subcategories'] = array();
}
$foo = $db->get_results("SELECT min_id as cat_id FROM lc2synment_lc.client_profile_minorities WHERE cp_id='{$cp_id}'");
if(!empty($foo)) {
	foreach($foo as $bar) {
		$client_cats['minorities'][$bar->cat_id] = '1';
	}
} else {
	$client_cats['minorities'] = array();
}
$foo = $db->get_results("SELECT ind_id as cat_id FROM lc2synment_lc.client_profile_industries WHERE cp_id='{$cp_id}'");
if(!empty($foo)) {
	foreach($foo as $bar) {
		$client_cats['industries'][$bar->cat_id] = '1';
	}
} else {
	$client_cats['industries'] = array();
}
$foo = $db->get_results("SELECT type,value FROM lc2synment_lc.client_profile_others WHERE cp_id='{$cp_id}'");
if(!empty($foo)) {
	foreach($foo as $bar) {
		$client_cats['others'][$bar->type] = $bar->value;
	}
} else {
	$client_cats['others'] = array();
}

$labels = array(
	'first_name' => 'First Name:',
	'last_name' => 'Last Name:',
	'street_address' => 'Address:',
	'city' => 'City:',
	'state' => 'State',
	'zip' => 'Zip:',
	'phone_1' => 'Phone:',
	'new_phones[]' => 'Phone:',
	'email' => 'Email:',
	'new_emails[]' => 'Email:',
	'age' => 'Age:',
	'gender' => 'Gender:',
	'occupation' => 'Occupation:',
	'income' => 'Income:',
	'applied' => 'Have you applied for funding in the past?',
	'funding_purpose' => 'What are you looking to get the funding for?',
	'amount_desired' => 'How much money do you need?',
	'beneficiaries' => 'Who will benefit, and how will they benefit?',
	'goal_solve' => 'Does your project solve a need or a problem?',
	'project_vision' => 'What is the vision behind your project?',
	'business_plan' => 'Do you have a business plan for this project?',
	'written_plan' => 'Have you ever written a business plan before?',
	'holdups' => 'What has held you back from applying for funding in the past?',
	'how_long' => 'How long have you been thinking about this?',
	'etc' => 'Is there anything you want your coach to know about you?',
	'special_considerations' => 'Are there any other special considerations that we need to consider when doing our research?',

	'owned_by_woman'		=>'Is the business owned by a woman?',
	'low_income_area'		=>'Is your business located in a low-income area, or an area sanctioned by a community for revitalization?',
	'help_nonprofit'		=>'Will the business be serving or helping a non-profit organization?',
	'is_nonprofit'			=>'Are you set up as a non-profit organization 501(c)(3)?',
	'serving_veterans'		=>'Will your business be serving or hiring veterans?',
	'training_employees'	=>'Will your business be training new/existing employees?',
	'will_research'			=>'Will your business participate in any research in your field?',
	'applied_before'		=>'Have you applied for funding in the past?',
	'awarded_grant'			=>'Have you ever been awarded a grant?',
	'is_veteran'			=>'Are you a Veteran?',
	'is_single_parent'		=>'Are You a Single Parent?',
	'is_disabled'			=>'Are you Disabled?',
	'is_ethnic_minority'	=>'Are you part of an Ethnic Minority',
	'applied_before_more_info'		=>'If yes, to what organization did you apply to?',
	'awarded_grant_more_info'		=>'If yes, by whom and for what amount?',
	'is_veteran_more_info'			=>'If so, please explain.',
	'is_disabled_more_info'			=>'If so, please explain.',
	'is_ethnic_minority_more_info'	=>'If so, which one?'
);

$yes_no_questions = array(
	//'partner_minority',
	'owned_by_woman',
	'low_income_area',
	'help_nonprofit',
	'is_nonprofit',
	'serving_veterans',
	'training_employees',
	'will_research',
	'is_veteran',
	'is_single_parent',
	'is_disabled',
	'is_ethnic_minority',
	'applied_before',
	'awarded_grant',
);
$yes_no_subquestions = array(
	//'partner_minority',
	'is_veteran'=>'is_veteran_more_info',
	'is_disabled'=>'is_disabled_more_info',
	'is_ethnic_minority'=>'is_ethnic_minority_more_info',
	'applied_before'=>'applied_before_more_info',
	'awarded_grant'=>'awarded_grant_more_info'
);

require_once($_SERVER['DOCUMENT_ROOT'].'/member/header_new_2021_06_29.php');
?>
<style type="text/css">
	#content div, #content td {
		padding:0px;
	}
	#GrantClientInfo label {
		font-family: 'SegoeUI', Verdana, san-serif;
		color:#989898;
		padding-right: 5px;
	}
	#GrantClientInfo textarea {
		margin: 10px 0px 0px 50px;
		width: 775px;
		height: 65px;
	}
	#content #ClientInfo td, #content #PartnerInfo td, #content #GrantClientInfo .question {
		padding: 5px;
	}
	#content #ClientInfo td.light, #content #PartnerInfo td.light {
		width:50%;
	}
	.info {
		padding-left: 20px;
	}
	.partner {
		margin: 5px 5px 20px 5px;
	}
	.partner table {
		width:100%;
	}
	.question {
		padding: 10px 0px;
	}
	.submit {
		margin-top: 20px;
		text-align: center;
	}
	.required label:after {
		content:" *";
		color: red;
	}
	.success {
		border: 2px solid #04A00A;
		color: #04A00A;
	}
	.failure, .validation_errors {
		border: 2px solid #A00A04;
		color: #A00A04;
	}
	.error {
		border: 2px solid #A00A04;
	}
	#GrantClientInfo .two_column div {
		width: 49%;
		margin: 0px;
		padding: 0px;
		display: inline-block;
		font-weight: normal;
	}
	#GrantClientInfo .two_column div label {
		font-weight: normal;
	}
	#GrantClientInfo .three_column div {
		width: 32%;
		margin: 0px;
		padding: 0px;
		display: inline-block;
		font-weight: normal;
	}
	#GrantClientInfo .three_column div label {
		font-weight: normal;
	}
	#GrantClientInfo .yes_no div {
		color: black;
		font-weight: bold;
	}
	#GrantClientInfo div .yes_no label {
		font-weight: normal;
		font-family: 'SegoeUI', Verdana, san-serif;
		color: black;
	}
	#GrantClientInfo .yes_no .subquestion {
		display: none;
	}
	#GrantClientInfo .yes_no .subquestion label {
		margin: 10px 0px 0px 97px;
		display: block;
		font-weight: bold;
	}
	#GrantClientInfo .yes_no .subquestion textarea {
		margin: 10px 0px 0px 97px;
		width: 453px;
	}
	#GrantClientInfo .yes_no_question div {
		display:inline-block;
		vertical-align: middle;
		padding: 5px 0px;
	}
	#GrantClientInfo .yes_no_question .yes_no_label {
		display:inline-block;
		width: 453px;
		vertical-align: middle;
		font-weight: normal;
		font-family: 'SegoeUI', Verdana, san-serif;
		color: #989898;
	}
</style>
<script type="text/javascript">
	var new_partner = 0;
	function add_a_partner() {
		new_partner++;
		var html = '<div class="partner">' +
					'	<table cellspacing="0" cellpadding="0" class="info">' +
					'		<tr>' +
					'			<td class="light"><label>Partner Type: </label></td>' +
					'			<td class="dark"><select name="NewPartner['+new_partner+'][type]"><option value=""></option><option value="Father">Father</option><option value="Mother">Mother</option><option value="Brother">Brother</option><option value="Sister">Sister</option><option value="Son">Son</option><option value="Daughter">Daughter</option><option value="Other Relative">Other Relative</option><option value="Partner">Partner</option><option value="Spouse">Spouse</option><option value="Significant Other">Significant Other</option><option value="Life Partner">Life Partner</option><option value="Accountant">Accountant</option><option value="Secretary">Secretary</option><option value="Lawyer">Lawyer</option><option value="Board Member">Board Member</option><option value="Director">Director</option></select></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>First Name: </label></td>' +
					'			<td class="dark"><input type="text" name="NewPartner['+new_partner+'][first]" /></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>Last Name: </label></td>' +
					'			<td class="dark"><input type="text" name="NewPartner['+new_partner+'][last]" /></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>Phone: </label></td>' +
					'			<td class="dark"><input type="text" name="NewPartner['+new_partner+'][phone]" /></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>Email: </label></td>' +
					'			<td class="dark"><input type="text" name="NewPartner['+new_partner+'][email]" /></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>Gender: </label></td>' +
					'			<td class="dark"><select name="NewPartner['+new_partner+'][gender]"><option value=""></option><option value="m">Male</option><option value="f">Female</option></select></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>Age: </label></td>' +
					'			<td class="dark"><input type="text" name="NewPartner['+new_partner+'][age]" style="width:35px;" /></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>Occupation: </label></td>' +
					'			<td class="dark"><input type="text" name="NewPartner['+new_partner+'][occupation]" style="width:125px;" /></td>' +
					'		</tr>' +
					'		<tr>' +
					'			<td class="light"><label>Income: </label></td>' +
					'			<td class="dark"><input type="text" name="NewPartner['+new_partner+'][income]" style="width:85px;" /></td>' +
					'		</tr>' +
					'	</table>' +
					'</div>';
		$('#PartnerInfo').append(html);
	}
	function delete_partner(me,id) {
		if(confirm("Are you sure you want to delete this partner?")) {
			$(me).parents('.partner:first').html('<input type="hidden" name="DeletePartner[' + id + ']" value="1" />');
		}
	}
	function switch_profile_id(me) {
		window.location = 'client-profile.php?id=' + $(me).val();
	}
	$(document).ready(function() {
		<?php
		foreach($yes_no_subquestions as $key=>$value) {
			$temp = explode('_',$key);
			foreach($temp as $k=>$t) {
				$temp[$k] = ucwords($t);
			}
			$formatted_key = implode('',$temp);
			?>
				$('#ClientProfile<?= $formatted_key;?>Yes').click(function() {
					$('#subquestion_<?= $key;?>').show().find('textarea').removeAttr('disabled');
				});				
				$('#ClientProfile<?= $formatted_key;?>No').click(function() {
					$('#subquestion_<?= $key;?>').hide().find('textarea').attr('disabled','disabled');
				});
				if($('#ClientProfile<?= $formatted_key;?>Yes').is(':checked')) {
					$('#subquestion_<?= $key;?>').show().find('textarea').removeAttr('disabled');
				} else {
					$('#subquestion_<?= $key;?>').hide().find('textarea').attr('disabled','disabled');
				}	
			<?php
		}
		?>
	});
</script>
<div id="content" class="size">
	<div style="padding:10px;">
		<h1><img src="/member/images/icon_client_profile.png" /> Client Profile</h1>
		<p>Please take a few minutes and tell us about your project. The more information you can provide, the more we'll be able to assist you with your funding goals.</p>
		<hr />
		<?php if(count($profiles)>1) { ?>
		<div>
			<label>
				Select Profile:
				<select name="change_profile_id" onchange="switch_profile_id(this); return false;">
					<?php foreach($profiles as $profile) { ?>
					<option value="<?= $profile->id;?>" <?= ($document_id==$profile->id) ? 'selected' : '';?>><?= ($profile->date_entered=='0000-00-00 00:00:00') ? 'New Profile' : 'Saved: '.date('m/d/Y g:i a',strtotime($profile->date_entered));?></option>
					<?php } ?>
				</select>
			</label>
		</div>
		<?php } ?>
		<form action="/member/client-profile.php" method="post">
			<div id="container">
				<?= (!empty($message)) ? '<div class="'.$message[1].'">'.$message[0].'</div>' : null;?>
				<?php if(!empty($errors)) {?>
					<div class="validation_errors">
						<p>Please fix the following errors:</p>
						<?php
							foreach($errors as $model => $val) {
								if(!empty($val)) {
									echo '<p>' . preg_replace('/extra/i','',$model) . ':</p><ul>';
									foreach($val as $key => $value) {
										if(isset($labels[$model][$key])) {
											echo '<li>' . $labels[$model][$key] . " - " . $value . '</li>';
										} else {
											echo '<li>' . $key . " - " . $value . '</li>';
										}
									}
									echo '</ul>';
								}
							}
						?>
					</div>
				<?php }?>
				<div id="ClientInfo" class="roundBox all client_info">
					<h1>Client Information</h1>
					<div class="clear"></div>
					<input type="hidden" name="client_id" value="<?= $profile->client_id;?>" />
					<table cellspacing="0" cellpadding="0" class="info" style="width:100%;">
						<tr>
							<td class="light"><label>First Name: </label></td>
							<td class="dark <?= (isset($errors['ClientInfo']['first'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[first]" value="<?= $profile->first;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label>Last Name: </label></td>
							<td class="dark <?= (isset($errors['ClientInfo']['last'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[last]" value="<?= $profile->last;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label>Address: </label></td>
							<td class="dark <?= (isset($errors['ClientInfo']['address1'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[address1]" value="<?= $profile->address1;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label>City: </label></td>
							<td style="white-space:nowrap;" class="dark <?= (isset($errors['ClientInfo']['city'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[city]" value="<?= $profile->city;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label>State: </label></td>
							<td class="dark <?= (isset($errors['ClientInfo']['state'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[state]" value="<?= $profile->state;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label>Zip: </label></td>
							<td class="dark <?= (isset($errors['ClientInfo']['zip'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[zip]" value="<?= $profile->zip;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label>Phone: </label></td>
							<td class="dark <?= (isset($errors['ClientInfo']['phone_1'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[phone_1]" value="<?= formatPhone($profile->phone_1);?>" /></td>
						</tr>
						<tr>
							<td class="light"><label>Email: </label></td>
							<td class="dark <?= (isset($errors['ClientInfo']['email'])) ? 'error' : null; ?>"><input type="text" name="ClientInfo[email]" value="<?= $profile->email;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label for="ClientProfileAge"><?= $labels['age'];?></label></td>
							<td class="dark <?= (isset($errors['ClientProfile']['age'])) ? 'error' : null; ?>"><input id="ClientProfileAge" name="ClientProfile[age]" value="<?= $profile->age;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label for="ClientProfileGender"><?= $labels['gender'];?></label></td>
							<td class="dark <?= (isset($errors['ClientProfile']['gender'])) ? 'error' : null; ?>"><select id="ClientProfileGender" name="ClientProfile[gender]"><option value=""></option><option value="m" <?= ($profile->gender=='m') ? 'selected' : '';?>>Male</option><option value="f" <?= ($profile->gender=='f') ? 'selected' : '';?>>Female</option></select></td>
						</tr>
						<tr>
							<td class="light"><label for="ClientProfileOccupation"><?= $labels['occupation'];?></label></td>
							<td class="dark <?= (isset($errors['ClientProfile']['occupation'])) ? 'error' : null; ?>"><input id="ClientProfileOccupation" name="ClientProfile[occupation]" value="<?= $profile->occupation;?>" /></td>
						</tr>
						<tr>
							<td class="light"><label for="ClientProfileIncome"><?= $labels['income'];?></label></td>
							<td class="dark <?= (isset($errors['ClientProfile']['income'])) ? 'error' : null; ?>"><input id="ClientProfileIncome" name="ClientProfile[income]" value="<?= $profile->income;?>" /></td>
						</tr>
					</table>
				</div>
				<div id="PartnerInfo" class="roundBox all client_info">
					<h1>
						Partner Information
						<button onclick="add_a_partner(); return false;">Add a Partner</button>
					</h1>
					<div class="clear"></div>
					<?php
						foreach($partners as $i=>$partner) {
							?>
								<div class="partner">
									<input type="hidden" name="Partner[<?= $i;?>][id]" value="<?= $partner->id;?>" />
									<table cellspacing="0" cellpadding="0" class="info">
										<tr>
											<td class="light"><label>Partner Type: </label></td>
											<td class="dark">
												<select name="Partner[<?= $i;?>][type]">
													<option value="" <?= ($partner->type=='') ? 'selected' : '';?>></option>
													<option value="Father" <?= ($partner->type=='Father') ? 'selected' : '';?>>Father</option>
													<option value="Mother" <?= ($partner->type=='Mother') ? 'selected' : '';?>>Mother</option>
													<option value="Brother" <?= ($partner->type=='Brother') ? 'selected' : '';?>>Brother</option>
													<option value="Sister" <?= ($partner->type=='Sister') ? 'selected' : '';?>>Sister</option>
													<option value="Son" <?= ($partner->type=='Son') ? 'selected' : '';?>>Son</option>
													<option value="Daughter" <?= ($partner->type=='Daughter') ? 'selected' : '';?>>Daughter</option>
													<option value="Other Relative" <?= ($partner->type=='Other Relative') ? 'selected' : '';?>>Other Relative</option>
													<option value="Partner" <?= ($partner->type=='Partner') ? 'selected' : '';?>>Partner</option>
													<option value="Spouse" <?= ($partner->type=='Spouse') ? 'selected' : '';?>>Spouse</option>
													<option value="Significant Other" <?= ($partner->type=='Significant Other') ? 'selected' : '';?>>Significant Other</option>
													<option value="Life Partner" <?= ($partner->type=='Life Partner') ? 'selected' : '';?>>Life Partner</option>
													<option value="Accountant" <?= ($partner->type=='Accountant') ? 'selected' : '';?>>Accountant</option>
													<option value="Secretary" <?= ($partner->type=='Secretary') ? 'selected' : '';?>>Secretary</option>
													<option value="Lawyer" <?= ($partner->type=='Lawyer') ? 'selected' : '';?>>Lawyer</option>
													<option value="Board Member" <?= ($partner->type=='Board Member') ? 'selected' : '';?>>Board Member</option>
													<option value="Director" <?= ($partner->type=='Director') ? 'selected' : '';?>>Director</option>
												</select>
											</td>
										</tr>
										<tr>
											<td class="light"><label>First Name: </label></td>
											<td class="dark"><input type="text" name="Partner[<?= $i;?>][first]" value="<?= $partner->first;?>" /></td>
										</tr>
										<tr>
											<td class="light"><label>Last Name: </label></td>
											<td class="dark"><input type="text" name="Partner[<?= $i;?>][last]" value="<?= $partner->last;?>" /></td>
										</tr>
										<tr>
											<td class="light"><label>Phone: </label></td>
											<td class="dark"><input type="text" name="Partner[<?= $i;?>][phone]" value="<?= formatPhone($partner->phone);?>" /></td>
										</tr>
										<tr>
											<td class="light"><label>Email: </label></td>
											<td class="dark"><input type="text" name="Partner[<?= $i;?>][email]" value="<?= $partner->email;?>" /></td>
										</tr>
										<tr>
											<td class="light"><label>Gender: </label></td>
											<td class="dark <?= (isset($errors['Partner '.($i+1)]['gender'])) ? 'error' : null; ?>"><select name="Partner[<?= $i;?>][gender]"><option value=""></option><option value="m" <?= ($partner->gender=='m') ? 'selected' : '';?>>Male</option><option value="f" <?= ($partner->gender=='f') ? 'selected' : '';?>>Female</option></select></td>
										</tr>
										<tr>
											<td class="light"><label>Age: </label></td>
											<td class="dark <?= (isset($errors['Partner '.($i+1)]['age'])) ? 'error' : null; ?>"><input type="text" name="Partner[<?= $i;?>][age]" style="width:35px;" value="<?= $partner->age;?>" /></td>
										</tr>
										<tr>
											<td class="light"><label>Occupation: </label></td>
											<td class="dark <?= (isset($errors['Partner '.($i+1)]['occupation'])) ? 'error' : null; ?>"><input type="text" name="Partner[<?= $i;?>][occupation]" style="width:125px;" value="<?= $partner->occupation;?>" /></td>
										</tr>
										<tr>
											<td class="light"><label>Income: </label></td>
											<td class="dark <?= (isset($errors['Partner '.($i+1)]['income'])) ? 'error' : null; ?>"><input type="text" name="Partner[<?= $i;?>][income]" style="width:85px;" value="<?= $partner->income;?>" /></td>
										</tr>
									</table>
									<button onclick="delete_partner(this,'<?= $partner->id;?>'); return false;">Delete Partner</button>
								</div>
							<?php
						}
					?>
				</div>
				<div id="GrantClientInfo" class="roundBox all client_info">
					<h1>Client Profile</h1>
					<div class="clear"></div>
					<p>Before you begin working with your coach, we would like you to take a few minutes and fill out the client profile below to help your coach get to know you. Please be as detailed as possible. The more information you provide, the more your coach can assist you in obtaining the funding you are seeking!</p>
					<div>
						<div class="question">
							<div <?= (isset($errors['ClientProfile']['amount_desired'])) ? 'class="error"' : null; ?>>
								<label for="ClientProfileAmountDesired"><?= $labels['amount_desired'];?></label>
								<input id="ClientProfileAmountDesired" name="ClientProfile[amount_desired]" value="<?= $profile->amount_desired;?>" />
							</div>
						</div>
						<div class="question">
							<div><label for="ClientProfileFundingPurpose"><?= $labels['funding_purpose'];?></label></div>
							<div <?= (isset($errors['ClientProfile']['funding_purpose'])) ? 'class="error"' : null; ?>><textarea id="ClientProfileFundingPurpose" name="ClientProfile[funding_purpose]" value="" ><?= $profile->funding_purpose;?></textarea></div>
						</div>
						<div class="question">
							<div><label for="ClientProfileProjectVision"><?= $labels['project_vision'];?></label></div>
							<div <?= (isset($errors['ClientProfile']['project_vision'])) ? 'class="error"' : null; ?>><textarea id="ClientProfileProjectVision" name="ClientProfile[project_vision]"><?= $profile->project_vision;?></textarea></div>
						</div>	
						<div class="question">
							<div><label for="ClientProfileBeneficiaries"><?= $labels['beneficiaries'];?></label></div>
							<div <?= (isset($errors['ClientProfile']['beneficiaries'])) ? 'class="error"' : null; ?>><textarea id="ClientProfileBeneficiaries" name="ClientProfile[beneficiaries]"><?= $profile->beneficiaries;?></textarea></div>
						</div>
						<div class="question">
							<div <?= (isset($errors['ClientProfile']['how_long'])) ? 'class="error"' : null; ?>>
								<label for="ClientProfileHowLong"><?= $labels['how_long'];?></label>
								<input id="ClientProfileHowLong" name="ClientProfile[how_long]" value="<?= $profile->how_long;?>" />
							</div>
						</div>
						<div class="question">
							<div><label for="ClientProfileHoldups"><?= $labels['holdups'];?></label></div>
							<div <?= (isset($errors['ClientProfile']['holdups'])) ? 'class="error"' : null; ?>><textarea id="ClientProfileHoldups" name="ClientProfile[holdups]"><?= $profile->holdups;?></textarea></div>
						</div>
						<div class="question">
							<div><label>Grant Category <span class="italic">(Check all that apply)</span></label></div>
							<div class="two_column"><?php
								foreach($categories['categories'] as $cat) { ?>
								<div class="cat">
									<label>
										<input type="checkbox" name="ProfileCategory[categories][]" value="<?= $cat->id;?>" <?= ($client_cats['categories'][$cat->id]=='1') ? 'checked="checked"' : '';?> />
										<?= $cat->name;?>
									</label>
								</div>
								<?php } ?>
								<div class="cat">
									<label>
										Other
										<input type="text" name="others[category]" style="margin-right: 5px;" value="<?= $client_cats['others']['category'];?>" />
									</label>
								</div>
							</div>
						</div>
						<div class="question">
							<div><label>Sub-Categories <span class="italic">(Check all that apply)</span></label></div>
							<div class="three_column"><?php
								foreach($categories['subcategories'] as $cat) { ?>
								<div class="cat">
									<label>
										<input type="checkbox" name="ProfileCategory[subcategories][]" value="<?= $cat->id;?>" <?= ($client_cats['subcategories'][$cat->id]=='1') ? 'checked="checked"' : '';?> />
										<?= $cat->name;?>
									</label>
								</div>
								<?php } ?>
								<div class="cat">
									<label>
										Other
										<input type="text" name="others[subcategory]" style="margin-right: 5px;" value="<?= $client_cats['others']['subcategory'];?>" />
									</label>
								</div>
							</div>
						</div>
						<div class="question">
							<div><label>Minorities <span class="italic">(Check all that apply)</span></label></div>
							<div class="three_column"><?php
								foreach($categories['minorities'] as $cat) { ?>
								<div class="cat">
									<label>
										<input type="checkbox" name="ProfileCategory[minorities][]" value="<?= $cat->id;?>" <?= ($client_cats['minorities'][$cat->id]=='1') ? 'checked="checked"' : '';?> />
										<?= $cat->name;?>
									</label>
								</div>
								<?php } ?>
								<div class="cat">
									<label>
										Other
										<input type="text" name="others[minority]" style="margin-right: 5px;" value="<?= $client_cats['others']['minority'];?>" />
									</label>
								</div>
							</div>
						</div>
						<div class="question">
							<div><label>Industry <span class="italic">(Please select the industry that applies you)</span></label></div>
							<div class="three_column"><?php
								foreach($categories['industries'] as $cat) { ?>
								<div class="cat">
									<label>
										<input type="checkbox" name="ProfileCategory[industries][]" value="<?= $cat->id;?>" <?= ($client_cats['industries'][$cat->id]=='1') ? 'checked="checked"' : '';?> />
										<?= $cat->name;?>
									</label>
								</div>
								<?php } ?>
								<div class="cat">
									<label>
										Other
										<input type="text" name="others[industry]" style="margin-right: 5px;" value="<?= $client_cats['others']['industry'];?>" />
									</label>
								</div>
							</div>
						</div>
						<div class="yes_no">
							<?php
								foreach($yes_no_questions as $question) {
									$temp = explode('_',$question);
									foreach($temp as $k=>$t) {
										$temp[$k] = ucwords($t);
									}
									$formatted_key = implode('',$temp);
									?><div class="yes_no_question <?=  (isset($errors['ClientProfile'][$question])) ? 'error' : null;?>">
										<div>
											<label>
												<input type="radio" id="ClientProfile<?= $formatted_key;?>Yes" name="ClientProfile[<?= $question;?>]" value="yes" <?= ($profile_arr[$question]=='yes') ? 'checked="checked"' : '';?> />Yes
											</label>
											<label>
												<input type="radio" id="ClientProfile<?= $formatted_key;?>No" name="ClientProfile[<?= $question;?>]" value="no"  <?= ($profile_arr[$question]=='no') ? 'checked="checked"' : '';?> />No
											</label>
											<div class="yes_no_label"><?= $labels[$question];?></div>
										</div>
									</div><?php
									if(isset($yes_no_subquestions[$question])) {
										$temp = explode('_',$yes_no_subquestions[$question]);
										foreach($temp as $k=>$t) {
											$temp[$k] = ucwords($t);
										}
										$formatted_key = implode('',$temp);
									?>
										<div class="subquestion" id="subquestion_<?= $question;?>">
											<label for="ClientProfile<?= $formatted_key;?>"><?= $labels[$yes_no_subquestions[$question]];?></label>
											<textarea id="ClientProfile<?= $formatted_key;?>" name="ClientProfile[<?= $yes_no_subquestions[$question];?>]"><?= $profile_arr[$yes_no_subquestions[$question]];?></textarea>
										</div>
									<?php
									}
								}
							?>
						</div>
						<div class="question">
							<div><label for="ClientProfileEtc"><?= $labels['etc'];?></label></div>
							<div <?= (isset($errors['ClientProfile']['etc'])) ? 'class="error"' : null; ?>><textarea id="ClientProfileEtc" name="ClientProfile[etc]" ><?= $profile->etc;?></textarea></div>
						</div>
						<div class="question">
							<div><label for="ClientProfileSpecialConsiderations"><?= $labels['special_considerations'];?></label></div>
							<div <?= (isset($errors['ClientProfile']['special_considerations'])) ? 'class="error"' : null; ?>><textarea id="ClientProfileSpecialConsiderations" name="ClientProfile[special_considerations]" ><?= $profile->special_considerations;?></textarea></div>
						</div>
					</div>
					<div>
						<input type="hidden" name="profile_id" value="<?= $document_id;?>" />
						<input name="submit" type="submit" value="Submit" class="submit" />
					</div>
				</div>
			</div>
		</form>
	</div>
</div>

<?php require_once($_SERVER['DOCUMENT_ROOT'].'/member/footer.php'); ?>

Youez - 2016 - github.com/yon3zu
LinuXploit