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

$disp = '';
$pagetitle = 'View/Search Investors';


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

$disp .= '

<div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Investors List: <br>
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
											<th> Name</th>
                                            <th>Phone</th>
											<th>Address</th>
											
											<th>Operation</th>
                                        </tr>
                                    </thead>
                                    <tbody>';

while($row = mysqli_fetch_array($res))
{

$disp .= '<tr class="odd gradeX" >';
$disp .= '<td>'.$row['name'].'</td><td>'.$row['phone'].'</td><td>'.$row['address'].'</td>
<td><a href="editinvestor.php?id='.$row['id'].'"><img src="../assets/img/edit.png"></a> &nbsp;&nbsp;<a onclick="return confirm(\'Are you sure you want to delete this investor info? \')" href="deleteinvestor.php?id='.$row['id'].'"><img src="../assets/img/delete.png"></a>&nbsp;&nbsp;</td>
</tr>';
}

$disp .='            </tbody>
                                </table>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>';
			

//echo $disp;
			
include('../header.php');
include('../template.php');

?>

<script>
            $(document).ready(function () {
                $('#dataTables-example').dataTable();
            });
    </script>
    
     