Skip to content

Commit

Permalink
Update instrument_list
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 14, 2023
1 parent 179df36 commit 0736b50
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
25 changes: 16 additions & 9 deletions modules/instrument_list/php/instrument_list.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,23 @@ class Instrument_List extends \NDB_Menu_Filter
$this->tpl_data['display']
= array_merge($this->candidate->getData(), $this->timePoint->getData());
// DoB to Derived Age
$dob = $this->candidate->getCandidateDoB();
$dob_year = abs((date('Y', strtotime($dob)) - date('Y')));
$dob_month = abs((date('m', strtotime($dob)) - date('m')));
$dob_age = $dob_year . " y / " . $dob_month . " m";
$dob_age=null;
// DoB to Derived Age
$dob = $this->candidate->getData();
if ($dob['DoB'] !=null && isset($dob['DoB']) ) {
$dob_year = abs((date('Y', strtotime($dob['DoB'])) - date('Y')));
$dob_month = abs((date('m', strtotime($dob['DoB'])) - date('m')));
$dob_age = $dob_year . " y / " . $dob_month . " m";
}
$this->tpl_data['dob_age'] = $dob_age;
// EDC to EDC Age
$edc = $this->candidate->getCandidateEDC();
$edc_year = abs((date('Y', strtotime($edc)) - date('Y')));
$edc_month = abs((date('m', strtotime($edc)) - date('m')));
$edc_age = $edc_year . " y / " . $edc_month . " m";

$edc_age=null;
$edc = $this->candidate->getData();
if ($edc['EDC'] !=null && isset($edc['EDC']) ) {
$edc_year = abs((date('Y', strtotime($edc['EDC'])) - date('Y')));
$edc_month = abs((date('m', strtotime($edc['EDC'])) - date('m')));
$edc_age = $edc_year . " y / " . $edc_month . " m";
}
$this->tpl_data['edc_age'] = $edc_age;
}

Expand Down
14 changes: 9 additions & 5 deletions modules/instrument_list/templates/menu_instrument_list.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@
<!-- candidate data -->
<tbody>
<tr>
<td>
{$dob_age}
</td>
<td>
{if $dob_age!=""}
<td>
{$dob_age}
</td>
{/if}
{if $edc_age!=""}
<td>
{$edc_age}
</td>
</td>
{/if}
<td>
{$display.Sex}
</td>
Expand Down

0 comments on commit 0736b50

Please sign in to comment.