Skip to content

Commit

Permalink
UPD: reports index pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Itskiprotich committed Aug 28, 2024
1 parent 301f9b3 commit 5ce5f27
Show file tree
Hide file tree
Showing 12 changed files with 440 additions and 280 deletions.
5 changes: 5 additions & 0 deletions src/Controller/Reporter/AefisController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public function index()

$this->set('page_options', $this->page_options);
$this->set(compact('aefis'));

$counties = $this->Aefis->Counties->find('list', array('order' => array('Counties.county_name' => 'ASC')));
$this->set(compact('counties'));
$designations = $this->Aefis->Designations->find('list', array('order' => array('Designations.name' => 'ASC')));
$this->set(compact('designations'));
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/Controller/Reporter/DevicesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public function index()

$this->set('page_options', $this->page_options);
$this->set(compact('devices'));


$counties = $this->Devices->Counties->find('list', array('order' => array('Counties.county_name' => 'ASC')));
$this->set(compact('counties'));
$designations = $this->Devices->Designations->find('list', array('order' => array('Designations.name' => 'ASC')));
$this->set(compact('designations'));
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/Controller/Reporter/MedicationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public function index()

$this->set('page_options', $this->page_options);
$this->set(compact('medications'));

$counties = $this->Medications->Counties->find('list', array('order' => array('Counties.county_name' => 'ASC')));
$this->set(compact('counties'));
$designations = $this->Medications->Designations->find('list', array('order' => array('Designations.name' => 'ASC')));
$this->set(compact('designations'));
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/Controller/Reporter/PqmpsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public function index()

$this->set('page_options', $this->page_options);
$this->set(compact('pqmps'));

$counties = $this->Pqmps->Counties->find('list', array('order' => array('Counties.county_name' => 'ASC')));
$this->set(compact('counties'));
$designations = $this->Pqmps->Designations->find('list', array('order' => array('Designations.name' => 'ASC')));
$this->set(compact('designations'));

$countries = $this->Pqmps->Countries->find('list', array('order' => array('Countries.name' => 'ASC')));
$this->set(compact('countries'));
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Controller/Reporter/SadrsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public function index()
$this->set('page_options', $this->page_options);
$this->set(compact('sadrs'));
$this->set(compact('sadr'));
$counties = $this->Sadrs->Counties->find('list', array('order' => array('Counties.county_name' => 'ASC')));
$this->set(compact('counties'));
$designations = $this->Sadrs->Designations->find('list', array('order' => array('Designations.name' => 'ASC')));
$this->set(compact('designations'));
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Controller/Reporter/TransfusionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public function index()

$this->set('page_options', $this->page_options);
$this->set(compact('transfusions'));
$counties = $this->Transfusions->Counties->find('list', array('order' => array('Counties.county_name' => 'ASC')));
$this->set(compact('counties'));
$designations = $this->Transfusions->Designations->find('list', array('order' => array('Designations.name' => 'ASC')));
$this->set(compact('designations'));
}

