示例#1
0
 public function insuranceAction()
 {
     $this->_helper->layout->disableLayout();
     $drids = trim($this->_getParam('drids'));
     $comp_id = $this->_getParam('comp_id');
     $DoctorInsurance = new Application_Model_DoctorInsurance();
     if ($comp_id > 0) {
         $Company = new Application_Model_InsuranceCompany();
         $insuranceCompany = $Company->find($comp_id);
     }
     $returnArray = array();
     $dridArray = explode(' ', $drids);
     if (count($dridArray)) {
         foreach ($dridArray as $drid) {
             if ($comp_id > 0) {
                 $object = $DoctorInsurance->fetchRow("doctor_id={$drid} AND insurance_id={$comp_id}");
                 if (!empty($object)) {
                     $returnArray[$drid] = "<div class=\"in-network\">In Network</div>\r\n        <img width=\"125\" alt=\"{$insuranceCompany->getCompany()}\" src=\"/images/insurance/{$insuranceCompany->getLogo()}\">";
                 } else {
                     $returnArray[$drid] = "<strong>Out of network.</strong><br />Please contact the Doctor's office to see if they file paperwork.";
                 }
             } elseif ($comp_id == -1) {
                 $returnArray[$drid] = "<span class='na'>N/A</span>";
             } else {
                 $returnArray[$drid] = "Please enter your insurance at the top of the page.";
             }
         }
     }
     echo Zend_Json::encode($returnArray);
     exit;
 }