| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package VikBooking |
| 4 |
* @subpackage com_vikbooking |
| 5 |
* @author Alessio Gaggii - e4j - Extensionsforjoomla.com |
| 6 |
* @copyright Copyright (C) 2018 e4j - Extensionsforjoomla.com. All rights reserved. |
| 7 |
* @license GNU General Public License version 2 or later; see LICENSE |
| 8 |
* @link https://vikwp.com |
| 9 |
*/ |
| 10 |
|
| 11 |
defined('ABSPATH') or die('No script kiddies please!'); |
| 12 |
|
| 13 |
$app = JFactory::getApplication(); |
| 14 |
$pidcountry = $app->getUserStateFromRequest("vbo.states.idcountry", 'idcountry', 0, 'int'); |
| 15 |
$pstatename = $app->getUserStateFromRequest("vbo.states.statename", 'statename', '', 'string'); |
| 16 |
|
| 17 |
$vbo_app = VikBooking::getVboApplication(); |
| 18 |
$vbo_app->loadSelect2(); |
| 19 |
|
| 20 |
JText::script('VBNEWCUSTOMFCOUNTRY'); |
| 21 |
|
| 22 |
?> |
| 23 |
<div class="vbo-list-form-filters vbo-btn-toolbar"> |
| 24 |
<form action="index.php?option=com_vikbooking&view=states" method="post" name="statesform"> |
| 25 |
<div style="width: 100%; display: inline-block;" class="btn-toolbar" id="filter-bar"> |
| 26 |
<div class="btn-group pull-left"> |
| 27 |
<select name="idcountry" id="idcountry" onchange="document.statesform.submit();"> |
| 28 |
<option></option> |
| 29 |
<?php |
| 30 |
foreach (VikBooking::getCountriesArray($tn = true, $no_id = false) as $country) { |
| 31 |
?> |
| 32 |
<option value="<?php echo $country['id']; ?>"<?php echo $country['id'] == $pidcountry ? ' selected="selected"' : ''; ?>><?php echo $country['country_name']; ?></option> |
| 33 |
<?php |
| 34 |
} |
| 35 |
?> |
| 36 |
</select> |
| 37 |
</div> |
| 38 |
<div class="btn-group pull-left input-append btn-group-right-el"> |
| 39 |
<input type="text" name="statename" id="statename" value="<?php echo JHtml::fetch('esc_attr', $pstatename); ?>" size="40" placeholder="<?php echo JText::translate('VBPVIEWROOMONE'); ?>"/> |
| 40 |
<button type="button" class="btn btn-secondary" onclick="document.statesform.submit();"><i class="icon-search"></i></button> |
| 41 |
</div> |
| 42 |
<div class="btn-group pull-left"> |
| 43 |
<button type="button" class="btn btn-secondary" onclick="document.getElementById('statename').value='';document.getElementById('idcountry').value='';document.statesform.submit();"><?php echo JText::translate('JSEARCH_FILTER_CLEAR'); ?></button> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
<input type="hidden" name="task" value="" /> |
| 47 |
<input type="hidden" name="option" value="com_vikbooking" /> |
| 48 |
</form> |
| 49 |
</div> |
| 50 |
|
| 51 |
<script> |
| 52 |
(function($) { |
| 53 |
'use strict'; |
| 54 |
|
| 55 |
$(function() { |
| 56 |
$('#idcountry').select2({ |
| 57 |
allowClear: true, |
| 58 |
placeholder: Joomla.JText._('VBNEWCUSTOMFCOUNTRY'), |
| 59 |
}); |
| 60 |
}); |
| 61 |
})(jQuery); |
| 62 |
</script> |
| 63 |
|
| 64 |
<?php |
| 65 |
if (empty($this->rows)) { |
| 66 |
?> |
| 67 |
<p class="warn"><?php echo JText::translate('JGLOBAL_NO_MATCHING_RESULTS'); ?></p> |
| 68 |
<form action="index.php?option=com_vikbooking" method="post" name="adminForm" id="adminForm"> |
| 69 |
<input type="hidden" name="task" value="" /> |
| 70 |
<input type="hidden" name="option" value="com_vikbooking" /> |
| 71 |
</form> |
| 72 |
<?php |
| 73 |
} else { |
| 74 |
?> |
| 75 |
<form action="index.php?option=com_vikbooking" method="post" name="adminForm" id="adminForm" class="vbo-list-form"> |
| 76 |
<div class="table-responsive"> |
| 77 |
<table cellpadding="4" cellspacing="0" border="0" width="100%" class="table table-striped vbo-list-table"> |
| 78 |
<thead> |
| 79 |
<tr> |
| 80 |
<th width="20"> |
| 81 |
<input type="checkbox" onclick="Joomla.checkAll(this)" value="" name="checkall-toggle"> |
| 82 |
</th> |
| 83 |
<th class="title left" width="150"> |
| 84 |
<a href="index.php?option=com_vikbooking&view=states&vborderby=state_name&vbordersort=<?php echo ($this->orderby == "state_name" && $this->ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($this->orderby == "state_name" && $this->ordersort == "ASC" ? "vbo-list-activesort" : ($this->orderby == "state_name" ? "vbo-list-activesort" : "")); ?>"> |
| 85 |
<?php echo JText::translate('VBO_STATE_PROVINCE') . ($this->orderby == "state_name" && $this->ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($this->orderby == "state_name" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?> |
| 86 |
</a> |
| 87 |
</th> |
| 88 |
<th class="title left" width="150"><?php echo JText::translate( 'VBNEWCUSTOMFCOUNTRY' ); ?></th> |
| 89 |
<th class="title center" width="100" align="center"> |
| 90 |
<a href="index.php?option=com_vikbooking&view=states&vborderby=state_3_code&vbordersort=<?php echo ($this->orderby == "state_3_code" && $this->ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($this->orderby == "state_3_code" && $this->ordersort == "ASC" ? "vbo-list-activesort" : ($this->orderby == "state_3_code" ? "vbo-list-activesort" : "")); ?>"> |
| 91 |
<?php echo JText::translate('VBO_3CHAR_CODE').($this->orderby == "state_3_code" && $this->ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($this->orderby == "state_3_code" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?> |
| 92 |
</a> |
| 93 |
</th> |
| 94 |
<th class="title center" width="100" align="center"> |
| 95 |
<a href="index.php?option=com_vikbooking&view=states&vborderby=state_2_code&vbordersort=<?php echo ($this->orderby == "state_2_code" && $this->ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($this->orderby == "state_2_code" && $this->ordersort == "ASC" ? "vbo-list-activesort" : ($this->orderby == "state_2_code" ? "vbo-list-activesort" : "")); ?>"> |
| 96 |
<?php echo JText::translate('VBO_2CHAR_CODE').($this->orderby == "state_2_code" && $this->ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($this->orderby == "state_2_code" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?> |
| 97 |
</a> |
| 98 |
</th> |
| 99 |
<th class="title center" width="50" align="center"> |
| 100 |
<a href="index.php?option=com_vikbooking&view=states&vborderby=published&vbordersort=<?php echo ($this->orderby == "published" && $this->ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($this->orderby == "published" && $this->ordersort == "ASC" ? "vbo-list-activesort" : ($this->orderby == "published" ? "vbo-list-activesort" : "")); ?>"> |
| 101 |
<?php echo JText::translate('VBPSHOWPAYMENTSFIVE').($this->orderby == "published" && $this->ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($this->orderby == "published" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?> |
| 102 |
</a> |
| 103 |
</th> |
| 104 |
</tr> |
| 105 |
</thead> |
| 106 |
<?php |
| 107 |
$k = 0; |
| 108 |
$i = 0; |
| 109 |
for ($i = 0, $n = count($this->rows); $i < $n; $i++) { |
| 110 |
$row = $this->rows[$i]; |
| 111 |
?> |
| 112 |
<tr class="row<?php echo $k; ?>"> |
| 113 |
<td><input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row['id']; ?>" onclick="Joomla.isChecked(this.checked);"></td> |
| 114 |
<td class="vbo-highlighted-td"><a href="index.php?option=com_vikbooking&task=states.edit&cid[]=<?php echo $row['id']; ?>"><?php echo $row['state_name']; ?></a></td> |
| 115 |
<td><?php echo $row['country_name']; ?></td> |
| 116 |
<td class="center"><?php echo $row['state_3_code']; ?></td> |
| 117 |
<td class="center"><?php echo $row['state_2_code']; ?></td> |
| 118 |
<td class="center"><?php echo ($row['published'] == 1 ? '<i class="'.VikBookingIcons::i('check', 'vbo-icn-img').'" style="color: #099909;"></i>' : '<i class="'.VikBookingIcons::i('times-circle', 'vbo-icn-img').'" style="color: #ff0000;"></i>'); ?></td> |
| 119 |
</tr> |
| 120 |
<?php |
| 121 |
$k = 1 - $k; |
| 122 |
} |
| 123 |
?> |
| 124 |
</table> |
| 125 |
</div> |
| 126 |
|
| 127 |
<input type="hidden" name="boxchecked" value="0" /> |
| 128 |
<input type="hidden" name="task" value="" /> |
| 129 |
<input type="hidden" name="view" value="states" /> |
| 130 |
<input type="hidden" name="idcountry" value="<?php echo $pidcountry; ?>" /> |
| 131 |
|
| 132 |
<?php echo JHtml::fetch('form.token'); ?> |
| 133 |
<?php echo $this->navbut; ?> |
| 134 |
</form> |
| 135 |
<?php |
| 136 |
} |
| 137 |
?> |
| 138 |
|