<?php  
// Include main file
include_once('../libs/main.php');
// Check Login
include_once('checkLogin.php');

$guarantorObj = new guarantor();

if(isset($_REQUEST['clinic_id'])  && $_REQUEST['clinic_id']!=""){

    $where = "guarantor_clinic_id = '".$_REQUEST['clinic_id']."' AND guarantor_fname != '' ";
    $orderby = array(" guarantor_id desc ");
    $guarantorArg    = array('where' => $where,'orderBy'=>$orderby);
    $guarantorDetails = $guarantorObj->getAllRecords($guarantorArg);
    ?>
    <option value="">Select Guarantor</option>
    <?php
    foreach ($guarantorDetails as $key => $guarantorvalue) 
    { ?>
       <option value="<?php echo $guarantorvalue->guarantor_sikka_id; ?>" ><?php echo $guarantorvalue->guarantor_fname." ".$guarantorvalue->guarantor_lname." - ".$guarantorvalue->guarantor_sikka_id ; ?></option>
                             
    <?php }
}

?>