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

//$pmspatientObj = new pmspatient();
$pmspatientObj = new pmsPatient();

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

    $where = array("pmsPatient_clinic_id="=>$_REQUEST['clinic_id']);
    $orderby = array(" pmsPatient_id desc ");
    $pmspatientArg    = array('where' => $where,'orderBy'=>$orderby);
    $pmspatientDetails = $pmspatientObj->getAllRecords($pmspatientArg);
    ?>
    <option value="">Select Patient</option>
    <?php
    foreach ($pmspatientDetails as $key => $pmspatientdata) 
    { ?>
       <option value="<?php echo $pmspatientdata->pmsPatient_patient_id; ?>" ><?php echo $pmspatientdata->pmsPatient_fname." ".$pmspatientdata->pmsPatient_lname." - ".$pmspatientdata->pmsPatient_patient_id; ?></option>
                             
    <?php }
}

?>