<?php include('./utility/texteditor_limited.php')?>
<form name="searchfrm" id="searchfrm" action="<?php echo $page_name?>" method="post" target="_parent" enctype="multipart/form-data">
<input type="hidden" name="member_id" id="member_id" value="<?php echo $userDetails->id?>" />
<input type="hidden" name="status" id="status" value="<?php echo $userDetails->status?>" />
<div style="padding-top:40px;">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left" class="breadcrumb"><a href="index.php" class="bnav">Home</a> &raquo; <?php if($userDetails->id==''){?>Member Registration<?php }else{?>Edit Profile<?php }?></td>
                </tr>
              <tr>
                <td>&nbsp;</td>
                </tr>
              <tr>
                <td><h3><?php if($userDetails->id==''){?>Member Registration<?php }else{?>Edit Profile<?php }?></h3></td>
                </tr>
              <tr>
                <td><br /><h4 style="color:red"><?php echo $error_msg;?></h4></td>
                </tr>
              <tr>
                <td>
                  <table width="95%" border="0" align="center" cellpadding="5" cellspacing="1" class="table table-bordered table-striped">
                    <tr>
                      <td width="42%" align="right"><strong>Family Number</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="familyno" type="text" class="form-control" id="familyno" style="width:300px; height:35px" value="<?php echo $userDetails->familyno?>" />
						<div id="regno_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Full Name</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="fullname" type="text" class="form-control" id="fullname" style="width:300px; height:35px" value="<?php echo $userDetails->fullname?>" />
						<div id="regno_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Gender</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select id="gender" name="gender" class="form-control">
                          	<option value="">[Gender]</option>
									<option value="Male" <?php if("Male"==$userDetails->gender){echo "selected";}?>>Male</option>
									<option value="Female" <?php if("Female"==$userDetails->gender){echo "selected";}?>>Female</option>
                          </select>
						<div id="plno_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Blood Group</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select id="bloodgroup" name="bloodgroup" class="form-control">
								<option value="">[Blood Group]</option>
								<option value="A+" <?php if($userDetails->bloodgroup == 'A+') { echo "Selected"; } ?>>A+</option>
								<option value="B+" <?php if($userDetails->bloodgroup == 'B+') { echo "Selected"; } ?>>B+</option>
								<option value="A-" <?php if($userDetails->bloodgroup == 'A-') { echo "Selected"; } ?>>A-</option>
								<option value="B-" <?php if($userDetails->bloodgroup == 'B-') { echo "Selected"; } ?>>B-</option>
								<option value="AB+" <?php if($userDetails->bloodgroup == 'AB+') { echo "Selected"; } ?>>AB+</option>
								<option value="AB-" <?php if($userDetails->bloodgroup == 'AB-') { echo "Selected"; } ?>>AB-</option>
								<option value="O+" <?php if($userDetails->bloodgroup == 'O+') { echo "Selected"; } ?>>O+</option>
								<option value="O-" <?php if($userDetails->bloodgroup == 'O-') { echo "Selected"; } ?>>O-</option>
                          	</select>      
						<div id="firstname_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Birth Date</strong></td>
                      <td width="58%" align="left">
					  	 <?php if($userDetails->dob=="0" or $userDetails->dob=="0000-00-00"){
					  		$userDetails->dob = "";
					  }?>
						<div class="col-lg-8" align="left" style="padding-left:0px">
					  	<div class='input-group date' id='dob_dt'>
					  		<input name="dob" type="text" class="form-control" id="dob" style="width:300px; height:35px" data-format="YYYY-MM-DD" placeholder="YYYY-MM-DD" value="<?php echo $userDetails->dob?>" /><span class="input-group-addon" ><span class="glyphicon glyphicon-calendar"></span>
                                </span>
						</div>
						</div>
					  <script type="text/javascript">
								 $(function () {
									$('#dob_dt').datetimepicker({
										pickTime: false
									});
									
								});
							</script>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Anniversary Date</strong></td>
                      <td width="58%" align="left">
					  	 <?php if($userDetails->expirydate=="0" or $userDetails->expirydate=="0000-00-00"){
					  		$userDetails->expirydate = "";
					  }?>
						<div class="col-lg-8" align="left" style="padding-left:0px">
					  	<div class='input-group date' id='expirydate_dt'>
					  		<input name="expirydate" type="text" class="form-control" id="expirydate" style="width:300px; height:35px" data-format="YYYY-MM-DD" placeholder="YYYY-MM-DD" value="<?php echo $userDetails->expirydate?>" /><span class="input-group-addon" ><span class="glyphicon glyphicon-calendar"></span>
                                </span>
						</div>
						</div>
					  <script type="text/javascript">
								 $(function () {
									$('#expirydate_dt').datetimepicker({
										pickTime: false
									});
									
								});
							</script>
                      </div>
					  </td>
                    </tr>
					
					<!--<tr>
                      <td width="42%" align="right"><strong>Native Place</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select id="nativeplace" name="nativeplace" class="form-control">
                          	<option value="">[Gam]</option>
							<?php
							
							foreach($gams as $gam){
								?>
									<option value="<?php echo $gam->name?>" <?php if($gam->name==$userDetails->nativeplace){echo "selected";}?>><?php echo $gam->name?></option>
								<?php
							}
							?>
                          </select>  
						<div id="regno_vmsg"></div>
                      </div>
					  </td>
                    </tr>-->
					<tr>
                      <td width="42%" align="right"><strong>Address1</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="address1" type="text" class="form-control" id="address1" style="width:300px; height:35px" value="<?php echo $userDetails->address1?>" />
						<div id="address1_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Address2</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="address2" type="text" class="form-control" id="address2" style="width:300px; height:35px" value="<?php echo $userDetails->address2?>" />
						<div id="address2_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>City</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="city" type="text" class="form-control" id="city" style="width:300px; height:35px" value="<?php echo $userDetails->city?>" />
						<div id="address3_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>State</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="state" type="text" class="form-control" id="state" style="width:300px; height:35px" value="<?php echo $userDetails->state?>" />
						<div id="address3_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Country</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select id="country" name="country" class="form-control">
                          	<option value="">[Country]</option>
							<?php
							
							foreach($countries as $country){
								?>
									<option value="<?php echo $country->name?>" <?php if($country->name==$userDetails->country){echo "selected";}?>><?php echo $country->name?></option>
								<?php
							}
							?>
                          </select>  
						<div id="country_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Zipcode</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="zipcode" type="text" class="form-control" id="zipcode" style="width:300px; height:35px" value="<?php echo $userDetails->zip?>" />
						<div id="zipcode_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Residence Phone</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="phone" type="text" class="form-control" id="phone" style="width:300px; height:35px" value="<?php echo $userDetails->phone?>" />
						<div id="rphone_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Mobile</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="mobile" type="text" class="form-control" id="mobile" style="width:300px; height:35px" value="<?php echo $userDetails->mobile?>" />
						<div id="mobile_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Email</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="email" type="text" class="form-control" id="email" style="width:300px; height:35px" value="<?php echo $userDetails->email?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>User Name</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="username" type="text" class="form-control" id="username" style="width:300px; height:35px" value="<?php echo $userDetails->username?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Password</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="password" type="password" class="form-control" id="password" style="width:300px; height:35px" value="<?php echo $userDetails->password?>" />
						<div id="password_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Marital Status</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select id="maritalstatus" name="maritalstatus" class="form-control">
								<option value="">[Marital Status]</option>
								<option value="Married" <?php if($userDetails->maritalstatus == 'Married') { echo "Selected"; } ?>>Married</option>
								<option value="Unmarried" <?php if($userDetails->maritalstatus == 'Unmarried') { echo "Selected"; } ?>>Unmarried</option>
								
                          	</select>      
						<div id="firstname_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>No. of Family Members</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="nooffamilymembers" type="text" class="form-control" id="nooffamilymembers" style="width:300px; height:35px" value="<?php echo $userDetails->nooffamilymembers?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Education</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="education" type="text" class="form-control" id="education" style="width:300px; height:35px" value="<?php echo $userDetails->education?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Occupation</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select id="occupation" name="occupation" class="form-control">
                          	<option value="">[Occupation]</option>
                            <option value="Business" <?php if($userDetails->occupation == 'Business') { echo "Selected"; } ?>>Business</option>
							<option value="Job" <?php if($userDetails->occupation == 'Job') { echo "Selected"; } ?>>Job</option>
                          </select> 
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Name of Company</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_nameofcompany" type="text" class="form-control" id="bus_nameofcompany" style="width:300px; height:35px" value="<?php echo $userDetails->bus_nameofcompany?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Nature of Business</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_nature" type="text" class="form-control" id="bus_nature" style="width:300px; height:35px" value="<?php echo $userDetails->bus_nature?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Designation</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_designation" type="text" class="form-control" id="bus_designation" style="width:300px; height:35px" value="<?php echo $userDetails->bus_designation?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business Address1</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_address1" type="text" class="form-control" id="bus_address1" style="width:300px; height:35px" value="<?php echo $userDetails->bus_address1?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business Address2</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_address2" type="text" class="form-control" id="bus_address2" style="width:300px; height:35px" value="<?php echo $userDetails->bus_address2?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business City</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_city" type="text" class="form-control" id="bus_city" style="width:300px; height:35px" value="<?php echo $userDetails->bus_city?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business State</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_state" type="text" class="form-control" id="bus_state" style="width:300px; height:35px" value="<?php echo $userDetails->bus_state?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business Country</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select id="bus_country" name="bus_country" class="form-control">
                          	<option value="">[Country]</option>
							<?php
							
							foreach($countries as $country){
								?>
									<option value="<?php echo $country->name?>" <?php if($country->name==$userDetails->bus_country){echo "selected";}?>><?php echo $country->name?></option>
								<?php
							}
							?>
                          </select>  
						<div id="country_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business Zip</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_zip" type="text" class="form-control" id="bus_zip" style="width:300px; height:35px" value="<?php echo $userDetails->bus_zip?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business Phone</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_phone" type="text" class="form-control" id="bus_phone" style="width:300px; height:35px" value="<?php echo $userDetails->bus_phone?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business Website</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_website" type="text" class="form-control" id="bus_website" style="width:300px; height:35px" value="<?php echo $userDetails->bus_website?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Business Email</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input name="bus_email" type="text" class="form-control" id="bus_email" style="width:300px; height:35px" value="<?php echo $userDetails->bus_email?>" />
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>About business</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
						<textarea name="about_business" class="form-control" id="about_business"/><?php echo $userDetails->about_business?></textarea>
						<div id="email_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Show Contact Info</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<select name="showcontactinfo" id="showcontactinfo" class="form-control" style="width:100px; text-align:left">
												  	<option value="1" <?php if($userDetails->showcontactinfo==1){echo "selected";}?>>Yes</option>
													<option value="0" <?php if($userDetails->showcontactinfo==0){echo "selected";}?>>No</option>
												  </select>
						<div id="showcontactinfo_vmsg"></div>
                      </div>
					  </td>
                    </tr>
					<tr>
                      <td width="42%" align="right"><strong>Image</strong></td>
                      <td width="58%" align="left">
					  	<div class="form-group">
							<input type="file" name="simage" id="simage" /> <br />
						  (Only <?php echo VALID_EXT_MEMBERS?>)
						<div id="simage_vmsg"></div>
                      </div>
					   <?php 
					  if(!empty($userDetails->simage)){
								 ?>
							 	<table align="center" border="0" cellpadding="3" cellspacing="3" width="100%">
                               	   <tr>	
                                   		<td width="133"><?php if(!empty($userDetails->simage)){?> <img src="<?php echo  UPLOADDIR_MEMBERS."/".$userDetails->simage?>?<?php echo date("YmdHis")?>" width="100" height="100" alt="<?php echo SEO_IMAGE_ALT; ?>" title="<?php echo SEO_IMAGE_TITLE; ?>"> <?php }?><input type="hidden" name="homebanner_image_old" value="<?php echo $userDetails->simage?>">
										</td>
                                   	   
                                   </tr>
                               </table>
                             <?php } ?>
					  </td>
                    </tr>
					
                    
                    <tr align="left">
                      <td align="right">&nbsp;</td>
                      <td><input type="submit" class="btn btn-blue" name="Submit" id="Submit" value="Submit" /></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center">&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center">&nbsp;</td>
              </tr>
              </table>
</form>
<script type="text/javascript">
$(document).ready(function() {
    $('#searchfrm').bootstrapValidator({
        message: 'This value is not valid',
        fields: {
			mobile: {
                message: 'The Mobile is not valid',
                validators: {
                    notEmpty: {
                        message: 'The Mobile is required and can\'t be empty'
                    }
                }
            },
            email: {
				message: 'The Email Address is not valid',
                validators: {
					notEmpty: {
                        message: 'The Email address is required and can\'t be empty'
                    },
                    emailAddress: {
                        message: 'The input is not a valid email address'
                    }
                }
            },password: {
                message: 'The Password is not valid',
                validators: {
                    notEmpty: {
                        message: 'The Password is required and can\'t be empty'
                    }
                }
            }
        }
    });
});
</script>