/**
Expand Down
113 changes: 64 additions & 49 deletions templates/element/aefi/aefi_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,36 @@
?>
</td>
<td colspan="2">
<?php
echo $this->Form->control(
'start_date',
array(
'div' => false,
'type' => 'text',
'class' => 'control-small unauthorized_index',
'after' => '-to-',
'label' => array('class' => 'required', 'text' => 'Report Dates'),
'placeHolder' => 'Start Date'
)
);
echo $this->Form->control(
'end_date',
array(
'div' => false,
'type' => 'text',
'class' => 'control-small unauthorized_index',
'after' => '<a style="font-weight:normal" onclick="$(\'.unauthorized_index\').val(\'\');" >
<h5>Report Dates</h5>
<div style="display: flex; align-items: center;">
<?php
echo $this->Form->control(
'start_date',
array(
'div' => false,
'type' => 'text',
'class' => 'control-small unauthorized_index',
'label' => false,
'placeHolder' => 'Start Date'
)
);
?>
<span style="margin: 0 10px;">-to-</span>
<?php
echo $this->Form->control(
'end_date',
array(
'div' => false,
'type' => 'text',
'class' => 'control-small unauthorized_index',
'after' => '<a style="font-weight:normal" onclick="$(\'.unauthorized_index\').val(\'\');" >
<em class="accordion-toggle">clear!</em></a>',
'label' => false,
'placeHolder' => 'End Date'
)
);
?>
'label' => false,
'placeHolder' => 'End Date'
)
);
?>
</div>
</td>
<td>
<?php
Expand All @@ -111,6 +116,7 @@
echo $this->Form->control('serious', array(
'options' => array('Yes' => 'Yes', 'No' => 'No'),
'legend' => false,
'label'=>false,
'type' => 'radio'
));
?>
Expand All @@ -132,37 +138,38 @@
<tr>
<td>
<?php
echo $this->Form->control('bcg', array('label' => 'BCG Lymphadenitis', 'hiddenField' => false));
echo $this->Form->control('convulsion', array('label' => 'Convulsion', 'hiddenField' => false));
echo $this->Form->control('urticaria', array('label' => 'Generalized urticaria', 'hiddenField' => false));
echo $this->Form->control('bcg', array('label' => 'BCG Lymphadenitis', 'hiddenField' => false, 'type' => 'checkbox'));
echo $this->Form->control('convulsion', array('label' => 'Convulsion', 'hiddenField' => false, 'type' => 'checkbox'));
echo $this->Form->control('urticaria', array('label' => 'Generalized urticaria', 'hiddenField' => false, 'type' => 'checkbox'));
?>
</td>
<td>
<td>
<!-- 782327 -->
<?php
echo $this->Form->control('high_fever', array('label' => 'High Fever', 'hiddenField' => false));
echo $this->Form->control('abscess', array('label' => 'Injection site abscess', 'hiddenField' => false));
echo $this->Form->control('high_fever', array('label' => 'High Fever', 'hiddenField' => false, 'type' => 'checkbox'));
echo $this->Form->control('abscess', array('label' => 'Injection site abscess', 'hiddenField' => false, 'type' => 'checkbox'));
?>
</td>
<td colspan="2">
<?php
echo $this->Form->control('local_reaction', array('label' => 'Severe Local Reaction', 'hiddenField' => false));
echo $this->Form->control('anaphylaxis', array('label' => 'Anaphylaxis', 'hiddenField' => false));
echo $this->Form->control('local_reaction', array('label' => 'Severe Local Reaction', 'hiddenField' => false, 'type' => 'checkbox'));
echo $this->Form->control('anaphylaxis', array('label' => 'Anaphylaxis', 'hiddenField' => false, 'type' => 'checkbox'));
?>
</td>
<td>
<?php
echo $this->Form->control('meningitis', array('label' => 'Encephalopathy', 'hiddenField' => false));
echo $this->Form->control('paralysis', array('label' => 'Paralysis', 'hiddenField' => false));
echo $this->Form->control('meningitis', array('label' => 'Encephalopathy', 'hiddenField' => false, 'type' => 'checkbox'));
echo $this->Form->control('paralysis', array('label' => 'Paralysis', 'hiddenField' => false, 'type' => 'checkbox'));
?>
</td>
<td>
<?php
echo $this->Form->control('toxic_shock', array('label' => 'Toxic shock', 'hiddenField' => false));
echo $this->Form->control('toxic_shock', array('label' => 'Toxic shock', 'hiddenField' => false, 'type' => 'checkbox'));
?>
</td>
<td>
<?php
echo $this->Form->control('complaint_other', array('label' => 'Other', 'hiddenField' => false));
echo $this->Form->control('complaint_other', array('label' => 'Other', 'hiddenField' => false, 'type' => 'checkbox'));
echo $this->Form->control('complaint_other_specify', array('type' => 'text', 'label' => false, 'class' => 'control-small', 'placeholder' => '(specify)'));
?>
</td>
Expand All @@ -187,6 +194,7 @@
echo $this->Form->control('report_type', array(
'options' => array('Initial' => 'Initial', 'Followup' => 'Followup'),
'legend' => false,
'label'=>false,
'type' => 'radio'
));
?>
Expand Down Expand Up @@ -254,6 +262,7 @@
echo $this->Form->control('gender', array(
'options' => array('Male' => 'Male', 'Female' => 'Female', 'Unknown' => 'Unknown'),
'legend' => false,
'label'=>false,
'type' => 'radio'
));
?>
Expand All @@ -266,6 +275,7 @@
echo $this->Form->control('submitted', array(
'options' => array('1' => 'UnSubmitted', '2' => 'Submitted'),
'legend' => false,
'label'=>false,
'type' => 'radio'
));
?>
Expand Down Expand Up @@ -350,7 +360,7 @@
<?php
echo $this->Form->button('<i class="icon-search icon-white"></i> Search', array(
'class' => 'btn btn-primary',
'escapeTitle'=>false,
'escapeTitle' => false,
'div' => 'control-group',
'div' => false,
'formnovalidate' => 'formnovalidate',
Expand Down Expand Up @@ -381,7 +391,7 @@
ending on <span class="badge">{{end}}</span>')
);
?>

</p>
<?php echo $this->Form->end(); ?>
<div class="pagination">
Expand All @@ -393,7 +403,7 @@
<?= $this->Paginator->last(__('last') . ' >>') ?>
</ul>
</div>


<table class="table table-bordered table-striped">
<thead>
Expand Down Expand Up @@ -571,26 +581,31 @@

<script type="text/javascript">
$(function() {
var adates = $('#AefiStartDate, #AefiEndDate').datepicker({
$('#start-date').datepicker({
minDate: "-100Y",
maxDate: "-0D",
dateFormat: 'dd-mm-yy',
format: 'dd-mm-yyyy',
endDate: '-0d',
showButtonPanel: true,
changeMonth: true,
changeYear: true,
showAnim: 'show',
onSelect: function(selectedDate) {
var option = this.id == "AefiStartDate" ? "minDate" : "maxDate",
instance = $(this).data("datepicker"),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings);
adates.not(this).datepicker("option", option, date);
// Set the minDate of the end date picker based on the selected start date
$('#end-date').datepicker("option", "minDate", selectedDate);
}
});

// Initialize end date picker
$('#end-date').datepicker({
minDate: "-100Y", // This will be dynamically updated
maxDate: "-0D",
dateFormat: 'dd-mm-yy',
showButtonPanel: true,
changeMonth: true,
changeYear: true,
showAnim: 'show'
});


});
</script>
Loading

0 comments on commit 5ce5f27

Please sign in to comment.