eHealth-Portal/admin/layouts/administration_part/vaccines_fullwidth.php

151 lines
6.6 KiB
PHP

<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.5
@build 24th April, 2021
@created 13th August, 2020
@package eHealth Portal
@subpackage vaccines_fullwidth.php
@author Oh Martin <https://github.com/namibia/eHealth-Portal>
@copyright Copyright (C) 2020 Vast Development Method. All rights reserved.
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Portal for mobile health clinics
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->vvyvaccines;
$user = JFactory::getUser();
$id = $displayData->item->id;
// set the edit URL
$edit = "index.php?option=com_ehealth_portal&view=immunisation_vaccine_types&task=immunisation_vaccine_type.edit";
// set a return value
$return = ($id) ? "index.php?option=com_ehealth_portal&view=administration_part&layout=edit&id=" . $id : "";
// check for a return value
$jinput = JFactory::getApplication()->input;
if ($_return = $jinput->get('return', null, 'base64'))
{
$return .= "&return=" . $_return;
}
// check if return value was set
if (Ehealth_portalHelper::checkString($return))
{
// set the referral values
$ref = ($id) ? "&ref=administration_part&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return));
}
else
{
$ref = ($id) ? "&ref=administration_part&refid=" . $id : "";
}
// set the create new URL
$new = "index.php?option=com_ehealth_portal&view=immunisation_vaccine_types&task=immunisation_vaccine_type.edit" . $ref;
// set the create new and close URL
$close_new = "index.php?option=com_ehealth_portal&view=immunisation_vaccine_types&task=immunisation_vaccine_type.edit";
// load the action object
$can = Ehealth_portalHelper::getActions('immunisation_vaccine_type');
?>
<div class="form-vertical">
<?php if ($can->get('core.create')): ?>
<div class="btn-group">
<a class="btn btn-small btn-success" href="<?php echo $new; ?>"><span class="icon-new icon-white"></span> <?php echo JText::_('COM_EHEALTH_PORTAL_NEW'); ?></a>
<a class="btn btn-small" onclick="Joomla.submitbutton('administration_part.cancel');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo JText::_('COM_EHEALTH_PORTAL_CLOSE_NEW'); ?></a>
</div><br /><br />
<?php endif; ?>
<?php if (Ehealth_portalHelper::checkArray($items)): ?>
<table class="footable table data immunisation_vaccine_types" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<thead>
<tr>
<th>
<?php echo JText::_('COM_EHEALTH_PORTAL_IMMUNISATION_VACCINE_TYPE_NAME_LABEL'); ?>
</th>
<th data-breakpoints="xs sm">
<?php echo JText::_('COM_EHEALTH_PORTAL_IMMUNISATION_VACCINE_TYPE_ADMINISTRATION_PART_LABEL'); ?>
</th>
<th data-breakpoints="xs sm">
<?php echo JText::_('COM_EHEALTH_PORTAL_IMMUNISATION_VACCINE_TYPE_DESCRIPTION_LABEL'); ?>
</th>
<th width="10" data-breakpoints="xs sm md">
<?php echo JText::_('COM_EHEALTH_PORTAL_IMMUNISATION_VACCINE_TYPE_STATUS'); ?>
</th>
<th width="5" data-type="number" data-breakpoints="xs sm md">
<?php echo JText::_('COM_EHEALTH_PORTAL_IMMUNISATION_VACCINE_TYPE_ID'); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($items as $i => $item): ?>
<?php
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$canDo = Ehealth_portalHelper::getActions('immunisation_vaccine_type',$item,'immunisation_vaccine_types');
?>
<tr>
<td>
<?php if ($canDo->get('core.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?><?php echo $ref; ?>"><?php echo $displayData->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'immunisation_vaccine_types.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $displayData->escape($item->name); ?>
<?php endif; ?>
</td>
<td>
<?php echo $displayData->escape($item->administration_part_name); ?>
</td>
<td>
<?php echo $displayData->escape($item->description); ?>
</td>
<?php if ($item->published == 1): ?>
<td class="center" data-value="1">
<span class="status-metro status-published" title="<?php echo JText::_('COM_EHEALTH_PORTAL_PUBLISHED'); ?>">
<?php echo JText::_('COM_EHEALTH_PORTAL_PUBLISHED'); ?>
</span>
</td>
<?php elseif ($item->published == 0): ?>
<td class="center" data-value="2">
<span class="status-metro status-inactive" title="<?php echo JText::_('COM_EHEALTH_PORTAL_INACTIVE'); ?>">
<?php echo JText::_('COM_EHEALTH_PORTAL_INACTIVE'); ?>
</span>
</td>
<?php elseif ($item->published == 2): ?>
<td class="center" data-value="3">
<span class="status-metro status-archived" title="<?php echo JText::_('COM_EHEALTH_PORTAL_ARCHIVED'); ?>">
<?php echo JText::_('COM_EHEALTH_PORTAL_ARCHIVED'); ?>
</span>
</td>
<?php elseif ($item->published == -2): ?>
<td class="center" data-value="4">
<span class="status-metro status-trashed" title="<?php echo JText::_('COM_EHEALTH_PORTAL_TRASHED'); ?>">
<?php echo JText::_('COM_EHEALTH_PORTAL_TRASHED'); ?>
</span>
</td>
<?php endif; ?>
<td class="nowrap center hidden-phone">
<?php echo $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php endif; ?>
</div>