<?php
if($this->session->userdata('user')){
  $user = $this->session->userdata('user');
  $isLogin = true;
  $email = $user['username']; 
  $password = $user['password']; 
}else{
  $isLogin = false;
}
?>

<div class="innerBanner container-fluid mb-5">
	<div class="row h-100 align-items-center">
		<div class="col-md-4 col-lg-6">
			<h2 class="whiteColor mb-0">MEMBERS SECTION</h2>
		</div>
		<div class="col-md-8 col-lg-6">
			<ul class="breadcrumb">
				<li><a href="<?php echo base_url(); ?>">Home</a></li>
				<li><a href="javascript:;">Members Section</a></li>
				<li>Members Directory</li>
			</ul>
		</div>
	</div>
</div>
<div class="container-fluid">
	<div class="row">
		<div class="col-lg-3 mb-3">
			<div>
				<!--<div class="blackRect"></div>-->
				<h5 class="text-uppercase mb-3 searchHeading rounded">Search By</h5>
				<form id="searchForm">
					<div class="form-group">
						<input class="form-control" placeholder="Product" id="product" name="product" value="">
					</div>
					<div class="form-group">
						<input class="form-control" placeholder="Company Name" id="cname" name="cname" value="">
					</div>
					<div class="form-group">
						<input class="form-control" placeholder="City" id="city" name="city" value="">	
					</div>
					<div class="form-group">
						<select class="form-control" id="region" name="region">
							<option value="">Choose Region</option>
							<option value="east">Eastern Region</option>
							<option value="west">Western Region</option>
							<option value="north">Northern Region</option>
							<option value="south">Southern Region</option>
						</select>
					</div>
					<div class="form-group">
						<select class="form-control" id="sort" name="sort">
							<option value="">Sort By</option>
							<option value="A">A</option>
							<option value="B">B</option>
							<option value="C">C</option>
							<option value="D">D</option>
							<option value="E">E</option>
							<option value="F">F</option>
							<option value="G">G</option>
							<option value="H">H</option>
							<option value="I">I</option>
							<option value="J">J</option>
							<option value="K">K</option>
							<option value="L">L</option>
							<option value="M">M</option>
							<option value="N">N</option>
							<option value="O">O</option>
							<option value="P">P</option>
							<option value="Q">Q</option>
							<option value="R">R</option>
							<option value="S">S</option>
							<option value="T">T</option>
							<option value="U">U</option>
							<option value="V">V</option>
							<option value="W">W</option>
							<option value="X">X</option>
							<option value="Y">Y</option>
							<option value="Z">Z</option>
						</select>
					</div>
					<div class="form-group">
						<input type="submit" class="btn searchBtn grayGradientBg whiteColor" value="search">
						<input type="reset" class="btn searchBtn grayGradientBg whiteColor reset" value="reset">
					</div>
				</form>
			</div>
		</div>
		<div class="col-lg-9 mb-5" id="innerData">
			<div class="row">
				<h5 class="col-12 mb-3 text-uppercase" id="total"></h5>
				<div class="col-12">
					<div id="member_content" class="row">
					
					</div>
				</div>

				<div class="col-12">
					<div id="pagination_link" class="pagination">
          
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<?php if($isLogin){ ?>
<div id="memberEnquiryLogin" style="display:none">
  <h1 class="redColor mb-4">Contact Us</h1>

	<form id="memberEnquiryLoginForm">
    <div class="container">
      <div class="row mb-4">
				
				<div class="col-md-12 mb-3">
          <input type="text" class="form-control" id="member_name" name="member_name">
          <label for="member_name" class="error"></label>
				</div>
				
        <div class="col-md-6 mb-3">
          <input type="text" class="form-control" id="enquiry_name" name="enquiry_name" placeholder="Name">
          <label for="enquiry_name" class="error"></label>
        </div>
				
				<div class="col-md-6 mb-3">
          <input type="text" class="form-control" id="enquiry_email" name="enquiry_email" placeholder="Email">
          <label for="enquiry_email" class="error"></label>
				</div>
				
        <div class="col-md-6 mb-3">
         	<select class="form-control" id="enquiry_country" name="enquiry_country">
						<option value="">Select Country</option>
						<?php foreach($country as $val){
							echo '<option value="'.ucfirst($val->countryName).'">'.ucfirst($val->countryName).'</option>'; 
						}?>
					</select>
					<label for="enquiry_country" class="error"></label>
				</div>
				
				<div class="col-md-6 mb-3">
          <input type="number" class="form-control" id="enquiry_mobile" name="enquiry_mobile" placeholder="Mobile">
          <label for="enquiry_mobile" class="error"></label>
				</div>
         
        <div class="col-md-12 mb-3">
          <textarea class="form-control" id="enquiry_message" name="enquiry_message" placeholder="Message"></textarea>
          <label for="enquiry_message" class="error"></label>
				</div>
				
				<div class="col-md-12 mb-3">
          <label for="general_error" class="error"></label>
				</div>

				<input type="hidden" id="member_email" name="member_email">
      </div>
     
      <div class="row mb-3">     
        <div class="col-md-6">
          <input type="submit" value="Submit" class="btn redGradientBg whiteColor">
        </div>
      </div>  
    </div>
  </form>
</div>

<div id="memberEnquiry" style="display:none">
  <h1 class="redColor mb-4">Contact Us</h1>
	<form id="memberEnquiryForm">
  </form>
</div>

<?php }else{ ?>
<div id="memberEnquiry" style="display:none">
  <h1 class="redColor mb-4">Contact Us</h1>

	<form id="memberEnquiryForm">
    <div class="container">
      <div class="row mb-4">
				
				<div class="col-md-12 mb-3">
          <input type="text" class="form-control" id="member_name" name="member_name">
          <label for="member_name" class="error"></label>
				</div>
				
        <div class="col-md-6 mb-3">
          <input type="text" class="form-control" id="enquiry_name" name="enquiry_name" placeholder="Name">
          <label for="enquiry_name" class="error"></label>
        </div>
				
				<div class="col-md-6 mb-3">
          <input type="text" class="form-control" id="enquiry_email" name="enquiry_email" placeholder="Email">
          <label for="enquiry_email" class="error"></label>
				</div>
				
        <div class="col-md-3 mb-3">
         	<select class="form-control" id="enquiry_country" name="enquiry_country">
						<option value="">Select Country</option>
						<?php foreach($country as $val){
							echo '<option value="'.$val->phonecode.'">'.ucfirst($val->countryName).'</option>'; 
						}?>
					</select>
					<label for="enquiry_country" class="error"></label>
				</div>
				
				<div class="col-md-3 mb-3">
          <input type="number" class="form-control" id="enquiry_mobile" name="enquiry_mobile" placeholder="Mobile">
          <label for="enquiry_mobile" class="error"></label>
				</div>
				
				<div class="col-md-3 mb-3" id="enquiry_otp_text">
          <input class="form-control" id="enquiry_otp" name="enquiry_otp" placeholder="Enter OTP" />
          <label for="enquiry_otp" class="error"></label>
				</div>
				
        <div class="col-md-3 mb-3">
					<button id="enquiry_otp_send" class="btn redGradientBg whiteColor">Generate OTP</button>
					<button id="enquiry_otp_resend" class="btn redGradientBg whiteColor">Resend OTP</button>
				</div>
         
        <div class="col-md-12 mb-3">
          <textarea class="form-control" id="enquiry_message" name="enquiry_message" placeholder="Message"></textarea>
          <label for="enquiry_message" class="error"></label>
				</div>
				
				<div class="col-md-12 mb-3">
          <label for="general_error" class="error"></label>
				</div>

				<input type="hidden" id="member_email" name="member_email">
				<input type="hidden" id="otp_sent" name="otp_sent" value="no">
      </div>
     
      <div class="row mb-3">     
        <div class="col-md-6">
          <input type="submit" value="Submit" class="btn redGradientBg whiteColor">
        </div>
      </div>  
    </div>
  </form>
</div>

<div id="memberEnquiryLogin" style="display:none">
  <h1 class="redColor mb-4">Contact Us</h1>

	<form id="memberEnquiryLoginForm">

  </form>
</div>
<?php } ?>


