-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrealmcharactersview.php
834 lines (707 loc) · 24.7 KB
/
realmcharactersview.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
<?php
if (session_id() == "") session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include_once "includes/framework/ewcfg9.php" ?>
<?php include_once "includes/framework/ewmysql9.php" ?>
<?php include_once "phpfn9.php" ?>
<?php include_once "realmcharactersinfo.php" ?>
<?php include_once "userfn9.php" ?>
<?php
//
// Page class
//
$realmcharacters_view = NULL; // Initialize page object first
class crealmcharacters_view extends crealmcharacters {
// Page ID
var $PageID = 'view';
// Project ID
var $ProjectID = "{94C0E450-F9A8-47EE-A905-551040DB9277}";
// Table name
var $TableName = 'realmcharacters';
// Page object name
var $PageObjName = 'realmcharacters_view';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
if ($this->UseTokenInUrl) $PageUrl .= "t=" . $this->TableVar . "&"; // Add page token
return $PageUrl;
}
// Page URLs
var $AddUrl;
var $EditUrl;
var $CopyUrl;
var $DeleteUrl;
var $ViewUrl;
var $ListUrl;
// Export URLs
var $ExportPrintUrl;
var $ExportHtmlUrl;
var $ExportExcelUrl;
var $ExportWordUrl;
var $ExportXmlUrl;
var $ExportCsvUrl;
var $ExportPdfUrl;
// Update URLs
var $InlineAddUrl;
var $InlineCopyUrl;
var $InlineEditUrl;
var $GridAddUrl;
var $GridEditUrl;
var $MultiDeleteUrl;
var $MultiUpdateUrl;
// Message
function getMessage() {
return @$_SESSION[EW_SESSION_MESSAGE];
}
function setMessage($v) {
ew_AddMessage($_SESSION[EW_SESSION_MESSAGE], $v);
}
function getFailureMessage() {
return @$_SESSION[EW_SESSION_FAILURE_MESSAGE];
}
function setFailureMessage($v) {
ew_AddMessage($_SESSION[EW_SESSION_FAILURE_MESSAGE], $v);
}
function getSuccessMessage() {
return @$_SESSION[EW_SESSION_SUCCESS_MESSAGE];
}
function setSuccessMessage($v) {
ew_AddMessage($_SESSION[EW_SESSION_SUCCESS_MESSAGE], $v);
}
function getWarningMessage() {
return @$_SESSION[EW_SESSION_WARNING_MESSAGE];
}
function setWarningMessage($v) {
ew_AddMessage($_SESSION[EW_SESSION_WARNING_MESSAGE], $v);
}
// Show message
function ShowMessage() {
$hidden = FALSE;
$html = "";
// Message
$sMessage = $this->getMessage();
$this->Message_Showing($sMessage, "");
if ($sMessage <> "") { // Message in Session, display
$html .= "<p class=\"ewMessage\">" . $sMessage . "</p>";
$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
}
// Warning message
$sWarningMessage = $this->getWarningMessage();
$this->Message_Showing($sWarningMessage, "warning");
if ($sWarningMessage <> "") { // Message in Session, display
$html .= "<table class=\"ewMessageTable\"><tr><td class=\"ewWarningIcon\"></td><td class=\"ewWarningMessage\">" . $sWarningMessage . "</td></tr></table>";
$_SESSION[EW_SESSION_WARNING_MESSAGE] = ""; // Clear message in Session
}
// Success message
$sSuccessMessage = $this->getSuccessMessage();
$this->Message_Showing($sSuccessMessage, "success");
if ($sSuccessMessage <> "") { // Message in Session, display
$html .= "<table class=\"ewMessageTable\"><tr><td class=\"ewSuccessIcon\"></td><td class=\"ewSuccessMessage\">" . $sSuccessMessage . "</td></tr></table>";
$_SESSION[EW_SESSION_SUCCESS_MESSAGE] = ""; // Clear message in Session
}
// Failure message
$sErrorMessage = $this->getFailureMessage();
$this->Message_Showing($sErrorMessage, "failure");
if ($sErrorMessage <> "") { // Message in Session, display
$html .= "<table class=\"ewMessageTable\"><tr><td class=\"ewErrorIcon\"></td><td class=\"ewErrorMessage\">" . $sErrorMessage . "</td></tr></table>";
$_SESSION[EW_SESSION_FAILURE_MESSAGE] = ""; // Clear message in Session
}
echo "<div class=\"ewMessageDialog\"" . (($hidden) ? " style=\"display: none;\"" : "") . ">" . $html . "</div>";
}
var $PageHeader;
var $PageFooter;
// Show Page Header
function ShowPageHeader() {
$sHeader = $this->PageHeader;
$this->Page_DataRendering($sHeader);
if ($sHeader <> "") { // Header exists, display
echo "<p class=\"phpmaker\">" . $sHeader . "</p>";
}
}
// Show Page Footer
function ShowPageFooter() {
$sFooter = $this->PageFooter;
$this->Page_DataRendered($sFooter);
if ($sFooter <> "") { // Fotoer exists, display
echo "<p class=\"phpmaker\">" . $sFooter . "</p>";
}
}
// Validate page request
function IsPageRequest() {
global $objForm;
if ($this->UseTokenInUrl) {
if ($objForm)
return ($this->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($this->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language, $UserAgent;
// User agent
$UserAgent = ew_UserAgent();
$GLOBALS["Page"] = &$this;
// Language object
if (!isset($Language)) $Language = new cLanguage();
// Parent constuctor
parent::__construct();
// Table object (realmcharacters)
if (!isset($GLOBALS["realmcharacters"])) {
$GLOBALS["realmcharacters"] = &$this;
$GLOBALS["Table"] = &$GLOBALS["realmcharacters"];
}
$KeyUrl = "";
if (@$_GET["realmid"] <> "") {
$this->RecKey["realmid"] = $_GET["realmid"];
$KeyUrl .= "&realmid=" . urlencode($this->RecKey["realmid"]);
}
if (@$_GET["acctid"] <> "") {
$this->RecKey["acctid"] = $_GET["acctid"];
$KeyUrl .= "&acctid=" . urlencode($this->RecKey["acctid"]);
}
$this->ExportPrintUrl = $this->PageUrl() . "export=print" . $KeyUrl;
$this->ExportHtmlUrl = $this->PageUrl() . "export=html" . $KeyUrl;
$this->ExportExcelUrl = $this->PageUrl() . "export=excel" . $KeyUrl;
$this->ExportWordUrl = $this->PageUrl() . "export=word" . $KeyUrl;
$this->ExportXmlUrl = $this->PageUrl() . "export=xml" . $KeyUrl;
$this->ExportCsvUrl = $this->PageUrl() . "export=csv" . $KeyUrl;
$this->ExportPdfUrl = $this->PageUrl() . "export=pdf" . $KeyUrl;
// Page ID
if (!defined("EW_PAGE_ID"))
define("EW_PAGE_ID", 'view', TRUE);
// Table name (for backward compatibility)
if (!defined("EW_TABLE_NAME"))
define("EW_TABLE_NAME", 'realmcharacters', TRUE);
// Start timer
if (!isset($GLOBALS["gTimer"])) $GLOBALS["gTimer"] = new cTimer();
// Open connection
if (!isset($conn)) $conn = ew_Connect();
// Export options
$this->ExportOptions = new cListOptions();
$this->ExportOptions->Tag = "span";
$this->ExportOptions->TagClassName = "ewExportOption";
}
//
// Page_Init
//
function Page_Init() {
global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
// Security
$Security = new cAdvancedSecurity();
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
// Get export parameters
if (@$_GET["export"] <> "") {
$this->Export = $_GET["export"];
} elseif (ew_IsHttpPost()) {
if (@$_POST["exporttype"] <> "")
$this->Export = $_POST["exporttype"];
} else {
$this->setExportReturnUrl(ew_CurrentUrl());
}
$gsExport = $this->Export; // Get export parameter, used in header
$gsExportFile = $this->TableVar; // Get export file, used in header
if (@$_GET["realmid"] <> "") {
if ($gsExportFile <> "") $gsExportFile .= "_";
$gsExportFile .= ew_StripSlashes($_GET["realmid"]);
}
if (@$_GET["acctid"] <> "") {
if ($gsExportFile <> "") $gsExportFile .= "_";
$gsExportFile .= ew_StripSlashes($_GET["acctid"]);
}
// Setup export options
$this->SetupExportOptions();
$this->CurrentAction = (@$_GET["a"] <> "") ? $_GET["a"] : @$_POST["a_list"];
// Global Page Loading event (in userfn*.php)
Page_Loading();
// Page Load event
$this->Page_Load();
}
//
// Page_Terminate
//
function Page_Terminate($url = "") {
global $conn;
// Page Unload event
$this->Page_Unload();
// Global Page Unloaded event (in userfn*.php)
Page_Unloaded();
$this->Page_Redirecting($url);
// Close connection
$conn->Close();
// Go to URL if specified
if ($url <> "") {
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
header("Location: " . $url);
}
exit();
}
var $ExportOptions; // Export options
var $DisplayRecs = 1;
var $StartRec;
var $StopRec;
var $TotalRecs = 0;
var $RecRange = 10;
var $RecCnt;
var $RecKey = array();
var $Recordset;
//
// Page main
//
function Page_Main() {
global $Language;
// Load current record
$bLoadCurrentRecord = FALSE;
$sReturnUrl = "";
$bMatchRecord = FALSE;
if ($this->IsPageRequest()) { // Validate request
if (@$_GET["realmid"] <> "") {
$this->realmid->setQueryStringValue($_GET["realmid"]);
$this->RecKey["realmid"] = $this->realmid->QueryStringValue;
} else {
$sReturnUrl = "realmcharacterslist.php"; // Return to list
}
if (@$_GET["acctid"] <> "") {
$this->acctid->setQueryStringValue($_GET["acctid"]);
$this->RecKey["acctid"] = $this->acctid->QueryStringValue;
} else {
$sReturnUrl = "realmcharacterslist.php"; // Return to list
}
// Get action
$this->CurrentAction = "I"; // Display form
switch ($this->CurrentAction) {
case "I": // Get a record to display
if (!$this->LoadRow()) { // Load record based on key
if ($this->getSuccessMessage() == "" && $this->getFailureMessage() == "")
$this->setFailureMessage($Language->Phrase("NoRecord")); // Set no record message
$sReturnUrl = "realmcharacterslist.php"; // No matching record, return to list
}
}
// Export data only
if (in_array($this->Export, array("html","word","excel","xml","csv","email","pdf"))) {
if ($this->Export == "email" && $this->ExportReturnUrl() == ew_CurrentPage()) // Default return page
$this->setExportReturnUrl($this->GetViewUrl()); // Add key
$this->ExportData();
if ($this->Export == "email")
$this->Page_Terminate($this->ExportReturnUrl());
else
$this->Page_Terminate(); // Terminate response
exit();
}
} else {
$sReturnUrl = "realmcharacterslist.php"; // Not page request, return to list
}
if ($sReturnUrl <> "")
$this->Page_Terminate($sReturnUrl);
// Render row
$this->RowType = EW_ROWTYPE_VIEW;
$this->ResetAttrs();
$this->RenderRow();
}
// Set up starting record parameters
function SetUpStartRec() {
if ($this->DisplayRecs == 0)
return;
if ($this->IsPageRequest()) { // Validate request
if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
$this->StartRec = $_GET[EW_TABLE_START_REC];
$this->setStartRecordNumber($this->StartRec);
} elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
$PageNo = $_GET[EW_TABLE_PAGE_NO];
if (is_numeric($PageNo)) {
$this->StartRec = ($PageNo-1)*$this->DisplayRecs+1;
if ($this->StartRec <= 0) {
$this->StartRec = 1;
} elseif ($this->StartRec >= intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1) {
$this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1;
}
$this->setStartRecordNumber($this->StartRec);
}
}
}
$this->StartRec = $this->getStartRecordNumber();
// Check if correct start record counter
if (!is_numeric($this->StartRec) || $this->StartRec == "") { // Avoid invalid start record counter
$this->StartRec = 1; // Reset start record counter
$this->setStartRecordNumber($this->StartRec);
} elseif (intval($this->StartRec) > intval($this->TotalRecs)) { // Avoid starting record > total records
$this->StartRec = intval(($this->TotalRecs-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to last page first record
$this->setStartRecordNumber($this->StartRec);
} elseif (($this->StartRec-1) % $this->DisplayRecs <> 0) {
$this->StartRec = intval(($this->StartRec-1)/$this->DisplayRecs)*$this->DisplayRecs+1; // Point to page boundary
$this->setStartRecordNumber($this->StartRec);
}
}
// Load recordset
function LoadRecordset($offset = -1, $rowcnt = -1) {
global $conn;
// Call Recordset Selecting event
$this->Recordset_Selecting($this->CurrentFilter);
// Load List page SQL
$sSql = $this->SelectSQL();
if ($offset > -1 && $rowcnt > -1)
$sSql .= " LIMIT $rowcnt OFFSET $offset";
// Load recordset
$rs = ew_LoadRecordset($sSql);
// Call Recordset Selected event
$this->Recordset_Selected($rs);
return $rs;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $Language;
$sFilter = $this->KeyFilter();
// Call Row Selecting event
$this->Row_Selecting($sFilter);
// Load SQL based on filter
$this->CurrentFilter = $sFilter;
$sSql = $this->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn;
if (!$rs || $rs->EOF) return;
// Call Row Selected event
$row = &$rs->fields;
$this->Row_Selected($row);
$this->realmid->setDbValue($rs->fields('realmid'));
$this->acctid->setDbValue($rs->fields('acctid'));
$this->numchars->setDbValue($rs->fields('numchars'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language;
global $gsLanguage;
// Initialize URLs
$this->AddUrl = $this->GetAddUrl();
$this->EditUrl = $this->GetEditUrl();
$this->CopyUrl = $this->GetCopyUrl();
$this->DeleteUrl = $this->GetDeleteUrl();
$this->ListUrl = $this->GetListUrl();
// Call Row_Rendering event
$this->Row_Rendering();
// Common render codes for all row types
// realmid
// acctid
// numchars
if ($this->RowType == EW_ROWTYPE_VIEW) { // View row
// realmid
if (strval($this->realmid->CurrentValue) <> "") {
$sFilterWrk = "`id`" . ew_SearchString("=", $this->realmid->CurrentValue, EW_DATATYPE_NUMBER);
$sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `realmlist`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
ew_AddFilter($sWhereWrk, $sFilterWrk);
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$this->realmid->ViewValue = $rswrk->fields('DispFld');
$this->realmid->ViewValue .= ew_ValueSeparator(1,$this->realmid) . $rswrk->fields('Disp2Fld');
$rswrk->Close();
} else {
$this->realmid->ViewValue = $this->realmid->CurrentValue;
}
} else {
$this->realmid->ViewValue = NULL;
}
$this->realmid->ViewCustomAttributes = "";
// acctid
if (strval($this->acctid->CurrentValue) <> "") {
$sFilterWrk = "`id`" . ew_SearchString("=", $this->acctid->CurrentValue, EW_DATATYPE_NUMBER);
$sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `username` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `account`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
ew_AddFilter($sWhereWrk, $sFilterWrk);
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$this->acctid->ViewValue = $rswrk->fields('DispFld');
$this->acctid->ViewValue .= ew_ValueSeparator(1,$this->acctid) . $rswrk->fields('Disp2Fld');
$rswrk->Close();
} else {
$this->acctid->ViewValue = $this->acctid->CurrentValue;
}
} else {
$this->acctid->ViewValue = NULL;
}
$this->acctid->ViewCustomAttributes = "";
// numchars
$this->numchars->ViewValue = $this->numchars->CurrentValue;
$this->numchars->ViewCustomAttributes = "";
// realmid
$this->realmid->LinkCustomAttributes = "";
$this->realmid->HrefValue = "";
$this->realmid->TooltipValue = "";
// acctid
$this->acctid->LinkCustomAttributes = "";
$this->acctid->HrefValue = "";
$this->acctid->TooltipValue = "";
// numchars
$this->numchars->LinkCustomAttributes = "";
$this->numchars->HrefValue = "";
$this->numchars->TooltipValue = "";
}
// Call Row Rendered event
if ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$this->Row_Rendered();
}
// Set up export options
function SetupExportOptions() {
global $Language;
// Printer friendly
$item = &$this->ExportOptions->Add("print");
$item->Body = "<a href=\"" . $this->ExportPrintUrl . "\">" . $Language->Phrase("PrinterFriendly") . "</a>";
$item->Visible = TRUE;
// Export to Excel
$item = &$this->ExportOptions->Add("excel");
$item->Body = "<a href=\"" . $this->ExportExcelUrl . "\">" . $Language->Phrase("ExportToExcel") . "</a>";
$item->Visible = FALSE;
// Export to Word
$item = &$this->ExportOptions->Add("word");
$item->Body = "<a href=\"" . $this->ExportWordUrl . "\">" . $Language->Phrase("ExportToWord") . "</a>";
$item->Visible = FALSE;
// Export to Html
$item = &$this->ExportOptions->Add("html");
$item->Body = "<a href=\"" . $this->ExportHtmlUrl . "\">" . $Language->Phrase("ExportToHtml") . "</a>";
$item->Visible = TRUE;
// Export to Xml
$item = &$this->ExportOptions->Add("xml");
$item->Body = "<a href=\"" . $this->ExportXmlUrl . "\">" . $Language->Phrase("ExportToXml") . "</a>";
$item->Visible = FALSE;
// Export to Csv
$item = &$this->ExportOptions->Add("csv");
$item->Body = "<a href=\"" . $this->ExportCsvUrl . "\">" . $Language->Phrase("ExportToCsv") . "</a>";
$item->Visible = FALSE;
// Export to Pdf
$item = &$this->ExportOptions->Add("pdf");
$item->Body = "<a href=\"" . $this->ExportPdfUrl . "\">" . $Language->Phrase("ExportToPDF") . "</a>";
$item->Visible = TRUE;
// Export to Email
$item = &$this->ExportOptions->Add("email");
$item->Body = "<a id=\"emf_realmcharacters\" href=\"javascript:void(0);\" onclick=\"ew_EmailDialogShow({lnk:'emf_realmcharacters',hdr:ewLanguage.Phrase('ExportToEmail'),key:" . ew_ArrayToJsonAttr($this->RecKey) . ",sel:false});\">" . $Language->Phrase("ExportToEmail") . "</a>";
$item->Visible = FALSE;
// Hide options for export/action
if ($this->Export <> "")
$this->ExportOptions->HideAllOptions();
}
// Export data in HTML/CSV/Word/Excel/XML/Email/PDF format
function ExportData() {
$utf8 = (strtolower(EW_CHARSET) == "utf-8");
$bSelectLimit = FALSE;
// Load recordset
if ($bSelectLimit) {
$this->TotalRecs = $this->SelectRecordCount();
} else {
if ($rs = $this->LoadRecordset())
$this->TotalRecs = $rs->RecordCount();
}
$this->StartRec = 1;
$this->SetUpStartRec(); // Set up start record position
// Set the last record to display
if ($this->DisplayRecs <= 0) {
$this->StopRec = $this->TotalRecs;
} else {
$this->StopRec = $this->StartRec + $this->DisplayRecs - 1;
}
if (!$rs) {
header("Content-Type:"); // Remove header
header("Content-Disposition:");
$this->ShowMessage();
return;
}
$ExportDoc = ew_ExportDocument($this, "v");
$ParentTable = "";
if ($bSelectLimit) {
$StartRec = 1;
$StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;
} else {
$StartRec = $this->StartRec;
$StopRec = $this->StopRec;
}
$sHeader = $this->PageHeader;
$this->Page_DataRendering($sHeader);
$ExportDoc->Text .= $sHeader;
$this->ExportDocument($ExportDoc, $rs, $StartRec, $StopRec, "view");
$sFooter = $this->PageFooter;
$this->Page_DataRendered($sFooter);
$ExportDoc->Text .= $sFooter;
// Close recordset
$rs->Close();
// Export header and footer
$ExportDoc->ExportHeaderAndFooter();
// Clean output buffer
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
// Write debug message if enabled
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
// Output data
$ExportDoc->Export();
}
// Page Load event
function Page_Load() {
//echo "Page Load";
}
// Page Unload event
function Page_Unload() {
//echo "Page Unload";
}
// Page Redirecting event
function Page_Redirecting(&$url) {
// Example:
//$url = "your URL";
}
// Message Showing event
// $type = ''|'success'|'failure'|'warning'
function Message_Showing(&$msg, $type) {
if ($type == 'success') {
//$msg = "your success message";
} elseif ($type == 'failure') {
//$msg = "your failure message";
} elseif ($type == 'warning') {
//$msg = "your warning message";
} else {
//$msg = "your message";
}
}
// Page Data Rendering event
function Page_DataRendering(&$header) {
// Example:
//$header = "your header";
}
// Page Data Rendered event
function Page_DataRendered(&$footer) {
// Example:
//$footer = "your footer";
}
}
?>
<?php ew_Header(FALSE) ?>
<?php
// Create page object
if (!isset($realmcharacters_view)) $realmcharacters_view = new crealmcharacters_view();
// Page init
$realmcharacters_view->Page_Init();
// Page main
$realmcharacters_view->Page_Main();
?>
<?php include_once "header.php" ?>
<?php if ($realmcharacters->Export == "") { ?>
<script type="text/javascript">
// Page object
var realmcharacters_view = new ew_Page("realmcharacters_view");
realmcharacters_view.PageID = "view"; // Page ID
var EW_PAGE_ID = realmcharacters_view.PageID; // For backward compatibility
// Form object
var frealmcharactersview = new ew_Form("frealmcharactersview");
// Form_CustomValidate event
frealmcharactersview.Form_CustomValidate =
function(fobj) { // DO NOT CHANGE THIS LINE!
// Your custom validation code here, return false if invalid.
return true;
}
// Use JavaScript validation or not
<?php if (EW_CLIENT_VALIDATE) { ?>
frealmcharactersview.ValidateRequired = true;
<?php } else { ?>
frealmcharactersview.ValidateRequired = false;
<?php } ?>
// Dynamic selection lists
frealmcharactersview.Lists["x_realmid"] = {"LinkField":"x_id","Ajax":null,"AutoFill":false,"DisplayFields":["x_id","x_name","",""],"ParentFields":[],"FilterFields":[],"Options":[]};
frealmcharactersview.Lists["x_acctid"] = {"LinkField":"x_id","Ajax":null,"AutoFill":false,"DisplayFields":["x_id","x_username","",""],"ParentFields":[],"FilterFields":[],"Options":[]};
// Form object for search
</script>
<script type="text/javascript">
// Write your client script here, no need to add script tags.
</script>
<?php } ?>
<p><span id="ewPageCaption" class="ewTitle ewTableTitle"><?php echo $Language->Phrase("View") ?> <?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $realmcharacters->TableCaption() ?> </span><?php $realmcharacters_view->ExportOptions->Render("body"); ?>
</p>
<?php if ($realmcharacters->Export == "") { ?>
<p class="phpmaker">
<a href="<?php echo $realmcharacters_view->ListUrl ?>" id="a_BackToList" class="ewLink"><?php echo $Language->Phrase("BackToList") ?></a>
</p>
<?php } ?>
<?php $realmcharacters_view->ShowPageHeader(); ?>
<?php
$realmcharacters_view->ShowMessage();
?>
<form name="frealmcharactersview" id="frealmcharactersview" class="ewForm" action="" method="post">
<input type="hidden" name="t" value="realmcharacters">
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table id="tbl_realmcharactersview" class="ewTable">
<?php if ($realmcharacters->realmid->Visible) { // realmid ?>
<tr id="r_realmid"<?php echo $realmcharacters->RowAttributes() ?>>
<td class="ewTableHeader"><span id="elh_realmcharacters_realmid"><table class="ewTableHeaderBtn"><tr><td><?php echo $realmcharacters->realmid->FldCaption() ?></td></tr></table></span></td>
<td<?php echo $realmcharacters->realmid->CellAttributes() ?>><span id="el_realmcharacters_realmid">
<span<?php echo $realmcharacters->realmid->ViewAttributes() ?>>
<?php echo $realmcharacters->realmid->ViewValue ?></span>
</span></td>
</tr>
<?php } ?>
<?php if ($realmcharacters->acctid->Visible) { // acctid ?>
<tr id="r_acctid"<?php echo $realmcharacters->RowAttributes() ?>>
<td class="ewTableHeader"><span id="elh_realmcharacters_acctid"><table class="ewTableHeaderBtn"><tr><td><?php echo $realmcharacters->acctid->FldCaption() ?></td></tr></table></span></td>
<td<?php echo $realmcharacters->acctid->CellAttributes() ?>><span id="el_realmcharacters_acctid">
<span<?php echo $realmcharacters->acctid->ViewAttributes() ?>>
<?php echo $realmcharacters->acctid->ViewValue ?></span>
</span></td>
</tr>
<?php } ?>
<?php if ($realmcharacters->numchars->Visible) { // numchars ?>
<tr id="r_numchars"<?php echo $realmcharacters->RowAttributes() ?>>
<td class="ewTableHeader"><span id="elh_realmcharacters_numchars"><table class="ewTableHeaderBtn"><tr><td><?php echo $realmcharacters->numchars->FldCaption() ?></td></tr></table></span></td>
<td<?php echo $realmcharacters->numchars->CellAttributes() ?>><span id="el_realmcharacters_numchars">
<span<?php echo $realmcharacters->numchars->ViewAttributes() ?>>
<?php echo $realmcharacters->numchars->ViewValue ?></span>
</span></td>
</tr>
<?php } ?>
</table>
</div>
</td></tr></table>
</form>
<br>
<script type="text/javascript">
frealmcharactersview.Init();
</script>
<?php
$realmcharacters_view->ShowPageFooter();
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
?>
<?php if ($realmcharacters->Export == "") { ?>
<script type="text/javascript">
// Write your table-specific startup script here
// document.write("page loaded");
</script>
<?php } ?>
<?php include_once "footer.php" ?>
<?php
$realmcharacters_view->Page_Terminate();
?>