<?php
include "include/db.php";
include "include/auth.php";
if(isset($_REQUEST['view']) && isset($_REQUEST['cl'])){
    if(strlen($_REQUEST['view']) > 0 && strlen($_REQUEST['cl']) > 0){
        $url_prop_id = $_REQUEST['view'];
        $url_client_id = $_REQUEST['cl'];
        $query_prop_select = "SELECT * FROM property WHERE prop_id = $url_prop_id"; 
        $run_prop_select = mysqli_query($conn, $query_prop_select);
        if(mysqli_num_rows($run_prop_select) == 1){
            while($row_prop_select = mysqli_fetch_array($run_prop_select)){
                $url_prop_case_num = $row_prop_select['prop_case_num'];
                $url_prop_loan_num = $row_prop_select['prop_loan_num'];
                $url_prop_full_add = $row_prop_select['prop_full_add'];
                $url_prop_county = $row_prop_select['prop_county'];
                $url_prop_state = $row_prop_select['prop_state'];
                $url_prop_city = $row_prop_select['prop_city'];
                $url_prop_zip = $row_prop_select['prop_zip'];
            }              
        }else{
            header("Location:index.php");
            exit;
        }

        $query_client_select = "SELECT * FROM client WHERE client_id = $url_client_id"; 
        $run_client_select = mysqli_query($conn, $query_client_select);
        if(mysqli_num_rows($run_client_select) == 1){
            while($row_client_select = mysqli_fetch_array($run_client_select)){
                $url_client_name = $row_client_select['client_name'];               
            }              
        }else{
            header("Location:index.php");
            exit;
        }
    }else{
        header("Location:index.php");
        exit;
    }
    
}else{
    header("Location:index.php");
    exit;
}

include "header.php";

?>
<div id="page-wrapper">
<h3>Property Bid/Invoice Details<a class='btn btn-warning' style = 'float:right;' href='property-list.php' id = ''>Cancel</a></h3>
<h4>Client Name- <?php echo $url_client_name; ?></h4>
<h4>Case No- <?php echo $url_prop_case_num." - ".$url_prop_full_add." ".$url_prop_city. " ". $url_prop_county. " ". $url_prop_state. " ". $url_prop_zip; ?></h4>
<?php                                     
    if(isset($successmessage)){
        if(strlen($successmessage) > 0){
            echo '<div class="alert alert-success">
            <strong>'. $successmessage .'</strong></div>';
        }
    } 

    if(isset($message)){
        if(strlen($message) >0){
            echo '<div class="alert alert-danger">
            <strong>'. $message .'</strong>
            </div>';
        }
    }
   
?>              
    
<div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
            <div class="panel-body">

                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-bidwiz-property-order-list">
                                    <thead>
                                        <tr>
                                                <th>
                                                  Date
                                                </th>
                                                <th>
                                                   Invoice#
                                                </th>
                                                <th>
                                                   Work Order#
                                                </th>
                                             
                                                    <th>
                                              Invoice Amount
                                                </th>
                                                
                                                
                                                <th>
                                             Vendor Pay Amount
                                                </th>
                                                
                                                <th>
                                                  Vendor Pay Date
                                                </th>
                                                <th>
                                              Projected Profit
                                                </th>
                                                <th>
                                              Client Pay Reference#
                                                </th>
                                                <th>
                                              Client Pay Amount
                                                </th>
                                                <th>
                                                  Client Pay Date
                                                </th>
                                                <th>
                                                Actual Profit
                                                </th>
                                                <th>
                                                Staff
                                                </th>
                                                <th>
                                                View
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
</tbody>
                         
                                    </table>
                                    
                                    </div><!-- panel-body  -->
                 </div> <!-- panel panel-default -->
            </div> <!--  col lg 12-->
        </div> <!-- row -->


</div> <!--  page wrapper -->                             
       
       
<?php  include "footer.php";   ?>