Show last authors
1 {{groovy}}
2
3 import groovy.sql.Sql
4
5 String strDBTable = "\"regUser\".\"newUser\""
6 def sqlConnection = new Sql(services.cmpConnectRegDB.connectRegDB())
7
8 String strCurRecCol = "firstname"
9 int intRecCount=0
10
11 String strContactID = ""
12 String strCompanyName = ""
13 String strCompanyAddress = ""
14 String strCompanyCity = ""
15 String strCompanyPostcode = ""
16 String strCompanyProvince = ""
17 String strCompanyCountry = ""
18 String strTitle = ""
19 String strFirstname = ""
20 String strLastname = ""
21 String strPrefname = ""
22 String strRole = ""
23 String strLphone = ""
24 String strMphone = ""
25 String strEmail = ""
26 String strEmail2 = ""
27 String strCreateTime = java.time.ZonedDateTime.now()
28 String strCreateIP = request.remoteAddr
29 String strConfCode = ""
30 String strEmailBody = ""
31
32 String strFormStatus = "DataEntry"
33
34 String strEditCommand = request.get("butAction")
35 if (strEditCommand == null){
36 strEditCommand = "none"
37 xcontext.put("strEditCommand", strEditCommand)
38 }
39 // println "strEditCommand:" + strEditCommand
40
41 //Process Commands
42
43 if ((strEditCommand == "Correct") || (strEditCommand == "Register") || (strEditCommand == "Proceed")){
44
45 strCompanyName = services.cleanStr.alphanum(request.companyname)
46 strCompanyAddress = services.cleanStr.alphanum(request.companyaddress)
47 strCompanyCity = services.cleanStr.alphanum(request.companycity)
48 strCompanyPostcode = services.cleanStr.alphanum(request.companypostcode)
49 strCompanyProvince = services.cleanStr.alphanum(request.companyprovince)
50 strCompanyCountry = services.cleanStr.alphanum(request.companycountry)
51 strTitle = services.cleanStr.alphanum(request.title)
52 strFirstname = services.cleanStr.alphanum(request.firstname)
53 strLastname = services.cleanStr.alphanum(request.lastname)
54 strPrefname = services.cleanStr.alphanum(request.prefname)
55 strRole = services.cleanStr.alphanum(request.role) ?:""
56 strLphone = services.cleanStr.numphone(request.lphone)
57 strMphone = services.cleanStr.numphone(request.mphone)
58 strEmail = services.cleanStr.alphanum(request.email)
59 strEmail2 = services.cleanStr.alphanum(request.email2)
60 strCreateTime = java.time.ZonedDateTime.now()
61 strCreateIP = request.remoteAddr
62 strConfCode = services.genRandom.randStr(16)
63 if (strEditCommand == "Register"){
64 String sqlHowManyRecords = "SELECT count(createtime) as reccount FROM " + strDBTable + " where email='" + strEmail + "'"
65 intRecCount = sqlConnection.rows(sqlHowManyRecords).reccount[0] ?:0
66 if (intRecCount == 0){ //insert a new record
67 sqlQueryInsertRec = "INSERT INTO " + strDBTable +
68 """(
69 companyname,
70 companyaddress,
71 companycity,
72 companypostcode,
73 companyprovince,
74 companycountry,
75 title,
76 firstname,
77 lastname,
78 prefname,
79 role,
80 lphone,
81 mphone,
82 email,
83 email2,
84 createtime,
85 createip,
86 confemailsenttime,
87 confemailsentcode)
88 VALUES(
89 '$strCompanyName',
90 '$strCompanyAddress',
91 '$strCompanyCity',
92 '$strCompanyPostcode',
93 '$strCompanyProvince',
94 '$strCompanyCountry',
95 '$strTitle',
96 '$strFirstname',
97 '$strLastname',
98 '$strPrefname',
99 '$strRole',
100 '$strLphone',
101 '$strMphone',
102 '$strEmail',
103 '$strEmail2',
104 now(),
105 '$strCreateIP',
106 now(),
107 '$strConfCode')
108 ;"""
109 sqlConnection.execute(sqlQueryInsertRec)
110 }
111 else{ // update the existing record
112 sqlQueryInsertRec = "UPDATE " + strDBTable +
113 """
114 SET
115 companyname = '$strCompanyName',
116 companyaddress = '$strCompanyAddress',
117 companycity = '$strCompanyCity',
118 companypostcode = '$strCompanyPostcode',
119 companyprovince = '$strCompanyProvince',
120 companycountry = '$strCompanyCountry',
121 title = '$strTitle',
122 firstname = '$strFirstname',
123 lastname = '$strLastname',
124 prefname = '$strPrefname',
125 role = '$strRole',
126 lphone = '$strLphone',
127 mphone = '$strMphone',
128 email = '$strEmail',
129 email2 = '$strEmail2',
130 createtime = now(),
131 createip = '$strCreateIP',
132 confemailsenttime = now(),
133 confemailsentcode = '$strConfCode',
134 confreceivetime = null,
135 confreceivecode = '',
136 status = 'new'
137 WHERE email = '$strEmail';"""
138 sqlConnection.execute(sqlQueryInsertRec)
139 }
140 strEmailBody = "Dear " + strPrefname + ","
141 strEmailBody = strEmailBody + "\r\n" + "\r\n" + "A request was made to register you to the CEC website (https://cecocert.com) with the following information:" + "\r\n" + "\r\n"
142 strEmailBody = strEmailBody + "Registered Business: " + strCompanyName + ", " + strCompanyAddress + ", " + strCompanyCity + ", " + strCompanyPostcode + ", " + strCompanyProvince + ", " + strCompanyCountry + "\r\n" + "\r\n"
143 strEmailBody = strEmailBody + "Contact info: " + strTitle + " " + strFirstname + " " + strLastname + "\r\n"
144 strEmailBody = strEmailBody + "Contact role: " + strRole + "\r\n"
145 strEmailBody = strEmailBody + "Landline phone: " + strLphone + "\r\n"
146 strEmailBody = strEmailBody + "Mobile phone: " + strMphone + "\r\n" + "\r\n"
147 strEmailBody = strEmailBody + "The request was made from IP address: " + strCreateIP
148 strEmailBody = strEmailBody + "\r\n" + "\r\n" + "Please click the below link to confirm your e-mail address:" + "\r\n"
149 strEmailBody = strEmailBody + "https://cecocert.com/bin/view/StartPage/X1100%20-%20Process%20e-mail%20confirmation/WebHome"
150 strEmailBody = strEmailBody + "?em=" + strEmail + "&cc=" + strConfCode
151 strEmailBody = strEmailBody + "\r\n" + "\r\n" + "If you do not confirm your e-mail address within 24 hours, the information you entered will be deleted!"
152
153 // println strEmailBody
154 xcontext.put("strEmailBody",strEmailBody)
155 // services.writeLog.writeLogEntry(xcontext.getUser(), request.remoteAddr, doc.space, "INSERT AS NEW", intCurUID)
156 xcontext.put("strCompanyName",strCompanyName)
157 xcontext.put("strCompanyAddress",strCompanyAddress)
158 xcontext.put("strCompanyCity",strCompanyCity)
159 xcontext.put("strCompanyPostcode",strCompanyPostcode)
160 xcontext.put("strCompanyProvince",strCompanyProvince)
161 xcontext.put("strCompanyCountry",strCompanyCountry)
162 xcontext.put("strTitle",strTitle)
163 xcontext.put("strFirstname",strFirstname)
164 xcontext.put("strLastname",strLastname)
165 xcontext.put("strPrefname",strPrefname)
166 xcontext.put("strRole",strRole)
167 xcontext.put("strLphone",strLphone)
168 xcontext.put("strMphone",strMphone)
169 xcontext.put("strEmail",strEmail)
170 xcontext.put("strEmail2",strEmail2)
171 xcontext.put("strCreateIP",strCreateIP)
172 strFormStatus = "SendEmail"
173 }
174 if (strEditCommand == "Proceed"){
175 xcontext.put("strCompanyName",strCompanyName)
176 xcontext.put("strCompanyAddress",strCompanyAddress)
177 xcontext.put("strCompanyCity",strCompanyCity)
178 xcontext.put("strCompanyPostcode",strCompanyPostcode)
179 xcontext.put("strCompanyProvince",strCompanyProvince)
180 xcontext.put("strCompanyCountry",strCompanyCountry)
181 xcontext.put("strTitle",strTitle)
182 xcontext.put("strFirstname",strFirstname)
183 xcontext.put("strLastname",strLastname)
184 xcontext.put("strPrefname",strPrefname)
185 xcontext.put("strRole",strRole)
186 xcontext.put("strLphone",strLphone)
187 xcontext.put("strMphone",strMphone)
188 xcontext.put("strEmail",strEmail)
189 xcontext.put("strEmail2",strEmail2)
190 xcontext.put("strCreateIP",strCreateIP)
191 strFormStatus = "DataVerify"
192 }
193 if (strEditCommand == "Correct"){
194 xcontext.put("strCompanyName",strCompanyName)
195 xcontext.put("strCompanyAddress",strCompanyAddress)
196 xcontext.put("strCompanyCity",strCompanyCity)
197 xcontext.put("strCompanyPostcode",strCompanyPostcode)
198 xcontext.put("strCompanyProvince",strCompanyProvince)
199 xcontext.put("strCompanyCountry",strCompanyCountry)
200 xcontext.put("strTitle",strTitle)
201 xcontext.put("strFirstname",strFirstname)
202 xcontext.put("strLastname",strLastname)
203 xcontext.put("strPrefname",strPrefname)
204 xcontext.put("strRole",strRole)
205 xcontext.put("strLphone",strLphone)
206 xcontext.put("strMphone",strMphone)
207 xcontext.put("strEmail",strEmail)
208 xcontext.put("strEmail2",strEmail2)
209 xcontext.put("strCreateIP",strCreateIP)
210 strFormStatus = "DataCorrection"
211 }
212 }
213 sqlConnection.close()
214 xcontext.put("strFormStatus", strFormStatus)
215
216 {{/groovy}}
217
218 {{velocity}}
219 ##$xcontext.strFormStatus
220 #if( $xcontext.strFormStatus == "DataEntry" )
221 {{html wiki=false clean=false}}
222 <head>
223 <style>
224 #cecTable {
225 font-family: Arial, Helvetica, sans-serif;
226 border-collapse: collapse;
227 border-color: #007d84
228 width: 100%;
229 }
230
231 #cecTable td, #cecTable th {
232 border: 1px solid #007d84;
233 padding: 8px;
234 }
235
236 #cecTable tr:nth-child(even){background-color: #d0d3d4;}
237
238 #cecTable tr:hover {background-color: #ddd;}
239
240 #cecTable th {
241 padding-top: 12px;
242 padding-bottom: 12px;
243 text-align: left;
244 background-color: #007d84;
245 color: white;
246 }
247 </style>
248 </head>
249 <form action="" class="xformInline" method="post" name="Contact Edit Form">
250 <table id="cecTable"; cellspacing="5px" cellpadding="5%" border="1" width="100%"; align="left">
251 <col style="width:30%">
252 <col style="width:70%">
253 <th colspan = "2">
254 <b>Company Information</b>
255 </th>
256 <tr>
257 <td align="left" class="style1">Company name:</td>
258 <td class="style1">
259 <input type="text" id="companyname" name="companyname" placeholder="Enter the legal name of your company" size="50">
260 </select>
261 </td>
262 </tr>
263 <tr>
264 <td align="left" class="style1">Registered Business Address - House Number, Street:</td>
265 <td class="style1">
266 <input type="text" id="companyaddress" name="companyaddress" placeholder="Enter the House Number, Street, Floor, etc part of your company's registered business address" size="100">
267 </select>
268 </td>
269 </tr>
270 <tr>
271 <td align="left" class="style1">Registered Business Address - City:</td>
272 <td class="style1">
273 <input type="text" id="companycity" name="companycity" placeholder="Enter the City part of your company's registered business address" size="100">
274 </select>
275 </td>
276 </tr>
277 <tr>
278 <td align="left" class="style1">Registered Business Address - Postal Code:</td>
279 <td class="style1">
280 <input type="text" id="companypostcode" name="companypostcode" placeholder="Enter the Postal Code part of your company's registered business address" size="100">
281 </select>
282 </td>
283 </tr>
284 <tr>
285 <td align="left" class="style1">Registered Business Address - Province or State:</td>
286 <td class="style1">
287 <input type="text" id="companyprovince" name="companyprovince" placeholder="Enter the Province or State part of your company's registered business address, leave empty if n/a" size="100">
288 </select>
289 </td>
290 </tr>
291 <tr>
292 <td align="left" class="style1">Registered Business Address - Country:</td>
293 <td class="style1">
294 <input type="text" id="companycountry" name="companycountry" placeholder="Enter the Country part of your company's registered business address" size="50">
295 </select>
296 </td>
297 </tr>
298 <th colspan = "2">
299 <b>Your Contact Information</b>
300 </th>
301 <tr>
302 <td align="left" class="style1">Title:</td>
303 <td class="style1">
304 <input type="text" id="title" name="title" placeholder="Enter your title (Ms, Mr, Dr, etc)" size="30">
305 </td>
306 </tr>
307 <tr>
308 <td align="left" class="style1">First name:</td>
309 <td class="style1">
310 <input type="text" id="firstname" name="firstname" placeholder="Enter your first name" size="50">
311 </td>
312 </tr>
313 <tr>
314 <td align="left" class="style1">Last name:</td>
315 <td class="style1">
316 <input type="text" id="lastname" name="lastname" placeholder="Enter your surname/family name" size="50">
317 </td>
318 </tr>
319 <tr>
320 <td align="left" class="style1">Preferred name to address you:<br>Examples: Peter, Mr. Parker, Fujikawa-san</td>
321 <td class="style1">
322 <input type="text" id="prefname" name="prefname" placeholder="Enter the name you want to be addressed by, for example in e-mails and letters" size="70">
323 </td>
324 </tr>
325 <tr>
326 <td align="left" class="style1">Your Role within the company:</td>
327 <td class="style1">
328 <input type="text" id="role" name="role" placeholder="Enter the Role you have within the company" size="70">
329 </td>
330 </tr>
331 <tr>
332 <td align="left" class="style1">Phone number (Landline):</td>
333 <td class="style1">
334 <input type="text" id="lphone" name="lphone" placeholder="Enter your landline phone number, with country code, without symbols" size="70">
335 </td>
336 </tr>
337 <tr>
338 <td align="left" class="style1">Phone number (Mobile):</td>
339 <td class="style1">
340 <input type="text" id="mphone" name="mphone" placeholder="Enter your mobile phone number, with country code, without symbols" size="70">
341 </td>
342 </tr>
343 <tr>
344 <td align="left" class="style1">E-Mail address (primary):</td>
345 <td class="style1">
346 <input type="email" id="email" name="email" placeholder="Enter your primary e-mail address, usually the company e-mail address" size="70">
347 </td>
348 </tr>
349 <tr>
350 <td align="left" class="style1">E-Mail address (secondary):</td>
351 <td class="style1">
352 <input type="email" id="email2" name="email2" placeholder="Enter a secondary e-mail address, in case the primary one becomes unavailable" size="80">
353 </td>
354 </tr>
355 <tr>
356 <td></td>
357 <td align="left" class="style1">
358 <input class="btn btn-primary" type="submit" name="butAction" value="Proceed">
359 </td>
360 </tr>
361 </table>
362 </form>
363 {{/html}}
364 #end
365 #if( $xcontext.strFormStatus == "DataCorrection" )
366 {{html wiki=false clean=false}}
367 <form action="" class="xformInline" method="post" name="User Registration Form">
368 <head>
369 <style>
370 #cecTable {
371 font-family: Arial, Helvetica, sans-serif;
372 border-collapse: collapse;
373 border-color: #007d84
374 width: 100%;
375 }
376
377 #cecTable td, #cecTable th {
378 border: 1px solid #007d84;
379 padding: 8px;
380 }
381
382 #cecTable tr:nth-child(even){background-color: #d0d3d4;}
383
384 #cecTable tr:hover {background-color: #ddd;}
385
386 #cecTable th {
387 padding-top: 12px;
388 padding-bottom: 12px;
389 text-align: left;
390 background-color: #007d84;
391 color: white;
392 }
393 </style>
394 </head>
395 <table id="cecTable"; cellspacing="5px" cellpadding="5%" border="1" width="100%"; align="left">
396 <col style="width:30%">
397 <col style="width:70%">
398 <th colspan = "2">
399 <b>Company Information</b>
400 </th>
401 <tr>
402 <td align="left" class="style1">Company name:</td>
403 <td class="style1">
404 <input type="text" id="companyname" name="companyname" placeholder="Enter the legal name of your company" value="${xcontext.strCompanyName}" size="50">
405 </select>
406 </td>
407 </tr>
408 <tr>
409 <td align="left" class="style1">Registered Business Address - House Number, Street:</td>
410 <td class="style1">
411 <input type="text" id="companyaddress" name="companyaddress" placeholder="Enter the House Number, Street, Floor, etc part of your company's registered business address" value="${xcontext.strCompanyAddress}" size="100">
412 </select>
413 </td>
414 </tr>
415 <tr>
416 <td align="left" class="style1">Registered Business Address - City:</td>
417 <td class="style1">
418 <input type="text" id="companycity" name="companycity" placeholder="Enter the City part of your company's registered business address" value="${xcontext.strCompanyCity}" size="100">
419 </select>
420 </td>
421 </tr>
422 <tr>
423 <td align="left" class="style1">Registered Business Address - Postal Code:</td>
424 <td class="style1">
425 <input type="text" id="companypostcode" name="companypostcode" placeholder="Enter the Postal Code part of your company's registered business address" value="${xcontext.strCompanyPostcode}" size="100">
426 </select>
427 </td>
428 </tr>
429 <tr>
430 <td align="left" class="style1">Registered Business Address - Province or State:</td>
431 <td class="style1">
432 <input type="text" id="companyprovince" name="companyprovince" placeholder="Enter the Province or State part of your company's registered business address, leave empty if n/a" value="${xcontext.strCompanyProvince}" size="100">
433 </select>
434 </td>
435 </tr>
436 <tr>
437 <td align="left" class="style1">Registered Business Address - Country:</td>
438 <td class="style1">
439 <input type="text" id="companycountry" name="companycountry" placeholder="Enter the Country part of your company's registered business address" value="${xcontext.strCompanyCountry}" size="50">
440 </select>
441 </td>
442 </tr>
443 <th colspan = "2">
444 <b>Your Contact Information</b>
445 </th>
446 <tr>
447 <td align="left" class="style1">Title:</td>
448 <td class="style1">
449 <input type="text" id="title" name="title" placeholder="Enter your title" value="${xcontext.strTitle}" size="20">
450 </td>
451 </tr>
452 <tr>
453 <td align="left" class="style1">First name:</td>
454 <td class="style1">
455 <input type="text" id="firstname" name="firstname" placeholder="Enter your first name" value="${xcontext.strFirstname}" size="50">
456 </td>
457 </tr>
458 <tr>
459 <td align="left" class="style1">Last name:</td>
460 <td class="style1">
461 <input type="text" id="lastname" name="lastname" placeholder="Enter your surname/family name" value="${xcontext.strLastname}" size="50">
462 </td>
463 </tr>
464 <tr>
465 <td align="left" class="style1">Preferred name to address you:</td>
466 <td class="style1">
467 <input type="text" id="prefname" name="prefname" placeholder="Enter the name you want to be addressed by" value="${xcontext.strPrefname}" size="50">
468 </td>
469 </tr>
470 <tr>
471 <td align="left" class="style1">Phone number (Landline):</td>
472 <td class="style1">
473 <input type="text" id="lphone" name="lphone" placeholder="Enter your landline phone number, with country code, without symbols" value="${xcontext.strLphone}" size="70">
474 </td>
475 </tr>
476 <tr>
477 <td align="left" class="style1">Phone number (Mobile):</td>
478 <td class="style1">
479 <input type="text" id="mphone" name="mphone" placeholder="Enter your mobile phone number, with country code, without symbols" value="${xcontext.strMphone}" size="70">
480 </td>
481 </tr>
482 <tr>
483 <td align="left" class="style1">E-Mail address (primary):</td>
484 <td class="style1">
485 <input type="email" id="email" name="email" placeholder="Enter your primary e-mail address, usually the company e-mail address" value="${xcontext.strEmail}" size="70">
486 </td>
487 </tr>
488 <tr>
489 <td align="left" class="style1">E-Mail address (secondary):</td>
490 <td class="style1">
491 <input type="email" id="email2" name="email2" placeholder="Enter a secondary e-mail address, in case the primary one becomes unavailable" value="${xcontext.strEmail2}" size="70">
492 </td>
493 </tr>
494 <tr>
495 <td></td>
496 <td align="left" class="style1">
497 <input class="btn btn-primary" type="submit" name="butAction" value="Proceed">
498 </td>
499 </tr>
500 </table>
501 </form>
502 {{/html}}
503 #end
504
505 #if( $xcontext.strFormStatus == "DataVerify" )
506 You have entered the following information to register to the CEC Scheme:
507 {{html wiki=false clean=false}}
508 <form action="" class="xformInline" method="post" name="User Registration Form">
509 <head>
510 <style>
511 #cecTable {
512 font-family: Arial, Helvetica, sans-serif;
513 border-collapse: collapse;
514 border-color: #007d84
515 width: 100%;
516 }
517
518 #cecTable td, #cecTable th {
519 border: 1px solid #007d84;
520 padding: 8px;
521 }
522
523 #cecTable tr:nth-child(even){background-color: #d0d3d4;}
524
525 #cecTable tr:hover {background-color: #ddd;}
526
527 #cecTable th {
528 padding-top: 12px;
529 padding-bottom: 12px;
530 text-align: left;
531 background-color: #007d84;
532 color: white;
533 }
534 </style>
535 </head>
536 <table id="cecTable"; cellspacing="5px" cellpadding="5%" border="1" width="100%"; align="left">
537 <col style="width:30%">
538 <col style="width:70%">
539 <th colspan = "2">
540 <b>Company Information</b>
541 </th>
542 <tr>
543 <td align="left" class="style1">Company name:</td>
544 <td class="style1">
545 <input type="hidden" id="companyname" name="companyname" readonly value="${xcontext.strCompanyName}" size="50">
546 ${xcontext.strCompanyName}
547 </td>
548 </tr>
549 <tr>
550 <td align="left" class="style1">Registered Business Address - House Number, Street:</td>
551 <td class="style1">
552 <input type="hidden" id="companyaddress" name="companyaddress" readonly value="${xcontext.strCompanyAddress}" size="100">
553 ${xcontext.strCompanyAddress}
554 </td>
555 </tr>
556 <tr>
557 <td align="left" class="style1">Registered Business Address - City:</td>
558 <td class="style1">
559 <input type="hidden" id="companycity" name="companycity" readonly value="${xcontext.strCompanyCity}" size="100">
560 ${xcontext.strCompanyCity}
561 </td>
562 </tr>
563 <tr>
564 <td align="left" class="style1">Registered Business Address - Postal Code:</td>
565 <td class="style1">
566 <input type="hidden" id="companypostcode" name="companypostcode" readonly value="${xcontext.strCompanyPostcode}" size="100">
567 ${xcontext.strCompanyPostcode}
568 </td>
569 </tr>
570 <tr>
571 <td align="left" class="style1">Registered Business Address - Province or State:</td>
572 <td class="style1">
573 <input type="hidden" id="companyprovince" name="companyprovince" readonly value="${xcontext.strCompanyProvince}" size="100">
574 ${xcontext.strCompanyProvince}
575 </td>
576 </tr>
577 <tr>
578 <td align="left" class="style1">Registered Business Address - Country:</td>
579 <td class="style1">
580 <input type="hidden" id="companycountry" name="companycountry" readonly value="${xcontext.strCompanyCountry}" size="50">
581 ${xcontext.strCompanyCountry}
582 </td>
583 </tr>
584 <th colspan = "2">
585 <b>Your Contact Information</b>
586 </th>
587
588 <tr>
589 <td align="hidden" class="style1">Title:</td>
590 <td class="style1">
591 <input type="hidden" id="title" name="title" readonly value="${xcontext.strTitle}" size="10">
592 ${xcontext.strTitle}
593 </td>
594 </tr>
595 <tr>
596 <td align="hidden" class="style1">First name:</td>
597 <td class="style1">
598 <input type="hidden" id="firstname" name="firstname" readonly value="${xcontext.strFirstname}" size="50">
599 ${xcontext.strFirstname}
600 </td>
601 </tr>
602 <tr>
603 <td align="hidden" class="style1">Last name:</td>
604 <td class="style1">
605 <input type="hidden" id="lastname" name="lastname" readonly value="${xcontext.strLastname}" size="50">
606 ${xcontext.strLastname}
607 </td>
608 </tr>
609 <tr>
610 <td align="hidden" class="style1">Preferred name to address you:</td>
611 <td class="style1">
612 <input type="hidden" id="prefname" name="prefname" readonly value="${xcontext.strPrefname}" size="50">
613 ${xcontext.strPrefname}
614 </td>
615 </tr>
616 <tr>
617 <td align="left" class="style1">Phone number (Landline):</td>
618 <td class="style1">
619 <input type="hidden" id="lphone" name="lphone" readonly value="${xcontext.strLphone}" size="20">
620 ${xcontext.strLphone}
621 </td>
622 </tr>
623 <tr>
624 <td align="left" class="style1">Phone number (Mobile):</td>
625 <td class="style1">
626 <input type="hidden" id="mphone" name="mphone" readonly value="${xcontext.strMphone}" size="20">
627 ${xcontext.strMphone}
628 </td>
629 </tr>
630 <tr>
631 <td align="left" class="style1">E-Mail address (primary):</td>
632 <td class="style1">
633 <input type="hidden" id="email" name="email" readonly value="${xcontext.strEmail}" size="40">
634 ${xcontext.strEmail}
635 </td>
636 </tr>
637 <tr>
638 <td align="left" class="style1">E-Mail address (secondary):</td>
639 <td class="style1">
640 <input type="hidden" id="email2" name="email2" readonly value="${xcontext.strEmail2}" size="40">
641 ${xcontext.strEmail2}
642 </td>
643 </tr>
644 <tr>
645 <td>Click the button to the right to correct the above information</td>
646 <td align="left" class="style1">
647 <input class="btn btn-default" type="submit" name="butAction" value="Correct">
648 </td>
649 </tr>
650 </table>
651
652 <p>Please check the above information, and if correct, then read the terms and conditions below. If the above information is correct and you accept the terms and conditions, then please click the Register button at the bottom of this page.</p>
653 <p>If the information shown in the above table is incorrect, then please click the "Correct" button at the bottom of the above table to return to the editing page.</p>
654 <p><b>By clicking on the Register button, you agree to the following:</b>
655 <ul>
656 <li>The CEC Scheme, the CEC Website (cecocert.com), and the underlying computer systems are owned and operated by TruCert Assessment Services Inc. ("TruCert"), a company incorporated in Canada.</li>
657 <li>The information you enter into any form on the CEC Website may be stored and retained by TruCert and used for the purposes of the CEC Scheme.</li>
658 <li>Your IP address and time and date of you accessing the CEC Website may be stored and retained by TruCert and used for purposes of the CEC Scheme.</li>
659 <li>The primary computer systems used to store your information are located in Canada. TruCert may operate additional computer systems in the USA, the UK, or the EU that may store copies of your information.</li>
660 <li>By providing your contact information, you agree to TruCert contacting you, and communicating with you for the purposes of the CEC Scheme.</li>
661 <li>By providing your contact information, you agree to TruCert sharing your contact information and the fact that you intend in participating in the CEC Scheme to Mastercard International.</li>
662 <li>By providing your contact information, you agree to TruCert informing 3rd parties participating in the CEC Scheme of the fact that you are also participating in the CEC Scheme, for example by listing your contact information in a register of companies participating in the CEC Scheme.</li>
663 <li>TruCert will not sell, nor make available for free, your contact information for marketing or sales purposes of thirdy parties.</li>
664 <li>TruCert may change the terms and conditons of storing and sharing your contact information, but in such case will inform you of the modified terms and conditions by e-mail and will give you the option to have your contact information deleted before the modified terms and conditions come into force.</li>
665 </ul>
666 <p>After you click the below <b>Register</b> button, you should receive an automatically generated e-mail to the primary e-mail address you provide in the form above, containing a verification link. You must verify your e-mail address by clicking this verification link contained in the e-mail within 24 hours, otherwise your data may be deleted and you will have to restart the registration process.</p>
667
668 <input type="hidden" id="companyname" name="companyname" readonly value="${xcontext.strCompanyName}" size="50">
669
670 <input type="hidden" id="companycity" name="companycity" readonly value="${xcontext.strCompanyAddress}" size="100">
671 <input type="hidden" id="companyaddress" name="companyaddress" readonly value="${xcontext.strCompanyCity}" size="100">
672 <input type="hidden" id="companypostcode" name="companypostcode" readonly value="${xcontext.strCompanyPostcode}" size="100">
673 <input type="hidden" id="companyprovince" name="companyprovince" readonly value="${xcontext.strCompanyProvince}" size="100">
674 <input type="hidden" id="companycountry" name="companycountry" readonly value="${xcontext.strCompanyCountry}" size="50">
675
676 <input type="hidden" id="title" name="title" readonly value="${xcontext.strTitle}" size="10">
677 <input type="hidden" id="firstname" name="firstname" readonly value="${xcontext.strFirstname}" size="50">
678 <input type="hidden" id="lastname" name="lastname" readonly value="${xcontext.strLastname}" size="50">
679 <input type="hidden" id="prefname" name="prefname" readonly value="${xcontext.strPrefname}" size="50">
680 <input type="hidden" id="lphone" name="lphone" readonly value="${xcontext.strLphone}" size="20">
681 <input type="hidden" id="mphone" name="mphone" readonly value="${xcontext.strMphone}" size="20">
682 <input type="hidden" id="email" name="email" readonly value="${xcontext.strEmail}" size="40">
683 <input type="hidden" id="email2" name="email2" readonly value="${xcontext.strEmail2}" size="40">
684 <input class="btn btn-primary" type="submit" name="butAction" value="Register">
685 </form>
686 {{/html}}
687
688 #end
689 #if( $xcontext.strFormStatus == "SendEmail" )
690 #set($email_to = "${xcontext.strEmail}")
691 #set($email_subject = "CEC Registration - confirmation required to proceed")
692 #set($email_from = "cec_noreply@cecocert.com")
693 #set($email_text = "$xcontext.strEmailBody")
694 #set ($message = $services.mail.sender.createMessage($email_from, $email_to, $email_subject))
695 #set ($discard = $message.addPart("text/plain", ${xcontext.strEmailBody}))
696 #set ($mailResult = $services.mail.sender.send($message))
697 ## Check if the message was created properly and if we have permissions to send emails
698 #if ($services.mail.sender.lastError)
699 {{error}}$exceptiontool.getStackTrace($services.mail.sender.lastError){{/error}}
700 #end
701 ## Check if the mail we tried to send has failed to be sent
702 #set ($statuses = $mailResult.statusResult.getAllErrors())
703 #if ($statuses.hasNext())
704
705 {{warning}}
706 Something has gone wrong! Please do not try again!
707 {{/warning}}
708
709 #set ($status = $statuses.next())
710 {{warning}}
711 I am sorry, but there was a problem with sending you your confirmation e-mail!
712 The data you entered has likely already been stored in our database, and will not need to be entered again.
713 Hence, please do not try entering the information again but instead send an e-mail to contact@cecocert.com informing us about the problem.
714 As the subject line, please enter "CEC Registration - e-mail problem".
715 In the body of the e-mail, please simply provide your name and that of your company.
716 If possible, please copy and paste the error message shown below in red into the e-mail, below your name and that of your company.
717 We are sorry for the inconvenience!
718 {{/warning}}
719
720 {{error}}
721 Error: $status.errorSummary ($status.state)
722 $status.errorDescription
723 {{/error}}
724
725 #else
726 {{info}}
727 An e-mail asking you to confirm your e-mail address was sent to ${xcontext.strEmail}.
728 Please check your inbox and click on the link to confirm your e-mail address!
729 The process will only continue after you have confirmed your e-mail address.
730 {{/info}}
731 #end
732 #end
733
734 {{/velocity}}
735
© 2022 TruCert Assessment Services Inc.
V01-00