PluginProbe ʕ •ᴥ•ʔ
Appointment Booking Calendar / 1.3.94
Appointment Booking Calendar v1.3.94
1.4.04 1.4.03 1.4.02 trunk 1.3.51 1.3.52 1.3.53 1.3.54 1.3.55 1.3.56 1.3.57 1.3.58 1.3.59 1.3.60 1.3.61 1.3.62 1.3.63 1.3.64 1.3.65 1.3.66 1.3.67 1.3.68 1.3.69 1.3.70 1.3.71 1.3.72 1.3.73 1.3.74 1.3.75 1.3.76 1.3.77 1.3.78 1.3.79 1.3.80 1.3.81 1.3.82 1.3.83 1.3.84 1.3.85 1.3.86 1.3.87 1.3.88 1.3.89 1.3.90 1.3.91 1.3.92 1.3.93 1.3.94 1.3.95 1.3.96 1.3.97 1.3.98 1.3.99 1.4.01
appointment-booking-calendar / inc / cpabc_publish_wizzard.inc.php
appointment-booking-calendar / inc Last commit date
banner.php 1 year ago cp-feedback.php 1 year ago cp_admin_int_edition.inc.php 1 year ago cpabc_appointments_admin_addbk.inc.php 1 year ago cpabc_appointments_admin_int.inc.php 1 year ago cpabc_appointments_admin_int_bookings_list.inc.php 1 year ago cpabc_appointments_admin_int_calendar_list.inc.php 1 year ago cpabc_appointments_admin_int_edit_booking.inc.php 1 year ago cpabc_apps_go.inc.php 1 year ago cpabc_apps_on.inc.php 1 year ago cpabc_publish_wizzard.inc.php 1 year ago cpabc_scheduler.inc.php 1 year ago index.html 1 year ago
cpabc_publish_wizzard.inc.php
201 lines
1 <?php
2
3 if ( !is_admin() || !current_user_can('manage_options')) {echo 'Direct access not allowed.';exit;}
4
5 $nonce = wp_create_nonce( 'abc_update_actions_pwizard' );
6
7 ?>
8
9
10 <h1>Publish Appointment Booking Calendar</h1>
11
12 <style type="text/css">
13
14 .ahb-buttons-container{margin:1em 1em 1em 0;}
15 .ahb-return-link{float:right;}
16 .ahb-mssg{margin-left:0 !important; }
17 .ahb-section-container {
18 border: 1px solid #e6e6e6;
19 padding:0px;
20 border-radius: 3px;
21 -webkit-box-flex: 1;
22 flex: 1;
23 margin: 1em 1em 1em 0;
24 min-width: 200px;
25 background: #ffffff;
26 position:relative;
27 }
28 .ahb-section{padding:20px;display:none;}
29 .ahb-section label{font-weight:600;}
30 .ahb-section-active{display:block;}
31
32 .ahb-row{display:none;}
33 .ahb-section table td,
34 .ahb-section table th{padding-left:0;padding-right:0;}
35 .ahb-section select,
36 .ahb-section input[type="text"]{width:100%;}
37
38 .cpmvcontainer { font-size:16px !important; }
39 </style>
40
41 <div class="ahb-buttons-container">
42 <a href="javascript:document.location='admin.php?page=cpabc_appointments.php';" class="ahb-return-link">&larr;Return to the calendars list</a>
43 <div class="clear"></div>
44 </div>
45
46 <form method="post" action="?page=cpabc_appointments.php&pwizard=1" name="regForm" id="regForm">
47 <input name="cpabc_do_action_loaded" type="hidden" value="wizard" />
48 <input name="nonce" type="hidden" value="<?php echo esc_attr($nonce); ?>" />
49
50 <?php
51
52 if (cpabc_get_post_param('cpabc_do_action_loaded') == 'wizard') {
53 global $cpabc_postURL;
54 ?>
55 <div class="ahb-section-container">
56 <div class="ahb-section ahb-section-active" data-step="1">
57 <h1>Great! Form successfully published</h1>
58 <p class="cpmvcontainer">The booking form was placed into the page <a href="<?php echo esc_attr($cpabc_postURL); ?>"><?php echo esc_html($cpabc_postURL); ?></a>.</p>
59 <p class="cpmvcontainer">Now you can:</p>
60 <div style="clear:both"></div>
61 <button class="button button-primary cpmvcontainer" type="button" id="nextBtn" onclick="window.open('<?php echo esc_attr($cpabc_postURL); ?>');">View the Published Form</button>
62 <div style="clear:both"></div>
63 <p class="cpmvcontainer">* Note: If the form was published in a new page or post it will be a 'draft', you have to publish the page/post in the future if needed.</p>
64 <div style="clear:both"></div>
65 <button class="button button-primary cpmvcontainer" type="button" id="nextBtn" onclick="window.open('?page=cpabc_appointments.php&cal=<?php echo intval($_POST["cpabc_publish_id"]); ?>');">Edit the booking form settings</button>
66 <div style="clear:both"></div>
67 </div>
68 </div>
69 <div style="clear:both"></div>
70 <?php
71 } else {
72 ?>
73
74 <div class="ahb-section-container">
75 <div class="ahb-section ahb-section-active" data-step="1">
76 <table class="form-table">
77 <tbody>
78 <tr valign="top">
79 <th><label>Select booking form</label></th>
80 <td>
81 <select id="cpabc_publish_id" name="cpabc_publish_id" onchange="reloadappbk(this);">
82 <?php
83 $myrows = $wpdb->get_results( "SELECT * FROM ". $wpdb->prefix.CPABC_APPOINTMENTS_CONFIG_TABLE_NAME_NO_PREFIX);
84 foreach ($myrows as $item)
85 echo '<option value="'.intval($item->id).'"'.($item->id==$_GET["cal"]?' selected':'').'>'.esc_html($item->uname).'</option>';
86 ?>
87 </select>
88 </td>
89 </tr>
90 <tr valign="top">
91 <th><label>Where to publish it?</label></th>
92 <td>
93 <select name="whereto" onchange="mvpublish_displayoption(this);">
94 <option value="0">Into a new page</option>
95 <option value="1">Into a new post</option>
96 <option value="2">Into an existent page</option>
97 <option value="3">Into an existent post</option>
98 <option value="4" style="color:#bbbbbb">Widget in a sidebar, header or footer - upgrade required for this option -</option>
99 </select>
100 </td>
101 </tr>
102 <tr valign="top" id="posttitle">
103 <th><label>Page/Post Title</label></th>
104 <td>
105 <input type="text" name="posttitle" value="Booking Form" />
106 </td>
107 </tr>
108 <tr valign="top" id="ppage" style="display:none">
109 <th></th>
110 <td>
111
112 <h3 style="background:#cccccc; padding:5px;">Classic way? Just copy and paste the following shortcode into the page/post:</h3>
113
114 <div style="border: 1px dotted black; background-color: #FFFACD ;padding:15px; font-weight: bold; margin:10px;">
115 [CPABC_APPOINTMENT_CALENDAR calendar="<?php echo @intval($_GET["cal"]); ?>"]
116 </div>
117
118 <?php if (defined('ELEMENTOR_PATH')) { ?>
119 <br />
120 <h3 style="background:#cccccc; padding:5px;">Using Elementor?</h3>
121
122 <img src="<?php echo esc_attr(plugins_url('../controllers/help/elementor.png', __FILE__)); ?>">
123 <?php } ?>
124
125 <br />
126 <h3 style="background:#cccccc; padding:5px;">Using New WordPress Editor (Gutemberg) ? </h3>
127
128 <img src="<?php echo esc_attr(plugins_url('../controllers/help/gutemberg.png', __FILE__)); ?>">
129
130 <br />
131 <h3 style="background:#cccccc; padding:5px;">Using classic WordPress editor or other editors?</h3>
132
133 <?php _e('You can also publish the form in a post/page, use the dedicated icon','appointment-booking-calendar'); ?> <?php echo '<img hspace="5" src="'.esc_attr(plugins_url('../images/cpabc_apps.gif', __FILE__)).'" alt="'.esc_attr(__('Insert Appointment Booking Calendar','appointment-booking-calendar')).'" /></a>'; ?>
134 <?php _e('which has been added to your Upload/Insert Menu, just below the title of your Post/Page or under the "+" icon if using the Gutemberg editor.','appointment-booking-calendar'); ?>
135
136 </td>
137 </tr>
138 <tr valign="top" id="ppost" style="display:none">
139 <th><label>Select post</label></th>
140 <td>
141 <select name="publishpost">
142 <?php
143 $pages = get_posts();
144 foreach ( $pages as $page ) {
145 echo '<option value="' . intval($page->ID) . '">';
146 echo esc_html ($page->post_title);
147 echo '</option>';
148 }
149 ?>
150 </select>
151 </td>
152 </tr>
153 <tbody>
154 </table>
155 <hr size="1" />
156 <div class="ahb-buttons-container">
157 <input type="submit" value="Publish Booking Form" class="button button-primary" style="float:right;margin-right:10px" />
158 <div class="clear"></div>
159 </div>
160 </form>
161 </div>
162 </div>
163 <?php } ?>
164
165
166 <script type="text/javascript">
167
168 function reloadappbk(item) {
169 document.location = '?page=cpabc_appointments.php&pwizard=1&cal='+item.options[item.options.selectedIndex].value;
170 }
171
172
173 function mvpublish_displayoption(sel) {
174 document.getElementById("ppost").style.display = 'none';
175 document.getElementById("ppage").style.display = 'none';
176 document.getElementById("posttitle").style.display = 'none';
177 if (sel.selectedIndex == 4)
178 {
179 alert('Widget option available only in commercial versions. Upgrade required for this option.');
180 sel.selectedIndex = 0;
181 }
182 else if (sel.selectedIndex == 2)
183 document.getElementById("ppage").style.display = '';
184 else if (sel.selectedIndex == 3)
185 document.getElementById("ppage").style.display = '';
186 else if (sel.selectedIndex == 1 || sel.selectedIndex == 0)
187 document.getElementById("posttitle").style.display = '';
188 }
189
190
191 </script>
192
193 <div id="metabox_basic_settings" class="postbox" >
194 <h3 class='hndle' style="padding:5px;"><span><?php _e('Note','appointment-booking-calendar'); ?></span></h3>
195 <div class="inside">
196 <?php _e('You can also publish the form in a post/page, use the dedicated icon','appointment-booking-calendar'); ?> <?php echo '<img hspace="5" src="'.esc_attr(plugins_url('../images/cpabc_apps.gif', __FILE__)).'" alt="'.esc_attr(__('Insert Appointment Booking Calendar','appointment-booking-calendar')).'" /></a>'; ?>
197 <?php _e('which has been added to your Upload/Insert Menu, just below the title of your Post/Page or under the "+" icon if using the Gutemberg editor.','appointment-booking-calendar'); ?>
198 <br /><br />
199 </div>
200 </div>
201