if ($va_bill_check = $t_object->get('ca_object_lots.bill_upload.bill_upload_primary', array('returnAsArray' => true))) { $va_bill_primary = false; foreach ($va_bill_check as $va_key => $va_check) { foreach ($va_check as $check) { if ($check == 162) { $va_bill_primary = true; } } } if ($va_bill_primary == true) { $va_bill_images = $t_object->get('ca_object_lots.bill_upload', array('returnAsArray' => true, 'ignoreLocale' => true, 'rawDate' => 1, 'version' => 'icon', 'convertCodesToDisplayText' => true)); $va_lot_id = $t_object->get('ca_object_lots.lot_id'); $t_lot = new ca_object_lots($va_lot_id); print '<div class="unit "><span class="metaTitle">Bill of Sale:</span><span class="meta">'; $o_db = new Db(); $vn_media_element_id = $t_lot->_getElementID('bill_upload_media'); foreach ($va_bill_images as $vs_bill_id => $va_bill_imaged) { foreach ($va_bill_imaged as $vn_bill_id => $va_bill_image) { if ($va_bill_image['bill_upload_primary'] == "Yes") { $qr_res = $o_db->query('SELECT value_id FROM ca_attribute_values WHERE attribute_id = ? AND element_id = ?', array($vn_bill_id, $vn_media_element_id)); if ($qr_res->nextRow()) { print "<a href='#' onclick='caMediaPanel.showPanel(\"" . caNavUrl($this->request, '', 'Detail', 'GetMediaInfo', array('object_id' => $vn_object_id, 'value_id' => $qr_res->get('value_id'))) . "\"); return false;'>" . $va_bill_image['bill_upload_media'] . "</a>"; } } } } print "</span><div class='clearfix'></div></div>"; } } # if ($t_object->get('ca_objects.appraisal.appraisal_value')) { # $va_appraisal = $t_object->get('ca_objects.appraisal', array('returnAsArray' => true));