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

$disp = '';
$pagetitle = 'Edit Investor';

if(!isset($_REQUEST['id']))
{
$disp .= 'Please select an investor first';
include('../template.php');
exit;
}

$id = $_REQUEST['id'];

$q = "select * from investor where id='$id'";
$res = mysqli_query($dbcon,$q) or die(mysqli_error($dbcon));

if(mysqli_num_rows($res)<1)
{
$disp .= 'No investor found with this id';
include('../template.php');
exit;
}

$row = mysqli_fetch_array($res);

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


 
$disp .= '<form method="post" action="editinvestor2.php" id="editinvestorform">
<input type="hidden" name="id" value="'.$id.'">
<div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             Make changes and click submit
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <tbody>
									 
                                        <tr><th>Name *</th><td><input type="text" name="name" value="'.$row['name'].'" data-validation="required"></td></tr>
										<tr><th>Phone *:</th><td><input type="text" name="phone" value="'.$row['phone'].'" ></td></tr>
										<tr><th>Address *: </th><td><textarea name="address" row="3" >'.$row['address'].'</textarea></td></tr>
										
<tr><th>Click to Confirm Changes</th><td><button type="submit" name="editinvestrsubmit" class="btn-success">Submit Changes</button></td></tr>
																						
                                       
                                    
                                    </tbody>
                                </table>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>
			</form>';
			

		include('../header.php');
		include('../template.php');
			?>
		
    <!-- <script>
            $(document).ready(function () {
                $('#dataTables-example').dataTable();
            });
    </script>  -->
    <script>
                                    $.validate({
  form : '#editinvestorform'
});
</script>

			
               