Ejemplo n.º 1
0
                <p>
                    <b>Involved in events: </b>

                    <ul>
                        <?php 
    // find related events
    $records_events = recordSearch_2('[{"t":"14"},{"related_to:10":"' . $recID . '"} ]');
    if (@$records_events['reccount'] > 0) {
        foreach ($records_events['order'] as $eventID) {
            //get relationship record for related address (or search events with relation at once?)
            $term_id = recordGetRealtionshipType($system, $eventID, $recID);
            //date and time
            $date_out = composeDates($records_events, $eventID, '<b>Date: </b>');
            $time_out = composeTime($records_events, $eventID, '<b>Time: </b>');
            print '<li><a href="dh_popup.php?db=' . HEURIST_DBNAME . '&full=1&recID=' . $eventID . '">' . getFieldValue($records_events, $eventID, DT_NAME) . '</a> (' . getTermById(getFieldValue($records_events, $eventID, DT_EVENT_TYPE)) . ')';
            print '<ul><li>' . $date_out . '&nbsp;' . $time_out . '</li>';
            //get address of event
            $records_address = recordSearch_2('[{"t":"12"},{"relatedfrom:14":"' . $eventID . '"} ]');
            foreach ($records_address['order'] as $addrID) {
                $relation1 = recordGetRealtionship_2($system, $eventID, $addrID, 'address for event');
                // TODO: Remove, enable or explain: $term_id = recordGetRealtionshipType( $system, $recID, $recID );
                $event_address = '';
                $term_id = getFieldValue($relation1, 0, DT_RELATION_TYPE);
                if ($term_id == TERM_MAIN_CRIME_LOCATION) {
                    $event_address = 'Location: ';
                } else {
                    $event_address = getTermById_2($term_id);
                }
                $comment = getFieldValue($relation1, 0, DT_EXTENDED_DESCRIPTION);
                print '<li>' . $event_address . ' ' . ' <a href="dh_popup.php?db=' . HEURIST_DBNAME . '&full=1&recID=' . $addrID . '">' . getFieldValue($records_address, $addrID, 'rec_Title') . '</a><br/> ' . $comment . '</li>';
Ejemplo n.º 2
0
        $records_eventreports['order'] = array_unique($records_eventreports['order']);
    }
    if (count($records_eventreports['records']) > 0) {
        foreach ($records_eventreports['order'] as $repID) {
            //getFieldValue($records_eventreports, $repID, DT_ORIGINAL_RECORD_ID)
            //find DA Report name
            $da_report = '';
            $da_repID = getFieldValue($records_eventreports, $repID, DT_REPORT_DALINK);
            if ($da_repID > 0) {
                $da_report = recordSearch_2('ids:' . $da_repID);
                $da_report = getFieldValue($da_report, 0, DT_NAME);
            }
            ?>
                                <li>
                                    (#<?php 
            echo $repID . ')&nbsp;<em>' . getFieldValue($records_eventreports, $repID, 'rec_Title') . '</em>. [' . getFieldValue($records_eventreports, $repID, DT_DATE) . ']. ' . getTermById(getFieldValue($records_eventreports, $repID, DT_REPORT_SOURCE_TYPE)) . '&nbsp' . $da_report . ' ' . getFieldValue($records_eventreports, $repID, DT_REPORT_CITATION);
            ?>
                                </li>
                                <?php 
        }
    } else {
        echo '<li>None recorded</li>';
    }
    ?>
                    </ul>
                </p>

            </div>

        </body></html>
Ejemplo n.º 3
0
function getTermById_2($term_id, $type_suffix = '')
{
    $ret = getTermById($term_id);
    if (null == $ret || strpos(strtolower($ret), 'unknown') !== false) {
        return $type_suffix == '' ? '' : ' unknown ' . $type_suffix;
    } else {
        return $ret;
    }
}