<?php
include('../headertop.php');
include('../datepicker.php');
include('../db.php');

$disp = '';
$pagetitle = 'Add Investment';
//$disp .=' <div class="col-md-6">';

$q = "select * from investor";
$res = mysqli_query($dbcon,$q) or die(mysqli_error($dbcon,$q));
if(mysqli_num_rows($res)<1)
{
$disp .= 'No investors found. First add an investor.';
include('../template.php');
exit;
}

if(isset($_REQUEST['sm']))
$disp .= '<div class="smdiv">'.$_REQUEST['sm'].'</div>';
else
$disp .= '<div class="smdiv">Add Investment</div>';

$disp .='<form role="form" id="addinvestment" method="post" action="addinvestment2.php">
                                    <div class="row">
                                <div class="col-md-6">
                                    <h3>Fill all required fields(*) and click Submit</h3>
                                    
                                        <div class="form-group">
                                            <label>Investor *</label>
                                            <select id="investor" name="investor" data-validation="required" class="form-control" />
											<option value=""></option>';
											
							while($row = mysqli_fetch_array($res))
	{
	$disp .= '<option value="'.$row['id'].'">'.$row['name'].'</option>';
	}	
						
											
		$disp .= '</select></div>
                                       <div class="form-group" >
                                            <label> Date *</label>
                                           <input type="text"  class="form-control" name="date" id="datep1" readonly data-validation="required"  placeholder=""   />
                                        </div>
									   
									   		
		
		  <div class="form-group">
                                            <label>Amount *</label>
                                            <input type="text" class="form-control" name="amount" data-validation="required number"  />
                                        </div>
										
										 </div>
											  
											  <div class="col-md-6" style="margin-top:55px">
											  
																						  
											  <div class="form-group">
                                            <label>Particulars * </label>
                                            <textarea class="form-control" name="particulars" data-validation="required" rows="3"></textarea>
                                        </div>
											  
											 <div class="form-group">
                                            <label>Payment Method *</label>
                                            <select class="form-control" name="payment_method" data-validation="required"  />
                                            <option value=""></option>
                                            <option value="cash">Cash</option>
                                            <option value="cheque">Cheque</option>
                                            <option value="bank transfer">Bank Transfer</option>
                                            </select>
                                        </div>
											  
									<div class="form-group">
                                            <label>Payment Details (Leave blank in case of cash transactions)</label>
                                            <input type="text" class="form-control" name="payment_details" placeholder="Cheque num or bank transfer details" />
                                        </div>
                                              
                                         </div>
										
										<div class="col-md-9" style="text-align:center"><button type="submit" class="btn btn-primary" name="addinvestmentsubmit">Submit Button</button>
                                        <button type="reset" class="btn btn-default">Reset Button</button>
										</form></div>
                                    </div>';
									
									
                                    ?>
                                    <script>
                                    $.validate({
  form : '#addinvestment'
});
</script>


    
    <?php
		include('../header.php');

	include('../template.php');
	?>			
								

<!--  <div class="form-group">
                                            <label>Floor Number </label>
                                            <select class="form-control" name="floor_no"   />
											<option value=""></option>
											<option value="Ground">Ground Floor</option>
											<option value="1">1st Floor</option>
											<option value="2">2nd Floor</option>
											<option value="3">3rd Floor</option>
											<option value="4">4th Floor</option>
											<option value="5">5th Floor</option>
											<option value="Terrace">Terrace</option>
											</select>
                                        </div>
										
										<div class="form-group">
                                            <label>Flat Number </label>
                                            <input type="text" class="form-control" name="flat_no"  />
                                        </div>
                                        
                                        
                                        		  											  
											
										<div class="form-group">
                                            <label>Comments </label>
                                            <textarea class="form-control" name="comments"  rows="3"></textarea>
                                        </div>
											 
--> 