forked from domainmod/domainmod
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ssl-certs.php
1095 lines (949 loc) · 59 KB
/
ssl-certs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// /ssl-certs.php
//
// DomainMOD is an open source application written in PHP & MySQL used to track and manage your web resources.
// Copyright (C) 2010 Greg Chetcuti
//
// DomainMOD is free software; you can redistribute it and/or modify it under the terms of the GNU General
// Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// DomainMOD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along with DomainMOD. If not, please see
// http://www.gnu.org/licenses/
?>
<?php
include("_includes/start-session.inc.php");
include("_includes/config.inc.php");
include("_includes/database.inc.php");
include("_includes/software.inc.php");
include("_includes/auth/auth-check.inc.php");
include("_includes/timestamps/current-timestamp.inc.php");
include("_includes/system/functions/pagination.inc.php");
$page_title = "SSL Certificates";
$software_section = "ssl-certs";
// Form Variables
$export = $_GET['export'];
$oid = $_REQUEST['oid'];
$did = $_REQUEST['did'];
$sslpid = $_REQUEST['sslpid'];
$sslpaid = $_REQUEST['sslpaid'];
$ssltid = $_REQUEST['ssltid'];
$sslipid = $_REQUEST['sslipid'];
$sslpcid = $_REQUEST['sslpcid'];
$is_active = $_REQUEST['is_active'];
$result_limit = $_REQUEST['result_limit'];
$sort_by = $_REQUEST['sort_by'];
$search_for = $_REQUEST['search_for'];
$from_dropdown = $_REQUEST['from_dropdown'];
// Search Navigation Variables
$numBegin = $_REQUEST['numBegin'];
$begin = $_REQUEST['begin'];
$num = $_REQUEST['num'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') $from_dropdown = 0;
if ($export != "1") {
if ($from_dropdown != "1") {
if ($search_for != "") { $_SESSION['search_for_ssl'] = $search_for; } else { $_SESSION['search_for_ssl'] = ""; }
}
}
if ($result_limit == "") $result_limit = $_SESSION['number_of_ssl_certs'];
if ($is_active == "") $is_active = "LIVE";
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND o.id = '$oid' "; } else { $oid_string = ""; }
if ($did != "") { $did_string = " AND d.id = '$did' "; } else { $did_string = ""; }
if ($sslpid != "") { $sslpid_string = " AND sslp.id = '$sslpid' "; } else { $sslpid_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND sslc.account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND sslc.type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND sslc.ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND sslc.cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
if ($sort_by == "") $sort_by = "ed_a";
if ($sort_by == "ed_a") { $sort_by_string = " ORDER BY sslc.expiry_date asc, sslc.name asc "; }
elseif ($sort_by == "ed_d") { $sort_by_string = " ORDER BY sslc.expiry_date desc, sslc.name asc "; }
elseif ($sort_by == "dn_a") { $sort_by_string = " ORDER BY d.domain asc "; }
elseif ($sort_by == "dn_d") { $sort_by_string = " ORDER BY d.domain desc "; }
elseif ($sort_by == "sslc_a") { $sort_by_string = " ORDER BY sslc.name asc "; }
elseif ($sort_by == "sslc_d") { $sort_by_string = " ORDER BY sslc.name desc "; }
elseif ($sort_by == "sslf_a") { $sort_by_string = " ORDER BY sslcf.type asc, sslc.name asc "; }
elseif ($sort_by == "sslf_d") { $sort_by_string = " ORDER BY sslcf.type desc, sslc.name asc "; }
elseif ($sort_by == "sslip_a") { $sort_by_string = " ORDER BY ip.name asc, ip.ip asc "; }
elseif ($sort_by == "sslip_d") { $sort_by_string = " ORDER BY ip.name desc, ip.ip desc "; }
elseif ($sort_by == "sslpc_a") { $sort_by_string = " ORDER BY cat.name asc "; }
elseif ($sort_by == "sslpc_d") { $sort_by_string = " ORDER BY cat.name desc "; }
elseif ($sort_by == "o_a") { $sort_by_string = " ORDER BY o.name asc, sslc.name asc "; }
elseif ($sort_by == "o_d") { $sort_by_string = " ORDER BY o.name desc, sslc.name asc "; }
elseif ($sort_by == "sslp_a") { $sort_by_string = " ORDER BY sslp.name asc, sslc.name asc "; }
elseif ($sort_by == "sslp_d") { $sort_by_string = " ORDER BY sslp.name desc, sslc.name asc "; }
elseif ($sort_by == "sslpa_a") { $sort_by_string = " ORDER BY sslp.name asc, sslc.name asc "; }
elseif ($sort_by == "sslpa_d") { $sort_by_string = " ORDER BY sslp.name desc, sslc.name asc "; }
elseif ($sort_by == "sf_a") { $sort_by_string = " ORDER BY f.renewal_fee asc "; }
elseif ($sort_by == "sf_d") { $sort_by_string = " ORDER BY f.renewal_fee desc "; }
$sql = "SELECT sslc.id, sslc.domain_id, sslc.name, sslc.expiry_date, sslc.notes, sslc.active, sslc.insert_time, sslc.update_time, sslpa.id AS sslpa_id, sslpa.username, sslp.id AS sslp_id, sslp.name AS ssl_provider_name, o.id AS o_id, o.name AS owner_name, f.initial_fee, f.renewal_fee, cc.conversion, d.domain, sslcf.id as type_id, sslcf.type, ip.id AS ip_id, ip.name as ip_name, ip.ip, ip.rdns, cat.id AS cat_id, cat.name AS cat_name
FROM ssl_certs AS sslc, ssl_accounts AS sslpa, ssl_providers AS sslp, owners AS o, ssl_fees AS f, currencies AS c, currency_conversions AS cc, domains AS d, ssl_cert_types AS sslcf, ip_addresses AS ip, categories AS cat
WHERE sslc.account_id = sslpa.id
AND sslpa.ssl_provider_id = sslp.id
AND sslpa.owner_id = o.id
AND sslc.fee_id = f.id
AND f.currency_id = c.id
AND c.id = cc.currency_id
AND sslc.domain_id = d.id
AND sslc.type_id = sslcf.id
AND sslc.ip_id = ip.id
AND sslc.cat_id = cat.id
AND cc.user_id = '" . $_SESSION['user_id'] . "'
$is_active_string
$oid_string
$did_string
$sslpid_string
$sslpaid_string
$ssltid_string
$sslipid_string
$sslpcid_string
$search_string
$sort_by_string";
$sql_grand_total = "SELECT SUM(f.renewal_fee * cc.conversion) AS grand_total
FROM ssl_certs AS sslc, ssl_accounts AS sslpa, ssl_providers AS sslp, owners AS o, ssl_fees AS f, currencies AS c, currency_conversions AS cc, domains AS d, ssl_cert_types AS sslcf, ip_addresses AS ip, categories AS cat
WHERE sslc.account_id = sslpa.id
AND sslpa.ssl_provider_id = sslp.id
AND sslpa.owner_id = o.id
AND sslc.fee_id = f.id
AND f.currency_id = c.id
AND c.id = cc.currency_id
AND sslc.domain_id = d.id
AND sslc.type_id = sslcf.id
AND sslc.ip_id = ip.id
AND sslc.cat_id = cat.id
AND cc.user_id = '" . $_SESSION['user_id'] . "'
$is_active_string
$oid_string
$did_string
$sslpid_string
$sslpaid_string
$ssltid_string
$sslipid_string
$sslpcid_string
$search_string
$sort_by_string";
$result_grand_total = mysql_query($sql_grand_total,$connection) or die(mysql_error());
while ($row_grand_total = mysql_fetch_object($result_grand_total)) {
$grand_total = $row_grand_total->grand_total;
}
$temp_input_amount = $grand_total;
$temp_input_conversion = "";
$temp_input_currency_symbol = $_SESSION['default_currency_symbol'];
$temp_input_currency_symbol_order = $_SESSION['default_currency_symbol_order'];
$temp_input_currency_symbol_space = $_SESSION['default_currency_symbol_space'];
include("_includes/system/convert-and-format-currency.inc.php");
$grand_total = $temp_output_amount;
if ($export == "1") {
$result = mysql_query($sql,$connection) or die(mysql_error());
$total_rows = number_format(mysql_num_rows($result));
$current_timestamp_unix = strtotime($current_timestamp);
$export_filename = "ssl_results_" . $current_timestamp_unix . ".csv";
include("_includes/system/export/header.inc.php");
$row_content[$count++] = "SSL Certificate Search Results Export";
include("_includes/system/export/write-row.inc.php");
fputcsv($file_content, $blank_line);
$row_content[$count++] = "Total Cost:";
$row_content[$count++] = $grand_total;
$row_content[$count++] = $_SESSION['default_currency'];
include("_includes/system/export/write-row.inc.php");
$row_content[$count++] = "Number of SSL Certs:";
$row_content[$count++] = $total_rows;
include("_includes/system/export/write-row.inc.php");
fputcsv($file_content, $blank_line);
$row_content[$count++] = "[Search Filters]";
include("_includes/system/export/write-row.inc.php");
if ($_SESSION['search_for_ssl'] != "") {
$row_content[$count++] = "Keyword Search:";
$row_content[$count++] = $_SESSION['search_for_ssl'];
include("_includes/system/export/write-row.inc.php");
}
if ($did > 0) {
$sql_filter = "SELECT domain
FROM domains
WHERE id = '" . $did . "'";
$result_filter = mysql_query($sql_filter,$connection);
while ($row_filter = mysql_fetch_object($result_filter)) {
$row_content[$count++] = "Associated Domain:";
$row_content[$count++] = $row_filter->domain;
include("_includes/system/export/write-row.inc.php");
}
}
if ($sslpid > 0) {
$sql_filter = "SELECT name
FROM ssl_providers
WHERE id = '" . $sslpid . "'";
$result_filter = mysql_query($sql_filter,$connection);
while ($row_filter = mysql_fetch_object($result_filter)) {
$row_content[$count++] = "SSL Provider:";
$row_content[$count++] = $row_filter->name;
include("_includes/system/export/write-row.inc.php");
}
}
if ($sslpaid > 0) {
$sql_filter = "SELECT sslp.name AS ssl_provider_name, o.name AS owner_name, sslpa.username
FROM ssl_accounts AS sslpa, ssl_providers AS sslp, owners AS o
WHERE sslpa.ssl_provider_id = sslp.id
AND sslpa.owner_id = o.id
AND sslpa.id = '" . $sslpaid . "'";
$result_filter = mysql_query($sql_filter,$connection);
while ($row_filter = mysql_fetch_object($result_filter)) {
$row_content[$count++] = "SSL Provider Account:";
$row_content[$count++] = $row_filter->ssl_provider_name . " - " . $row_filter->owner_name . " - " . $row_filter->username;
include("_includes/system/export/write-row.inc.php");
}
}
if ($ssltid > 0) {
$sql_filter = "SELECT type
FROM ssl_cert_types
WHERE id = '" . $ssltid . "'";
$result_filter = mysql_query($sql_filter,$connection);
while ($row_filter = mysql_fetch_object($result_filter)) {
$row_content[$count++] = "SSL Type:";
$row_content[$count++] = $row_filter->type;
include("_includes/system/export/write-row.inc.php");
}
}
if ($sslipid > 0) {
$sql_filter = "SELECT name, ip
FROM ip_addresses
WHERE id = '" . $sslipid . "'";
$result_filter = mysql_query($sql_filter,$connection);
while ($row_filter = mysql_fetch_object($result_filter)) {
$row_content[$count++] = "SSL IP Address:";
$row_content[$count++] = $row_filter->name . " (" . $row_filter->ip . ")";
include("_includes/system/export/write-row.inc.php");
}
}
if ($sslpcid > 0) {
$sql_filter = "SELECT name
FROM categories
WHERE id = '" . $sslpcid . "'";
$result_filter = mysql_query($sql_filter,$connection);
while ($row_filter = mysql_fetch_object($result_filter)) {
$row_content[$count++] = "SSL Category:";
$row_content[$count++] = $row_filter->name;
include("_includes/system/export/write-row.inc.php");
}
}
if ($oid > 0) {
$sql_filter = "SELECT name
FROM owners
WHERE id = '" . $oid . "'";
$result_filter = mysql_query($sql_filter,$connection);
while ($row_filter = mysql_fetch_object($result_filter)) {
$row_content[$count++] = "Owner:";
$row_content[$count++] = $row_filter->name;
include("_includes/system/export/write-row.inc.php");
}
}
$row_content[$count++] = "SSL Status:";
if ($is_active == "ALL") {
$row_content[$count++] = "ALL";
include("_includes/system/export/write-row.inc.php");
} elseif ($is_active == "LIVE" || $is_active == "") {
$row_content[$count++] = "LIVE (Active / Pending)";
include("_includes/system/export/write-row.inc.php");
} elseif ($is_active == "0") {
$row_content[$count++] = "Expired";
include("_includes/system/export/write-row.inc.php");
} elseif ($is_active == "1") {
$row_content[$count++] = "Active";
include("_includes/system/export/write-row.inc.php");
} elseif ($is_active == "3") {
$row_content[$count++] = "Pending (Renewal)";
include("_includes/system/export/write-row.inc.php");
} elseif ($is_active == "4") {
$row_content[$count++] = "Pending (Other)";
include("_includes/system/export/write-row.inc.php");
} elseif ($is_active == "5") {
$row_content[$count++] = "Pending (Registration)";
include("_includes/system/export/write-row.inc.php");
}
fputcsv($file_content, $blank_line);
$row_content[$count++] = "SSL Cert Status";
$row_content[$count++] = "Expiry Date";
$row_content[$count++] = "Initial Fee";
$row_content[$count++] = "Renewal Fee";
$row_content[$count++] = "Host / Label";
$row_content[$count++] = "Domain";
$row_content[$count++] = "SSL Provider";
$row_content[$count++] = "SSL Provider Account";
$row_content[$count++] = "Username";
$row_content[$count++] = "SSL Type";
$row_content[$count++] = "IP Address Name";
$row_content[$count++] = "IP Address";
$row_content[$count++] = "IP Address rDNS";
$row_content[$count++] = "Category";
$row_content[$count++] = "Owner";
$row_content[$count++] = "Notes";
$sql_field = "SELECT name
FROM ssl_cert_fields
ORDER BY name";
$result_field = mysql_query($sql_field,$connection);
while ($row_field = mysql_fetch_object($result_field)) {
$row_content[$count++] = $row_field->name;
}
$row_content[$count++] = "Inserted";
$row_content[$count++] = "Updated";
include("_includes/system/export/write-row.inc.php");
while ($row = mysql_fetch_object($result)) {
$temp_initial_fee = $row->initial_fee * $row->conversion;
$temp_renewal_fee = $row->renewal_fee * $row->conversion;
if ($row->active == "0") { $ssl_status = "EXPIRED"; }
elseif ($row->active == "1") { $ssl_status = "ACTIVE"; }
elseif ($row->active == "3") { $ssl_status = "PENDING (RENEWAL)"; }
elseif ($row->active == "4") { $ssl_status = "PENDING (OTHER)"; }
elseif ($row->active == "5") { $ssl_status = "PENDING (REGISTRATION)"; }
else { $ssl_status = "ERROR -- PROBLEM WITH CODE IN SSL-CERTS.PHP"; }
$temp_input_amount = $temp_initial_fee;
$temp_input_conversion = "";
$temp_input_currency_symbol = $_SESSION['default_currency_symbol'];
$temp_input_currency_symbol_order = $_SESSION['default_currency_symbol_order'];
$temp_input_currency_symbol_space = $_SESSION['default_currency_symbol_space'];
include("_includes/system/convert-and-format-currency.inc.php");
$export_initial_fee = $temp_output_amount;
$temp_input_amount = $temp_renewal_fee;
$temp_input_conversion = "";
$temp_input_currency_symbol = $_SESSION['default_currency_symbol'];
$temp_input_currency_symbol_order = $_SESSION['default_currency_symbol_order'];
$temp_input_currency_symbol_space = $_SESSION['default_currency_symbol_space'];
include("_includes/system/convert-and-format-currency.inc.php");
$export_renewal_fee = $temp_output_amount;
$row_content[$count++] = $ssl_status;
$row_content[$count++] = $row->expiry_date;
$row_content[$count++] = $export_initial_fee;
$row_content[$count++] = $export_renewal_fee;
$row_content[$count++] = $row->name;
$row_content[$count++] = $row->domain;
$row_content[$count++] = $row->ssl_provider_name;
$row_content[$count++] = $row->ssl_provider_name . ", " . $row->owner_name . " (" . $row->username . ")";
$row_content[$count++] = $row->username;
$row_content[$count++] = $row->type;
$row_content[$count++] = $row->ip_name;
$row_content[$count++] = $row->ip;
$row_content[$count++] = $row->rdns;
$row_content[$count++] = $row->cat_name;
$row_content[$count++] = $row->owner_name;
$row_content[$count++] = $row->notes;
$sql_field = "SELECT field_name
FROM ssl_cert_fields
ORDER BY name";
$result_field = mysql_query($sql_field,$connection);
$array_count = 0;
$field_data = "";
while ($row_field = mysql_fetch_object($result_field)) {
$field_array[$array_count] = $row_field->field_name;
$array_count++;
}
foreach($field_array as $field) {
$sql_data = "SELECT " . $field . "
FROM ssl_cert_field_data
WHERE ssl_id = '" . $row->id . "'";
$result_data = mysql_query($sql_data,$connection);
while ($row_data = mysql_fetch_object($result_data)) {
$row_content[$count++] = $row_data->{$field};
}
}
$row_content[$count++] = $row->insert_time;
$row_content[$count++] = $row->update_time;
include("_includes/system/export/write-row.inc.php");
}
include("_includes/system/export/footer.inc.php");
}
?>
<?php include("_includes/doctype.inc.php"); ?>
<html>
<head>
<title><?=$software_title?> :: <?=$page_title?></title>
<?php include("_includes/layout/head-tags.inc.php"); ?>
<?php include("_includes/system/functions/jumpmenu.inc.php"); ?>
</head>
<body onLoad="document.forms[0].elements[10].focus()";>
<?php include("_includes/layout/header.inc.php"); ?>
<?php
if ($_SESSION['need_ssl_provider'] == "1") {
echo "<strong><font class=\"highlight\">0</font></strong> SSL Providers found. Please <a href=\"assets/add/ssl-provider.php\">click here</a> to add one.<BR><BR>";
exit;
}
if ($_SESSION['need_ssl_account'] == "1" && $_SESSION['need_ssl_provider'] != "1") {
echo "<strong><font class=\"highlight\">0</font></strong> SSL Provider Accounts found. Please <a href=\"assets/add/ssl-provider-account.php\">click here</a> to add one.<BR><BR>";
exit;
}
if ($_SESSION['need_ssl_cert'] == "1" && $_SESSION['need_ssl_provider'] != "1" && $_SESSION['need_ssl_account'] != "1" && $_SESSION['need_domain'] == "0") {
echo "<strong><font class=\"highlight\">0</font></strong> SSL Certificates. Please <a href=\"add/ssl-cert.php\">click here</a> to add one.<BR><BR>";
exit;
}
if ($_SESSION['need_domain'] == "1" && $_SESSION['need_ssl_provider'] == "0" && $_SESSION['need_ssl_account'] == "0") {
echo "Before you can add an SSL Certificate you must have at least one domain stored in your $software_title. Please <a href=\"domains.php\">click here</a> to add one.<BR><BR>";
exit;
}
$totalrows = mysql_num_rows(mysql_query($sql));
$navigate = pageBrowser($totalrows,15,$result_limit, "&oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&search_for=" . $_SESSION['search_for_ssl'] . "",$_REQUEST[numBegin],$_REQUEST[begin],$_REQUEST[num]);
$sql = $sql.$navigate[0];
$result = mysql_query($sql,$connection);
$total_rows = number_format(mysql_num_rows($result));
?>
<form name="ssl_cert_search_form" method="post" action="<?=$PHP_SELF?>">
<div class="search-block-outer">
<div class="search-block-inner">
<div class="search-block-left">
<?php
// DOMAIN
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND sslc.owner_id = '$oid' "; } else { $oid_string = ""; }
if ($sslpid != "") { $sslpid_string = " AND sslc.ssl_provider_id = '$sslpid' "; } else { $sslpid_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND sslc.account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND sslc.type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND sslc.ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND sslc.cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
$sql_domain = "SELECT d.id, d.domain
FROM domains AS d, ssl_certs AS sslc
WHERE d.id = sslc.domain_id
AND d.active not in ('0', '10')
$is_active_string
$oid_string
$sslpid_string
$sslpaid_string
$ssltid_string
$sslipid_string
$sslpcid_string
$search_string
GROUP BY d.domain
ORDER BY d.domain asc";
$result_domain = mysql_query($sql_domain,$connection);
echo "<select name=\"did\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=$oid&did=&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\">Domain - ALL</option>";
while ($row_domain = mysql_fetch_object($result_domain)) {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$row_domain->id&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_domain->id == $did) echo " selected"; echo ">"; echo "$row_domain->domain</option>";
}
echo "</select>";
?>
<BR><BR>
<?php
// SSL PROVIDER
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND sslc.owner_id = '$oid' "; } else { $oid_string = ""; }
if ($did != "") { $did_string = " AND sslc.domain_id = '$did' "; } else { $did_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND sslc.account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND sslc.type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND sslc.ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND sslc.cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
$sql_ssl_provider = "SELECT sslp.id, sslp.name
FROM ssl_providers AS sslp, ssl_certs AS sslc, domains AS d
WHERE sslp.id = sslc.ssl_provider_id
AND sslc.domain_id = d.id
$is_active_string
$oid_string
$did_string
$sslpaid_string
$ssltid_string
$sslipid_string
$sslpcid_string
$search_string
GROUP BY sslp.name
ORDER BY sslp.name asc";
$result_ssl_provider = mysql_query($sql_ssl_provider,$connection);
echo "<select name=\"sslpid\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\">SSL Provider - ALL</option>";
while ($row_ssl_provider = mysql_fetch_object($result_ssl_provider)) {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$row_ssl_provider->id&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_ssl_provider->id == $sslpid) echo " selected"; echo ">"; echo "$row_ssl_provider->name</option>";
}
echo "</select>";
?>
<BR><BR>
<?php
// SSL PROVIDER ACCOUNT
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND sslc.owner_id = '$oid' "; } else { $oid_string = ""; }
if ($did != "") { $did_string = " AND sslc.domain_id = '$did' "; } else { $did_string = ""; }
if ($sslpid != "") { $sslpid_string = " AND sslc.ssl_provider_id = '$sslpid' "; } else { $sslpid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND sslc.type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND sslc.ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND sslc.cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
$sql_account = "SELECT sslpa.id AS sslpa_id, sslpa.username, sslp.name AS sslp_name, o.name AS owner_name
FROM ssl_accounts AS sslpa, ssl_providers AS sslp, owners AS o, ssl_certs AS sslc, domains AS d
WHERE sslpa.ssl_provider_id = sslp.id
AND sslpa.owner_id = o.id
AND sslpa.id = sslc.account_id
AND sslc.domain_id = d.id
$is_active_string
$oid_string
$did_string
$sslpid_string
$ssltid_string
$sslipid_string
$sslpcid_string
$search_string
GROUP BY sslp.name, o.name, sslpa.username
ORDER BY sslp.name asc, o.name asc, sslpa.username asc";
$result_account = mysql_query($sql_account,$connection);
echo "<select name=\"sslpaid\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\">SSL Provider Account - ALL</option>";
while ($row_account = mysql_fetch_object($result_account)) {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$row_account->sslpa_id&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_account->sslpa_id == $sslpaid) echo " selected"; echo ">"; echo "$row_account->sslp_name, $row_account->owner_name ($row_account->username)</option>";
}
echo "</select>";
?>
<BR><BR>
<?php
// TYPE
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND sslc.owner_id = '$oid' "; } else { $oid_string = ""; }
if ($did != "") { $did_string = " AND sslc.domain_id = '$did' "; } else { $did_string = ""; }
if ($sslpid != "") { $sslpid_string = " AND sslc.ssl_provider_id = '$sslpid' "; } else { $sslpid_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND sslc.account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND sslc.ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND sslc.cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
$sql_type = "SELECT sslc.type_id, sslcf.type
FROM ssl_certs AS sslc, domains AS d, ssl_cert_types AS sslcf
WHERE sslc.domain_id = d.id
AND sslc.type_id = sslcf.id
$is_active_string
$oid_string
$did_string
$sslpid_string
$sslpaid_string
$sslipid_string
$sslpcid_string
$search_string
GROUP BY sslcf.type
ORDER BY sslcf.type asc";
$result_type = mysql_query($sql_type,$connection);
echo "<select name=\"ssltid\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\">SSL Type - ALL</option>";
while ($row_type = mysql_fetch_object($result_type)) {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$row_type->type_id&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_type->type_id == $ssltid) echo " selected"; echo ">"; echo "$row_type->type</option>";
}
echo "</select>";
?>
<BR><BR>
<?php
// IP ADDRESS
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND sslc.owner_id = '$oid' "; } else { $oid_string = ""; }
if ($did != "") { $did_string = " AND sslc.domain_id = '$did' "; } else { $did_string = ""; }
if ($sslpid != "") { $sslpid_string = " AND sslc.ssl_provider_id = '$sslpid' "; } else { $sslpid_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND sslc.account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND sslc.type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND sslc.cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
$sql_ip = "SELECT ip.id AS ip_id, ip.name AS ip_name, ip.ip
FROM ssl_certs AS sslc, domains AS d, ip_addresses AS ip
WHERE sslc.domain_id = d.id
AND sslc.ip_id = ip.id
$is_active_string
$oid_string
$did_string
$sslpid_string
$sslpaid_string
$ssltid_string
$sslpcid_string
$search_string
GROUP BY ip.name, ip.ip
ORDER BY ip.name, ip.ip";
$result_ip = mysql_query($sql_ip,$connection);
echo "<select name=\"sslipid\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\">IP Address - ALL</option>";
while ($row_ip = mysql_fetch_object($result_ip)) {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$row_ip->ip_id&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_ip->ip_id == $sslipid) echo " selected"; echo ">"; echo "$row_ip->ip_name ($row_ip->ip)</option>";
}
echo "</select>";
?>
<BR><BR>
<?php
// CATEGORY
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND sslc.owner_id = '$oid' "; } else { $oid_string = ""; }
if ($did != "") { $did_string = " AND sslc.domain_id = '$did' "; } else { $did_string = ""; }
if ($sslpid != "") { $sslpid_string = " AND sslc.ssl_provider_id = '$sslpid' "; } else { $sslpid_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND sslc.account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND sslc.type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND sslc.ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
$sql_cat = "SELECT c.id AS cat_id, c.name AS cat_name
FROM ssl_certs AS sslc, domains AS d, categories AS c
WHERE sslc.domain_id = d.id
AND sslc.cat_id = c.id
$is_active_string
$oid_string
$did_string
$sslpid_string
$sslpaid_string
$ssltid_string
$sslipid_string
$search_string
GROUP BY c.name
ORDER BY c.name";
$result_cat = mysql_query($sql_cat,$connection);
echo "<select name=\"sslpcid\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\">Category - ALL</option>";
while ($row_cat = mysql_fetch_object($result_cat)) {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$row_cat->cat_id&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_cat->cat_id == $sslpcid) echo " selected"; echo ">"; echo "$row_cat->cat_name</option>";
}
echo "</select>";
?>
<BR><BR>
<?php
// OWNER
if ($is_active == "0") { $is_active_string = " AND sslc.active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND sslc.active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND sslc.active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND sslc.active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND sslc.active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND sslc.active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND sslc.active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND sslc.active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND sslc.active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND sslc.active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND sslc.active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND sslc.active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND sslc.active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($did != "") { $did_string = " AND sslc.domain_id = '$did' "; } else { $did_string = ""; }
if ($sslpid != "") { $sslpid_string = " AND sslc.ssl_provider_id = '$sslpid' "; } else { $sslpid_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND sslc.account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND sslc.type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND sslc.ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND sslc.cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
if ($_SESSION['search_for_ssl'] != "") { $search_string = " AND (sslc.name LIKE '%" . $_SESSION['search_for_ssl'] . "%' OR d.domain LIKE '%" . $_SESSION['search_for_ssl'] . "%')"; } else { $search_string = ""; }
$sql_owner = "SELECT o.id, o.name
FROM owners AS o, ssl_certs AS sslc, domains AS d
WHERE o.id = sslc.owner_id
AND o.id = d.owner_id
$is_active_string
$did_string
$sslpid_string
$sslpaid_string
$ssltid_string
$sslipid_string
$sslpcid_string
$search_string
GROUP BY o.name
ORDER BY o.name asc";
$result_owner = mysql_query($sql_owner,$connection);
echo "<select name=\"oid\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\">Owner - ALL</option>";
while ($row_owner = mysql_fetch_object($result_owner)) {
echo "<option value=\"$PHP_SELF?oid=$row_owner->id&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_owner->id == $oid) echo " selected"; echo ">"; echo "$row_owner->name</option>";
}
echo "</select>";
?>
<BR><BR>
<?php
// STATUS
if ($is_active == "0") { $is_active_string = " AND active = '0' "; }
elseif ($is_active == "1") { $is_active_string = " AND active = '1' "; }
elseif ($is_active == "2") { $is_active_string = " AND active = '2' "; }
elseif ($is_active == "3") { $is_active_string = " AND active = '3' "; }
elseif ($is_active == "4") { $is_active_string = " AND active = '4' "; }
elseif ($is_active == "5") { $is_active_string = " AND active = '5' "; }
elseif ($is_active == "6") { $is_active_string = " AND active = '6' "; }
elseif ($is_active == "7") { $is_active_string = " AND active = '7' "; }
elseif ($is_active == "8") { $is_active_string = " AND active = '8' "; }
elseif ($is_active == "9") { $is_active_string = " AND active = '9' "; }
elseif ($is_active == "10") { $is_active_string = " AND active = '10' "; }
elseif ($is_active == "LIVE") { $is_active_string = " AND active IN ('1', '2', '3', '4', '5', '6', '7', '8', '9')"; }
elseif ($is_active == "ALL") { $is_active_string = " AND active IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10')"; }
if ($oid != "") { $oid_string = " AND owner_id = '$oid' "; } else { $oid_string = ""; }
if ($did != "") { $did_string = " AND domain_id = '$did' "; } else { $did_string = ""; }
if ($sslpid != "") { $sslp_string = " AND ssl_provider_id = '$sslpid' "; } else { $sslp_string = ""; }
if ($sslpaid != "") { $sslpaid_string = " AND account_id = '$sslpaid' "; } else { $sslpaid_string = ""; }
if ($ssltid != "") { $ssltid_string = " AND type_id = '$ssltid' "; } else { $ssltid_string = ""; }
if ($sslipid != "") { $sslipid_string = " AND ip_id = '$sslipid' "; } else { $sslipid_string = ""; }
if ($sslpcid != "") { $sslpcid_string = " AND cat_id = '$sslpcid' "; } else { $sslpcid_string = ""; }
$sql_active = "SELECT active, count(*) AS total_count
FROM ssl_certs
WHERE id != '0'
$oid_string
$did_string
$sslpid_string
$sslpaid_string
$ssltid_string
$sslipid_string
$sslpcid_string
GROUP BY active
ORDER BY active asc";
$result_active = mysql_query($sql_active,$connection);
echo "<select name=\"is_active\" onChange=\"MM_jumpMenu('parent',this,0)\">";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=LIVE&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($is_active == "LIVE") echo " selected"; echo ">"; echo "\"Live\" (Active / Pending)</option>";
while ($row_active = mysql_fetch_object($result_active)) {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$row_active->active&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($row_active->active == $is_active) echo " selected"; echo ">"; if ($row_active->active == "0") { echo "Expired"; } elseif ($row_active->active == "1") { echo "Active"; } elseif ($row_active->active == "3") { echo "Pending (Renewal)"; } elseif ($row_active->active == "4") { echo "Pending (Other)"; } elseif ($row_active->active == "5") { echo "Pending (Registration)"; } echo "</option>";
}
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=ALL&result_limit=$result_limit&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($is_active == "ALL") echo " selected"; echo ">"; echo "ALL</option>";
echo "</select>";
?>
<?php
// NUMBER OF SSL CERTS TO DISPLAY
echo "<select name=\"result_limit\" onChange=\"MM_jumpMenu('parent',this,0)\">";
if ($_SESSION['number_of_ssl_certs'] != "10" && $_SESSION['number_of_ssl_certs'] != "50" && $_SESSION['number_of_ssl_certs'] != "100" && $_SESSION['number_of_ssl_certs'] != "500" && $_SESSION['number_of_ssl_certs'] != "1000" && $_SESSION['number_of_ssl_certs'] != "1000000") {
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=" . $_SESSION['number_of_ssl_certs'] . "&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($result_limit == $_SESSION['number_of_ssl_certs']) echo " selected"; echo ">"; echo "" . $_SESSION['number_of_ssl_certs'] . "</option>";
}
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=10&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($result_limit == "10") echo " selected"; echo ">"; echo "10</option>";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=50&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($result_limit == "50") echo " selected"; echo ">"; echo "50</option>";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=100&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($result_limit == "100") echo " selected"; echo ">"; echo "100</option>";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=500&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($result_limit == "500") echo " selected"; echo ">"; echo "500</option>";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=1000&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($result_limit == "1000") echo " selected"; echo ">"; echo "1,000</option>";
echo "<option value=\"$PHP_SELF?oid=$oid&did=$did&sslpid=$sslpid&sslpaid=$sslpaid&ssltid=$ssltid&sslipid=$sslipid&sslpcid=$sslpcid&is_active=$is_active&result_limit=1000000&sort_by=$sort_by&from_dropdown=1&search_for=" . $_SESSION['search_for_ssl'] . "\""; if ($result_limit == "1000000") echo " selected"; echo ">"; echo "ALL</option>";
echo "</select>";
?>
<BR>
<input type="hidden" name="sort_by" value="<?=$sort_by?>">
</div>
<div class="search-block-right">
<strong>Keyword Search:</strong><BR><BR>
<input name="search_for" type="text" id="textfield" value="<?=$_SESSION['search_for_ssl']?>" size="20"> <input type="submit" name="button" id="button" value="Search »">
<input type="hidden" name="oid" value="<?=$oid?>">
<input type="hidden" name="did" value="<?=$did?>">
<input type="hidden" name="sslpid" value="<?=$sslpid?>">
<input type="hidden" name="sslpaid" value="<?=$sslpaid?>">
<input type="hidden" name="ssltid" value="<?=$ssltid?>">
<input type="hidden" name="sslipid" value="<?=$sslipid?>">
<input type="hidden" name="sslpcid" value="<?=$sslpcid?>">
<input type="hidden" name="is_active" value="<?=$is_active?>">
<input type="hidden" name="result_limit" value="<?=$result_limit?>">
<input type="hidden" name="begin" value="0">
<input type="hidden" name="num" value="1">
<input type="hidden" name="numBegin" value="1">
</div>
</div>
</div>
</form>
<div style="clear: both;"></div>
<?php if (mysql_num_rows($result) > 0) { ?>
<BR><strong>Total Cost:</strong> <?=$grand_total?> <?=$_SESSION['default_currency']?><BR><BR>
<strong>Number of SSL Certs:</strong> <?=number_format($totalrows)?><BR><BR>
<?php include("_includes/layout/pagination.menu.inc.php"); ?>
<?php if ($totalrows != '0') { ?>
<table class="main_table" cellpadding="0" cellspacing="0">
<tr class="main_table_row_heading_active">
<?php if ($_SESSION['display_ssl_expiry_date'] == "1") { ?>
<td class="main_table_cell_heading_active">
<a href="ssl-certs.php?oid=<?=$oid?>&did=<?=$did?>&sslpid=<?=$sslpid?>&sslpaid=<?=$sslpaid?>&ssltid=<?=$ssltid?>&sslipid=<?=$sslipid?>&sslpcid=<?=$sslpcid?>&is_active=<?=$is_active?>&result_limit=<?=$result_limit?>&sort_by=<?php if ($sort_by == "ed_a") { echo "ed_d"; } else { echo "ed_a"; } ?>&from_dropdown=1&search_for=<?=$_SESSION['search_for_ssl']?>"><font class="main_table_heading">Expiry Date</font></a>
</td>
<?php } ?>
<?php if ($_SESSION['display_ssl_fee'] == "1") { ?>
<td class="main_table_cell_heading_active">
<a href="ssl-certs.php?oid=<?=$oid?>&did=<?=$did?>&sslpid=<?=$sslpid?>&sslpaid=<?=$sslpaid?>&ssltid=<?=$ssltid?>&sslipid=<?=$sslipid?>&sslpcid=<?=$sslpcid?>&is_active=<?=$is_active?>&result_limit=<?=$result_limit?>&sort_by=<?php if ($sort_by == "sf_a") { echo "sf_d"; } else { echo "sf_a"; } ?>&from_dropdown=1&search_for=<?=$_SESSION['search_for_ssl']?>"><font class="main_table_heading">Fee</font></a>
</td>
<?php } ?>
<td class="main_table_cell_heading_active">
<a href="ssl-certs.php?oid=<?=$oid?>&did=<?=$did?>&sslpid=<?=$sslpid?>&sslpaid=<?=$sslpaid?>&ssltid=<?=$ssltid?>&sslipid=<?=$sslipid?>&sslpcid=<?=$sslpcid?>&is_active=<?=$is_active?>&result_limit=<?=$result_limit?>&sort_by=<?php if ($sort_by == "sslc_a") { echo "sslc_d"; } else { echo "sslc_a"; } ?>&from_dropdown=1&search_for=<?=$_SESSION['search_for_ssl']?>"><font class="main_table_heading">Host / Label</font></a>
</td>
<?php if ($_SESSION['display_ssl_domain'] == "1") { ?>
<td class="main_table_cell_heading_active">
<a href="ssl-certs.php?oid=<?=$oid?>&did=<?=$did?>&sslpid=<?=$sslpid?>&sslpaid=<?=$sslpaid?>&ssltid=<?=$ssltid?>&sslipid=<?=$sslipid?>&sslpcid=<?=$sslpcid?>&is_active=<?=$is_active?>&result_limit=<?=$result_limit?>&sort_by=<?php if ($sort_by == "dn_a") { echo "dn_d"; } else { echo "dn_a"; } ?>&from_dropdown=1&search_for=<?=$_SESSION['search_for_ssl']?>"><font class="main_table_heading">Domain</font></a>
</td>
<?php } ?>
<?php if ($_SESSION['display_ssl_provider'] == "1") { ?>
<td class="main_table_cell_heading_active">
<a href="ssl-certs.php?oid=<?=$oid?>&did=<?=$did?>&sslpid=<?=$sslpid?>&sslpaid=<?=$sslpaid?>&ssltid=<?=$ssltid?>&sslipid=<?=$sslipid?>&sslpcid=<?=$sslpcid?>&is_active=<?=$is_active?>&result_limit=<?=$result_limit?>&sort_by=<?php if ($sort_by == "sslp_a") { echo "sslp_d"; } else { echo "sslp_a"; } ?>&from_dropdown=1&search_for=<?=$_SESSION['search_for_ssl']?>"><font class="main_table_heading">SSL Provider</font></a>
</td>
<?php } ?>
<?php if ($_SESSION['display_ssl_account'] == "1") { ?>
<td class="main_table_cell_heading_active">
<a href="ssl-certs.php?oid=<?=$oid?>&did=<?=$did?>&sslpid=<?=$sslpid?>&sslpaid=<?=$sslpaid?>&ssltid=<?=$ssltid?>&sslipid=<?=$sslipid?>&sslpcid=<?=$sslpcid?>&is_active=<?=$is_active?>&result_limit=<?=$result_limit?>&sort_by=<?php if ($sort_by == "sslpa_a") { echo "sslpa_d"; } else { echo "sslpa_a"; } ?>&from_dropdown=1&search_for=<?=$_SESSION['search_for_ssl']?>"><font class="main_table_heading">SSL Account</font></a>
</td>
<?php } ?>
<?php if ($_SESSION['display_ssl_type'] == "1") { ?>
<td class="main_table_cell_heading_active">
<a href="ssl-certs.php?oid=<?=$oid?>&did=<?=$did?>&sslpid=<?=$sslpid?>&sslpaid=<?=$sslpaid?>&ssltid=<?=$ssltid?>&sslipid=<?=$sslipid?>&sslpcid=<?=$sslpcid?>&is_active=<?=$is_active?>&result_limit=<?=$result_limit?>&sort_by=<?php if ($sort_by == "sslf_a") { echo "sslf_d"; } else { echo "sslf_a"; } ?>&from_dropdown=1&search_for=<?=$_SESSION['search_for_ssl']?>"><font class="main_table_heading">Type</font></a>
</td>
<?php } ?>
<?php if ($_SESSION['display_ssl_ip'] == "1") { ?>
<td class="main_table_cell_heading_active">