| @@ -1,0 +1,310 @@ | ||
| 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 | +$vbo_app = VikBooking::getVboApplication(); | |
| 14 | + | |
| 15 | +$current_smsapi = VikBooking::getSMSAPIClass(); | |
| 16 | + | |
| 17 | +$allf = glob(VBO_ADMIN_PATH . DIRECTORY_SEPARATOR . 'smsapi' . DIRECTORY_SEPARATOR . '*.php'); | |
| 18 | +$allf = array_values(array_filter((array) $allf, function($fPath) { | |
| 19 | + $fPath = basename($fPath); | |
| 20 | + return $fPath && !preg_match('/^whatsapp/i', $fPath); | |
| 21 | +})); | |
| 22 | + | |
| 23 | +$psel = "<select name=\"smsapi\" id=\"smsapifile\" onchange=\"vikLoadSMSParameters(this.value);\">\n<option value=\"\"></option>\n"; | |
| 24 | +$classfiles = []; | |
| 25 | +foreach ($allf as $af) { | |
| 26 | + $classfiles[] = str_replace(VBO_ADMIN_PATH . DIRECTORY_SEPARATOR . 'smsapi' . DIRECTORY_SEPARATOR, '', $af); | |
| 27 | +} | |
| 28 | +sort($classfiles); | |
| 29 | + | |
| 30 | +foreach ($classfiles as $cf) { | |
| 31 | + $psel .= "<option value=\"".$cf."\"".($cf == $current_smsapi ? ' selected="selected"' : '').">".$cf."</option>\n"; | |
| 32 | +} | |
| 33 | +$psel .= "</select>"; | |
| 34 | + | |
| 35 | +$sendsmsto = VikBooking::getSendSMSTo(); | |
| 36 | +$sendsmswhen = VikBooking::getSendSMSWhen(); | |
| 37 | + | |
| 38 | +?> | |
| 39 | +<div class="vbo-config-maintab-left"> | |
| 40 | + <fieldset class="adminform"> | |
| 41 | + <div class="vbo-params-wrap"> | |
| 42 | + <legend class="adminlegend"><?php echo JText::translate('VBOCPARAMSMS'); ?></legend> | |
| 43 | + <div class="vbo-params-container"> | |
| 44 | + <div class="vbo-param-container"> | |
| 45 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSCLASS'); ?></div> | |
| 46 | + <div class="vbo-param-setting"><?php echo $psel; ?></div> | |
| 47 | + </div> | |
| 48 | + <div class="vbo-param-container"> | |
| 49 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSAUTOSEND'); ?></div> | |
| 50 | + <div class="vbo-param-setting"><?php echo $vbo_app->printYesNoButtons('smsautosend', JText::translate('VBYES'), JText::translate('VBNO'), (VikBooking::autoSendSMSEnabled() ? 1 : 0), 1, 0); ?></div> | |
| 51 | + </div> | |
| 52 | + <div class="vbo-param-container"> | |
| 53 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSSENDTO'); ?></div> | |
| 54 | + <div class="vbo-param-setting"> | |
| 55 | + <span class="vbo-spblock-inline"><input type="checkbox" name="smssendto[]" value="admin" id="smssendtoadmin"<?php echo in_array('admin', $sendsmsto) ? ' checked="checked"' : ''; ?> /> <label for="smssendtoadmin"><?php echo JText::translate('VBCONFIGSMSSENDTOADMIN'); ?></label></span> | |
| 56 | + <span class="vbo-spblock-inline"><input type="checkbox" name="smssendto[]" value="customer" id="smssendtocustomer"<?php echo in_array('customer', $sendsmsto) ? ' checked="checked"' : ''; ?> /> <label for="smssendtocustomer"><?php echo JText::translate('VBCONFIGSMSSENDTOCUSTOMER'); ?></label></span> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + <div class="vbo-param-container"> | |
| 60 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSSENDWHEN'); ?></div> | |
| 61 | + <div class="vbo-param-setting"> | |
| 62 | + <select name="smssendwhen" onchange="displaySMSTexts(this.value);"> | |
| 63 | + <option value="1"<?php echo $sendsmswhen <= 1 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBCONFIGSMSSENDWHENCONF'); ?></option> | |
| 64 | + <option value="2"<?php echo $sendsmswhen >= 2 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBCONFIGSMSSENDWHENCONFPEND'); ?></option> | |
| 65 | + </select> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + <div class="vbo-param-container"> | |
| 69 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSSADMINPHONE'); ?></div> | |
| 70 | + <div class="vbo-param-setting"><input type="text" name="smsadminphone" size="20" value="<?php echo JHtml::fetch('esc_attr', VikBooking::getSMSAdminPhone()); ?>" /></div> | |
| 71 | + </div> | |
| 72 | + <div class="vbo-param-container"> | |
| 73 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSADMTPL'); ?></div> | |
| 74 | + <div class="vbo-param-setting"> | |
| 75 | + <div class="btn-toolbar vbo-smstpl-toolbar"> | |
| 76 | + <div class="btn-group pull-left vbo-smstpl-bgroup"> | |
| 77 | + <button onclick="setSmsTplTag('smsadmintpl', '{customer_name}');" class="btn" type="button">{customer_name}</button> | |
| 78 | + <button onclick="setSmsTplTag('smsadmintpl', '{booking_id}');" class="btn" type="button">{booking_id}</button> | |
| 79 | + <button onclick="setSmsTplTag('smsadmintpl', '{checkin_date}');" class="btn" type="button">{checkin_date}</button> | |
| 80 | + <button onclick="setSmsTplTag('smsadmintpl', '{checkout_date}');" class="btn" type="button">{checkout_date}</button> | |
| 81 | + <button onclick="setSmsTplTag('smsadmintpl', '{num_nights}');" class="btn" type="button">{num_nights}</button> | |
| 82 | + <button onclick="setSmsTplTag('smsadmintpl', '{rooms_booked}');" class="btn" type="button">{rooms_booked}</button> | |
| 83 | + <button onclick="setSmsTplTag('smsadmintpl', '{rooms_names}');" class="btn" type="button">{rooms_names}</button> | |
| 84 | + <button onclick="setSmsTplTag('smsadmintpl', '{customer_country}');" class="btn" type="button">{customer_country}</button> | |
| 85 | + <button onclick="setSmsTplTag('smsadmintpl', '{customer_email}');" class="btn" type="button">{customer_email}</button> | |
| 86 | + <button onclick="setSmsTplTag('smsadmintpl', '{customer_phone}');" class="btn" type="button">{customer_phone}</button> | |
| 87 | + <button onclick="setSmsTplTag('smsadmintpl', '{tot_adults}');" class="btn" type="button">{tot_adults}</button> | |
| 88 | + <button onclick="setSmsTplTag('smsadmintpl', '{tot_children}');" class="btn" type="button">{tot_children}</button> | |
| 89 | + <button onclick="setSmsTplTag('smsadmintpl', '{tot_guests}');" class="btn" type="button">{tot_guests}</button> | |
| 90 | + <button onclick="setSmsTplTag('smsadmintpl', '{total}');" class="btn" type="button">{total}</button> | |
| 91 | + <button onclick="setSmsTplTag('smsadmintpl', '{total_paid}');" class="btn" type="button">{total_paid}</button> | |
| 92 | + <button onclick="setSmsTplTag('smsadmintpl', '{remaining_balance}');" class="btn" type="button">{remaining_balance}</button> | |
| 93 | + </div> | |
| 94 | + </div> | |
| 95 | + <div class="control vbo-smstpl-control"> | |
| 96 | + <textarea name="smsadmintpl" id="smsadmintpl" style="width: 90%; min-width: 90%; max-width: 100%; height: 100px;"><?php echo VikBooking::getSMSAdminTemplate(); ?></textarea> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + </div> | |
| 100 | + <div class="vbo-param-container"> | |
| 101 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSCUSTOTPL'); ?></div> | |
| 102 | + <div class="vbo-param-setting"> | |
| 103 | + <div class="btn-toolbar vbo-smstpl-toolbar"> | |
| 104 | + <div class="btn-group pull-left vbo-smstpl-bgroup"> | |
| 105 | + <button onclick="setSmsTplTag('smscustomertpl', '{customer_name}');" class="btn" type="button">{customer_name}</button> | |
| 106 | + <button onclick="setSmsTplTag('smscustomertpl', '{customer_pin}');" class="btn" type="button">{customer_pin}</button> | |
| 107 | + <button onclick="setSmsTplTag('smscustomertpl', '{booking_id}');" class="btn" type="button">{booking_id}</button> | |
| 108 | + <button onclick="setSmsTplTag('smscustomertpl', '{checkin_date}');" class="btn" type="button">{checkin_date}</button> | |
| 109 | + <button onclick="setSmsTplTag('smscustomertpl', '{checkout_date}');" class="btn" type="button">{checkout_date}</button> | |
| 110 | + <button onclick="setSmsTplTag('smscustomertpl', '{num_nights}');" class="btn" type="button">{num_nights}</button> | |
| 111 | + <button onclick="setSmsTplTag('smscustomertpl', '{rooms_booked}');" class="btn" type="button">{rooms_booked}</button> | |
| 112 | + <button onclick="setSmsTplTag('smscustomertpl', '{rooms_names}');" class="btn" type="button">{rooms_names}</button> | |
| 113 | + <button onclick="setSmsTplTag('smscustomertpl', '{tot_adults}');" class="btn" type="button">{tot_adults}</button> | |
| 114 | + <button onclick="setSmsTplTag('smscustomertpl', '{tot_children}');" class="btn" type="button">{tot_children}</button> | |
| 115 | + <button onclick="setSmsTplTag('smscustomertpl', '{tot_guests}');" class="btn" type="button">{tot_guests}</button> | |
| 116 | + <button onclick="setSmsTplTag('smscustomertpl', '{total}');" class="btn" type="button">{total}</button> | |
| 117 | + <button onclick="setSmsTplTag('smscustomertpl', '{total_paid}');" class="btn" type="button">{total_paid}</button> | |
| 118 | + <button onclick="setSmsTplTag('smscustomertpl', '{remaining_balance}');" class="btn" type="button">{remaining_balance}</button> | |
| 119 | + </div> | |
| 120 | + </div> | |
| 121 | + <div class="control vbo-smstpl-control"> | |
| 122 | + <textarea name="smscustomertpl" id="smscustomertpl" style="width: 90%; min-width: 90%; max-width: 100%; height: 100px;"><?php echo VikBooking::getSMSCustomerTemplate(); ?></textarea> | |
| 123 | + </div> | |
| 124 | + </div> | |
| 125 | + </div> | |
| 126 | + <div class="vbo-param-container" id="smsadmintplpend-tr" style="display: <?php echo $sendsmswhen <= 1 ? 'none' : 'flex'; ?>;"> | |
| 127 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSADMTPLPEND'); ?></div> | |
| 128 | + <div class="vbo-param-setting"> | |
| 129 | + <div class="btn-toolbar vbo-smstpl-toolbar"> | |
| 130 | + <div class="btn-group pull-left vbo-smstpl-bgroup"> | |
| 131 | + <button onclick="setSmsTplTag('smsadmintplpend', '{customer_name}');" class="btn" type="button">{customer_name}</button> | |
| 132 | + <button onclick="setSmsTplTag('smsadmintplpend', '{booking_id}');" class="btn" type="button">{booking_id}</button> | |
| 133 | + <button onclick="setSmsTplTag('smsadmintplpend', '{checkin_date}');" class="btn" type="button">{checkin_date}</button> | |
| 134 | + <button onclick="setSmsTplTag('smsadmintplpend', '{checkout_date}');" class="btn" type="button">{checkout_date}</button> | |
| 135 | + <button onclick="setSmsTplTag('smsadmintplpend', '{num_nights}');" class="btn" type="button">{num_nights}</button> | |
| 136 | + <button onclick="setSmsTplTag('smsadmintplpend', '{rooms_booked}');" class="btn" type="button">{rooms_booked}</button> | |
| 137 | + <button onclick="setSmsTplTag('smsadmintplpend', '{rooms_names}');" class="btn" type="button">{rooms_names}</button> | |
| 138 | + <button onclick="setSmsTplTag('smsadmintplpend', '{customer_country}');" class="btn" type="button">{customer_country}</button> | |
| 139 | + <button onclick="setSmsTplTag('smsadmintplpend', '{customer_email}');" class="btn" type="button">{customer_email}</button> | |
| 140 | + <button onclick="setSmsTplTag('smsadmintplpend', '{customer_phone}');" class="btn" type="button">{customer_phone}</button> | |
| 141 | + <button onclick="setSmsTplTag('smsadmintplpend', '{tot_adults}');" class="btn" type="button">{tot_adults}</button> | |
| 142 | + <button onclick="setSmsTplTag('smsadmintplpend', '{tot_children}');" class="btn" type="button">{tot_children}</button> | |
| 143 | + <button onclick="setSmsTplTag('smsadmintplpend', '{tot_guests}');" class="btn" type="button">{tot_guests}</button> | |
| 144 | + <button onclick="setSmsTplTag('smsadmintplpend', '{total}');" class="btn" type="button">{total}</button> | |
| 145 | + <button onclick="setSmsTplTag('smsadmintplpend', '{total_paid}');" class="btn" type="button">{total_paid}</button> | |
| 146 | + <button onclick="setSmsTplTag('smsadmintplpend', '{remaining_balance}');" class="btn" type="button">{remaining_balance}</button> | |
| 147 | + </div> | |
| 148 | + </div> | |
| 149 | + <div class="control vbo-smstpl-control"> | |
| 150 | + <textarea name="smsadmintplpend" id="smsadmintplpend" style="width: 90%; min-width: 90%; max-width: 100%; height: 100px;"><?php echo VikBooking::getSMSAdminTemplate(null, 'standby'); ?></textarea> | |
| 151 | + </div> | |
| 152 | + </div> | |
| 153 | + </div> | |
| 154 | + <div class="vbo-param-container" id="smscustomertplpend-tr" style="display: <?php echo $sendsmswhen <= 1 ? 'none' : 'flex'; ?>;"> | |
| 155 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSCUSTOTPLPEND'); ?></div> | |
| 156 | + <div class="vbo-param-setting"> | |
| 157 | + <div class="btn-toolbar vbo-smstpl-toolbar"> | |
| 158 | + <div class="btn-group pull-left vbo-smstpl-bgroup"> | |
| 159 | + <button onclick="setSmsTplTag('smscustomertplpend', '{customer_name}');" class="btn" type="button">{customer_name}</button> | |
| 160 | + <button onclick="setSmsTplTag('smscustomertplpend', '{customer_pin}');" class="btn" type="button">{customer_pin}</button> | |
| 161 | + <button onclick="setSmsTplTag('smscustomertplpend', '{booking_id}');" class="btn" type="button">{booking_id}</button> | |
| 162 | + <button onclick="setSmsTplTag('smscustomertplpend', '{checkin_date}');" class="btn" type="button">{checkin_date}</button> | |
| 163 | + <button onclick="setSmsTplTag('smscustomertplpend', '{checkout_date}');" class="btn" type="button">{checkout_date}</button> | |
| 164 | + <button onclick="setSmsTplTag('smscustomertplpend', '{num_nights}');" class="btn" type="button">{num_nights}</button> | |
| 165 | + <button onclick="setSmsTplTag('smscustomertplpend', '{rooms_booked}');" class="btn" type="button">{rooms_booked}</button> | |
| 166 | + <button onclick="setSmsTplTag('smscustomertplpend', '{rooms_names}');" class="btn" type="button">{rooms_names}</button> | |
| 167 | + <button onclick="setSmsTplTag('smscustomertplpend', '{tot_adults}');" class="btn" type="button">{tot_adults}</button> | |
| 168 | + <button onclick="setSmsTplTag('smscustomertplpend', '{tot_children}');" class="btn" type="button">{tot_children}</button> | |
| 169 | + <button onclick="setSmsTplTag('smscustomertplpend', '{tot_guests}');" class="btn" type="button">{tot_guests}</button> | |
| 170 | + <button onclick="setSmsTplTag('smscustomertplpend', '{total}');" class="btn" type="button">{total}</button> | |
| 171 | + <button onclick="setSmsTplTag('smscustomertplpend', '{total_paid}');" class="btn" type="button">{total_paid}</button> | |
| 172 | + <button onclick="setSmsTplTag('smscustomertplpend', '{remaining_balance}');" class="btn" type="button">{remaining_balance}</button> | |
| 173 | + </div> | |
| 174 | + </div> | |
| 175 | + <div class="control vbo-smstpl-control"> | |
| 176 | + <textarea name="smscustomertplpend" id="smscustomertplpend" style="width: 90%; min-width: 90%; max-width: 100%; height: 100px;"><?php echo VikBooking::getSMSCustomerTemplate(null, 'standby'); ?></textarea> | |
| 177 | + </div> | |
| 178 | + </div> | |
| 179 | + </div> | |
| 180 | + <div class="vbo-param-container" id="smsadmintplcanc-tr"> | |
| 181 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSADMTPLCANC'); ?></div> | |
| 182 | + <div class="vbo-param-setting"> | |
| 183 | + <div class="btn-toolbar vbo-smstpl-toolbar"> | |
| 184 | + <div class="btn-group pull-left vbo-smstpl-bgroup"> | |
| 185 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{customer_name}');" class="btn" type="button">{customer_name}</button> | |
| 186 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{booking_id}');" class="btn" type="button">{booking_id}</button> | |
| 187 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{checkin_date}');" class="btn" type="button">{checkin_date}</button> | |
| 188 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{checkout_date}');" class="btn" type="button">{checkout_date}</button> | |
| 189 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{num_nights}');" class="btn" type="button">{num_nights}</button> | |
| 190 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{rooms_booked}');" class="btn" type="button">{rooms_booked}</button> | |
| 191 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{rooms_names}');" class="btn" type="button">{rooms_names}</button> | |
| 192 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{customer_country}');" class="btn" type="button">{customer_country}</button> | |
| 193 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{customer_email}');" class="btn" type="button">{customer_email}</button> | |
| 194 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{customer_phone}');" class="btn" type="button">{customer_phone}</button> | |
| 195 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{tot_adults}');" class="btn" type="button">{tot_adults}</button> | |
| 196 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{tot_children}');" class="btn" type="button">{tot_children}</button> | |
| 197 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{tot_guests}');" class="btn" type="button">{tot_guests}</button> | |
| 198 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{total}');" class="btn" type="button">{total}</button> | |
| 199 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{total_paid}');" class="btn" type="button">{total_paid}</button> | |
| 200 | + <button onclick="setSmsTplTag('smsadmintplcanc', '{remaining_balance}');" class="btn" type="button">{remaining_balance}</button> | |
| 201 | + </div> | |
| 202 | + </div> | |
| 203 | + <div class="control vbo-smstpl-control"> | |
| 204 | + <textarea name="smsadmintplcanc" id="smsadmintplcanc" style="width: 90%; min-width: 90%; max-width: 100%; height: 100px;"><?php echo VikBooking::getSMSAdminTemplate(null, 'cancelled'); ?></textarea> | |
| 205 | + </div> | |
| 206 | + </div> | |
| 207 | + </div> | |
| 208 | + <div class="vbo-param-container" id="smscustomertplcanc-tr"> | |
| 209 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSCUSTOTPLCANC'); ?></div> | |
| 210 | + <div class="vbo-param-setting"> | |
| 211 | + <div class="btn-toolbar vbo-smstpl-toolbar"> | |
| 212 | + <div class="btn-group pull-left vbo-smstpl-bgroup"> | |
| 213 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{customer_name}');" class="btn" type="button">{customer_name}</button> | |
| 214 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{customer_pin}');" class="btn" type="button">{customer_pin}</button> | |
| 215 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{booking_id}');" class="btn" type="button">{booking_id}</button> | |
| 216 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{checkin_date}');" class="btn" type="button">{checkin_date}</button> | |
| 217 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{checkout_date}');" class="btn" type="button">{checkout_date}</button> | |
| 218 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{num_nights}');" class="btn" type="button">{num_nights}</button> | |
| 219 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{rooms_booked}');" class="btn" type="button">{rooms_booked}</button> | |
| 220 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{rooms_names}');" class="btn" type="button">{rooms_names}</button> | |
| 221 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{tot_adults}');" class="btn" type="button">{tot_adults}</button> | |
| 222 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{tot_children}');" class="btn" type="button">{tot_children}</button> | |
| 223 | + <button onclick="setSmsTplTag('smscustomertplcanc', '{tot_guests}');" class="btn" type="button">{tot_guests}</button> | |
| 224 | + </div> | |
| 225 | + </div> | |
| 226 | + <div class="control vbo-smstpl-control"> | |
| 227 | + <textarea name="smscustomertplcanc" id="smscustomertplcanc" style="width: 90%; min-width: 90%; max-width: 100%; height: 100px;"><?php echo VikBooking::getSMSCustomerTemplate(null, 'cancelled'); ?></textarea> | |
| 228 | + </div> | |
| 229 | + </div> | |
| 230 | + </div> | |
| 231 | + </div> | |
| 232 | + </div> | |
| 233 | + </fieldset> | |
| 234 | +</div> | |
| 235 | + | |
| 236 | +<div class="vbo-config-maintab-right"> | |
| 237 | + <fieldset class="adminform"> | |
| 238 | + <div class="vbo-params-wrap"> | |
| 239 | + <legend class="adminlegend"><?php echo JText::translate('VBCONFIGSMSPARAMETERS'); ?></legend> | |
| 240 | + <div class="vbo-params-container"> | |
| 241 | + <div id="vbo-sms-params"><?php echo !empty($current_smsapi) ? VikBooking::displaySMSParameters($current_smsapi, VikBooking::getSMSParams(false)) : ''; ?></div> | |
| 242 | + <?php | |
| 243 | + if (!empty($current_smsapi)) { | |
| 244 | + require_once(VBO_ADMIN_PATH . DIRECTORY_SEPARATOR . 'smsapi' . DIRECTORY_SEPARATOR . $current_smsapi); | |
| 245 | + if (method_exists('VikSmsApi', 'estimate')) { | |
| 246 | + ?> | |
| 247 | + <div class="vbo-param-container"> | |
| 248 | + <div class="vbo-param-label"><?php echo JText::translate('VBCONFIGSMSREMAINBAL'); ?></div> | |
| 249 | + <div class="vbo-param-setting"> | |
| 250 | + <button type="button" class="btn vbo-config-btn" onclick="vboEstimateCredit();"><i class="vboicn-coin-euro"></i><?php echo JText::translate('VBCONFIGSMSESTCREDIT'); ?></button> | |
| 251 | + <div id="vbo-sms-balance"></div> | |
| 252 | + </div> | |
| 253 | + </div> | |
| 254 | + <?php | |
| 255 | + } | |
| 256 | + } | |
| 257 | + ?> | |
| 258 | + </div> | |
| 259 | + </div> | |
| 260 | + </fieldset> | |
| 261 | +</div> | |
| 262 | + | |
| 263 | +<script type="text/javascript"> | |
| 264 | +if (typeof jQuery.fn.tooltip === 'function') { | |
| 265 | + jQuery(".hasTooltip").tooltip(); | |
| 266 | +} | |
| 267 | +function displaySMSTexts(sval) { | |
| 268 | + if (parseInt(sval) <= 1) { | |
| 269 | + document.getElementById('smsadmintplpend-tr').style.display = 'none'; | |
| 270 | + document.getElementById('smscustomertplpend-tr').style.display = 'none'; | |
| 271 | + } else { | |
| 272 | + document.getElementById('smsadmintplpend-tr').style.display = 'flex'; | |
| 273 | + document.getElementById('smscustomertplpend-tr').style.display = 'flex'; | |
| 274 | + } | |
| 275 | +} | |
| 276 | +function setSmsTplTag(taid, tpltag) { | |
| 277 | + var tplobj = document.getElementById(taid); | |
| 278 | + if (tplobj != null) { | |
| 279 | + var start = tplobj.selectionStart; | |
| 280 | + var end = tplobj.selectionEnd; | |
| 281 | + tplobj.value = tplobj.value.substring(0, start) + tpltag + tplobj.value.substring(end); | |
| 282 | + tplobj.selectionStart = tplobj.selectionEnd = start + tpltag.length; | |
| 283 | + tplobj.focus(); | |
| 284 | + } | |
| 285 | +} | |
| 286 | +function vikLoadSMSParameters(pfile) { | |
| 287 | + if (pfile.length > 0) { | |
| 288 | + jQuery("#vbo-sms-params").html('<?php echo addslashes(JText::translate('VIKLOADING')); ?>'); | |
| 289 | + jQuery.ajax({ | |
| 290 | + type: "POST", | |
| 291 | + url: "<?php echo VikBooking::ajaxUrl('index.php?option=com_vikbooking&task=loadsmsparams'); ?>", | |
| 292 | + data: { phpfile: pfile } | |
| 293 | + }).done(function(res) { | |
| 294 | + jQuery("#vbo-sms-params").html(res); | |
| 295 | + }); | |
| 296 | + } else { | |
| 297 | + jQuery("#vbo-sms-params").html('--------'); | |
| 298 | + } | |
| 299 | +} | |
| 300 | +function vboEstimateCredit() { | |
| 301 | + jQuery("#vbo-sms-balance").html('<?php echo addslashes(JText::translate('VIKLOADING')); ?>'); | |
| 302 | + jQuery.ajax({ | |
| 303 | + type: "POST", | |
| 304 | + url: "<?php echo VikBooking::ajaxUrl('index.php?option=com_vikbooking&task=loadsmsbalance'); ?>", | |
| 305 | + data: { vbo: '1' } | |
| 306 | + }).done(function(res) { | |
| 307 | + jQuery("#vbo-sms-balance").html(res); | |
| 308 | + }); | |
| 309 | +} | |
| 310 | +</script> | |