PluginProbe
AI Builder – Generate pages, blocks, images & translate with AI / 2.1.4
AI Builder – Generate pages, blocks, images & translate with AI v2.1.4
2.7.10 2.7.9 2.7.8 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.10 All 122 releases
ai-builder / admin / pages / account.php

account.php in AI Builder – Generate pages, blocks, images & translate with AI 2.1.4, at admin/pages/account.php

371 lines 18.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH'))
3 exit; // Exit if accessed directly
4
5 // Vérifier si l'utilisateur a déjà un token JWT
6 $jwt_token = get_option('aibui_jwt_token', '');
7 $user_successful_signup = get_option('aibui_user_successful_signup', false);
8
9 // Déterminer quelle vue afficher
10 $show_signup = empty($jwt_token) && !$user_successful_signup;
11 $show_signin = empty($jwt_token) && $user_successful_signup;
12 $show_dashboard = !empty($jwt_token);
13
14 // Si on est sur le dashboard mais qu'il n'y a pas de token, rediriger vers la connexion
15 if ($show_dashboard && empty($jwt_token)) {
16 $show_dashboard = false;
17 $show_signin = true;
18 }
19 ?>
20
21
22 <!-- Cloudflare Turnstile -->
23
24 <div class="ai-auth-container ai-fade-in">
25 <?php if ($show_signup): ?>
26 <!-- Formulaire d'inscription -->
27 <div class="ai-auth-header">
28 <h2>Create Account</h2>
29 <p>Join us to start building amazing content</p>
30 </div>
31
32 <form class="ai-auth-form" id="signup-form">
33 <div class="ai-form-group">
34 <label for="signup-email">Email Address</label>
35 <input type="email" id="signup-email" name="email" required>
36 </div>
37
38 <div class="ai-form-group">
39 <label for="signup-password">Password</label>
40 <input type="password" id="signup-password" name="password" required minlength="8">
41 </div>
42
43 <div class="ai-form-group">
44 <label for="signup-confirm-password">Confirm Password</label>
45 <input type="password" id="signup-confirm-password" name="confirm_password" required minlength="8">
46 </div>
47
48 <div class="ai-form-group ai-checkbox-group" style="padding: 10px;">
49 <label class="ai-checkbox-label" style=" padding: 5px;">
50 <input type="checkbox" id="terms-checkbox" name="terms_accepted" required>
51 <span class="ai-checkbox-custom"></span>
52 <span class="ai-checkbox-text">
53 I agree to the
54 <a href="https://website-ai-builder.com/index.php/terms-of-use/" target="_blank"
55 class="ai-link">Terms of
56 Service</a>
57 and
58 <a href="https://website-ai-builder.com/index.php/terms-and-conditions-of-sale/" target="_blank"
59 class="ai-link">Privacy
60 Policy</a>
61 </span>
62 </label>
63 </div>
64
65 <!-- <div class="ai-form-group">
66 <div id="cf-turnstile-signup" class="cf-turnstile" data-sitekey="VOTRE_CLE_SITE_TURNSTILE"></div>
67 </div> -->
68
69 <button type="submit" class="ai-submit-btn" id="signup-btn">
70 <span class="ai-loading" style="display: none;"></span>
71 Create Account
72 </button>
73 </form>
74
75 <div class="ai-toggle-form">
76 <button type="button" onclick="toggleForm('signin')">Already have an account? Sign in</button>
77 </div>
78
79 <?php elseif ($show_signin): ?>
80 <!-- Formulaire de connexion -->
81 <div class="ai-auth-header">
82 <h2>Welcome Back</h2>
83 <p>Sign in to your account</p>
84 </div>
85
86 <form class="ai-auth-form" id="signin-form">
87 <div class="ai-form-group">
88 <label for="signin-email" style="color: #232222; font-size: 14px;">Email Address</label>
89 <input type="email" id="signin-email" name="email" style="background-color: #ffffff;" required>
90 </div>
91
92 <div class="ai-form-group">
93 <label for="signin-password" style="color: #232222;">Password</label>
94 <input type="password" id="signin-password" name="password" style="background-color: #ffffff;" required>
95 </div>
96
97 <div class="ai-forgot-password">
98 <a href="<?php echo esc_url(admin_url('admin.php?page=aibui-reset-password')); ?>" class="ai-link">
99 Forgot your password?
100 </a>
101 </div>
102
103 <!-- <div class="ai-form-group">
104 <div id="cf-turnstile-signin" class="cf-turnstile" data-sitekey="VOTRE_CLE_SITE_TURNSTILE"></div>
105 </div> -->
106
107 <button type="submit" class="ai-submit-btn" id="signin-btn">
108 <span class="ai-loading" style="display: none;"></span>
109 Sign In
110 </button>
111 </form>
112
113 <div class="ai-toggle-form">
114 <button type="button" onclick="toggleForm('signup')">Don't have an account? Sign up</button>
115 </div>
116
117 <?php else: ?>
118 <!-- Dashboard utilisateur connecté -->
119 <div class="ai-auth-header">
120 <h2>Account Dashboard</h2>
121 <p>Welcome back! Here's your account overview</p>
122 </div>
123
124 <div class="ai-dashboard-content">
125 <!-- Informations du plan -->
126 <div class="ai-dashboard-card">
127 <div class="ai-card-header">
128 <div class="ai-card-icon">
129 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
130 <path d="M12 2L2 7L12 12L22 7L12 2Z" stroke="currentColor" stroke-width="2"
131 stroke-linejoin="round" />
132 <path d="M2 17L12 22L22 17" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
133 <path d="M2 12L12 17L22 12" stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
134 </svg>
135 </div>
136 <div class="ai-card-title">
137 <h3>Current Plan</h3>
138 <div class="ai-plan-badge" id="plan-badge">
139 <span class="ai-loading" style="display: none;"></span>
140 Loading...
141 </div>
142 </div>
143 </div>
144 <div class="ai-card-content">
145 <p>Your subscription plan determines your monthly credits and features.</p>
146 <button type="button" class="ai-secondary-btn"
147 onclick="window.location.href='<?php echo esc_url(admin_url('admin.php?page=aibui-credits')); ?>'">
148 <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
149 <path
150 d="M11 4H4C3.46957 4 2.96086 4.21071 2.58579 4.58579C2.21071 4.96086 2 5.46957 2 6V20C2 20.5304 2.21071 21.0391 2.58579 21.4142C2.96086 21.7893 3.46957 22 4 22H18C18.5304 22 19.0391 21.7893 19.4142 21.4142C19.7893 21.0391 20 20.5304 20 20V13"
151 stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
152 <path
153 d="M18.5 2.5C18.8978 2.10217 19.4374 1.87868 20 1.87868C20.5626 1.87868 21.1022 2.10217 21.5 2.5C21.8978 2.89782 22.1213 3.43739 22.1213 4C22.1213 4.56261 21.8978 5.10217 21.5 5.5L12 15L8 16L9 12L18.5 2.5Z"
154 stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
155 </svg>
156 Change Plan
157 </button>
158 </div>
159 </div>
160
161 <!-- Section Tuto -->
162 <div class="ai-dashboard-card">
163 <div class="ai-card-header">
164 <div class="ai-card-icon">
165 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
166 <path
167 d="M4 19.5V5.5C4 4.67157 4.67157 4 5.5 4H18.5C19.3284 4 20 4.67157 20 5.5V19.5C20 20.3284 19.3284 21 18.5 21H5.5C4.67157 21 4 20.3284 4 19.5Z"
168 stroke="currentColor" stroke-width="2" stroke-linejoin="round" />
169 <path d="M8 8H16" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
170 <path d="M8 12H16" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
171 <path d="M8 16H12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
172 </svg>
173 </div>
174 <div class="ai-card-title">
175 <h3>How to use the tool?</h3>
176 <div class="ai-plan-badge tuto">
177 Tutorial
178 </div>
179 </div>
180 </div>
181 <div class="ai-card-content">
182 <p>Discover all the features and learn how to use AI Builder efficiently.</p>
183 <button type="button" class="ai-secondary-btn"
184 onclick="window.location.href='<?php echo esc_url(admin_url('admin.php?page=aibui-tuto')); ?>'">
185 <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
186 <path d="M12 4V20" stroke="currentColor" stroke-width="2" stroke-linecap="round"
187 stroke-linejoin="round" />
188 <path d="M5 12H19" stroke="currentColor" stroke-width="2" stroke-linecap="round"
189 stroke-linejoin="round" />
190 </svg>
191 See Tutorial
192 </button>
193 </div>
194 </div>
195
196 <!-- Informations des crédits -->
197 <div class="ai-dashboard-card">
198 <div class="ai-card-header">
199 <div class="ai-card-icon">
200 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
201 <circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" />
202 <path d="M12 6V12L16 14" stroke="currentColor" stroke-width="2" stroke-linecap="round"
203 stroke-linejoin="round" />
204 </svg>
205 </div>
206 <div class="ai-card-title">
207 <h3>AI Credits</h3>
208 <div class="ai-credits-display" id="credits-display">
209 <span class="ai-loading" style="display: none;"></span>
210 Loading...
211 </div>
212 </div>
213 </div>
214 <div class="ai-card-content">
215 <div class="ai-credits-breakdown" id="credits-breakdown">
216 <div class="ai-credit-item">
217 <span class="ai-credit-label">Free credits:</span>
218 <span class="ai-credit-value" id="creation-credits">-</span>
219 </div>
220 <div class="ai-credit-item">
221 <span class="ai-credit-label">Monthly subscription:</span>
222 <span class="ai-credit-value" id="monthly-credits">-</span>
223 </div>
224 <div class="ai-credit-item">
225 <span class="ai-credit-label">Paid credits:</span>
226 <span class="ai-credit-value" id="paid-credits">-</span>
227 </div>
228 </div>
229 <button type="button" class="ai-primary-btn"
230 onclick="window.location.href='<?php echo esc_url(admin_url('admin.php?page=aibui-credits')); ?>'">
231 <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
232 <path d="M12 2V6" stroke="currentColor" stroke-width="2" stroke-linecap="round"
233 stroke-linejoin="round" />
234 <path d="M12 18V22" stroke="currentColor" stroke-width="2" stroke-linecap="round"
235 stroke-linejoin="round" />
236 <path d="M4.93 4.93L7.76 7.76" stroke="currentColor" stroke-width="2" stroke-linecap="round"
237 stroke-linejoin="round" />
238 <path d="M16.24 16.24L19.07 19.07" stroke="currentColor" stroke-width="2" stroke-linecap="round"
239 stroke-linejoin="round" />
240 <path d="M2 12H6" stroke="currentColor" stroke-width="2" stroke-linecap="round"
241 stroke-linejoin="round" />
242 <path d="M18 12H22" stroke="currentColor" stroke-width="2" stroke-linecap="round"
243 stroke-linejoin="round" />
244 <path d="M4.93 19.07L7.76 16.24" stroke="currentColor" stroke-width="2" stroke-linecap="round"
245 stroke-linejoin="round" />
246 <path d="M16.24 7.76L19.07 4.93" stroke="currentColor" stroke-width="2" stroke-linecap="round"
247 stroke-linejoin="round" />
248 </svg>
249 Buy More Credits
250 </button>
251 </div>
252 </div>
253
254 <!-- Actions du compte -->
255 <div class="ai-dashboard-actions">
256 <button type="button" class="ai-submit-btn ai-signout-btn" onclick="signOut()">
257 <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
258 <path
259 d="M9 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H9"
260 stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
261 <path d="M16 17L21 12L16 7" stroke="currentColor" stroke-width="2" stroke-linecap="round"
262 stroke-linejoin="round" />
263 <path d="M21 12H9" stroke="currentColor" stroke-width="2" stroke-linecap="round"
264 stroke-linejoin="round" />
265 </svg>
266 Sign Out
267 </button>
268 </div>
269 </div>
270 <?php endif; ?>
271
272 <div id="message-container"></div>
273 </div>
274
275 <!-- Formulaire caché pour l'inscription -->
276 <div class="ai-form-hidden" id="hidden-signup-form">
277 <div class="ai-auth-header">
278 <h2>Create Account</h2>
279 <p>Join us to start building amazing content</p>
280 </div>
281
282 <form class="ai-auth-form" id="hidden-signup-form-element">
283 <div class="ai-form-group">
284 <label for="hidden-signup-email" style="color: #232222; font-size: 14px;">Email Address</label>
285 <input type="email" id="hidden-signup-email" name="email" style="background-color: #ffffff;" required>
286 </div>
287
288 <div class="ai-form-group">
289 <label for="hidden-signup-password" style="color: #232222; font-size: 14px;">Password</label>
290 <input type="password" id="hidden-signup-password" name="password" style="background-color: #ffffff;"
291 required minlength="8">
292 </div>
293
294 <div class="ai-form-group">
295 <label for="hidden-signup-confirm-password" style="color: #232222; font-size: 14px;">Confirm
296 Password</label>
297 <input type="password" id="hidden-signup-confirm-password" name="confirm_password"
298 style="background-color: #ffffff;" required minlength="8">
299 </div>
300
301 <div class="ai-form-group ai-checkbox-group" style="padding: 10px;">
302 <label class="ai-checkbox-label" style=" padding: 5px;">
303 <input type="checkbox" id="terms-checkbox" name="terms_accepted" required>
304 <span class="ai-checkbox-custom"></span>
305 <span class="ai-checkbox-text">
306 I agree to the
307 <a href="https://website-ai-builder.com/index.php/terms-of-use/" target="_blank"
308 class="ai-link">Terms of
309 Service</a>
310 and
311 <a href="https://website-ai-builder.com/index.php/terms-and-conditions-of-sale/" target="_blank"
312 class="ai-link">Privacy
313 Policy</a>
314 </span>
315 </label>
316 </div>
317
318 <!-- <div class="ai-form-group">
319 <div id="cf-turnstile-hidden-signup" class="cf-turnstile" data-sitekey="VOTRE_CLE_SITE_TURNSTILE"></div>
320 </div> -->
321
322 <button type="submit" class="ai-submit-btn" id="hidden-signup-btn">
323 <span class="ai-loading" style="display: none;"></span>
324 Create Account
325 </button>
326 </form>
327
328 <div class="ai-toggle-form">
329 <button type="button" onclick="toggleForm('signin')">Already have an account? Sign in</button>
330 </div>
331 </div>
332
333 <!-- Formulaire caché pour la connexion -->
334 <div class="ai-form-hidden" id="hidden-signin-form">
335 <div class="ai-auth-header">
336 <h2>Welcome Back</h2>
337 <p>Sign in to your account</p>
338 </div>
339
340 <form class="ai-auth-form" id="hidden-signin-form-element">
341 <div class="ai-form-group">
342 <label for="hidden-signin-email" style="color: #232222; font-size: 14px;">Email Address</label>
343 <input type="email" id="hidden-signin-email" name="email" style="background-color: #ffffff;" required>
344 </div>
345
346 <div class="ai-form-group">
347 <label for="hidden-signin-password" style="color: #232222; font-size: 14px;">Password</label>
348 <input type="password" id="hidden-signin-password" name="password" style="background-color: #ffffff;"
349 required>
350 </div>
351
352 <div class="ai-forgot-password">
353 <a href="<?php echo esc_url(admin_url('admin.php?page=aibui-reset-password')); ?>" class="ai-link">
354 Forgot your password?
355 </a>
356 </div>
357
358 <!-- <div class="ai-form-group">
359 <div id="cf-turnstile-hidden-signin" class="cf-turnstile" data-sitekey="VOTRE_CLE_SITE_TURNSTILE"></div>
360 </div> -->
361
362 <button type="submit" class="ai-submit-btn" id="hidden-signin-btn">
363 <span class="ai-loading" style="display: none;"></span>
364 Sign In
365 </button>
366 </form>
367
368 <div class="ai-toggle-form">
369 <button type="button" onclick="toggleForm('signup')">Don't have an account? Sign up</button>
370 </div>
371 </div>