· 7 years ago · Nov 09, 2018, 07:50 AM
1<!--#Include file="config.inc.asp"-->
2<!--#Include file="../includes/security.inc.asp"-->
3<%
4If Request.Cookies("AAN")("ERRMSG") <> "" Then
5 ERRMSG = Request.Cookies("AAN")("ERRMSG")
6 Response.Cookies("AAN")("ERRMSG") = ""
7 Response.Cookies("AAN").domain = CookieDomain
8 Response.Cookies("AAN").expires = Date + 2
9End If
10
11If Request.Form("StartNumber") <> "" Then '<
12 ' NEW BOND NUMBERS BEING SUBMITTED '
13 StartNumber = ClearInjection(Request.Form("StartNumber"))
14 EndNumber = ClearInjection(Request.Form("EndNumber"))
15
16 NumbersAdded = 0
17 TotalDuplicates = 0
18
19 If IsNumeric(StartNumber) AND IsNumeric(EndNumber) Then
20
21 %><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
22
23 For vInt = StartNumber to EndNumber
24 'First check to see if this record exists'
25 SuretyNumberID = "0"
26 SQL = "SELECT SuretyNumberID FROM [SuretyNumbers] WHERE SuretyNumber = " & vInt
27 Set rs = Server.CreateObject("ADODB.RecordSet")
28 rs.Open SQL,Conn,0,1
29
30 While Not rs.EOF
31 SuretyNumberID = rs.Fields("SuretyNumberID")
32 rs.MoveNext
33 Wend
34 rs.Close
35 Set rs = Nothing
36
37 If SuretyNumberID = "0" Then
38 SQL = "INSERT INTO [SuretyNumbers] (SuretyNumber,NotaryApplicantID) VALUES " & _
39 "('" & vInt & "','0')"
40 Conn.Execute SQL,,128
41
42 NumbersAdded = NumbersAdded + 1
43
44 Else
45
46 TotalDuplicates = TotalDuplicates + 1
47
48 End If
49 Next
50
51 Conn.Close
52 Set Conn = Nothing
53 End If
54
55 ERRMSG = NumbersAdded & " numbers have been added. "
56
57 If TotalDuplicates > 0 Then '<
58 ERRMSG = ERRMSG & TotalDuplicates & " duplicates prevented. "
59 End If
60
61 Response.Cookies("AAN")("ERRMSG") = ERRMSG
62 Response.Cookies("AAN").domain = CookieDomain
63 Response.Cookies("AAN").expires = Date + 2
64 Response.Redirect("applications.asp")
65
66ElseIf Request.Form("FlagIDPaid") <> "" Then '<
67
68 NumbersUpdated = 0
69 ChangedFromPaid = 0
70 ChangedToPaid = 0
71 NonExisting = 0
72 AvoidDuplicate = 0
73 FlagIDPaid = Request.Form("FlagIDPaid")
74 PaidReference = Request.Form("PaidReference")
75
76 %><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
77
78 Response.Write("FlagIDPaid=" & FlagIDPaid)
79
80 If Instr(1,FlagIDPaid,", ",1) > 0 Then '<
81 IDArray = Split(FlagIDPaid,", ")
82 For vInt = 0 to UBound(IDArray)
83 UpdateBondNumber IDArray(vInt),True,PaidReference,NumbersUpdated,ChangedFromPaid,ChangedToPaid,NonExisting,AvoidDuplicate,DuplicateMessage
84 Next
85 Else
86 UpdateBondNumber FlagIDPaid,True,PaidReference,NumbersUpdated,ChangedFromPaid,ChangedToPaid,NonExisting,AvoidDuplicate,DuplicateMessage
87 End If
88
89 If ChangedToPaid > 0 Then '<
90 ERRMSG = ERRMSG & ChangedToPaid & " surety numbers were set to paid that were previously unpaid. "
91 End If
92
93 Conn.Close
94 Set Conn = Nothing
95
96 Response.Cookies("AAN")("ERRMSG") = ERRMSG
97 Response.Cookies("AAN").domain = CookieDomain
98 Response.Cookies("AAN").expires = Date + 2
99 Response.Redirect("applications.asp")
100
101ElseIf Request.Form("BondStartNumber") <> "" OR Request.Form("BondStartDate") <> "" Then '<
102
103 ' CHANGING STATUS OF BOND NUMBERS '
104
105 BondStartNumber = ClearInjection(Request.Form("BondStartNumber"))
106 BondEndNumber = ClearInjection(Request.Form("BondEndNumber"))
107 BondStartDate = ClearInjection(Request.Form("BondStartDate"))
108 BondEndDate = ClearInjection(Request.Form("BondEndDate"))
109 BondStatus = ClearInjection(Request.Form("BondStatus"))
110 PaidReference = ClearInjection(Request.Form("PaidReference"))
111
112 If BondStatus = "Paid" Then
113 Paid = True
114 ElseIf BondStatus = "NotPaid" Then
115 Paid = False
116 End If
117
118 NumbersUpdated = 0
119 ChangedFromPaid = 0
120 ChangedToPaid = 0
121 NonExisting = 0
122 AvoidDuplicate = 0
123
124 %><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
125
126 If IsNumeric(BondStartNumber) Then
127 ' Query by Bond Number '
128 If IsNumeric(BondEndNumber) Then
129 ' Span of numbers submitted '
130 ' 8/10/2009 - Verify that the margin between these numbers does not exceed 1000 '
131 vInt = BondEndNumber - BondStartNumber
132 If vInt > 1000 Then '<
133 ERRMSG = "Warning: This process will only allow updates of 1000 bond numbers per submission."
134 Else
135 For vInt = BondStartNumber to BondEndNumber
136 UpdateBondNumber vInt,Paid,PaidReference,NumbersUpdated,ChangedFromPaid,ChangedToPaid,NonExisting,AvoidDuplicate,DuplicateMessage
137 Next
138 End If
139 Else
140 ' Only one number submitted '
141 UpdateBondNumber BondStartNumber,Paid,PaidReference,NumbersUpdated,ChangedFromPaid,ChangedToPaid,NonExisting,AvoidDuplicate,DuplicateMessage
142 End If
143
144 ElseIf IsDate(BondStartDate) Then
145 ' Query By Post Date '
146 BondStartDate = FormatDateTime(BondStartDate,2) & " 12:00:01 AM"
147 If IsDate(BondEndDate) Then
148 ' Span of dates submitted '
149 BondEndDate = FormatDateTime(BondEndDate,2) & " 11:59:59 PM"
150 Else
151 ' Single date submitted '
152 BondEndDate = FormatDateTime(BondStartDate,2) & " 11:59:59 PM"
153 End If
154 SQL = "SELECT " & _
155 " SuretyNumbers.SuretyNumber " & _
156 " FROM SuretyNumbers " & _
157 " RIGHT JOIN NotaryApplicants ON SuretyNumbers.NotaryApplicantID = NotaryApplicants.NotaryApplicantID " & _
158 " WHERE (((NotaryApplicants.PostDate) > #" & BondStartDate & "#) AND ((NotaryApplicants.EditDate) < #" & BondEndDate & "#))"
159 Set rs = Server.CreateObject("ADODB.Recordset")
160 rs.Open SQL,Conn,0,1
161
162 While Not rs.EOF
163 SuretyNumber = rs.Fields("SuretyNumber")
164 UpdateBondNumber SuretyNumber,Paid,PaidReference,NumbersUpdated,ChangedFromPaid,ChangedToPaid,NonExisting,AvoidDuplicate,DuplicateMessage
165 rs.MoveNext
166 Wend
167 rs.Close
168 Set rs = Nothing
169 End If
170
171 If NumbersUpdated > 0 Then '<
172 ERRMSG = NumbersUpdated & " surety numbers have had status updates. "
173 End If
174 If NonExisting > 0 Then '<
175 ERRMSG = ERRMSG & NonExisting & " surety numbers were not in the database. "
176 End If
177 If ChangedFromPaid > 0 Then '<
178 ERRMSG = ERRMSG & ChangedFromPaid & " surety numbers were set to not paid that were previously paid. "
179 End If
180 If ChangedToPaid > 0 Then '<
181 ERRMSG = ERRMSG & ChangedToPaid & " surety numbers were set to paid that were previously unpaid. "
182 End If
183 If AvoidDuplicate > 0 Then '<
184 ERRMSG = ERRMSG & AvoidDuplicate & " surety number updates were rejected because they were alreay paid: " & DuplicateMessage
185 End If
186
187 Conn.Close
188 Set Conn = Nothing
189
190 Response.Cookies("AAN")("ERRMSG") = ERRMSG
191 Response.Cookies("AAN").domain = CookieDomain
192 Response.Cookies("AAN").expires = Date + 2
193 Response.Redirect("applications.asp")
194
195ElseIf Request.QueryString("SuretyNumber") <> "" Then '<
196
197 ' LOOKING UP STATUS OF A SPECIFIC BOND NUMBER '
198
199 %><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
200
201 SuretyNumber = ClearInjection(Request.QueryString("SuretyNumber"))
202 RecordExists = False
203 SQL = "SELECT " & _
204 " NotaryApplicants.NotaryApplicantID, " & _
205 " NotaryApplicants.FirstName, " & _
206 " NotaryApplicants.MiddleName, " & _
207 " NotaryApplicants.LastName, " & _
208 " NotaryApplicants.NameSuffix, " & _
209 " NotaryApplicants.AddDate, " & _
210 " NotaryApplicantStatusType.StatusName " & _
211 " FROM (SuretyNumbers " & _
212 " LEFT JOIN NotaryApplicants ON SuretyNumbers.NotaryApplicantID = NotaryApplicants.NotaryApplicantID) " & _
213 " LEFT JOIN NotaryApplicantStatusType ON NotaryApplicants.NotaryApplicantStatusTypeID = NotaryApplicantStatusType.NotaryApplicantStatusTypeID " & _
214 " WHERE (((SuretyNumbers.SuretyNumber)=" & SuretyNumber & "))"
215 Set rs = Server.CreateObject("ADODB.Recordset")
216 rs.Open SQL,Conn,0,1
217
218 While Not rs.EOF
219 RecordExists = True
220 NotaryApplicantID = rs.Fields("NotaryApplicantID")
221 FirstName = rs.Fields("FirstName")
222 MiddleName = rs.Fields("MiddleName")
223 LastName = rs.Fields("LastName")
224 NameSuffix = rs.Fields("NameSuffix")
225 AddDate = rs.Fields("AddDate")
226 StatusName = rs.Fields("StatusName")
227 rs.MoveNext
228 Wend
229 rs.Close
230 Set rs = Nothing
231
232 If RecordExists = False Then
233 ERRMSG = "Bond number " & SuretyNumber & " is not in the database."
234 ElseIf FirstName = "" OR IsNull(FirstName) Then
235 ERRMSG = "Bond number " & SuretyNumber & " is available for assignment."
236 Else
237 NotaryName = FirstName
238 If MiddleName <> "" Then '<
239 NotaryName = NotaryName & " " & MiddleName
240 End If
241 NotaryName = NotaryName & " " & LastName
242 If NameSuffix <> "" Then '<
243 NotaryName = NotaryName & ", " & NameSuffix
244 End If
245
246 HashString = FirstName & NotaryApplicantID & LastName
247 HashString = MD5(HashString)
248
249 ApplicationLink = "https://" & SSLPath & "/tn/applications/" & HashString & ".pdf"
250 ERRMSG = "Bond number " & SuretyNumber & " was assigned to the <!a href=""" & ApplicationLink & """>application</a> for <br>" & NotaryName & " on " & AddDate & ".<br>The current status is " & StatusName & "."
251 End If
252
253 Conn.Close
254 Set Conn = Nothing
255
256ElseIf Request.Form("adminAction") <> "" Then '<
257
258 ' SUBMITTING CHECKED LIST OF NOTARY APPLICANTS '
259 MessagePath = "D:\www\aan_members\live\messages\"
260 SendMessage = False
261
262 adminAction = Request.Form("adminAction")
263
264 If adminAction = "approve" Then
265 ' DO APPROVE TEMPLATE MESSAGE HERE '
266 MessagePath = MessagePath & "application_approved.html"
267 SendMessage = True
268 ElseIf adminAction = "reject" Then
269 ' DO REJECTION TEMPLATE MESSAGE HERE '
270 'MessagePath = MessagePath & "application_rejected.html"'
271 'SendMessage = True'
272 ElseIf adminAction = "ship" Then
273 ' DO SHIPPING TEMPLATE MESSAGE HERE '
274 MessagePath = MessagePath & "supplies_shipped.html"
275 SendMessage = True
276 Else
277 SendMessage = False
278 End If
279
280 If SendMessage = True Then
281 Set fs = Server.CreateObject("Scripting.FileSystemObject")
282 Set a = fs.OpenTextFile(MessagePath)
283 MM = a.ReadAll
284 a.close
285 Set a = Nothing
286 End If
287
288 %><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
289
290 For Each Item in Request.Form
291 If Instr(1,Item,"suretyField",1) > 0 Then '<
292 NotaryApplicantID = Item
293 NotaryApplicantID = Replace(NotaryApplicantID,"suretyField","")
294 x = "Checkbox = ClearInjection(Request.Form(" & Chr(34) & "NotaryApplicantID" & NotaryApplicantID & Chr(34) & "))"
295 Execute x
296 SuretyNumber = ClearInjection(Request.Form(Item))
297 Response.Write("<br>NotaryApplicantID " & NotaryApplicantID & " will be assigned surety number " & SuretyNumber & ".")
298
299 If adminAction = "approve" AND SuretyNumber <> "" Then '<
300 ' APPROVE APPLICATION '
301 SQL = "UPDATE [SuretyNumbers] SET NotaryApplicantID = '" & NotaryApplicantID & "', AssignDate = #" & Now & "# WHERE SuretyNumber = " & SuretyNumber
302 Conn.Execute SQL,,128
303 SQL = "UPDATE [NotaryApplicants] SET NotaryApplicantStatusTypeID = '7' WHERE NotaryApplicantID = " & NotaryApplicantID
304 Conn.Execute SQL,,128
305
306 If SendMessage = True Then
307 SQL = "SELECT " & _
308 " NotaryApplicants.NotaryApplicantID, " & _
309 " NotaryApplicants.FirstName, " & _
310 " NotaryApplicants.LastName, " & _
311 " NotaryApplicants.Email, " & _
312 " NotaryApplicants.CustomerID, " & _
313 " NotaryApplicants.TransactionID, " & _
314 " NotaryApplicants.AddDate, " & _
315 " NotaryApplicants.OptOut, " & _
316 " NotaryApplicants.OptOutIncomplete, " & _
317 " NotaryAppNumbers.AANNumber, " & _
318 " Transactions.TransactionDate " & _
319 " FROM (NotaryApplicants " & _
320 " LEFT JOIN NotaryAppNumbers ON NotaryApplicants.NotaryApplicantID = NotaryAppNumbers.NotaryApplicantID) " & _
321 " LEFT JOIN Transactions ON NotaryApplicants.TransactionID = Transactions.TransactionID " & _
322 " WHERE (((NotaryApplicants.NotaryApplicantID)=" & NotaryApplicantID & "))"
323 Set rsN = Server.CreateObject("ADODB.Recordset")
324 rsN.Open SQL,Conn,0,1
325
326 While Not rsN.EOF
327 FirstName = rsN.Fields("FirstName")
328 LastName = rsN.Fields("LastName")
329 Email = rsN.Fields("Email")
330 NotaryApplicantID = rsN.Fields("NotaryApplicantID")
331 CustomerID = rsN.Fields("CustomerID")
332 TransactionID = rsN.Fields("TransactionID")
333 TransactionDate = rsN.Fields("TransactionDate")
334 If IsDate(TransactionDate) Then
335 YY = Year(TransactionDate)
336 YY = Mid(YY,3,2)
337 End If
338 AddDate = rsN.Fields("AddDate")
339 If IsDate(AddDate) Then AddDate = FormatDateTime(AddDate,2)
340 OptOut = rsN.Fields("OptOut")
341 OptOutIncomplete = rsN.Fields("OptOutIncomplete")
342 AANNumber = rsN.Fields("AANNumber")
343 rsN.MoveNext
344 Wend
345 rsN.Close
346 Set rsN = Nothing
347
348 OrderNumber = CustomerID & "-" & YY & TransactionID
349 OrderNumber = YY & TransactionID
350 ApplicationNumber = NotaryApplicantID & "-" & AANNumber
351
352 xMessage = MM
353
354 xMessage = Replace(xMessage,"<FirstName>",FirstName)
355 xMessage = Replace(xMessage,"<LastName>",LastName)
356 xMessage = Replace(xMessage,"<OrderNumber>",OrderNumber)
357 xMessage = Replace(xMessage,"<AddDate>",AddDate)
358 xMessage = Replace(xMessage,"<ApplicationNumber>",ApplicationNumber)
359
360 '** EMAIL SCRIPT **'
361 MMFrom = "American Association of Notaries (sales@usnotaries.com)"
362 MMTo = Email
363 'MMBCC = "texasnotaries@yahoo.com,aan@websoft.net"'
364 MMSubject = "Your Texas Notary Application #" & ApplicationNumber & " has Been Approved by SOS"
365 MMBody = xMessage
366 ' 9/17/2009 - NOW SENDING MESSAGE REGARDLESS IF THEY OPTED OUT (per Kal 9/16/2009) '
367 'If OptOut = True OR IsNull(Email) OR Email = "" Then'
368 If IsNull(Email) OR Email = "" Then
369 MMSend = False
370 Else
371 MMSend = True
372 End If
373
374 Set ObjSendMail = Server.CreateObject("CDO.Message")
375 Set iConf = CreateObject("CDO.Configuration")
376 Set Flds = iConf.Fields
377 Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
378 '**** Path below may need to be changed if it is not correct '
379 Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\Inetpub\mailroot\Pickup"
380 Flds.Update
381 Set ObjSendMail.Configuration = iConf
382 ObjSendMail.To = MMTo
383 If MMBCC <> "" Then '<
384 ObjSendMail.BCC = MMBCC
385 End If
386 ObjSendMail.Subject = MMSubject
387 ObjSendMail.From = MMFrom
388 ObjSendMail.HTMLBody = MMBody
389 ObjSendMail.HTMLBodyPart.ContentTransferEncoding = "quoted-printable"
390 'ObjSendMail.TextBody = "this is the body"'
391 If MMSend = True Then
392 ObjSendMail.Send
393 End If
394 Set ObjSendMail = Nothing
395 '** EMAIL SCRIPT **'
396 End If
397
398 ElseIf adminAction = "cancel" AND Checkbox = "on" Then
399 ' FLAG APPLICATION AS DELETED '
400 SQL = "UPDATE [NotaryApplicants] SET NotaryApplicantStatusTypeID = '0' WHERE NotaryApplicantID = " & NotaryApplicantID
401 Conn.Execute SQL,,128
402 ' 8/27/2009 - FREE UP SURETY NUMBER '
403 SQL = "UPDATE [SuretyNumbers] SET NotaryApplicantID = 0 WHERE NotaryApplicantID = " & NotaryApplicantID
404 Conn.Execute SQL,,128
405 ElseIf adminAction = "reject" AND Checkbox = "on" Then
406 ' FLAG APPLICATION AS REJECTED '
407 SQL = "UPDATE [NotaryApplicants] SET NotaryApplicantStatusTypeID = '8' WHERE NotaryApplicantID = " & NotaryApplicantID
408 Conn.Execute SQL,,128
409 ' 8/27/2009 - FREE UP SURETY NUMBER '
410 SQL = "UPDATE [SuretyNumbers] SET NotaryApplicantID = 0 WHERE NotaryApplicantID = " & NotaryApplicantID
411 Conn.Execute SQL,,128
412 ElseIf adminAction = "uploaded" AND Checkbox = "on" Then
413 SQL = "SELECT EditDate FROM [NotaryApplicants] WHERE NotaryApplicantID = " & NotaryApplicantID
414 Set rs = Server.CreateObject("ADODB.Recordset")
415 rs.Open SQL,Conn,0,1
416
417 While Not rs.EOF
418 EditDate = rs.Fields("EditDate")
419 rs.MoveNext
420 Wend
421 rs.Close
422 Set rs = Nothing
423
424 ' FLAG APPLICATION AS UPLOADED AND UPDATE PostDate '
425 SQL = "UPDATE [NotaryApplicants] SET NotaryApplicantStatusTypeID = '6', PostDate = #" & EditDate & "# WHERE NotaryApplicantID = " & NotaryApplicantID
426 Conn.Execute SQL,,128
427 ElseIf adminAction = "ship" AND Checkbox = "on" Then
428 ' SHIP SUPPLIES '
429 SQL = "SELECT FirstName,LastName,Email,NotaryApplicantStatusTypeID,TransactionID FROM [NotaryApplicants] WHERE NotaryApplicantID = " & NotaryApplicantID
430 Set rs = Server.CreateObject("ADODB.Recordset")
431 rs.Open SQL,Conn,0,1
432
433 While Not rs.EOF
434 FirstName = rs.Fields("FirstName")
435 LastName = rs.Fields("LastName")
436 Email = rs.Fields("Email")
437 NotaryApplicantStatusTypeID = rs.Fields("NotaryApplicantStatusTypeID")
438 TransactionID = rs.Fields("TransactionID")
439 rs.MoveNext
440 Wend
441 rs.Close
442 Set rs = Nothing
443
444 If TransactionID > 0 AND NotaryApplicantStatusTypeID <> 8 AND NotaryApplicantStatusTypeID <> 9 Then '<
445 SQL = "UPDATE [Transactions] SET TransactionStatus = '5' WHERE TransactionID = " & TransactionID
446 Conn.Execute SQL,,128
447
448 If SendMessage = True Then
449 SQL = "SELECT " & _
450 " NotaryApplicants.NotaryApplicantID, " & _
451 " NotaryApplicants.FirstName, " & _
452 " NotaryApplicants.LastName, " & _
453 " NotaryApplicants.Email, " & _
454 " NotaryApplicants.CustomerID, " & _
455 " NotaryApplicants.TransactionID, " & _
456 " NotaryApplicants.AddDate, " & _
457 " NotaryApplicants.OptOut, " & _
458 " NotaryApplicants.OptOutIncomplete, " & _
459 " NotaryAppNumbers.AANNumber, " & _
460 " Transactions.TransactionDate " & _
461 " FROM (NotaryApplicants " & _
462 " LEFT JOIN NotaryAppNumbers ON NotaryApplicants.NotaryApplicantID = NotaryAppNumbers.NotaryApplicantID) " & _
463 " LEFT JOIN Transactions ON NotaryApplicants.TransactionID = Transactions.TransactionID " & _
464 " WHERE (((NotaryApplicants.NotaryApplicantID)=" & NotaryApplicantID & "))"
465 Set rsN = Server.CreateObject("ADODB.Recordset")
466 rsN.Open SQL,Conn,0,1
467
468 While Not rsN.EOF
469 FirstName = rsN.Fields("FirstName")
470 LastName = rsN.Fields("LastName")
471 Email = rsN.Fields("Email")
472 NotaryApplicantID = rsN.Fields("NotaryApplicantID")
473 CustomerID = rsN.Fields("CustomerID")
474 TransactionID = rsN.Fields("TransactionID")
475 TransactionDate = rsN.Fields("TransactionDate")
476 If IsDate(TransactionDate) Then
477 YY = Year(TransactionDate)
478 YY = Mid(YY,3,2)
479 End If
480 AddDate = rsN.Fields("AddDate")
481 If IsDate(AddDate) Then AddDate = FormatDateTime(AddDate,2)
482 AANNumber = rsN.Fields("AANNumber")
483 OptOut = rsN.Fields("OptOut")
484 OptOutIncomplete = rsN.Fields("OptOutIncomplete")
485 rsN.MoveNext
486 Wend
487 rsN.Close
488 Set rsN = Nothing
489
490 OrderNumber = CustomerID & "-" & YY & TransactionID
491 OrderNumber = YY & TransactionID
492 ApplicationNumber = NotaryApplicantID & "-" & AANNumber
493
494 xMessage = MM
495
496 xMessage = Replace(xMessage,"<FirstName>",FirstName)
497 xMessage = Replace(xMessage,"<LastName>",LastName)
498 xMessage = Replace(xMessage,"<OrderNumber>",OrderNumber)
499 xMessage = Replace(xMessage,"<AddDate>",AddDate)
500 xMessage = Replace(xMessage,"<ApplicationNumber>",ApplicationNumber)
501
502 '** EMAIL SCRIPT **'
503 MMFrom = "American Association of Notaries (sales@usnotaries.com)"
504 MMTo = Email
505 'MMBCC = "texasnotaries@yahoo.com"'
506 MMSubject = "Shipping Notification for Texas Application #" & ApplicationNumber
507 MMBody = xMessage
508 ' 9/17/2009 - NOW SENDING MESSAGE REGARDLESS IF THEY OPTED OUT (per Kal 9/16/2009) '
509 'If OptOut = True OR IsNull(Email) OR Email = "" Then'
510 If IsNull(Email) OR Email = "" Then
511 MMSend = False
512 Else
513 MMSend = True
514 End If
515
516 Set ObjSendMail = Server.CreateObject("CDO.Message")
517 Set iConf = CreateObject("CDO.Configuration")
518 Set Flds = iConf.Fields
519 Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
520 '**** Path below may need to be changed if it is not correct '
521 Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\Inetpub\mailroot\Pickup"
522 Flds.Update
523 Set ObjSendMail.Configuration = iConf
524 ObjSendMail.To = MMTo
525 If MMBCC <> "" Then '<
526 ObjSendMail.BCC = MMBCC
527 End If
528 ObjSendMail.Subject = MMSubject
529 ObjSendMail.From = MMFrom
530 ObjSendMail.HTMLBody = MMBody
531 ObjSendMail.HTMLBodyPart.ContentTransferEncoding = "quoted-printable"
532 'ObjSendMail.TextBody = "this is the body"'
533 If MMSend = True Then
534 ObjSendMail.Send
535 End If
536 Set ObjSendMail = Nothing
537 '** EMAIL SCRIPT **'
538 End If
539
540 End If
541
542 ElseIf adminAction = "allowMessages" AND Checkbox = "on" Then
543 ' SUBSCRIBE TO NOTIFICATION MESSAGES '
544 SQL = "UPDATE [NotaryApplicants] SET OptOutIncomplete = False WHERE NotaryApplicantID = " & NotaryApplicantID
545 Conn.Execute SQL,,128
546 ElseIf adminAction = "blockMessages" AND Checkbox = "on" Then
547 ' SUBSCRIBE TO NOTIFICATION MESSAGES '
548 SQL = "UPDATE [NotaryApplicants] SET OptOutIncomplete = True WHERE NotaryApplicantID = " & NotaryApplicantID
549 Conn.Execute SQL,,128
550 End If
551 End If
552 Next
553
554 Conn.Close
555 Set Conn = Nothing
556
557 Response.Cookies("AAN")("ERRMSG") = "Applications updated."
558 Response.Cookies("AAN").domain = CookieDomain
559 Response.Cookies("AAN").expires = Date + 2
560 Response.Redirect("applications.asp")
561
562ElseIf Request.Form("BusinessName") <> "" Then '<
563
564 ' SUBMITTING SOS ACCOUNT & PAYMENT DATA '
565
566 BusinessName = Request.Form("BusinessName")
567 FirstName = Request.Form("FirstName")
568 MiddleName = Request.Form("MiddleName")
569 LastName = Request.Form("LastName")
570 NameSuffix = Request.Form("NameSuffix")
571 AddressLine1 = Request.Form("AddressLine1")
572 AddressLine2 = Request.Form("AddressLine2")
573 City = Request.Form("City")
574 StateCode = Request.Form("StateCode")
575 PostalCode = Request.Form("PostalCode")
576 PhoneNumber = Request.Form("PhoneNumber")
577 FaxNumber = Request.Form("FaxNumber")
578 ClientID = Request.Form("ClientID")
579 SOSPassword = Request.Form("SOSPassword")
580 CardType = Request.Form("CardType")
581 CardNumber = Request.Form("CardNumber")
582 ExpireMonth = Request.Form("ExpireMonth")
583 ExpireYear = Request.Form("ExpireYear")
584 LegalEaseNumber = Request.Form("LegalEaseNumber")
585
586 ' CREATE DEFAULT DATA FILE '
587 DataFile = DOSPath & "\default.data.xml"
588 Set fs = Server.CreateObject("Scripting.FileSystemObject")
589 Set a = fs.CreateTextFile(DataFile)
590 a.WriteLine("<?xml version=""1.0"" ?>")
591 a.WriteLine("<ClientData xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">")
592 If ClientID = "" Then
593 a.WriteLine(" <ClientID />")
594 Else
595 a.WriteLine(" <ClientID>" & ClientID & "</ClientID>")
596 End If
597 If SOSPassword = "" Then
598 a.WriteLine(" <Password />")
599 Else
600 a.WriteLine(" <Password>" & SOSPassword & "</Password>")
601 End If
602 If CardType = "" Then CardType = "0"
603 a.WriteLine(" <CardType>" & CardType & "</CardType>")
604 If CardNumber = "" Then
605 a.WriteLine(" <CardNumber />")
606 Else
607 a.WriteLine(" <CardNumber>" & CardNumber & "</CardNumber>")
608 End If
609 If LegalEaseNumber = "" Then
610 a.WriteLine(" <LegalEaseNumber />")
611 Else
612 a.WriteLine(" <LegalEaseNumber>" & LegalEaseNumber & "</LegalEaseNumber>")
613 End If
614 If ExpireYear = "" Then ExpireYear = "2050"
615 a.WriteLine(" <ExpireYear>" & ExpireYear & "</ExpireYear>")
616 If ExpireMonth = "" Then ExpireMonth = "12"
617 a.WriteLine(" <ExpireMonth>" & ExpireMonth & "</ExpireMonth>")
618 If BusinessName = "" Then
619 a.WriteLine(" <BusinessName />")
620 Else
621 a.WriteLine(" <BusinessName>" & BusinessName & "</BusinessName>")
622 End If
623 If FirstName = "" Then
624 a.WriteLine(" <FirstName />")
625 Else
626 a.WriteLine(" <FirstName>" & FirstName & "</FirstName>")
627 End If
628 If MiddleName = "" Then
629 a.WriteLine(" <MiddleName />")
630 Else
631 a.WriteLine(" <MiddleName>" & MiddleName & "</MiddleName>")
632 End If
633 If LastName = "" Then
634 a.WriteLine(" <LastName />")
635 Else
636 a.WriteLine(" <LastName>" & LastName & "</LastName>")
637 End If
638 If NameSuffix = "" Then
639 a.WriteLine(" <NameSuffix />")
640 Else
641 a.WriteLine(" <NameSuffix>" & NameSuffix & "</NameSuffix>")
642 End If
643 If AddressLine1 = "" Then
644 a.WriteLine(" <AddressLine1 />")
645 Else
646 a.WriteLine(" <AddressLine1>" & AddressLine1 & "</AddressLine1>")
647 End If
648 If AddressLine2 = "" Then
649 a.WriteLine(" <AddressLine2 />")
650 Else
651 a.WriteLine(" <AddressLine2>" & AddressLine2 & "</AddressLine2>")
652 End If
653 If City = "" Then
654 a.WriteLine(" <City />")
655 Else
656 a.WriteLine(" <City>" & City & "</City>")
657 End If
658 If StateCode = "" Then
659 a.WriteLine(" <StateCode />")
660 Else
661 a.WriteLine(" <StateCode>" & Ucase(StateCode) & "</StateCode>")
662 End If
663 If PostalCode = "" Then
664 a.WriteLine(" <PostalCode />")
665 Else
666 a.WriteLine(" <PostalCode>" & PostalCode & "</PostalCode>")
667 End If
668 a.WriteLine(" <PostalCodeExtension />")
669 a.WriteLine(" <Country>USA</Country>")
670 If PhoneNumber = "" Then
671 a.WriteLine(" <PhoneNumber />")
672 Else
673 a.WriteLine(" <PhoneNumber>" & PhoneNumber & "</PhoneNumber>")
674 End If
675 a.WriteLine(" <PhoneExtension />")
676 If FaxNumber = "" Then
677 a.WriteLine(" <FaxNumber />")
678 Else
679 a.WriteLine(" <FaxNumber>" & FaxNumber & "</FaxNumber>")
680 End If
681 a.WriteLine(" <EMail />")
682 a.WriteLine("</ClientData>")
683 a.Close
684 Set a = Nothing
685 ' END OF DEFAULT FILE '
686
687 ' CREDIT CARD FILE '
688 DataFile = DOSPath & "\Template.CreditCard.xml"
689 Set fs = Server.CreateObject("Scripting.FileSystemObject")
690 Set a = fs.CreateTextFile(DataFile)
691 a.WriteLine("<?xml version=""1.0"" ?>")
692 a.WriteLine("<ClientData xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">")
693 If ClientID = "" Then
694 a.WriteLine(" <ClientID />")
695 Else
696 a.WriteLine(" <ClientID>" & ClientID & "</ClientID>")
697 End If
698 If SOSPassword = "" Then
699 a.WriteLine(" <Password />")
700 Else
701 a.WriteLine(" <Password>" & SOSPassword & "</Password>")
702 End If
703 a.WriteLine(" <EnvelopeID>0</EnvelopeID>")
704 a.WriteLine(" <PaymentType>3</PaymentType>")
705 a.WriteLine(" <RunMode>1</RunMode>")
706 If CardType = "" Then CardType = "0"
707 a.WriteLine(" <CardType>" & CardType & "</CardType>")
708 If CardNumber = "" Then
709 a.WriteLine(" <CardNumber />")
710 Else
711 a.WriteLine(" <CardNumber>" & CardNumber & "</CardNumber>")
712 End If
713 If LegalEaseNumber = "" Then
714 a.WriteLine(" <LegalEaseNumber />")
715 Else
716 a.WriteLine(" <LegalEaseNumber>" & LegalEaseNumber & "</LegalEaseNumber>")
717 End If
718 If ExpireYear = "" Then ExpireYear = "2050"
719 a.WriteLine(" <ExpireYear>" & ExpireYear & "</ExpireYear>")
720 If ExpireMonth = "" Then ExpireMonth = "12"
721 a.WriteLine(" <ExpireMonth>" & ExpireMonth & "</ExpireMonth>")
722 If BusinessName = "" Then
723 a.WriteLine(" <BusinessName />")
724 Else
725 a.WriteLine(" <BusinessName>" & BusinessName & "</BusinessName>")
726 End If
727 If FirstName = "" Then
728 a.WriteLine(" <FirstName />")
729 Else
730 a.WriteLine(" <FirstName>" & FirstName & "</FirstName>")
731 End If
732 If MiddleName = "" Then
733 a.WriteLine(" <MiddleName />")
734 Else
735 a.WriteLine(" <MiddleName>" & MiddleName & "</MiddleName>")
736 End If
737 If LastName = "" Then
738 a.WriteLine(" <LastName />")
739 Else
740 a.WriteLine(" <LastName>" & LastName & "</LastName>")
741 End If
742 If NameSuffix = "" Then
743 a.WriteLine(" <NameSuffix />")
744 Else
745 a.WriteLine(" <NameSuffix>" & NameSuffix & "</NameSuffix>")
746 End If
747 If AddressLine1 = "" Then
748 a.WriteLine(" <AddressLine1 />")
749 Else
750 a.WriteLine(" <AddressLine1>" & AddressLine1 & "</AddressLine1>")
751 End If
752 If AddressLine2 = "" Then
753 a.WriteLine(" <AddressLine2 />")
754 Else
755 a.WriteLine(" <AddressLine2>" & AddressLine2 & "</AddressLine2>")
756 End If
757 If City = "" Then
758 a.WriteLine(" <City />")
759 Else
760 a.WriteLine(" <City>" & City & "</City>")
761 End If
762 If StateCode = "" Then
763 a.WriteLine(" <StateCode />")
764 Else
765 a.WriteLine(" <StateCode>" & Ucase(StateCode) & "</StateCode>")
766 End If
767 If PostalCode = "" Then
768 a.WriteLine(" <PostalCode />")
769 Else
770 a.WriteLine(" <PostalCode>" & PostalCode & "</PostalCode>")
771 End If
772 a.WriteLine(" <PostalCodeExtension />")
773 a.WriteLine(" <Country>USA</Country>")
774 If PhoneNumber = "" Then
775 a.WriteLine(" <PhoneNumber />")
776 Else
777 a.WriteLine(" <PhoneNumber>" & PhoneNumber & "</PhoneNumber>")
778 End If
779 a.WriteLine(" <PhoneExtension />")
780 If FaxNumber = "" Then
781 a.WriteLine(" <FaxNumber />")
782 Else
783 a.WriteLine(" <FaxNumber>" & FaxNumber & "</FaxNumber>")
784 End If
785 a.WriteLine(" <EMail />")
786 a.WriteLine("</ClientData>")
787 a.Close
788 Set a = Nothing
789 ' END OF CREDIT CARD FILE '
790
791
792 ' LEGALEASE FILE '
793 DataFile = DOSPath & "\Template.LegalEase.xml"
794 Set fs = Server.CreateObject("Scripting.FileSystemObject")
795 Set a = fs.CreateTextFile(DataFile)
796 a.WriteLine("<?xml version=""1.0"" ?>")
797 a.WriteLine("<ClientData xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">")
798 If ClientID = "" Then
799 a.WriteLine(" <ClientID />")
800 Else
801 a.WriteLine(" <ClientID>" & ClientID & "</ClientID>")
802 End If
803 If SOSPassword = "" Then
804 a.WriteLine(" <Password />")
805 Else
806 a.WriteLine(" <Password>" & SOSPassword & "</Password>")
807 End If
808 a.WriteLine(" <EnvelopeID>0</EnvelopeID>")
809 a.WriteLine(" <PaymentType>4</PaymentType>")
810 a.WriteLine(" <RunMode>1</RunMode>")
811 If CardType = "" Then CardType = "0"
812 a.WriteLine(" <CardType>" & CardType & "</CardType>")
813 If CardNumber = "" Then
814 a.WriteLine(" <CardNumber />")
815 Else
816 a.WriteLine(" <CardNumber>" & LegalEaseNumber & "</CardNumber>")
817 End If
818 If ExpireYear = "" Then ExpireYear = "2050"
819 a.WriteLine(" <ExpireYear>" & ExpireYear & "</ExpireYear>")
820 If ExpireMonth = "" Then ExpireMonth = "12"
821 a.WriteLine(" <ExpireMonth>" & ExpireMonth & "</ExpireMonth>")
822 If BusinessName = "" Then
823 a.WriteLine(" <BusinessName />")
824 Else
825 a.WriteLine(" <BusinessName>" & BusinessName & "</BusinessName>")
826 End If
827 If FirstName = "" Then
828 a.WriteLine(" <FirstName />")
829 Else
830 a.WriteLine(" <FirstName>" & FirstName & "</FirstName>")
831 End If
832 If MiddleName = "" Then
833 a.WriteLine(" <MiddleName />")
834 Else
835 a.WriteLine(" <MiddleName>" & MiddleName & "</MiddleName>")
836 End If
837 If LastName = "" Then
838 a.WriteLine(" <LastName />")
839 Else
840 a.WriteLine(" <LastName>" & LastName & "</LastName>")
841 End If
842 If NameSuffix = "" Then
843 a.WriteLine(" <NameSuffix />")
844 Else
845 a.WriteLine(" <NameSuffix>" & NameSuffix & "</NameSuffix>")
846 End If
847 If AddressLine1 = "" Then
848 a.WriteLine(" <AddressLine1 />")
849 Else
850 a.WriteLine(" <AddressLine1>" & AddressLine1 & "</AddressLine1>")
851 End If
852 If AddressLine2 = "" Then
853 a.WriteLine(" <AddressLine2 />")
854 Else
855 a.WriteLine(" <AddressLine2>" & AddressLine2 & "</AddressLine2>")
856 End If
857 If City = "" Then
858 a.WriteLine(" <City />")
859 Else
860 a.WriteLine(" <City>" & City & "</City>")
861 End If
862 If StateCode = "" Then
863 a.WriteLine(" <StateCode />")
864 Else
865 a.WriteLine(" <StateCode>" & Ucase(StateCode) & "</StateCode>")
866 End If
867 If PostalCode = "" Then
868 a.WriteLine(" <PostalCode />")
869 Else
870 a.WriteLine(" <PostalCode>" & PostalCode & "</PostalCode>")
871 End If
872 a.WriteLine(" <PostalCodeExtension />")
873 a.WriteLine(" <Country>USA</Country>")
874 If PhoneNumber = "" Then
875 a.WriteLine(" <PhoneNumber />")
876 Else
877 a.WriteLine(" <PhoneNumber>" & PhoneNumber & "</PhoneNumber>")
878 End If
879 a.WriteLine(" <PhoneExtension />")
880 If FaxNumber = "" Then
881 a.WriteLine(" <FaxNumber />")
882 Else
883 a.WriteLine(" <FaxNumber>" & FaxNumber & "</FaxNumber>")
884 End If
885 a.WriteLine(" <EMail />")
886 a.WriteLine("</ClientData>")
887 a.Close
888 Set a = Nothing
889 ' END OF LEGALEASE FILE '
890
891
892 ' SOS DIRECT FILE '
893 DataFile = DOSPath & "\Template.SOSDirect.xml"
894 Set fs = Server.CreateObject("Scripting.FileSystemObject")
895 Set a = fs.CreateTextFile(DataFile)
896 a.WriteLine("<?xml version=""1.0"" ?>")
897 a.WriteLine("<ClientData xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">")
898 If ClientID = "" Then
899 a.WriteLine(" <ClientID />")
900 Else
901 a.WriteLine(" <ClientID>" & ClientID & "</ClientID>")
902 End If
903 If SOSPassword = "" Then
904 a.WriteLine(" <Password />")
905 Else
906 a.WriteLine(" <Password>" & SOSPassword & "</Password>")
907 End If
908 a.WriteLine(" <EnvelopeID>0</EnvelopeID>")
909 a.WriteLine(" <PaymentType>5</PaymentType>")
910 a.WriteLine(" <RunMode>1</RunMode>")
911 a.WriteLine("</ClientData>")
912 a.Close
913 Set a = Nothing
914 ' END OF SOS FILE '
915
916 Set fs = Nothing
917 Response.Cookies("AAN")("ERRMSG") = "Payment configurations have been updated."
918 Response.Cookies("AAN").domain = CookieDomain
919 Response.Cookies("AAN").expires = Date + 2
920 Response.Redirect("applications.asp")
921End If
922
923Sub UpdateBondNumber(BondNumber,Paid,PaidReference,NumbersUpdated,ChangedFromPaid,ChangedToPaid,NonExisting,AvoidDuplicate,DuplicateMessage)
924 'First check to see if this record exists'
925 SuretyNumberID = "0"
926 SQL = "SELECT SuretyNumberID,Paid,PaidDate,PaidReference FROM [SuretyNumbers] WHERE SuretyNumber = " & BondNumber
927 Set rs5 = Server.CreateObject("ADODB.RecordSet")
928 rs5.Open SQL,Conn,0,1
929
930 While Not rs5.EOF
931 SuretyNumberID = rs5.Fields("SuretyNumberID")
932 PaidBefore = rs5.Fields("Paid")
933 PaidDateBefore = rs5.Fields("PaidDate")
934 PaidReferenceBefore = rs5.Fields("PaidReference")
935 rs5.MoveNext
936 Wend
937 rs5.Close
938 Set rs5 = Nothing
939
940 SQL = "UPDATE [SuretyNumbers] SET Paid = " & Paid
941
942 UpdateRecord = True
943 If SuretyNumberID = "0" Then
944 NonExisting = NonExisting + 1
945 UpdateRecord = False
946 ElseIf PaidBefore = True AND Paid = False Then
947 ChangedFromPaid = ChangedFromPaid + 1
948 ElseIf PaidBefore = False AND Paid = True Then
949 ChangedToPaid = ChangedToPaid + 1
950 SQL = SQL & ", PaidDate = #" & Now & "#, PaidReference = '" & PaidReference & "' "
951 ElseIf PaidBefore = True AND Paid = True AND Request.Form("UpdateReference") = "on" Then
952 ' 8/11/2009 This is a change in PaidReference - update the date paid anyway for Kal '
953 SQL = SQL & ", PaidDate = #" & Now & "#, PaidReference = '" & PaidReference & "' "
954 ElseIf PaidBefore = True AND Paid = True Then
955 ' 8/13/2009 DO NOT ALLOW DUPLICATES '
956 UpdateRecord = False
957 AvoidDuplicate = AvoidDuplicate + 1
958 DuplicateMessage = DuplicateMessage + "<br>Bond # " & BondNumber & " was flagged paid on " & FormatDateTime(PaidDateBefore,2) & " with reference " & PaidReferenceBefore & "."
959 End If
960
961 If UpdateRecord = True Then
962 SQL = SQL & " WHERE SuretyNumberID = " & SuretyNumberID
963 Conn.Execute SQL,,128
964 NumbersUpdated = NumbersUpdated + 1
965 End If
966
967 Response.Write("<br>" & SQL)
968End Sub
969%>
970
971<!--#Include File="header.inc.asp"-->
972
973<SCRIPT LANGUAGE="JavaScript">
974<!--
975function addNumbers() {
976 var form = document.forms["surety"];
977 if (form.StartNumber.value == "") {
978 alert("You must have numeric values for both fields. ");
979 form.StartNumber.focus();
980 }
981 else if (form.EndNumber.value == "") {
982 alert("You must have numeric values for both fields. ");
983 form.EndNumber.focus();
984 }
985 else if (isNaN(form.StartNumber.value)) {
986 alert("The entry for start number is invalid. ");
987 form.StartNumber.select();
988 }
989 else if (isNaN(form.EndNumber.value)) {
990 alert("The entry for end number is invalid. ");
991 form.EndNumber.select();
992 }
993 else if (form.StartNumber.value.length != 8) {
994 alert("The bond numbers must be 8 numeric digits. ");
995 form.StartNumber.focus();
996 }
997 else if (form.EndNumber.value.length != 8) {
998 alert("The bond numbers must be 8 numeric digits. ");
999 form.EndNumber.focus();
1000 }
1001 else if ((form.StartNumber.value.charAt(0) != "2") || (form.StartNumber.value.charAt(1) != "5")) {
1002 alert("The bond numbers must start with '25'. ");
1003 form.StartNumber.focus();
1004 }
1005 else if ((form.EndNumber.value.charAt(0) != "2") || (form.EndNumber.value.charAt(1) != "5")) {
1006 alert("The bond numbers must start with '25'. ");
1007 form.EndNumber.focus();
1008 }
1009 else if (parseInt(form.EndNumber.value) - parseInt(form.StartNumber.value) > 1000) {
1010 alert("The current span exceeds 1000 number values. ");
1011 form.EndNumber.select();
1012 }
1013 else {
1014 form.submit();
1015 }
1016}
1017function checkNumber() {
1018 var form = document.forms["lookup"];
1019 if ((form.SuretyNumber.value == "") && (form.SuretyStartDate.value == "") && (form.PaidReference.value == "")) {
1020 alert("Please enter a bond number, date or paid reference to use the bond number query. ");
1021 form.SuretyNumber.focus();
1022 }
1023 else if ((form.SuretyNumber.value != "") && (isNaN(form.SuretyNumber.value))) {
1024 alert("The entry for bond number is invalid. Please correct the number or delete it entirely. ");
1025 form.SuretyNumber.select();
1026 }
1027 else if (form.SuretyNumber.value != "") {
1028 url = "applications.asp?SuretyNumber=" + form.SuretyNumber.value;
1029 document.location.href = url;
1030 }
1031 else if ((form.paid.checked == false) && (form.unpaid.checked == false)) {
1032 alert('Please check either the "Paid", "Unpaid" or both checkboxes. ');
1033 }
1034 else {
1035 var startDate = form.SuretyStartDate.value;
1036 if ((isDate(startDate)) || (form.PaidReference.value != "")) {
1037 form.submit();
1038 }
1039 else {
1040 alert("The entry for date is invalid. ");
1041 form.SuretyStartDate.select();
1042 }
1043 }
1044}
1045function checkQuery() {
1046 var form = document.forms["query"];
1047 if ((form.PostDate.value == "") && (form.NotaryApplicantID.value == "") && (form.EndDate.value == "") && (form.LastName.value == "")) {
1048 alert("Please enter a date, application # or name to continue. ");
1049 }
1050 else if (form.NotaryApplicantID.value != "") {
1051 if (isNaN(form.NotaryApplicantID.value)) {
1052 alert("Please enter a numeric value in the application ID field or delete the current entry. ");
1053 form.NotaryApplicantID.select();
1054 }
1055 else {
1056 form.submit();
1057 }
1058 }
1059 else if (form.PostDate.value != "") {
1060 if (isDate(form.PostDate.value)) {
1061 form.submit();
1062 }
1063 else {
1064 alert("Please enter a valid date in the form of mm/dd/yyyy. ");
1065 form.PostDate.select();
1066 }
1067 }
1068 else if ((form.StartDate.value != "") && (form.EndDate.value != "")) {
1069 if (isDate(form.StartDate.value)) {
1070 form.submit();
1071 }
1072 else {
1073 alert("Please enter a valid date in the form of mm/dd/yyyy. ");
1074 form.PostDate.select();
1075 }
1076 }
1077 else form.submit();
1078}
1079function isDate(DateStr) {
1080 if (DateStr != "") {
1081 if (DateStr.indexOf("/") > -1) {
1082 if (DateStr.indexOf("/",DateStr.indexOf("/")) > -1) {
1083 //
1084 var DateStrArray = DateStr.split("/");
1085 var mm = DateStrArray[0];
1086 var dd = DateStrArray[1];
1087 var yyyy = DateStrArray[2];
1088 if (mm.length == 1) {
1089 mm = "0" + mm
1090 }
1091 if (dd.length == 1) {
1092 dd = "0" + dd
1093 }
1094 if (yyyy.length = 2) {
1095 yyyy = "20" + yyyy
1096 }
1097 var d = new Date(mm + "/" + dd + "/" + yyyy);
1098 return d.getMonth() + 1 == mm && d.getDate() == dd && d.getFullYear() == yyyy;
1099 }
1100 else return false;
1101 }
1102 else return false;
1103 }
1104 else return false;
1105}
1106
1107function updateStatus() {
1108 var form = document.forms["bondStatus"];
1109 var allowSubmit = true;
1110 var errmsg = "";
1111 if (((isNaN(form.BondStartNumber.value) == true) || (form.BondStartNumber.value == "")) && (form.BondStartDate.value == "")) {
1112 allowSubmit = false;
1113 errmsg = "Please enter a valid bond number to use this function. ";
1114 form.BondStartNumber.focus();
1115 }
1116 else if ((form.BondStartNumber.value == "") && (isDate(form.BondStartDate.value) == false) && (form.BondStartDate.value != "")) {
1117 allowSubmit = false;
1118 errmsg = "Please enter a valid date to use this function. ";
1119 form.BondStartDate.focus();
1120 }
1121 else if ((isNaN(form.BondStartNumber.value) == false) && (isNaN(form.BondEndNumber.value) == false)) {
1122 if (form.BondEndNumber.value - parseInt(form.BondStartNumber.value) >= 1000) {
1123 allowSubmit = false;
1124 errmsg = "Please limit updates to spans of up to 1000 bond numbers at a time. ";
1125 form.BondStartNumber.focus();
1126 }
1127 }
1128 if (form.PaidReference.value != "") {
1129 var rf = form.PaidReference.value;
1130 if (rf.length != 4) {
1131 allowSubmit = false;
1132 errmsg = "The reference number must consist of 4 numeric digits. ";
1133 form.PaidReference.select();
1134 }
1135 else {
1136 for (var i=0;i<rf.length;i++) {
1137 if ((rf.charCodeAt(i) > 47) && (rf.charCodeAt(i) < 58)) {
1138 // this is a numeric value
1139 }
1140 else {
1141 errmsg = "The reference number must contain numeric digits only. ";
1142 allowSubmit = false;
1143 }
1144 }
1145 }
1146 }
1147 if (allowSubmit == true) {
1148 form.submit();
1149 }
1150 else {
1151 alert(errmsg);
1152 }
1153}
1154
1155function flagAsPaid() {
1156 var form = document.forms["bonds"];
1157 var allowSubmit = true;
1158 var errmsg = "";
1159 if (form.PaidReference.value != "") {
1160 var rf = form.PaidReference.value;
1161 if (rf.length != 4) {
1162 allowSubmit = false;
1163 errmsg = "The reference number must consist of 4 numeric digits. ";
1164 form.PaidReference.select();
1165 }
1166 else {
1167 for (var i=0;i<rf.length;i++) {
1168 if ((rf.charCodeAt(i) > 47) && (rf.charCodeAt(i) < 58)) {
1169 // this is a numeric value
1170 }
1171 else {
1172 errmsg = "The reference number must contain numeric digits only. ";
1173 allowSubmit = false;
1174 }
1175 }
1176 }
1177 }
1178 if (allowSubmit == true) {
1179 form.submit();
1180 }
1181 else {
1182 alert(errmsg);
1183 }
1184}
1185
1186function editCustomer(CustomerID,ShippingAddressID) {
1187
1188 CustomerEditor = window.open("","custwin","scrollbars=yes,width=500,height=400");
1189 CustomerEditor.location.href = "https://secure.usnotaries.net/admin/edit_customer.tn.asp?CustomerID=" + CustomerID + "&ShippingAddressID=" + ShippingAddressID;
1190 if (CustomerEditor.opener == null) CustomerEditor.opener = window;
1191 CustomerEditor.opener.name = "opener";
1192
1193 // the following loads the contact info only
1194 //CustomerEditor = window.open("","custwin","scrollbars=yes,width=300,height=150");
1195 //CustomerEditor.location.href = "contact.info.asp?CustomerID=" + CustomerID + "&ShippingAddressID=" + ShippingAddressID;
1196 //if (CustomerEditor.opener == null) CustomerEditor.opener = window;
1197 //CustomerEditor.opener.name = "opener";
1198}
1199
1200//-->
1201</SCRIPT>
1202
1203<!--HORIZONTAL NAVIGATION-->
1204<!--#Include file="nav.inc.asp"-->
1205<P>
1206<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#ffffff" WIDTH="100%" HEIGHT="100%">
1207 <TR VALIGN=TOP>
1208 <TD CLASS=bodytxt ALIGN=CENTER>
1209 <% If ERRMSG <> "" Then %>
1210 <DIV CLASS=boldtxt>
1211 <FONT COLOR=Red>
1212 <%=ERRMSG%>
1213 </FONT>
1214 </DIV>
1215 <P>
1216 <% End If %>
1217
1218<%
1219' CHECK FOR APPLICATIONS THAT HAVE BEEN UPLOADED TO THE STATE (NotaryApplicantStatusTypeID=6) BUT HAVE NOT BEEN APPROVED OR REJECTED IN 2 WEEKS (PostDate < (Today-14days)) '
1220TwoWeeksAgo = DateSerial(Year(Now),Month(Now),Day(Now)-14)
1221SQL = "SELECT NotaryApplicantID,FirstName,MiddleName,LastName,NameSuffix,PostDate FROM [NotaryApplicants] WHERE NotaryApplicantStatusTypeID = 6 AND PostDate <= #" & TwoWeeksAgo & "#"
1222%><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
1223Set rs = Server.CreateObject("ADODB.Recordset")
1224rs.Open SQL,Conn,0,1
1225
1226ShowHeader = True
1227While Not rs.EOF
1228 If ShowHeader = True Then
1229 ShowHeader = False
1230 %>
1231 <div style="color:red;font-size:18px;font-family:arial,helvetica;font-weight:bold;">
1232 The following applications have exceeded two weeks at the S.O.S.
1233 </div>
1234 <ul style="color:red;font-size:18px;font-family:arial,helvetica;font-weight:bold;">
1235 <%
1236 End If
1237 NotaryApplicantID = rs.Fields("NotaryApplicantID")
1238 FirstName = rs.Fields("FirstName")
1239 MiddleName = rs.Fields("MiddleName")
1240 LastName = rs.Fields("LastName")
1241 NameSuffix = rs.Fields("NameSuffix")
1242 NotaryName = FirstName
1243 If MiddleName <> "" Then NotaryName = NotaryName & " " & MiddleName '<
1244 NotaryName = NotaryName & " " & LastName
1245 If NameSuffix <> "" Then NotaryName = NotaryName & ", " & NameSuffix '<
1246 PostDate = rs.Fields("PostDate")
1247 If IsDate(PostDate) Then
1248 PostDate = FormatDateTime(PostDate,2)
1249 Else
1250 PostDate = " " & Chr(59)
1251 End If
1252 %>
1253 <li><a href="app.entry.asp?NotaryApplicantID=<%=NotaryApplicantID%>"><%=NotaryName%></a> - <%=FormatDateTime(PostDate,2)%>
1254 <%
1255 rs.MoveNext
1256Wend
1257rs.Close
1258Set rs = Nothing
1259Conn.Close
1260Set Conn = Nothing
1261If ShowHeader = False Then
1262 %>
1263 </ul>
1264 <%
1265End If
1266%>
1267
1268<% If Request.Form("PostDate") <> "" OR Request.Form("StartDate") <> "" OR Request.Form("NotaryApplicantID") <> "" OR Request.Form("LastName") <> "" Then '< %>
1269 <!--#Include Virtual="/http/includes/conn.inc.asp"-->
1270 <%
1271
1272 WhereClause = ""
1273 StartDate = Request.Form("StartDate")
1274 EndDate = Request.Form("EndDate")
1275 PostDate = Request.Form("PostDate")
1276 DateCriteria = Request.Form("DateCriteria")
1277 NotaryApplicantID = Request.Form("NotaryApplicantID")
1278 LastName = Request.Form("LastName")
1279 IncludeApproved = Request.Form("IncludeApproved")
1280 IncludeRenewals = Request.Form("IncludeRenewals")
1281 OnlyErrors = Request.Form("OnlyErrors")
1282 IncludeNew = Request.Form("IncludeNew")
1283 OrderByStatus = Request.Form("OrderByStatus")
1284 OutputReport = Request.Form("OutputReport")
1285 If OutputReport = "on" Then
1286 OutputReport = True
1287 Else
1288 OutputReport = False
1289 End If
1290 SearchByID = False
1291 If IsNumeric(NotaryApplicantID) AND NotaryApplicantID <> "0" Then '<
1292 SearchByID = True
1293 WhereClause = " WHERE (((NotaryApplicants.NotaryApplicantID)=" & NotaryApplicantID & ") OR ((NotaryAppNumbers.AANNumber)='" & NotaryApplicantID & "'))"
1294 HeaderLabel = "Notary Application ID #" & NotaryApplicantID
1295 ElseIf LastName <> "" Then '<
1296 If Instr(1,LastName,"*",1) > 0 Then '<
1297 LastName = Replace(LastName,"*","%")
1298 WhereClause = " WHERE NotaryApplicants.LastName LIKE '" & LastName & "'"
1299 HeaderLabel = "Notary Last Name matches " & Request.Form("LastName")
1300 Else
1301 WhereClause = " WHERE NotaryApplicants.LastName = '" & LastName & "'"
1302 HeaderLabel = "Notary Last Name is " & Request.Form("LastName")
1303 End If
1304 ElseIf IsDate(PostDate) Then
1305 DayBefore = DateSerial(Year(PostDate),Month(PostDate),Day(PostDate)-1) & " 11:59:59 PM"
1306 DayAfter = DateSerial(Year(PostDate),Month(PostDate),Day(PostDate)+1) & " 12:00:01 AM"
1307 WhereClause = "WHERE (((NotaryApplicants.PostDate) > #" & DayBefore & "#) AND ((NotaryApplicants.PostDate) < #" & DayAfter & "#))"
1308 HeaderLabel = "Notary Applications Submitted " & PostDate
1309 ElseIf IsDate(StartDate) AND IsDate(EndDate) Then
1310 EndDate = DateSerial(Year(EndDate),Month(EndDate),Day(EndDate)+1)
1311 WhereClause = "WHERE (((NotaryApplicants.PostDate) > #" & StartDate & "#) AND ((NotaryApplicants.PostDate) < #" & EndDate & "#))"
1312 HeaderLabel = "Notary Applications Submitted between " & StartDate & " and " & EndDate
1313 Else
1314 WhereClause = ""
1315 End If
1316
1317 If DateCriteria <> "" Then '<
1318 If DateCriteria = "AddDate" Then
1319 WhereClause = Replace(WhereClause,"PostDate","AddDate")
1320 End If
1321 End If
1322
1323 If IncludeApproved = "on" Then
1324 WhereClause = WhereClause & " AND NotaryApplicants.NotaryApplicantStatusTypeID = 7 "
1325 End If
1326 If IncludeRenewals = "on" AND IncludeNew = "" Then
1327 WhereClause = WhereClause & " AND NotaryApplicants.RenewalYN = True "
1328 ElseIf IncludeRenewals = "" AND IncludeNew = "on" Then
1329 WhereClause = WhereClause & " AND NotaryApplicants.RenewalYN = False "
1330 End If
1331 If OnlyErrors = "on" Then
1332 WhereClause = WhereClause & " AND NotaryApplicants.NotaryApplicantStatusTypeID = 9 "
1333 WhereClause = Replace(WhereClause,"NotaryApplicants.PostDate","NotaryApplicants.EditDate")
1334 End If
1335
1336 If WhereClause = "" Then
1337 Response.Cookies("AAN")("ERRMSG") = "Invalid Query. Operation aborted."
1338 Response.Cookies("AAN").domain = CookieDomain
1339 Response.Cookies("AAN").expires = Date + 2
1340 Response.Redirect("applications.asp")
1341 Else
1342
1343 If SearchByID = True Then
1344 SQL = "SELECT " & _
1345 " NotaryApplicants.NotaryApplicantID, " & _
1346 " NotaryApplicants.NotaryApplicantStatusTypeID, " & _
1347 " NotaryApplicants.FirstName, " & _
1348 " NotaryApplicants.MiddleName, " & _
1349 " NotaryApplicants.LastName, " & _
1350 " NotaryApplicants.NameSuffix, " & _
1351 " NotaryApplicants.TransactionID, " & _
1352 " NotaryApplicants.CustomerID, " & _
1353 " NotaryApplicants.AddDate, " & _
1354 " NotaryApplicants.PostDate, " & _
1355 " NotaryApplicants.ExpireDate, " & _
1356 " NotaryApplicantStatusType.StatusName, " & _
1357 " NotaryAppNumbers.AANNumber " & _
1358 " FROM (NotaryApplicants " & _
1359 " LEFT JOIN NotaryApplicantStatusType ON NotaryApplicants.NotaryApplicantStatusTypeID = NotaryApplicantStatusType.NotaryApplicantStatusTypeID) " & _
1360 " LEFT JOIN NotaryAppNumbers ON NotaryApplicants.NotaryApplicantID = NotaryAppNumbers.NotaryApplicantID "
1361
1362 Else
1363 SQL = "SELECT " & _
1364 " NotaryApplicants.NotaryApplicantID, " & _
1365 " NotaryApplicants.NotaryApplicantStatusTypeID, " & _
1366 " NotaryApplicants.FirstName, " & _
1367 " NotaryApplicants.MiddleName, " & _
1368 " NotaryApplicants.LastName, " & _
1369 " NotaryApplicants.NameSuffix, " & _
1370 " NotaryApplicants.TransactionID, " & _
1371 " NotaryApplicants.CustomerID, " & _
1372 " NotaryApplicants.AddDate, " & _
1373 " NotaryApplicants.PostDate, " & _
1374 " NotaryApplicants.ExpireDate, " & _
1375 " NotaryApplicantStatusType.StatusName " & _
1376 " FROM NotaryApplicants " & _
1377 " LEFT JOIN NotaryApplicantStatusType " & _
1378 " ON NotaryApplicants.NotaryApplicantStatusTypeID = NotaryApplicantStatusType.NotaryApplicantStatusTypeID "
1379 End If
1380
1381 SQL = "SELECT " & _
1382 " NotaryApplicants.NotaryApplicantID, " & _
1383 " NotaryApplicants.FirstName, " & _
1384 " NotaryApplicants.MiddleName, " & _
1385 " NotaryApplicants.LastName, " & _
1386 " NotaryApplicants.NameSuffix, " & _
1387 " NotaryApplicants.TransactionID, " & _
1388 " NotaryApplicants.CustomerID, " & _
1389 " NotaryApplicants.AddDate, " & _
1390 " NotaryApplicants.PostDate, " & _
1391 " NotaryApplicants.ExpireDate, " & _
1392 " NotaryApplicants.NotaryApplicantStatusTypeID. " & _
1393 " NotaryApplicantStatusType.StatusName, " & _
1394 " NotaryAppNumbers.AANNumber, " & _
1395 " Transactions.TransactionStatus, " & _
1396 " Transactions.PaymentTypeID " & _
1397 " FROM ((NotaryApplicants " & _
1398 " LEFT JOIN NotaryApplicantStatusType ON NotaryApplicants.NotaryApplicantStatusTypeID = NotaryApplicantStatusType.NotaryApplicantStatusTypeID) " & _
1399 " LEFT JOIN NotaryAppNumbers ON NotaryApplicants.NotaryApplicantID = NotaryAppNumbers.NotaryApplicantID) " & _
1400 " LEFT JOIN Transactions ON NotaryApplicants.TransactionID = Transactions.TransactionID "
1401
1402 SQL = "SELECT " & _
1403 " NotaryApplicants.NotaryApplicantID, " & _
1404 " NotaryApplicants.NotaryApplicantStatusTypeID, " & _
1405 " NotaryApplicants.FirstName, " & _
1406 " NotaryApplicants.MiddleName, " & _
1407 " NotaryApplicants.LastName, " & _
1408 " NotaryApplicants.NameSuffix, " & _
1409 " NotaryApplicants.CustomerID, " & _
1410 " NotaryApplicants.TransactionID, " & _
1411 " NotaryApplicants.AddDate, " & _
1412 " NotaryApplicants.PostDate, " & _
1413 " NotaryApplicants.ExpireDate, " & _
1414 " NotaryApplicants.OfficeEntry, " & _
1415 " NotaryApplicants.OptOut, " & _
1416 " NotaryApplicants.OptOutIncomplete, " & _
1417 " NotaryApplicantStatusType.StatusName, " & _
1418 " NotaryAppNumbers.AANNumber, " & _
1419 " Transactions.TransactionStatus, " & _
1420 " Transactions.PaymentTypeID, " & _
1421 " Transactions.ShippingAddressID " & _
1422 " FROM ((NotaryApplicants " & _
1423 " LEFT JOIN NotaryApplicantStatusType ON NotaryApplicants.NotaryApplicantStatusTypeID = NotaryApplicantStatusType.NotaryApplicantStatusTypeID) " & _
1424 " LEFT JOIN NotaryAppNumbers ON NotaryApplicants.NotaryApplicantID = NotaryAppNumbers.NotaryApplicantID) " & _
1425 " LEFT JOIN Transactions ON NotaryApplicants.TransactionID = Transactions.TransactionID "
1426 SQL = SQL & WhereClause
1427
1428 If OrderByStatus = "on" Then
1429 SQL = SQL & " ORDER BY Transactions.TransactionStatus"
1430 Else
1431 SQL = SQL & " ORDER BY NotaryApplicants.NotaryApplicantID"
1432 End If
1433
1434 If DBUG = True Then
1435 'Response.Write(SQL & "<p>[OrderByStatus=" & OrderByStatus & " & OutputReport=" & OutputReport & "]")'
1436 End If
1437
1438 Set rs = Server.CreateObject("ADODB.Recordset")
1439 rs.Open SQL,Conn,0,1
1440
1441 ShowHeader = True
1442 vInt = 0
1443 If OutputReport = True Then
1444 AsciiFile = "d:\www\texasnotary\live\report.csv"
1445 Set fs = Server.CreateObject("Scripting.FileSystemObject")
1446 Set a = fs.CreateTextFile(AsciiFile)
1447 End If
1448 While Not rs.EOF
1449 If ShowHeader = True Then
1450 If OutputReport = True Then a.WriteLine("Last Name, First Name, Middle Name, Name Suffix")
1451 %>
1452 <script type="text/javascript" language="javascript">
1453 <!--
1454 function checkBoxes() {
1455 var Box;
1456 var form = document.forms["apps"];
1457 for (xx=0; xx < form.elements.length; xx++) {
1458 if (form.elements[xx].type == 'checkbox') {
1459 Box = form.elements[xx];
1460 if (Box.name.indexOf("NotaryApplicantID") > -1) {
1461 if (Box.checked == true) {
1462 Box.checked = false;
1463 }
1464 else {
1465 Box.checked = true;
1466 }
1467 }
1468 }
1469 }
1470 updateSuretyNumbers();
1471 }
1472
1473 function updateSuretyNumbers() {
1474 var form = document.forms["apps"];
1475 if ((form.adminAction.options[form.adminAction.selectedIndex].value == "approve") || (form.adminAction.options[form.adminAction.selectedIndex].value == "message")) {
1476 // UPDATE THE TABLE TO DISPLAY SURETY NUMBERS FOR CHECKED ITEMS
1477 var Box;
1478 var BoxArray = "";
1479 var totalNumbers = 0;
1480 var ID;
1481 var TGT
1482 for (xx=0; xx < form.elements.length; xx++) {
1483 if (form.elements[xx].type == 'checkbox') {
1484 Box = form.elements[xx];
1485 if (Box.name.indexOf("NotaryApplicantID") > -1) {
1486 if (Box.checked == true) {
1487 BoxArray = BoxArray + Box.name + "|";
1488 totalNumbers = parseInt(totalNumbers) + 1;
1489 }
1490 else {
1491 ID = Box.name.replace("NotaryApplicantID","");
1492 TGT = "suretyNumber" + ID;
1493 document.getElementById(TGT).innerHTML = "--";
1494 TGT = eval("form.suretyField" + ID);
1495 TGT.value = "";
1496 }
1497 }
1498 }
1499 }
1500 if (totalNumbers > 0) {
1501 form.BoxArray.value = BoxArray;
1502 //alert("totalNumbers=" + totalNumbers);
1503 if (form.adminAction.options[form.adminAction.selectedIndex].value == "approve") {
1504 var parameters = "totalNumbers=" + totalNumbers;
1505 var randomizer = new Date();
1506 var url = "https://secure.usnotaries.net/tn/admin/xml.suretyNumbers.asp?r=" + randomizer;
1507 if (window.XMLHttpRequest) {
1508 req = new XMLHttpRequest();
1509 }
1510 else if (window.ActiveXObject) {
1511 req = new ActiveXObject("Microsoft.XMLHTTP");
1512 }
1513 if (req) {
1514 req.onreadystatechange = processSuretyNumbers;
1515 req.open("POST", url, true);
1516 req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
1517 req.setRequestHeader("Content-length", parameters.length);
1518 req.send(parameters);
1519 }
1520 }
1521 }
1522 }
1523 }
1524
1525 function processSuretyNumbers() {
1526 if (req.readyState == 4) {
1527 if (req.status == 200) {
1528 var form = document.forms["apps"];
1529 var BoxArray = form.BoxArray.value;
1530 var Box;
1531 var ID;
1532 var TGT;
1533 var SuretyNumbers = req.responseText;
1534 // SuretyNumbers = | DELIMITED LIST OF NUMBERS
1535 // BoxArray = | DELIMITED LIST OF CHECKBOX NAMES
1536 var SNArray = SuretyNumbers.split("|");
1537 var BXArray = BoxArray.split("|");
1538 for (var i=0;i<=SNArray.length;i++) {
1539 if ((isNaN(SNArray[i]) == false) && (SNArray[i] != "")) {
1540 ID = BXArray[i].replace("NotaryApplicantID","")
1541 TGT = "suretyNumber" + ID;
1542 document.getElementById(TGT).innerHTML = SNArray[i];
1543 TGT = eval("form.suretyField" + ID);
1544 TGT.value = SNArray[i];
1545 }
1546 }
1547 }
1548 }
1549 }
1550 function actionChanged() {
1551 var form = document.forms["apps"];
1552 var BoxArray;
1553 var BXArray;
1554 var ID;
1555 var TGT;
1556 if (form.adminAction.options[form.adminAction.selectedIndex].value == "approve") {
1557 updateSuretyNumbers();
1558 }
1559 else {
1560 var BoxArray = form.BoxArray.value;
1561 var BXArray = BoxArray.split("|");
1562 for (var i=0;i<=BXArray.length;i++) {
1563 if ((BXArray[i] != undefined) && (BXArray[i] != "")) {
1564 ID = BXArray[i].replace("NotaryApplicantID","");
1565 TGT = "suretyNumber" + ID;
1566 document.getElementById(TGT).innerHTML = "--";
1567 TGT = eval("form.suretyField" + ID);
1568 TGT.value = "";
1569 }
1570 }
1571 }
1572 }
1573 function takeAction() {
1574 var form = document.forms["apps"];
1575 if (form.adminAction.options[form.adminAction.selectedIndex].value == "approve") {
1576 if (confirm("This will change the status of the checked applicants to approved and assign the listed surety numbers. \n\nAre you sure you want to do that?")) {
1577 form.submit();
1578 }
1579 }
1580 else if (form.adminAction.options[form.adminAction.selectedIndex].value == "cancel") {
1581 if (confirm("This will change the status of the checked applicants to deleted. \n\nAre you sure you want to do that?")) {
1582 form.submit();
1583 }
1584 }
1585 else if (form.adminAction.options[form.adminAction.selectedIndex].value == "reject") {
1586 if (confirm("This will change the status of the checked applicants to rejected. \n\nAre you sure you want to do that?")) {
1587 form.submit();
1588 }
1589 }
1590 else if (form.adminAction.options[form.adminAction.selectedIndex].value == "message") {
1591 var IDS = form.BoxArray.value;
1592 remote = window.open("","remotewin","scrollbars,width=640,height=450");
1593 remote.location.href = "message.asp?NotaryApplicantID=" + IDS;
1594 if (remote.opener == null) remote.opener = window;
1595 remote.opener.name = "opener";
1596 }
1597 else if (form.adminAction.options[form.adminAction.selectedIndex].value == "uploaded") {
1598 if (confirm("This will change the status of the checked applicants to uploaded to SOS. \n\nAre you sure you want to do that?")) {
1599 form.submit();
1600 }
1601 }
1602 else if (form.adminAction.options[form.adminAction.selectedIndex].value == "ship") {
1603 if (confirm("This will change the status of the checked applicants to shipped. \n\nAre you sure you want to do that?")) {
1604 form.submit();
1605 }
1606 }
1607 else if (form.adminAction.options[form.adminAction.selectedIndex].value == "allowMessages") {
1608 if (confirm("This will allow the checked applicants to received email notifications regarding applications. \n\nAre you sure you want to do that?")) {
1609 form.submit();
1610 }
1611 }
1612 else if (form.adminAction.options[form.adminAction.selectedIndex].value == "blockMessages") {
1613 if (confirm("This will prevent the checked applicants from receiving email notifications regarding applications. \n\nAre you sure you want to do that?")) {
1614 form.submit();
1615 }
1616 }
1617
1618 }
1619 //-->
1620 </script>
1621 <table border="0" cellpadding="0" cellspacing="0">
1622 <form name="apps" method="post" action="applications.asp">
1623 <input type="hidden" name="BoxArray" value="">
1624 <tr>
1625 <td><img width="22" height="40" src="../images/admin_left_checked.gif"></td>
1626 <td bgcolor="#006699"><select name="adminAction" onChange="actionChanged();">
1627 <option>
1628 <option value="cancel">Cancel
1629 <option value="approve">Approve
1630 <option value="reject">Rejected
1631 <option value="message">Message
1632 <option value="uploaded">Uploaded
1633 <option value="ship">Ship
1634 <option value="allowMessages">Allow Messages
1635 <option value="blockMessages">Block Messages
1636 </select></td>
1637 <td><a href="javascript:void takeAction();"><img border="0" width="82" height="40" src="../images/admin_right_checked.gif"></a></td>
1638 </tr>
1639 </table>
1640
1641 <table cellpadding=0 cellspacing=0 border=1 bordercolor="#000099" bgcolor="#ffffcc">
1642 <tr>
1643 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;" colspan="12">
1644 <%=HeaderLabel%>
1645 </td>
1646 </tr>
1647 <tr>
1648 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1649 <a href="javascript:void checkBoxes();" style="color:#fff;">X</a>
1650 </th>
1651 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1652 #
1653 </th>
1654 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1655 Surety #
1656 </th>
1657 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1658 N ID
1659 </th>
1660 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1661 Order ID
1662 </th>
1663 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1664 Date Generated
1665 </th>
1666 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1667 Notary Name
1668 </th>
1669 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1670 Applicant Status
1671 </th>
1672 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1673 Order Status
1674 </th>
1675 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1676 Uploaded to SOS
1677 </th>
1678 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1679 Form of Payment
1680 </th>
1681 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
1682
1683 </th>
1684 </tr>
1685 <%
1686 ShowHeader = False
1687
1688 If OutputReport = True Then
1689 ' CREATE PDF FILE CONTAINING NOTARY NAMES '
1690 Set Pdf = Server.CreateObject("Persits.Pdf")
1691 Set Doc1 = Pdf.CreateDocument
1692 Doc1.Title = "State Names List & Supply Orders"
1693 Doc1.Creator = "American Association of Notaries"
1694 Set Page1 = Doc1.Pages.Add
1695 ' DRAW HEADER GRAPHIC '
1696 Set Image = Doc1.OpenImage( Server.MapPath( "logo_letterhead.jpg") )
1697 Set Param = Pdf.CreateParam
1698 Param("x") = 25
1699 Param("y") = 690
1700 Param("ScaleX") = 1 / 5
1701 Param("ScaleY") = 1 / 5
1702 Page1.Canvas.DrawImage Image, Param
1703
1704
1705 Set Doc2 = Pdf.CreateDocument
1706 Doc2.Title = "State Names List & Supply Orders"
1707 Doc2.Creator = "American Association of Notaries"
1708 Set Page2 = Doc2.Pages.Add
1709 ' DRAW HEADER GRAPHIC '
1710 Set Image = Doc2.OpenImage( Server.MapPath( "logo_letterhead.jpg") )
1711 Set Param = Pdf.CreateParam
1712 Param("x") = 25
1713 Param("y") = 690
1714 Param("ScaleX") = 1 / 5
1715 Param("ScaleY") = 1 / 5
1716 Page2.Canvas.DrawImage Image, Param
1717
1718 Set Font1 = Doc1.Fonts("Helvetica-Bold")
1719 Params = "x=35" & Chr(59) & " y=675" & Chr(59) & " alignment=left" & Chr(59) & " size=11"
1720 Page1.Canvas.DrawText "DATE: " & FormatDateTime(Now,2), Params, Font1
1721
1722 Page1x = 50
1723 Page1y = 635
1724 Doc1Tracker = 1
1725 Set Font1 = Doc1.Fonts("Helvetica")
1726 Page1.Canvas.SetParams "LineWidth=0.1"
1727
1728 Set Font2 = Doc2.Fonts("Helvetica-Bold")
1729 Params = "x=35" & Chr(59) & " y=675" & Chr(59) & " alignment=left" & Chr(59) & " size=11"
1730 Page2.Canvas.DrawText "DATE: " & FormatDateTime(Now,2), Params, Font2
1731 DrawPage2Stuff
1732 Page2x = 50
1733 Page2y = 635
1734 Doc2Tracker = 1
1735 Set Font2 = Doc2.Fonts("Helvetica")
1736 Page2.Canvas.SetParams "LineWidth=0.1"
1737
1738 ItemNumber = 1
1739 PageNumber = 2
1740 End If
1741
1742 End If
1743
1744 NotaryApplicantID = rs.Fields("NotaryApplicantID")
1745 ExpireDate = rs.Fields("ExpireDate")
1746
1747 ' CHECK FOR SURETY NUMBER '
1748 SQL = "SELECT SuretyNumber FROM [SuretyNumbers] WHERE NotaryApplicantID = " & NotaryApplicantID
1749 Set rs1 = Server.CreateObject("ADODB.Recordset")
1750 rs1.Open SQL,Conn,0,1
1751
1752 SuretyNumber = "--"
1753 While Not rs1.EOF
1754 SuretyNumber = rs1.Fields("SuretyNumber")
1755 rs1.MoveNext
1756 Wend
1757 rs1.Close
1758 Set rs1 = Nothing
1759
1760 TransactionID = rs.Fields("TransactionID")
1761 TransactionStatus = rs.Fields("TransactionStatus")
1762 PaymentTypeID = rs.Fields("PaymentTypeID")
1763 OfficeEntry = rs.Fields("OfficeEntry")
1764 OptOut = rs.Fields("OptOut")
1765 OptOutIncomplete = rs.Fields("OptOutIncomplete")
1766
1767 ' CHECK FOR TRANSACTION STATUS - 7/15/2009 '
1768 If TransactionID = "" Then
1769 TransactionStatus = "--"
1770 Else
1771 Select Case TransactionStatus
1772 Case "0"
1773 TransactionStatus = "Incomplete"
1774 Case "1"
1775 TransactionStatus = "Rejected"
1776 Case "2"
1777 TransactionStatus = "Waiting for..."
1778 Case "3"
1779 TransactionStatus = "Approved"
1780 Case "4"
1781 TransactionStatus = "Processed"
1782 Case "5"
1783 TransactionStatus = "Shipped"
1784 Case "6"
1785 TransactionStatus = "Delayed"
1786 Case Else
1787 TransactionStatus = "Deleted"
1788 End Select
1789 End If
1790 Select Case PaymentTypeID
1791 Case "1"
1792 FormOfPayment = "Credit Card"
1793 Case "2"
1794 FormOfPayment = "Check or Mail"
1795 Case Else
1796 FormOfPayment = "--"
1797 End Select
1798
1799 LastName = CSV(rs.Fields("LastName"))
1800 FirstName = CSV(rs.Fields("FirstName"))
1801 MiddleName = CSV(rs.Fields("MiddleName"))
1802 NameSuffix = CSV(rs.Fields("NameSuffix"))
1803 NewRecord = LastName & "," & _
1804 FirstName & "," & _
1805 MiddleName & "," & _
1806 NameSuffix
1807 NewRecord = AddChars(NewRecord)
1808 If OutputReport = True Then
1809 a.WriteLine(NewRecord)
1810 End If
1811 vInt = vInt + 1
1812
1813 CustomerID = rs.Fields("CustomerID")
1814 ShippingAddressID = rs.Fields("ShippingAddressID")
1815 AddDate = rs.Fields("AddDate")
1816 PostDate = rs.Fields("PostDate")
1817 If IsDate(PostDate) Then
1818 ' Kal wants the time included '
1819 'PostDate = FormatDateTime(PostDate,2)'
1820 Else
1821 PostDate = "--"
1822 End If
1823 StatusName = rs.Fields("StatusName")
1824 NotaryApplicantStatusTypeID = rs.Fields("NotaryApplicantStatusTypeID")
1825
1826 If CINT(NotaryApplicantStatusTypeID) = 3 AND CSTR(TransactionStatus) = "--" Then
1827 StatusName = "Received"
1828 ElseIf CINT(NotaryApplicantStatusTypeID) = 3 AND CSTR(TransactionStatus) = "Incomplete" Then
1829 StatusName = "Printed"
1830 'ElseIf CINT(NotaryApplicantStatusTypeID) = 3 AND CSTR(TransactionStatus) = "Deleted" Then'
1831 ' 8/3/2009 - Now using OfficeEntry flag in the database '
1832 ElseIf CINT(NotaryApplicantStatusTypeID) = 3 AND OfficeEntry = True Then
1833 StatusName = "Office Entry"
1834 TransactionStatus = "--"
1835 End If
1836
1837 NotaryName = FirstName
1838 If MiddleName <> "" Then NotaryName = NotaryName & " " & MiddleName '<
1839 NotaryName = NotaryName & " " & LastName
1840 If NameSuffix <> "" Then NotaryName = NotaryName & ", " & NameSuffix '<
1841 NotaryName = AddChars(NotaryName)
1842
1843 ' PDF STUFF '
1844 If OutputReport = True Then
1845 If CINT(Doc1Tracker) = 2 Then
1846 Params = "x=325" & Chr(59) & " y=675" & Chr(59) & " alignment=left" & Chr(59) & " size=11"
1847 Page1.Canvas.DrawText "DATE UPLOADED: " & PostDate, Params, Font1
1848 ElseIf CINT(Doc1Tracker) = 31 Then
1849 ' MOVE TO 2ND COLUMN '
1850 Page1x = 305
1851 Page1y = 635
1852 ElseIf CINT(Doc1Tracker) = 61 Then
1853 Set Page1 = Doc1.Pages.Add
1854
1855 ' DRAW HEADER GRAPHIC '
1856 Set Image = Doc1.OpenImage( Server.MapPath( "logo_letterhead.jpg") )
1857 Set Param = Pdf.CreateParam
1858 Param("x") = 25
1859 Param("y") = 690
1860 Param("ScaleX") = 1 / 5
1861 Param("ScaleY") = 1 / 5
1862 Page1.Canvas.DrawImage Image, Param
1863
1864 Set Font1 = Doc1.Fonts("Helvetica-Bold")
1865 Params = "x=35" & Chr(59) & " y=675" & Chr(59) & " alignment=left" & Chr(59) & " size=11"
1866 Page1.Canvas.DrawText "DATE: " & FormatDateTime(Now,2), Params, Font1
1867 Set Font1 = Doc1.Fonts("Helvetica")
1868
1869 Doc1Tracker = 1
1870 Page1x = 50
1871 Page1y = 635
1872 End If
1873
1874 If CINT(Doc2Tracker) = 31 Then
1875 Doc2Tracker = 1
1876
1877 Set Page2 = Doc2.Pages.Add
1878 Page2x = 50
1879 Page2y = 635
1880
1881 ' DRAW HEADER GRAPHIC '
1882 Set Image = Doc2.OpenImage( Server.MapPath( "logo_letterhead.jpg") )
1883 Set Param = Pdf.CreateParam
1884 Param("x") = 25
1885 Param("y") = 690
1886 Param("ScaleX") = 1 / 5
1887 Param("ScaleY") = 1 / 5
1888 Page2.Canvas.DrawImage Image, Param
1889
1890 Set Font2 = Doc2.Fonts("Helvetica-Bold")
1891 Params = "x=35" & Chr(59) & " y=675" & Chr(59) & " alignment=left" & Chr(59) & " size=11"
1892 Page2.Canvas.DrawText "DATE: " & FormatDateTime(Now,2) & " (Page " & PageNumber & ")", Params, Font2
1893 Set Font2 = Doc2.Fonts("Helvetica")
1894 PageNumber = PageNumber + 1
1895
1896 DrawPage2Stuff
1897 End If
1898
1899 Params = "x=" & Page2x-20 & Chr(59) & " y=" & Page2y & Chr(59) & " alignment=left" & Chr(59) & " size=9"
1900 Page2.Canvas.DrawText ItemNumber & ".", Params, Font2
1901 Params = "x=" & Page2x & Chr(59) & " y=" & Page2y & Chr(59) & " alignment=left" & Chr(59) & " size=9"
1902 Page2.Canvas.DrawText NotaryName, Params, Font2
1903 Params = "x=525" & Chr(59) & " y=" & Page2y & Chr(59) & " alignment=left" & Chr(59) & " size=9"
1904 End If
1905
1906 If IsDate(ExpireDate) Then
1907 ExpireDate = FormatDateTime(ExpireDate,2)
1908 Else
1909 ExpireDate = "-N.A.-"
1910 End If
1911
1912 If OutputReport = True Then
1913 Page2.Canvas.DrawText ExpireDate, Params, Font2
1914
1915 With Page2.Canvas
1916 .MoveTo 25, Page2y-20
1917 .LineTo 590, Page2y-20
1918 .Stroke
1919 End With
1920
1921 Params = "x=" & Page1x-20 & Chr(59) & " y=" & Page1y & Chr(59) & " alignment=left" & Chr(59) & " size=9"
1922 Page1.Canvas.DrawText ItemNumber & ".", Params, Font1
1923 Params = "x=" & Page1x & Chr(59) & " y=" & Page1y & Chr(59) & " alignment=left" & Chr(59) & " size=9"
1924 Page1.Canvas.DrawText NotaryName, Params, Font1
1925
1926 Page1y = Page1y - 20
1927 Page2y = Page2y - 20
1928
1929 ItemNumber = ItemNumber + 1
1930 Doc1Tracker = Doc1Tracker + 1
1931 Doc2Tracker = Doc2Tracker + 1
1932 End If
1933
1934 If BGCOLOR = "#cc9" Then
1935 BGCOLOR = "#996"
1936 Else
1937 BGCOLOR = "#cc9"
1938 End If
1939
1940 If TransactionID = "0" Then
1941 TransactionID = "--"
1942 ElseIf IsNumeric(TransactionID) Then
1943
1944 ' 10/28/2009 - QUERY TO MAKE SURE THIS APPLICATION REFERS TO A TRANSACTION THAT CONTAINS A PACKAGE OR '
1945 SQL = "SELECT TransactionItemID FROM [TransactionDetails] WHERE TransactionID = " & TransactionID & " AND (StateProductID = 1333 OR StateProductID = 1331)"
1946 Set rs1 = Server.CreateObject("ADODB.Recordset")
1947 rs1.Open SQL,Conn,0,1
1948
1949 TransactionItemID = 0
1950 While Not rs1.EOF
1951 TransactionItemID = rs1.Fields("TransactionItemID")
1952 rs1.MoveNext
1953 Wend
1954 rs1.Close
1955 Set rs1 = Nothing
1956
1957 If TransactionItemID = 0 Then
1958 BGCOLOR = "#fc0"
1959 End If
1960
1961
1962 TransactionID = "<a href=""https://secure.usnotaries.net/admin/orders.tn.asp?TransactionID=" & TransactionID & """ target=""_blank"">" & TransactionID & "</a>"
1963
1964 End If
1965 %>
1966 <tr>
1967 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
1968 <input type="checkbox" name="NotaryApplicantID<%=NotaryApplicantID%>" onClick="updateSuretyNumbers();">
1969 <input type="hidden" name="suretyField<%=NotaryApplicantID%>" value="">
1970 </td>
1971 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
1972 <%=vInt%>
1973 </td>
1974 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
1975 <div id="suretyNumber<%=NotaryApplicantID%>"><%=SuretyNumber%></div>
1976 </td>
1977 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
1978 <% 'If IsNull(ShippingAddressID) = True Then' %>
1979 <% If CustomerID = "0" Then %>
1980 <%=NotaryApplicantID%>
1981 <% Else %>
1982 <A HREF="JavaScript:void editCustomer('<%=CustomerID%>','<%=ShippingAddressID%>');"><%=NotaryApplicantID%></a>
1983 <% End If %>
1984 </td>
1985 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
1986 <%=TransactionID%>
1987 </td>
1988 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
1989 <%
1990 If IsDate(AddDate) Then
1991 DisplayDate AddDate,2
1992 Response.Write(" ")
1993 DisplayDate AddDate,4
1994 Else
1995 Response.Write(" ")
1996 End If
1997 %>
1998 </td>
1999 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2000 <a href="app.entry.asp?NotaryApplicantID=<%=NotaryApplicantID%>"><%=NotaryName%></a>
2001 </td>
2002 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2003 <%=StatusName%>
2004 </td>
2005 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2006 <%=TransactionStatus%>
2007 </td>
2008 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2009 <%=PostDate%>
2010 </td>
2011 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2012 <%=FormOfPayment%>
2013 </td>
2014 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2015 <% If OptOutIncomplete = True Then %>
2016 <img width="24" height="19" alt="Unsubscribed" src="../images/icon_block_email.gif">
2017 <% Else %>
2018 <img width="24" height="19" alt="Subscribed" src="../images/icon_allow_email.gif">
2019 <% End If %>
2020 </td>
2021 </tr>
2022 <%
2023 rs.MoveNext
2024 Wend
2025 rs.Close
2026 Set rs = Nothing
2027 Conn.Close
2028 Set Conn = Nothing
2029
2030 If OutputReport = True Then
2031 a.Close
2032 Set a = Nothing
2033 Set fs = Nothing
2034 End If
2035
2036 If ShowHeader = True Then
2037
2038 Response.Cookies("AAN")("ERRMSG") = "No records found matching that criteria."
2039 Response.Cookies("AAN").domain = CookieDomain
2040 Response.Cookies("AAN").expires = Date + 2
2041 'Response.Redirect("applications.asp")'
2042 Else
2043 If OutputReport = True Then
2044 ' BUILD PATH TO PDF REPORT '
2045 ApplicationPath = "report.state.pdf"
2046 ' BROWSER PATH FOR REDIRECT '
2047 URLPath = "https://" & SSLPath & "/tn/admin/report.state.pdf"
2048 ' FILE SYSTEM PATH FOR DELETING/WRITING PDF '
2049 ApplicationPath = Server.MapPath(ApplicationPath)
2050 ' DELETE EXISTING APP '
2051 Set fs = Server.CreateObject("Scripting.FileSystemObject")
2052 If fs.FileExists(ApplicationPath) Then
2053 fs.DeleteFile(ApplicationPath)
2054 End If
2055 set fs = Nothing
2056
2057 ' SAVE PDF '
2058 FileName = Doc1.Save(Server.MapPath("report.state.pdf"))
2059 Doc1.close
2060
2061 ' BUILD PATH TO PDF REPORT '
2062 ApplicationPath = "report.supplies.pdf"
2063 ' BROWSER PATH FOR REDIRECT '
2064 URL2Path = "https://" & SSLPath & "/tn/admin/report.supplies.pdf"
2065 ' FILE SYSTEM PATH FOR DELETING/WRITING PDF '
2066 ApplicationPath = Server.MapPath(ApplicationPath)
2067 ' DELETE EXISTING APP '
2068 Set fs = Server.CreateObject("Scripting.FileSystemObject")
2069 If fs.FileExists(ApplicationPath) Then
2070 fs.DeleteFile(ApplicationPath)
2071 End If
2072 set fs = Nothing
2073
2074 ' SAVE PDF '
2075 File2Name = Doc2.Save(Server.MapPath("report.supplies.pdf"))
2076 Doc2.close
2077 End If
2078 %>
2079
2080 </form>
2081 </table>
2082
2083 <% If OutputReport = True Then %>
2084 <div style="color:red;font-size:x-small;font-weight:bold;">
2085 There are <%=vInt%> applicants included in this query. <a href="http://www.texasnotary.com/report.csv">Right-click here</a> and select
2086 <br>
2087 "Save target as..." to save a report to your hard drive.
2088 Download lists of names for <a href="<%=URLPath%>" target="_blank">STATE</a> and <a href="<%=URL2Path%>" target="_blank">SUPPLIES</a>.
2089 </div>
2090 <% End If %>
2091 <p>
2092
2093 <%
2094 End If
2095
2096 End If
2097
2098 Sub DrawPage2Stuff
2099 Page2.Canvas.SetParams "LineWidth=0.1"
2100 With Page2.Canvas
2101 ' TOP LINE '
2102 .MoveTo 25, 655
2103 .LineTo 590, 655
2104 .Stroke
2105 ' BELOW LABELS '
2106 .MoveTo 25, 640
2107 .LineTo 590, 640
2108 .Stroke
2109 ' LEFT MARGIN '
2110 .MoveTo 25, 655
2111 .LineTo 25, 35
2112 .Stroke
2113 ' RIGHT MARGIN '
2114 .MoveTo 590, 655
2115 .LineTo 590, 35
2116 .Stroke
2117 ' BOTTOM MARGIN '
2118 .MoveTo 25, 35
2119 .LineTo 590, 35
2120 .Stroke
2121 ' NAME MARGIN '
2122 .MoveTo 180, 655
2123 .LineTo 180, 35
2124 .Stroke
2125 ' RECT MARGIN '
2126 .MoveTo 245, 655
2127 .LineTo 245, 35
2128 .Stroke
2129 ' RND MARGIN '
2130 .MoveTo 310, 655
2131 .LineTo 310, 35
2132 .Stroke
2133 ' R RND MARGIN '
2134 .MoveTo 373, 655
2135 .LineTo 373, 35
2136 .Stroke
2137 ' R RECT MARGIN '
2138 .MoveTo 438, 655
2139 .LineTo 438, 35
2140 .Stroke
2141 ' ADDL MARGIN '
2142 .MoveTo 515, 655
2143 .LineTo 515, 35
2144 .Stroke
2145 End With
2146 Set Font2 = Doc2.Fonts("Helvetica-Bold")
2147 Params = "x=45" & Chr(59) & " y=652" & Chr(59) & " alignment=left" & Chr(59) & " size=9"
2148 Page2.Canvas.DrawText "Name ", Params, Font2
2149 Params = "x=187" & Chr(59) & " y=652" & Chr(59) & " alignment=left" & Chr(59) & " size=9"
2150 Page2.Canvas.DrawText "Self-ink rect.", Params, Font2
2151 Params = "x=252" & Chr(59) & " y=652" & Chr(59) & " alignment=left" & Chr(59) & " size=9"
2152 Page2.Canvas.DrawText "Self-ink rnd.", Params, Font2
2153 Params = "x=318" & Chr(59) & " y=652" & Chr(59) & " alignment=left" & Chr(59) & " size=9"
2154 Page2.Canvas.DrawText "Rubber rnd.", Params, Font2
2155 Params = "x=380" & Chr(59) & " y=652" & Chr(59) & " alignment=left" & Chr(59) & " size=9"
2156 Page2.Canvas.DrawText "Rubber rect.", Params, Font2
2157 Params = "x=448" & Chr(59) & " y=652" & Chr(59) & " alignment=left" & Chr(59) & " size=9"
2158 Page2.Canvas.DrawText "Add'l supplies", Params, Font2
2159 Params = "x=525" & Chr(59) & " y=652" & Chr(59) & " alignment=left" & Chr(59) & " size=9"
2160 Page2.Canvas.DrawText "Expiration", Params, Font2
2161 Set Font2 = Doc2.Fonts("Helvetica")
2162 End Sub
2163
2164ElseIf Request.Form("SuretyStartDate") <> "" OR Request.Form("PaidReference") <> "" Then '<
2165
2166 ' ADMIN IS QUERYING FOR BOND NUMBER STATUS REPORT '
2167 ResultLimit = 2500
2168 ' 9/24/2009 ALLOW ADMIN TO GENERATE REPORT ONLY '
2169 ReportOnly = Request.Form("ReportOnly")
2170 If ReportOnly = "on" Then
2171 ReportOnly = True
2172 Else
2173 ReportOnly = False
2174 End If
2175
2176 SuretyStartDate = Request.Form("SuretyStartDate")
2177 SuretyEndDate = Request.Form("SuretyEndDate")
2178 Paid = Request.Form("Paid")
2179 UnPaid = Request.Form("UnPaid")
2180 If Paid = "on" Then
2181 Paid = True
2182 Else
2183 Paid = False
2184 End If
2185 If UnPaid = "on" Then
2186 UnPaid = True
2187 Else
2188 UnPaid = False
2189 End If
2190 PaidReference = Request.Form("PaidReference")
2191
2192 If ReportOnly = True Then
2193 SQL = "SELECT "
2194 Else
2195 SQL = "SELECT TOP " & ResultLimit
2196 End If
2197 SQL = SQL & " NotaryApplicants.NotaryApplicantID, " & _
2198 " NotaryApplicants.FirstName, " & _
2199 " NotaryApplicants.MiddleName, " & _
2200 " NotaryApplicants.LastName, " & _
2201 " NotaryApplicants.NameSuffix, " & _
2202 " NotaryApplicants.PostDate AS SOSPostDate, " & _
2203 " NotaryAppNumbers.AANNumber, " & _
2204 " SuretyNumbers.SuretyNumber, " & _
2205 " SuretyNumbers.PostDate AS CNAPostDate, " & _
2206 " SuretyNumbers.PaidDate, " & _
2207 " SuretyNumbers.Paid, " & _
2208 " SuretyNumbers.PaidReference " & _
2209 " FROM ((NotaryApplicants "
2210
2211 If IsDate(SuretyStartDate) Then
2212
2213 SuretyStartDate = FormatDateTime(SuretyStartDate,2) & " 12:00:01 AM"
2214
2215 If IsDate(SuretyEndDate) Then
2216 ' Span of dates submitted '
2217 SuretyEndDate = FormatDateTime(SuretyEndDate,2) & " 11:59:59 PM"
2218 HeaderLabel = "Applications submitted to S.O.S. between " & FormatDateTime(SuretyStartDate,2) & " AND " & FormatDateTime(SuretyEndDate,2)
2219 Else
2220 ' Single date submitted '
2221 SuretyEndDate = FormatDateTime(SuretyStartDate,2) & " 11:59:59 PM"
2222 HeaderLabel = "Applications submitted to S.O.S. on " & FormatDateTime(SuretyStartDate,2)
2223 End If
2224
2225 SQL = SQL & " LEFT JOIN NotaryAppNumbers ON NotaryApplicants.NotaryApplicantID = NotaryAppNumbers.NotaryApplicantID) " & _
2226 " LEFT JOIN SuretyNumbers ON NotaryApplicants.NotaryApplicantID = SuretyNumbers.NotaryApplicantID) " & _
2227 " LEFT JOIN NotaryApplicantStatusType ON NotaryApplicants.NotaryApplicantStatusTypeID = NotaryApplicantStatusType.NotaryApplicantStatusTypeID " & _
2228 " WHERE (((NotaryApplicants.PostDate) > #" & SuretyStartDate & "#) AND ((NotaryApplicants.PostDate) < #" & SuretyEndDate & "#) "
2229
2230 If Paid = True AND UnPaid = True AND PaidReference = "" Then
2231 ' NO NEED FOR ADDITIONAL WHERE CLAUSE '
2232 SQL = SQL & ")"
2233 ElseIf Paid = True AND UnPaid = True AND PaidReference <> "" Then '<
2234 SQL = SQL & " AND ((SuretyNumbers.PaidReference) = '" & PaidReference & "'))"
2235 HeaderLabel = HeaderLabel & " that have a reference of """ & PaidReference & """ "
2236 Else
2237 SQL = SQL & " AND ((SuretyNumbers.Paid) = " & Paid & "))"
2238 If PaidReference <> "" Then '<
2239 SQL = SQL & " AND ((SuretyNumbers.PaidReference) = '" & PaidReference & "')"
2240 HeaderLabel = HeaderLabel & " that have a reference of """ & PaidReference & """ "
2241 End If
2242 If Paid = True Then
2243 HeaderLabel = HeaderLabel & " and are paid."
2244 Else
2245 HeaderLabel = HeaderLabel & " and are NOT paid."
2246 End If
2247 End If
2248 HeaderLabel = HeaderLabel & PaidLabel
2249 Else
2250 ' 8/11/2009 - If surety dates are not provided then set them to past and future dates '
2251 ' This will allow Kal to query on PaidReference '
2252 SQL = SQL & " LEFT JOIN NotaryAppNumbers ON NotaryApplicants.NotaryApplicantID = NotaryAppNumbers.NotaryApplicantID) " & _
2253 " LEFT JOIN SuretyNumbers ON NotaryApplicants.NotaryApplicantID = SuretyNumbers.NotaryApplicantID) " & _
2254 " LEFT JOIN NotaryApplicantStatusType ON NotaryApplicants.NotaryApplicantStatusTypeID = NotaryApplicantStatusType.NotaryApplicantStatusTypeID "
2255
2256 HeaderLabel = "Applications with reference """ & PaidReference & """ "
2257 If Paid = True AND UnPaid = True AND PaidReference = "" Then
2258 ' NO NEED FOR ADDITIONAL WHERE CLAUSE '
2259 SQL = SQL & " WHERE (((SuretyNumbers.PaidReference)='" & PaidReference & "'))"
2260 Else
2261 SQL = SQL & " WHERE (((SuretyNumbers.Paid)=" & Paid & ") AND ((SuretyNumbers.PaidReference)='" & PaidReference & "'))"
2262 If Paid = True Then
2263 HeaderLabel = HeaderLabel & " and are paid."
2264 Else
2265 HeaderLabel = HeaderLabel & " and are NOT paid."
2266 End If
2267 End If
2268 HeaderLabel = HeaderLabel & PaidLabel
2269 End If
2270 SQL = SQL & " ORDER BY SuretyNumbers.SuretyNumber"
2271
2272 AsciiFile = "d:\www\texasnotary\live\surety.report.csv"
2273 Set fs = Server.CreateObject("Scripting.FileSystemObject")
2274 Set a = fs.CreateTextFile(AsciiFile)
2275 a.WriteLine("ID #, AAN #, Surety #, First Name, Middle Name, LastName, Suffix, Posted to S.O.S., Transferred to CNA, Paid, Reference")
2276
2277 %>
2278 <table cellpadding=0 cellspacing=0 border=1 bordercolor="#000099" bgcolor="#ffffcc">
2279 <tr>
2280 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;padding:10px;" colspan="13">
2281 <%=HeaderLabel%>
2282 </td>
2283 </tr>
2284 <%
2285
2286 If ReportOnly = False Then
2287 %>
2288 <tr><form name="bonds" method="post" action="applications.asp">
2289 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2290 #
2291 </th>
2292 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2293 ID #
2294 </th>
2295 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2296 AAN #
2297 </th>
2298 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2299 Surety #
2300 </th>
2301 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2302 First
2303 </th>
2304 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2305 Middle
2306 </th>
2307 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2308 Last
2309 </th>
2310 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2311 Suffix
2312 </th>
2313 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2314 Posted to S.O.S.
2315 </th>
2316 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2317 Transferred to CNA
2318 </th>
2319 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2320 Paid
2321 </th>
2322 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2323 Paid date
2324 </th>
2325 <th class="boldtxt" style="padding:3px 5px 3px 5px;background-color:#000;color:white;">
2326 Reference
2327 </th>
2328 </tr>
2329 <%
2330 End If
2331 %><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
2332 Set rs = Server.CreateObject("ADODB.Recordset")
2333 rs.Open SQL,Conn,0,1
2334
2335 vInt = 0
2336 ShowPaidReference = False
2337 While Not rs.EOF
2338 vInt = vInt + 1
2339 If BGCOLOR = "#cc9" Then
2340 BGCOLOR = "#996"
2341 Else
2342 BGCOLOR = "#cc9"
2343 End If
2344
2345 NotaryApplicantID = rs.Fields("NotaryApplicantID")
2346 LastName = rs.Fields("LastName")
2347 FirstName = rs.Fields("FirstName")
2348 MiddleName = rs.Fields("MiddleName")
2349 NameSuffix = rs.Fields("NameSuffix")
2350 SOSPostDate = rs.Fields("SOSPostDate")
2351 AANNumber = rs.Fields("AANNumber")
2352 SuretyNumber = rs.Fields("SuretyNumber")
2353 CNAPostDate = rs.Fields("CNAPostDate")
2354 PaidDate = rs.Fields("PaidDate")
2355 Paid = rs.Fields("Paid")
2356 PaidReference = rs.Fields("PaidReference")
2357
2358 If ReportOnly = False Then
2359 %>
2360 <tr>
2361 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2362 <%=vInt%>
2363 </td>
2364 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2365 <%=NotaryApplicantID%>
2366 </td>
2367 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2368 <%=AANNumber%>
2369 </td>
2370 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2371 <%=SuretyNumber%>
2372 </td>
2373 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2374 <%=FirstName%>
2375 </td>
2376 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2377 <%
2378 If MiddleName = "" OR IsNull(MiddleName) Then
2379 Response.Write(" ")
2380 Else
2381 Response.Write(MiddleName)
2382 End If
2383 %>
2384 </td>
2385 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2386 <%=LastName%>
2387 </td>
2388 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2389 <%
2390 If NameSuffix = "" OR IsNull(NameSuffix) Then
2391 Response.Write(" ")
2392 Else
2393 Response.Write(NameSuffix)
2394 End If
2395 %>
2396 </td>
2397 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2398 <%
2399 If IsDate(SOSPostDate) Then
2400 DisplayDate SOSPostDate,2
2401 Response.Write(" ")
2402 DisplayDate SOSPostDate,4
2403 Else
2404 Response.Write(" ")
2405 End If
2406 %>
2407 </td>
2408 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2409 <%
2410 If IsDate(CNAPostDate) Then
2411 DisplayDate CNAPostDate,2
2412 Response.Write(" ")
2413 DisplayDate CNAPostDate,4
2414 Else
2415 Response.Write(" ")
2416 End If
2417 %>
2418 </td>
2419 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2420 <%
2421 If Paid = True Then
2422 Response.Write("X")
2423 Else
2424 Response.Write("<input type=""checkbox"" name=""FlagIDPaid"" value=""" & SuretyNumber & """>")
2425 ShowPaidReference = True
2426 End If
2427 %>
2428 </td>
2429 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2430 <%
2431 If IsDate(PaidDate) Then
2432 PaidDate = FormatDateTime(PaidDate,2)
2433 Else
2434 PaidDate = " "
2435 End If
2436 %>
2437 <%=PaidDate%>
2438 </td>
2439 <td class="boldtxt" style="background-color:<%=BGCOLOR%>;padding:3px 5px 3px 5px;">
2440 <%
2441 If PaidReference = "" OR IsNull(PaidReference) Then
2442 Response.Write(" ")
2443 Else
2444 Response.Write(PaidReference)
2445 End If
2446 %>
2447 </td>
2448 </tr>
2449 <%
2450 End If
2451
2452 NewRecord = CSV(NotaryApplicantID) & "," & _
2453 CSV(AANNumber) & "," & _
2454 CSV(SuretyNumber) & "," & _
2455 CSV(FirstName) & "," & _
2456 CSV(MiddleName) & "," & _
2457 CSV(LastName) & "," & _
2458 CSV(NameSuffix) & ","
2459 If IsDate(SOSPostDate) Then
2460 NewRecord = NewRecord & CSV(FormatDateTime(SOSPostDate,2))
2461 End If
2462 NewRecord = NewRecord & ","
2463 If IsDate(CNAPostDate) Then
2464 NewRecord = NewRecord & CSV(FormatDateTime(CNAPostDate,2))
2465 End If
2466 NewRecord = NewRecord & ","
2467 If Paid = True Then
2468 NewRecord = NewRecord & "X"
2469 End If
2470 NewRecord = NewRecord & "," & CSV(PaidReference)
2471 a.WriteLine(NewRecord)
2472 If CINT(vInt) = CINT(ResultLimit) AND ReportOnly = False Then
2473 %>
2474 <tr>
2475 <td colspan="13" bgcolor="#cc0000">
2476 <div style="color:white;font-weight:bold;font-size:18px;padding:5px;">
2477 Please note: this report is limited to <%=ResultLimit%> results.
2478 </div>
2479 </td>
2480 </tr>
2481 <%
2482 End If
2483 rs.MoveNext
2484 Wend
2485 rs.Close
2486 Set rs = Nothing
2487 Conn.Close
2488 Set Conn = Nothing
2489 a.Close
2490 Set a = Nothing
2491 Set fs = Nothing
2492
2493 If ShowPaidReference = True Then
2494 %>
2495 <tr>
2496 <td style="background-color:#fff;color:#069;font-size:14px;font-weight:bold;padding:10px;" colspan="13">
2497 Mark checked records as paid with the reference of
2498 <input type="text" name="PaidReference" value="" size="20" maxlength="128">
2499 <input type="button" value="Update Status" onClick="flagAsPaid();">
2500 </td>
2501 </tr>
2502 <% End If %>
2503 <tr>
2504 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;padding:10px;" colspan="13">
2505 Report generated with <%=vInt%> records. <a href="https://secure.texasnotary.com/surety.report.csv" style="color:white;">Right-click here</a> to save report to your computer.
2506 </td>
2507 </tr></form>
2508 </table>
2509<% End If %>
2510
2511
2512 <P>
2513
2514
2515 <TABLE CELLPADDING=10 CELLSPACING=0 BORDER=1 BORDERCOLOR="#000099" BGCOLOR="#ffffcc">
2516 <tr>
2517 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;">
2518 Applications <span style="color:#fff;">(<a href="app.entry.asp" style="color:#fff;">ADD NEW</a>)</span>
2519 </td>
2520 </tr>
2521 <form name="query" action="applications.asp" method="post">
2522
2523 <tr>
2524 <td>
2525 <table>
2526 <tr valign="top">
2527 <td class="boldtxt">
2528
2529 Specific date <input type="text" name="PostDate" value="" size="12">
2530 application #
2531 <input type="text" name="NotaryApplicantID" value="<%=Request.Form("NotaryApplicantID")%>" size="12">
2532 last name
2533 <input type="text" name="LastName" value="<%=Request.Form("LastName")%>" size="12">
2534 <br>
2535 Or look up applications between
2536 <input type="text" name="StartDate" value="" size="12">
2537 and
2538 <input type="text" name="EndDate" value="" size="12">
2539 that were
2540 <select name="DateCriteria">
2541 <option value="PostDate">posted to SOS
2542 <option value="AddDate">added to system
2543 </select>
2544
2545 <br>
2546 Include only
2547 <input type="checkbox" name="OnlyErrors">errors
2548 <input type="checkbox" name="IncludeApproved">approved
2549 <input type="checkbox" name="IncludeRenewals">renewal
2550 <input type="checkbox" name="IncludeNew">new applicants
2551
2552
2553
2554 <input type="checkbox" name="OrderByStatus">Sort by order status
2555
2556
2557
2558 <input type="checkbox" name="OutputReport">Output PDF Reports
2559 </td>
2560 <td>
2561 <input type="button" value="View Results" onClick="checkQuery();">
2562 </td>
2563 </tr>
2564 </table>
2565 </td>
2566
2567 </tr>
2568 </form>
2569 <form name="upload" action="upload.applications.asp" method="post" enctype="multipart/form-data">
2570 <TR VALIGN=TOP>
2571 <TD CLASS=boldtxt ALIGN=CENTER>
2572
2573 Upload applications:
2574
2575 <br>
2576
2577 <script type="text/javascript" language="javascript">
2578 <!--
2579 var lablname;
2580 var filename;
2581 function displayName(i) {
2582 var form = document.forms["upload"];
2583
2584 var field = "App";
2585 if (i.length == 1) {
2586 field = field + "0";
2587 }
2588 field = field + i;
2589 var filepath = eval("form." + field + ".value");
2590 filename = "";
2591 lablname = "filename" + i;
2592 var startFile = false;
2593 var numerical = "0123456789";
2594 for (var j=0;j<=filepath.length;j++) {
2595 if (startFile == true) {
2596 if (numerical.indexOf(filepath.charAt(j)) > -1) {
2597 filename = filename + filepath.charAt(j);
2598 }
2599 else if (startExtension == true) {
2600 extension = extension + filepath.charAt(j);
2601 }
2602 }
2603 if (filepath.charAt(j) == "\\") {
2604 filename = "";
2605 startFile = true;
2606 }
2607 else if (filepath.charAt(j) == ".") {
2608 // CHECK EXTENSION FOR JPG
2609 var extension = ""
2610 var startExtension = true;
2611 }
2612 }
2613 if (extension.toLowerCase() == "jpg") {
2614 displayApplicant();
2615 }
2616 else {
2617 document.getElementById(lablname).innerHTML = "<span style='color:red;'>Invalid file type.</span>";
2618 }
2619 document.getElementById(lablname).style.display = "block";
2620 }
2621 function displayApplicant() {
2622 var parameters = "AANNumber=" + filename;
2623 var randomizer = new Date();
2624 var url = "https://secure.usnotaries.net/tn/admin/xml.AANNumbers.asp?r=" + randomizer;
2625 if (window.XMLHttpRequest) {
2626 req = new XMLHttpRequest();
2627 }
2628 else if (window.ActiveXObject) {
2629 req = new ActiveXObject("Microsoft.XMLHTTP");
2630 }
2631 if (req) {
2632 req.onreadystatechange = displayNotaryName;
2633 req.open("POST", url, true);
2634 req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
2635 req.setRequestHeader("Content-length", parameters.length);
2636 req.send(parameters);
2637 }
2638 }
2639 function displayNotaryName() {
2640 if (req.readyState == 4) {
2641 if (req.status == 200) {
2642 var x = req.responseText;
2643 var xArray = x.split("|");
2644 NotaryName = xArray[0];
2645 if ((xArray[1] > 3) && (xArray[1] < 7)) {
2646 NotaryName = NotaryName + " <span style='color:red;'>(WARNING: already in transit)</span>"
2647 }
2648 else if (xArray[1] == 7) {
2649 NotaryName = NotaryName + " <span style='color:red;'>(WARNING: already approved)</span>"
2650 }
2651 else if ((xArray[1] == 8) || (xArray[1] == 9)) {
2652 NotaryName = NotaryName + " (resubmit)"
2653 }
2654 document.getElementById(lablname).innerHTML = "App# " + filename + " - " + NotaryName;
2655 }
2656 }
2657 }
2658 //-->
2659 </script>
2660
2661 <table>
2662 <!--#Include Virtual="/http/includes/conn.inc.asp"-->
2663 <%
2664 SQL = "SELECT Count(SuretyNumberID) AS TotalNumbers FROM [SuretyNumbers] WHERE NotaryApplicantID = 0"
2665 Set rs = Server.CreateObject("ADODB.Recordset")
2666 rs.Open SQL,Conn,0,1
2667
2668 While Not rs.EOF
2669 TotalNumbers = rs.Fields("TotalNumbers")
2670 rs.MoveNext
2671 Wend
2672 rs.Close
2673 Set rs = Nothing
2674
2675 Conn.Close
2676 Set Conn = Nothing
2677 %>
2678 <%
2679 For vInt = 1 to 50
2680 If CDBL(TotalNumbers+1) = CDBL(vInt) Then
2681 btnDisabled = " disabled"
2682 End If
2683 FileName = "App"
2684 If Len(vInt) = 1 Then
2685 FileName = FileName & "0"
2686 End If
2687 FileName = FileName & vInt
2688 %>
2689 <tr><td class="boldtxt"><%=vInt%>.</td> <td><input onChange="displayName('<%=vInt%>')" type="file" name="<%=FileName%>" size="40" <%=btnDisabled%>></td><td><div id="filename<%=vInt%>" style="display:none;font-size:x-small;font-weight:bold;"></div></td></tr>
2690 <%
2691 Next
2692 %>
2693 </table>
2694
2695 <%
2696 If TotalNumbers = 0 Then
2697 btnDisabled = " disabled"
2698 Else
2699 btnDisabled = ""
2700 End If
2701 %>
2702
2703 Method of Payment:
2704 <select name="MethodOfPayment">
2705 <option value="LegalEase">LegalEase
2706 <option value="CreditCard">Credit Card
2707 <option value="SOSDirect">SOS Direct
2708 </select>
2709
2710 <input type="SUBMIT" value="Upload Applications" <%=btnDisabled%>>
2711
2712 </TD>
2713 </TR>
2714 </form>
2715 </TABLE>
2716
2717<%
2718Sub ConvertVariable(DataStr)
2719 ' This subroutine is sent XML strings to convert to name/value pairs '
2720 x = Trim(DataStr)
2721 If x <> "" Then '<
2722 If Instr(1,x,Chr(10),1) Then x = Replace(x,Chr(10),"")
2723 If Instr(1,x,Chr(13),1) Then x = Replace(x,Chr(13),"")
2724 y = Instr(1,x,"<",1)
2725 If y > 0 AND Instr(1,x,">",1) > 0 Then '<
2726 xName = Mid(x,y+1,Instr(1,x,">",1)-2)
2727 ' Ifthe xName contains any characters that are non alpha-numeric or not _ or - , dismiss it '
2728 ValidVar = True
2729 For vInt = 1 to Len(xName)
2730 y = asc(Ucase(Mid(xName,vInt,1)))
2731 If (y > 64 AND y < 91) OR (y > 47 AND y < 58) OR y = 95 or y = 45 Then
2732 ' we are cool '
2733 Else
2734 ' dismiss this '
2735 ValidVar = False
2736 End If
2737 Next
2738 If ValidVar = True Then
2739 y = Mid(xName,Len(xName)-1,2)
2740 If y = " /" Then
2741 ' The value of this variable is null '
2742 xName = Mid(xName,1,Len(xName)-2)
2743 x = xName & "=" & Chr(34) & Chr(34)
2744 Execute x
2745 Else
2746 StartValue = False
2747 For vInt = 1 to Len(x)
2748 y = Mid(x,vInt,1)
2749 If StartValue = True Then
2750 If y = "<" Then
2751 StartValue = False
2752 Else
2753 xValue = xValue & y
2754 End If
2755 End If
2756 If y = ">" Then StartValue = True
2757 Next
2758 x = xName & "=" & Chr(34) & xValue & Chr(34)
2759 Execute x
2760 End If
2761 End If
2762 End If
2763 End If
2764End Sub
2765
2766Function CSV(x)
2767 If x <> "" Then '<
2768 If Instr(1,x,",",1) Then
2769 x = Chr(34) & x & Chr(34)
2770 End If
2771 End If
2772 CSV = x
2773End Function
2774%>
2775<% If Request.Cookies("admin")("SecurityLevel") = "1" OR Request.Cookies("admin")("SecurityLevel") = "2" OR Request.Cookies("admin")("SecurityLevel") = "3" Then %>
2776 <%
2777 DataFile = DOSPath & "\default.data.xml"
2778 Set fs = Server.CreateObject("Scripting.FileSystemObject")
2779 Set a = fs.OpenTextFile(DataFile)
2780 While Not a.AtEndOfStream
2781 DefaultData = DefaultData & "NewLine|" & a.ReadLine
2782 Wend
2783 a.Close
2784 Set a = Nothing
2785 Set fs = Nothing
2786
2787 DataArray = Split(DefaultData,"NewLine|")
2788 For vCount = 0 to UBound(DataArray)
2789 ConvertVariable DataArray(vCount)
2790 Next
2791 %>
2792 <P>
2793
2794 <script type="text/javascript" language="javascript">
2795 <!--
2796 function validatePayment() {
2797 var form = document.forms["payment"];
2798 if (form.BusinessName.value == "") {
2799 alert("Please enter the name of the business.");
2800 form.BusinessName.focus();
2801 }
2802 else if (form.FirstName.value == "") {
2803 alert("Please enter the first name of the payee.");
2804 form.FirstName.focus();
2805 }
2806 else if (form.LastName.value == "") {
2807 alert("Please enter the last name of the payee.");
2808 form.LastName.focus();
2809 }
2810 else if (form.AddressLine1.value == "") {
2811 alert("Please enter the address of the payee.");
2812 form.AddressLine1.focus();
2813 }
2814 else if (form.City.value == "") {
2815 alert("Please enter the city of the payee.");
2816 form.City.focus();
2817 }
2818 else if (form.StateCode.value == "") {
2819 alert("Please enter the state code of the payee.");
2820 form.StateCode.focus();
2821 }
2822 else if (form.PostalCode.value == "") {
2823 alert("Please enter the zip code of the payee.");
2824 form.PostalCode.focus();
2825 }
2826 else if (form.ClientID.value == "") {
2827 alert("Please enter the SOS Direct Client ID.");
2828 form.ClientID.focus();
2829 }
2830 else if (form.SOSPassword.value == "") {
2831 alert("Please enter the SOS Direct password.");
2832 form.SOSPassword.focus();
2833 }
2834 else if (form.SOSPassword2.value == "") {
2835 alert("Please confirm the SOS Direct password.");
2836 form.SOSPassword.focus();
2837 }
2838 else if (form.SOSPassword2.value != form.SOSPassword.value) {
2839 alert("The passwords you have entered do not match.");
2840 form.SOSPassword.select();
2841 }
2842 else if (form.CardType.options[form.CardType.selectedIndex].value == "") {
2843 alert("Please select the credit card type.");
2844 form.CardType.focus();
2845 }
2846 else if (form.CardNumber.value == "") {
2847 alert("Please enter a credit card number.");
2848 form.CardNumber.focus();
2849 }
2850 else if (form.ExpireMonth.options[form.ExpireMonth.selectedIndex].value == "") {
2851 alert("Please select the month the credit card expires.");
2852 form.ExpireMonth.focus();
2853 }
2854 else if (form.ExpireYear.options[form.ExpireYear.selectedIndex].value == "") {
2855 alert("Please select the year the credit card expires.");
2856 form.ExpireYear.focus();
2857 }
2858 else form.submit();
2859 }
2860 -->
2861 </script>
2862
2863 <TABLE CELLPADDING=10 CELLSPACING=0 BORDER=1 BORDERCOLOR="#000099" BGCOLOR="#ffffcc">
2864 <tr>
2865 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;">
2866 Payment Options
2867 </td>
2868 </tr>
2869 <form name="payment" action="applications.asp" method="post">
2870 <tr>
2871 <td align="center">
2872 <table>
2873 <tr>
2874 <td>
2875 Business Name
2876 </td>
2877 <td>
2878 <input type="text" name="BusinessName" value="<%=BusinessName%>" size="45" maxlength="50">
2879 </td>
2880 </tr>
2881 <tr>
2882 <td>
2883 First Name
2884 </td>
2885 <td>
2886 <input type="text" name="FirstName" value="<%=FirstName%>" size="10" maxlength="20">
2887 </td>
2888 </tr>
2889 <tr>
2890 <td>
2891 Middle Name
2892 </td>
2893 <td>
2894 <input type="text" name="MiddleName" value="<%=MiddleName%>" size="10" maxlength="20">
2895 </td>
2896 </tr>
2897 <tr>
2898 <td>
2899 Last Name
2900 </td>
2901 <td>
2902 <input type="text" name="LastName" value="<%=LastName%>" size="10" maxlength="20">
2903 </td>
2904 </tr>
2905 <tr>
2906 <td>
2907 Name Suffix
2908 </td>
2909 <td>
2910 <input type="text" name="NameSuffix" value="<%=NameSuffix%>" size="10" maxlength="20">
2911 </td>
2912 </tr>
2913 <tr>
2914 <td>
2915 Address Line 1
2916 </td>
2917 <td>
2918 <input type="text" name="AddressLine1" value="<%=AddressLine1%>" size="40" maxlength="50">
2919 </td>
2920 </tr>
2921 <tr>
2922 <td>
2923 Address Line 2
2924 </td>
2925 <td>
2926 <input type="text" name="AddressLine2" value="<%=AddressLine2%>" size="40" maxlength="50">
2927 </td>
2928 </tr>
2929 <tr>
2930 <td>
2931 City
2932 </td>
2933 <td>
2934 <input type="text" name="City" value="<%=City%>" size="15" maxlength="50">
2935 State
2936 <input type="text" name="StateCode" value="<%=StateCode%>" size="2" maxlength="2">
2937 Zip
2938 <input type="text" name="PostalCode" value="<%=PostalCode%>" size="5" maxlength="5">
2939 </td>
2940 </tr>
2941 <tr>
2942 <td>
2943 Phone Number
2944 </td>
2945 <td>
2946 <input type="text" name="PhoneNumber" value="<%=PhoneNumber%>" size="15" maxlength="15">
2947
2948 Fax
2949
2950 <input type="text" name="FaxNumber" value="<%=FaxNumber%>" size="15" maxlength="15">
2951 </td>
2952 </tr>
2953 <tr>
2954 <td>
2955 SOS Client ID
2956 </td>
2957 <td>
2958 <input type="text" name="ClientID" value="<%=ClientID%>" size="10" maxlength="20">
2959 </td>
2960 </tr>
2961 <tr>
2962 <td>
2963 Password
2964 </td>
2965 <td>
2966 <input type="password" name="SOSPassword" value="<%=Password%>" size="10" maxlength="20">
2967 </td>
2968 </tr>
2969 <tr>
2970 <td>
2971 Confirm Password
2972 </td>
2973 <td>
2974 <input type="password" name="SOSPassword2" value="<%=Password%>" size="10" maxlength="20">
2975 </td>
2976 </tr>
2977 <tr>
2978 <td>
2979 Credit Card Type
2980 </td>
2981 <td>
2982 <select name="CardType">
2983 <option>
2984 <%
2985 x = ""
2986 If CardType = "1" Then x = "selected"
2987 %>
2988 <option value="1" <%=x%>>MasterCard</option>
2989 <%
2990 x = ""
2991 If CardType = "2" Then x = "selected"
2992 %>
2993 <option value="2" <%=x%>>Visa</option>
2994 <%
2995 x = ""
2996 If CardType = "3" Then x = "selected"
2997 %>
2998 <option value="3" <%=x%>>Discover</option>
2999 </select>
3000 </td>
3001 </tr>
3002 <tr>
3003 <td>
3004 Card Number
3005 </td>
3006 <td>
3007 <input type="password" name="CardNumber" value="<%=CardNumber%>" size="20" maxlength="20">
3008 </td>
3009 </tr>
3010 <tr>
3011 <td>
3012 Expiration
3013 </td>
3014 <td>
3015 <select name="ExpireMonth">
3016 <option></option>
3017 <%
3018 For vInt = 1 to 12
3019 If ExpireMonth = "" Then ExpireMonth = 0
3020 If Len(vInt) = 1 Then
3021 y = "0" & vInt
3022 Else
3023 y = vInt
3024 End If
3025 x = ""
3026 xMonth = Ucase(Mid(MonthName(vInt),1,3))
3027 If CINT(ExpireMonth) = vInt Then x = "selected"
3028 %>
3029 <option value="<%=y%>" <%=x%>><%=xMonth%></option>
3030 <% Next %>
3031 </select>
3032 <select name="ExpireYear">
3033 <option value=""></option>
3034 <%
3035 For vInt = 0 to 15
3036 CurrentYear = Year(Now) + vInt
3037 If ExpireYear = "" Then ExpireYear = Year(Now)-1
3038 x = ""
3039 If CINT(ExpireYear) = CINT(CurrentYear) Then x = "selected"
3040 %>
3041 <option value="<%=CurrentYear%>" <%=x%>><%=CurrentYear%></option>
3042 <% Next %>
3043 </select>
3044 </td>
3045 </tr>
3046 <tr>
3047 <td>
3048 LegalEase Acct#
3049 </td>
3050 <td>
3051 <input type="text" name="LegalEaseNumber" value="<%=LegalEaseNumber%>" size="16" maxlength="20">
3052 </td>
3053 </tr>
3054 <tr>
3055 <td>
3056
3057 </td>
3058 <td>
3059 <input type="button" value="Submit Payment Data" onClick="validatePayment();">
3060 </td>
3061 </tr>
3062 </table>
3063
3064
3065 </td>
3066 </tr></form>
3067 </table>
3068
3069<% End If %>
3070 <P>
3071 <b><a href="https://direct.sos.state.tx.us/acct/acct-login.asp" target="_blank">S.O.S. Website</a></b>
3072
3073 <P>
3074 <TABLE CELLPADDING=10 CELLSPACING=0 BORDER=1 BORDERCOLOR="#000099" BGCOLOR="#ffffcc">
3075 <tr>
3076 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;">
3077 Add New Bond Numbers
3078 </td>
3079 </tr>
3080 <TR VALIGN=TOP>
3081 <TD CLASS=boldtxt ALIGN=CENTER>
3082
3083 You have <span style="color:red"><%=TotalNumbers%></span> bond numbers remaining
3084
3085<% If TotalNumbers > 0 Then %>
3086 <p>
3087 Remaining Numbers:
3088 <%
3089 %><!--#Include Virtual="/http/includes/conn.inc.asp"--><%
3090 SQL = "SELECT SuretyNumber FROM [SuretyNumbers] WHERE NotaryApplicantID = 0 ORDER BY SuretyNumber"
3091 Set rs = Server.CreateObject("ADODB.Recordset")
3092 rs.Open SQL,Conn,0,1
3093
3094 LastNumber = 0
3095 StartSpan = True
3096 While Not rs.EOF
3097 SuretyNumber = rs.Fields("SuretyNumber")
3098 If CDBL(SuretyNumber-1) = CDBL(LastNumber) Then
3099 ' THIS IS A CONTINUATION OF THE SPAN '
3100 Else
3101 If StartSpan = True Then
3102 Response.Write("<br>" & SuretyNumber)
3103 StartSpan = False
3104 Else
3105 Response.Write(" through " & LastNumber & "<br>" & SuretyNumber)
3106 StartSpan = True
3107 End If
3108 End If
3109
3110 LastNumber = SuretyNumber
3111 rs.MoveNext
3112 Wend
3113 rs.Close
3114 Set rs = Nothing
3115
3116 Conn.Close
3117 Set Conn = Nothing
3118
3119 Response.Write(" through " & SuretyNumber)
3120 %>
3121 </p>
3122<% End If %>
3123 </TD>
3124 </TR>
3125 <form name="surety" action="applications.asp" method="post">
3126 <TR VALIGN=TOP>
3127 <TD CLASS=boldtxt ALIGN=CENTER>
3128
3129 Add new numbers:
3130
3131 <input type="text" name="StartNumber" size="7">
3132
3133 through
3134
3135 <input type="text" name="EndNumber" size="7">
3136
3137 <input type="button" value="Insert Numbers" onClick="addNumbers();">
3138
3139 </TD>
3140 </TR>
3141 </form>
3142 <tr>
3143 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;">
3144 Update Bond Number Status
3145 </td>
3146 </tr>
3147 <form name="bondStatus" action="applications.asp" method="post">
3148 <TR VALIGN=TOP>
3149 <TD CLASS=boldtxt ALIGN=CENTER>
3150
3151 Bond number(s):
3152
3153 <input type="text" name="BondStartNumber" size="7">
3154
3155 through <span style="font-weight:normal;font-size:xx-small;">
3156 (optional)</span>
3157
3158 <input type="text" name="BondEndNumber" size="7">
3159
3160 <span style="font-size:16px;color:red;">-or-</span>
3161
3162 Date(s)
3163
3164 <input type="text" name="BondStartDate" size="12">
3165
3166 through <span style="font-weight:normal;font-size:xx-small;">
3167 (optional)</span>
3168
3169 <input type="text" name="BondEndDate" size="12">
3170
3171 <br>
3172
3173 Flag
3174 as
3175 <input type="radio" name="BondStatus" value="NotPaid">not paid
3176 <input type="radio" name="BondStatus" value="Paid" checked>paid
3177 <%
3178 PaidReference = Month(Now)
3179 If len(PaidReference) = 1 Then PaidReference = "0" & PaidReference
3180 PaidReference = PaidReference & Mid(Year(Now),3,2)
3181 %>
3182 with reference: <input type="text" name="PaidReference" value="" size="20" maxlength="128">
3183
3184 <input type="checkbox" name="UpdateReference">Update reference only
3185
3186 <input type="button" value="Update Status" onClick="updateStatus();">
3187
3188 </TD>
3189 </TR>
3190 </form>
3191 <tr>
3192 <td style="background-color:#069;color:white;font-size:14px;font-weight:bold;">
3193 Query Bond Numbers
3194 </td>
3195 </tr>
3196 <form name="lookup" action="applications.asp" method="post">
3197 <TR VALIGN=TOP>
3198 <TD CLASS=boldtxt ALIGN=CENTER>
3199
3200 Bond number:
3201
3202 <input type="text" name="SuretyNumber" size="7">
3203
3204 <span style="font-size:16px;color:red;">-or-</span>
3205
3206 Date(s)
3207
3208 <input type="text" name="SuretyStartDate" size="12">
3209
3210 through <span style="font-weight:normal;font-size:xx-small;">
3211 (optional)</span>
3212
3213 <input type="text" name="SuretyEndDate" size="12">
3214
3215 <br>
3216
3217 Filter results:
3218
3219 <input type="checkbox" name="paid" checked>Paid
3220 <input type="checkbox" name="unpaid" checked>Unpaid
3221
3222
3223
3224 Reference: <input type="text" name="PaidReference" size="24" maxlength="128">
3225
3226
3227 <input type="button" value="Get Status" onClick="checkNumber();">
3228
3229 <br>
3230
3231 <input type="checkbox" name="ReportOnly"> Generate results into a report only
3232
3233 </TD>
3234 </TR>
3235 </form>
3236 </TABLE>
3237
3238 </TD>
3239 </TR>
3240</TABLE>
3241
3242</BODY>
3243</HTML>