PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.20
VikAppointments Services Booking Calendar v1.2.20
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / views / customerinfo / tmpl / default.php
vikappointments / admin / views / customerinfo / tmpl Last commit date
default.php 1 month ago default_appointments.php 1 month ago default_billing.php 1 month ago default_draft.php 1 month ago default_notes.php 1 month ago default_packages.php 1 month ago index.html 1 month ago
default.php
165 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 JHtml::fetch('bootstrap.tooltip', '.hasTooltip');
15 JHtml::fetch('vaphtml.assets.fontawesome');
16 JHtml::fetch('vaphtml.assets.toast', 'bottom-right');
17
18 $customer = $this->customer;
19
20 $vik = VAPApplication::getInstance();
21
22 /**
23 * Trigger event to display custom HTML.
24 * In case it is needed to include any additional fields,
25 * it is possible to create a plugin and attach it to an event
26 * called "onDisplayViewCustomerinfo". The event method receives
27 * the view instance as argument.
28 *
29 * @since 1.7
30 */
31 $this->addons = $this->onDisplayView();
32
33 ?>
34
35 <div class="customer-info-modal" style="padding:10px;">
36
37 <form action="index.php?option=com_vikappointments" method="post" name="adminForm" id="adminForm">
38
39 <?php echo $vik->bootStartTabSet('customerinfo', array('active' => $this->getActiveTab('customerinfo_billing', $customer->id), 'cookie' => $this->getCookieTab($customer->id)->name)); ?>
40
41 <!-- BILLING -->
42
43 <?php
44 echo $vik->bootAddTab('customerinfo', 'customerinfo_billing', JText::translate('VAPMANAGECUSTOMERTITLE2'));
45 echo $this->loadTemplate('billing');
46 echo $vik->bootEndTab();
47 ?>
48
49 <!-- APPOINTMENTS -->
50
51 <?php
52 // add badge counter to tab
53 $options = array(
54 'badge' => array(
55 'count' => $this->appCount,
56 'class' => 'badge-info',
57 ),
58 );
59
60 echo $vik->bootAddTab('customerinfo', 'customerinfo_appointments', JText::translate('VAPMANAGECUSTOMERTITLE5'), $options);
61
62 if ($this->appointments)
63 {
64 echo $this->loadTemplate('appointments');
65 }
66 else
67 {
68 echo $vik->alert(JText::translate('JGLOBAL_NO_MATCHING_RESULTS'));
69 }
70
71 echo $vik->bootEndTab();
72 ?>
73
74 <!-- PACKAGES -->
75
76 <?php
77 if (VikAppointments::isPackagesEnabled())
78 {
79 // add badge counter to tab
80 $options = array(
81 'badge' => array(
82 'count' => $this->packCount,
83 'class' => 'badge-success',
84 ),
85 );
86
87 echo $vik->bootAddTab('customerinfo', 'customerinfo_packages', JText::translate('VAPMENUPACKAGES'), $options);
88
89 if ($this->packages)
90 {
91 echo $this->loadTemplate('packages');
92 }
93 else
94 {
95 echo $vik->alert(JText::translate('JGLOBAL_NO_MATCHING_RESULTS'));
96 }
97
98 echo $vik->bootEndTab();
99 }
100 ?>
101
102 <!-- NOTES -->
103
104 <?php
105 // add badge counter to tab
106 $options = array(
107 'badge' => array(
108 'count' => $this->notesCount,
109 'class' => 'badge-warning',
110 ),
111 );
112
113 echo $vik->bootAddTab('customerinfo', 'customerinfo_notes', JText::translate('VAPMANAGECUSTOMERTITLE4'), $options);
114
115 if ($this->notes)
116 {
117 echo $this->loadTemplate('notes');
118 }
119 else
120 {
121 echo $vik->alert(JText::translate('JGLOBAL_NO_MATCHING_RESULTS'));
122 }
123
124 echo $vik->bootEndTab();
125 ?>
126
127 <!-- Define role to detect the supported hook -->
128 <!-- {"rule":"customizer","event":"onDisplayViewCustomerinfo","type":"tab"} -->
129
130 <?php
131 /**
132 * Iterate remaining forms to be displayed within
133 * the nav bar as custom sections.
134 *
135 * @since 1.7
136 */
137 foreach ($this->addons as $formName => $formHtml)
138 {
139 $title = JText::translate($formName);
140
141 // fetch form key
142 $key = strtolower(preg_replace("/[^a-zA-Z0-9_]/", '', $title));
143
144 if (!preg_match("/^customerinfo_/", $key))
145 {
146 // keep same notation for fieldset IDs
147 $key = 'customerinfo_' . $key;
148 }
149
150 echo $vik->bootAddTab('customerinfo', $key, $title);
151 echo $formHtml;
152 echo $vik->bootEndTab();
153 }
154 ?>
155
156 <?php echo $vik->bootEndTabSet(); ?>
157
158 <input type="hidden" name="tmpl" value="component" />
159 <input type="hidden" name="view" value="customerinfo" />
160 <input type="hidden" name="cid[]" value="<?php echo $customer->id; ?>" />
161
162 </form>
163
164 </div>
165