示例#1
0
 function ExportData()
 {
     global $ZipCode;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "v";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     $this->SetUpStartRec();
     // Set up start record position
     // Set the last record to display
     if ($this->lDisplayRecs < 0) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
     }
     if ($ZipCode->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($ZipCode->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $ZipCode->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'ZipCode', $ZipCode->Export);
             ew_ExportAddValue($sExportStr, 'Status', $ZipCode->Export);
             ew_ExportAddValue($sExportStr, 'MonthlyRequest', $ZipCode->Export);
             ew_ExportAddValue($sExportStr, 'MinOrder', $ZipCode->Export);
             ew_ExportAddValue($sExportStr, 'Delivery', $ZipCode->Export);
             ew_ExportAddValue($sExportStr, 'Message', $ZipCode->Export);
             echo ew_ExportLine($sExportStr, $ZipCode->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $ZipCode->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($ZipCode->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('ZipCode', $ZipCode->ZipCode->CurrentValue);
                 $XmlDoc->AddField('Status', $ZipCode->Status->CurrentValue);
                 $XmlDoc->AddField('MonthlyRequest', $ZipCode->MonthlyRequest->CurrentValue);
                 $XmlDoc->AddField('MinOrder', $ZipCode->MinOrder->CurrentValue);
                 $XmlDoc->AddField('Delivery', $ZipCode->Delivery->CurrentValue);
                 $XmlDoc->AddField('Message', $ZipCode->Message->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $ZipCode->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('ZipCode', $ZipCode->ZipCode->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     echo ew_ExportField('Status', $ZipCode->Status->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     echo ew_ExportField('MonthlyRequest', $ZipCode->MonthlyRequest->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     echo ew_ExportField('MinOrder', $ZipCode->MinOrder->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     echo ew_ExportField('Delivery', $ZipCode->Delivery->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     echo ew_ExportField('Message', $ZipCode->Message->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $ZipCode->ZipCode->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     ew_ExportAddValue($sExportStr, $ZipCode->Status->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     ew_ExportAddValue($sExportStr, $ZipCode->MonthlyRequest->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     ew_ExportAddValue($sExportStr, $ZipCode->MinOrder->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     ew_ExportAddValue($sExportStr, $ZipCode->Delivery->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     ew_ExportAddValue($sExportStr, $ZipCode->Message->ExportValue($ZipCode->Export, $ZipCode->ExportOriginalValue), $ZipCode->Export);
                     echo ew_ExportLine($sExportStr, $ZipCode->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($ZipCode->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($ZipCode->Export);
     }
 }
示例#2
0
 function ExportData()
 {
     global $Customers;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "v";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     $this->SetUpStartRec();
     // Set up start record position
     // Set the last record to display
     if ($this->lDisplayRecs < 0) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
     }
     if ($Customers->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($Customers->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $Customers->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'CustomerID', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Email', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Password', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'FirstName', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'LastName', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'ContactPhone', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Allergies', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'DeliveryAddress1', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'DeliveryAddress2', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'DeliveryCity', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'DeliveryState', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'DeliveryZip', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'DeliveryComments', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingFirstName', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingLastName', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingAddress1', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingAddress2', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingCity', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingState', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingZip', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingPhone', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingCardType', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'BillingCardNumber', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'CIMCustID', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'CIMPymtProfID', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Customer_Type', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'First_Order_Date', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Last_Order_Date', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Total_Orders', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Delivery_Window', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'WeeklyMeals', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'WeeklyReg', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'WeeklyVeg', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Want', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'DontWant', $Customers->Export);
             ew_ExportAddValue($sExportStr, 'Comments', $Customers->Export);
             echo ew_ExportLine($sExportStr, $Customers->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $Customers->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($Customers->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('CustomerID', $Customers->CustomerID->CurrentValue);
                 $XmlDoc->AddField('zEmail', $Customers->zEmail->CurrentValue);
                 $XmlDoc->AddField('Password', $Customers->Password->CurrentValue);
                 $XmlDoc->AddField('FirstName', $Customers->FirstName->CurrentValue);
                 $XmlDoc->AddField('LastName', $Customers->LastName->CurrentValue);
                 $XmlDoc->AddField('ContactPhone', $Customers->ContactPhone->CurrentValue);
                 $XmlDoc->AddField('Allergies', $Customers->Allergies->CurrentValue);
                 $XmlDoc->AddField('DeliveryAddress1', $Customers->DeliveryAddress1->CurrentValue);
                 $XmlDoc->AddField('DeliveryAddress2', $Customers->DeliveryAddress2->CurrentValue);
                 $XmlDoc->AddField('DeliveryCity', $Customers->DeliveryCity->CurrentValue);
                 $XmlDoc->AddField('DeliveryState', $Customers->DeliveryState->CurrentValue);
                 $XmlDoc->AddField('DeliveryZip', $Customers->DeliveryZip->CurrentValue);
                 $XmlDoc->AddField('DeliveryComments', $Customers->DeliveryComments->CurrentValue);
                 $XmlDoc->AddField('BillingFirstName', $Customers->BillingFirstName->CurrentValue);
                 $XmlDoc->AddField('BillingLastName', $Customers->BillingLastName->CurrentValue);
                 $XmlDoc->AddField('BillingAddress1', $Customers->BillingAddress1->CurrentValue);
                 $XmlDoc->AddField('BillingAddress2', $Customers->BillingAddress2->CurrentValue);
                 $XmlDoc->AddField('BillingCity', $Customers->BillingCity->CurrentValue);
                 $XmlDoc->AddField('BillingState', $Customers->BillingState->CurrentValue);
                 $XmlDoc->AddField('BillingZip', $Customers->BillingZip->CurrentValue);
                 $XmlDoc->AddField('BillingPhone', $Customers->BillingPhone->CurrentValue);
                 $XmlDoc->AddField('BillingCardType', $Customers->BillingCardType->CurrentValue);
                 $XmlDoc->AddField('BillingCardNumber', $Customers->BillingCardNumber->CurrentValue);
                 $XmlDoc->AddField('CIMCustID', $Customers->CIMCustID->CurrentValue);
                 $XmlDoc->AddField('CIMPymtProfID', $Customers->CIMPymtProfID->CurrentValue);
                 $XmlDoc->AddField('Customer_Type', $Customers->Customer_Type->CurrentValue);
                 $XmlDoc->AddField('First_Order_Date', $Customers->First_Order_Date->CurrentValue);
                 $XmlDoc->AddField('Last_Order_Date', $Customers->Last_Order_Date->CurrentValue);
                 $XmlDoc->AddField('Total_Orders', $Customers->Total_Orders->CurrentValue);
                 $XmlDoc->AddField('Delivery_Window', $Customers->Delivery_Window->CurrentValue);
                 $XmlDoc->AddField('WeeklyMeals', $Customers->WeeklyMeals->CurrentValue);
                 $XmlDoc->AddField('WeeklyReg', $Customers->WeeklyReg->CurrentValue);
                 $XmlDoc->AddField('WeeklyVeg', $Customers->WeeklyVeg->CurrentValue);
                 $XmlDoc->AddField('Want', $Customers->Want->CurrentValue);
                 $XmlDoc->AddField('DontWant', $Customers->DontWant->CurrentValue);
                 $XmlDoc->AddField('Comments', $Customers->Comments->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $Customers->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('CustomerID', $Customers->CustomerID->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Email', $Customers->zEmail->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Password', $Customers->Password->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('FirstName', $Customers->FirstName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('LastName', $Customers->LastName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('ContactPhone', $Customers->ContactPhone->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Allergies', $Customers->Allergies->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('DeliveryAddress1', $Customers->DeliveryAddress1->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('DeliveryAddress2', $Customers->DeliveryAddress2->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('DeliveryCity', $Customers->DeliveryCity->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('DeliveryState', $Customers->DeliveryState->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('DeliveryZip', $Customers->DeliveryZip->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('DeliveryComments', $Customers->DeliveryComments->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingFirstName', $Customers->BillingFirstName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingLastName', $Customers->BillingLastName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingAddress1', $Customers->BillingAddress1->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingAddress2', $Customers->BillingAddress2->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingCity', $Customers->BillingCity->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingState', $Customers->BillingState->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingZip', $Customers->BillingZip->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingPhone', $Customers->BillingPhone->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingCardType', $Customers->BillingCardType->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('BillingCardNumber', $Customers->BillingCardNumber->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('CIMCustID', $Customers->CIMCustID->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('CIMPymtProfID', $Customers->CIMPymtProfID->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Customer_Type', $Customers->Customer_Type->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('First_Order_Date', $Customers->First_Order_Date->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Last_Order_Date', $Customers->Last_Order_Date->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Total_Orders', $Customers->Total_Orders->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Delivery_Window', $Customers->Delivery_Window->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('WeeklyMeals', $Customers->WeeklyMeals->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('WeeklyReg', $Customers->WeeklyReg->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('WeeklyVeg', $Customers->WeeklyVeg->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Want', $Customers->Want->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('DontWant', $Customers->DontWant->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportField('Comments', $Customers->Comments->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $Customers->CustomerID->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->zEmail->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Password->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->FirstName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->LastName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->ContactPhone->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Allergies->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->DeliveryAddress1->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->DeliveryAddress2->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->DeliveryCity->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->DeliveryState->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->DeliveryZip->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->DeliveryComments->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingFirstName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingLastName->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingAddress1->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingAddress2->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingCity->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingState->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingZip->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingPhone->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingCardType->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->BillingCardNumber->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->CIMCustID->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->CIMPymtProfID->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Customer_Type->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->First_Order_Date->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Last_Order_Date->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Total_Orders->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Delivery_Window->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->WeeklyMeals->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->WeeklyReg->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->WeeklyVeg->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Want->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->DontWant->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     ew_ExportAddValue($sExportStr, $Customers->Comments->ExportValue($Customers->Export, $Customers->ExportOriginalValue), $Customers->Export);
                     echo ew_ExportLine($sExportStr, $Customers->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($Customers->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($Customers->Export);
     }
 }
 function ExportData()
 {
     global $ItemIngredients;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "h";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     // Export all
     if ($ItemIngredients->ExportAll) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         // Export 1 page only
         $this->SetUpStartRec();
         // Set up start record position
         // Set the last record to display
         if ($this->lDisplayRecs < 0) {
             $this->lStopRec = $this->lTotalRecs;
         } else {
             $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
         }
     }
     if ($ItemIngredients->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($ItemIngredients->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $ItemIngredients->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'ItemIngredientID', $ItemIngredients->Export);
             ew_ExportAddValue($sExportStr, 'ItemID', $ItemIngredients->Export);
             ew_ExportAddValue($sExportStr, 'IngredientID', $ItemIngredients->Export);
             ew_ExportAddValue($sExportStr, 'Amount', $ItemIngredients->Export);
             ew_ExportAddValue($sExportStr, 'Type', $ItemIngredients->Export);
             ew_ExportAddValue($sExportStr, 'Letter_Code', $ItemIngredients->Export);
             ew_ExportAddValue($sExportStr, 'Vegetarian', $ItemIngredients->Export);
             echo ew_ExportLine($sExportStr, $ItemIngredients->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $ItemIngredients->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($ItemIngredients->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('ItemIngredientID', $ItemIngredients->ItemIngredientID->CurrentValue);
                 $XmlDoc->AddField('ItemID', $ItemIngredients->ItemID->CurrentValue);
                 $XmlDoc->AddField('IngredientID', $ItemIngredients->IngredientID->CurrentValue);
                 $XmlDoc->AddField('Amount', $ItemIngredients->Amount->CurrentValue);
                 $XmlDoc->AddField('Type', $ItemIngredients->Type->CurrentValue);
                 $XmlDoc->AddField('Letter_Code', $ItemIngredients->Letter_Code->CurrentValue);
                 $XmlDoc->AddField('Vegetarian', $ItemIngredients->Vegetarian->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $ItemIngredients->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('ItemIngredientID', $ItemIngredients->ItemIngredientID->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     echo ew_ExportField('ItemID', $ItemIngredients->ItemID->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     echo ew_ExportField('IngredientID', $ItemIngredients->IngredientID->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     echo ew_ExportField('Amount', $ItemIngredients->Amount->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     echo ew_ExportField('Type', $ItemIngredients->Type->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     echo ew_ExportField('Letter_Code', $ItemIngredients->Letter_Code->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     echo ew_ExportField('Vegetarian', $ItemIngredients->Vegetarian->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $ItemIngredients->ItemIngredientID->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     ew_ExportAddValue($sExportStr, $ItemIngredients->ItemID->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     ew_ExportAddValue($sExportStr, $ItemIngredients->IngredientID->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     ew_ExportAddValue($sExportStr, $ItemIngredients->Amount->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     ew_ExportAddValue($sExportStr, $ItemIngredients->Type->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     ew_ExportAddValue($sExportStr, $ItemIngredients->Letter_Code->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     ew_ExportAddValue($sExportStr, $ItemIngredients->Vegetarian->ExportValue($ItemIngredients->Export, $ItemIngredients->ExportOriginalValue), $ItemIngredients->Export);
                     echo ew_ExportLine($sExportStr, $ItemIngredients->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($ItemIngredients->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($ItemIngredients->Export);
     }
 }
示例#4
0
 function ExportData()
 {
     global $Orders;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "h";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     // Export all
     if ($Orders->ExportAll) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         // Export 1 page only
         $this->SetUpStartRec();
         // Set up start record position
         // Set the last record to display
         if ($this->lDisplayRecs < 0) {
             $this->lStopRec = $this->lTotalRecs;
         } else {
             $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
         }
     }
     if ($Orders->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($Orders->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $Orders->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'OrderID', $Orders->Export);
             ew_ExportAddValue($sExportStr, 'CustomerID', $Orders->Export);
             ew_ExportAddValue($sExportStr, 'TransactionNumber', $Orders->Export);
             ew_ExportAddValue($sExportStr, 'DateOrdered', $Orders->Export);
             ew_ExportAddValue($sExportStr, 'Total', $Orders->Export);
             ew_ExportAddValue($sExportStr, 'DeliveryDate', $Orders->Export);
             ew_ExportAddValue($sExportStr, 'PromoCodeID', $Orders->Export);
             ew_ExportAddValue($sExportStr, 'Sequence', $Orders->Export);
             echo ew_ExportLine($sExportStr, $Orders->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $Orders->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($Orders->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('OrderID', $Orders->OrderID->CurrentValue);
                 $XmlDoc->AddField('CustomerID', $Orders->CustomerID->CurrentValue);
                 $XmlDoc->AddField('TransactionNumber', $Orders->TransactionNumber->CurrentValue);
                 $XmlDoc->AddField('DateOrdered', $Orders->DateOrdered->CurrentValue);
                 $XmlDoc->AddField('Total', $Orders->Total->CurrentValue);
                 $XmlDoc->AddField('DeliveryDate', $Orders->DeliveryDate->CurrentValue);
                 $XmlDoc->AddField('PromoCodeID', $Orders->PromoCodeID->CurrentValue);
                 $XmlDoc->AddField('Sequence', $Orders->Sequence->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $Orders->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('OrderID', $Orders->OrderID->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportField('CustomerID', $Orders->CustomerID->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportField('TransactionNumber', $Orders->TransactionNumber->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportField('DateOrdered', $Orders->DateOrdered->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportField('Total', $Orders->Total->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportField('DeliveryDate', $Orders->DeliveryDate->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportField('PromoCodeID', $Orders->PromoCodeID->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportField('Sequence', $Orders->Sequence->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $Orders->OrderID->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     ew_ExportAddValue($sExportStr, $Orders->CustomerID->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     ew_ExportAddValue($sExportStr, $Orders->TransactionNumber->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     ew_ExportAddValue($sExportStr, $Orders->DateOrdered->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     ew_ExportAddValue($sExportStr, $Orders->Total->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     ew_ExportAddValue($sExportStr, $Orders->DeliveryDate->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     ew_ExportAddValue($sExportStr, $Orders->PromoCodeID->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     ew_ExportAddValue($sExportStr, $Orders->Sequence->ExportValue($Orders->Export, $Orders->ExportOriginalValue), $Orders->Export);
                     echo ew_ExportLine($sExportStr, $Orders->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($Orders->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($Orders->Export);
     }
 }
 function ExportData()
 {
     global $ItemDetails;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "v";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     $this->SetUpStartRec();
     // Set up start record position
     // Set the last record to display
     if ($this->lDisplayRecs < 0) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
     }
     if ($ItemDetails->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($ItemDetails->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $ItemDetails->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'ItemID', $ItemDetails->Export);
             ew_ExportAddValue($sExportStr, 'Time_to_Table', $ItemDetails->Export);
             ew_ExportAddValue($sExportStr, 'Level_Of_Difficulty', $ItemDetails->Export);
             ew_ExportAddValue($sExportStr, 'Beverage_Pairing', $ItemDetails->Export);
             ew_ExportAddValue($sExportStr, 'Vegetarian_Subsitution', $ItemDetails->Export);
             ew_ExportAddValue($sExportStr, 'Calories', $ItemDetails->Export);
             ew_ExportAddValue($sExportStr, 'Other', $ItemDetails->Export);
             ew_ExportAddValue($sExportStr, 'Image', $ItemDetails->Export);
             echo ew_ExportLine($sExportStr, $ItemDetails->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $ItemDetails->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($ItemDetails->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('ItemID', $ItemDetails->ItemID->CurrentValue);
                 $XmlDoc->AddField('Time_to_Table', $ItemDetails->Time_to_Table->CurrentValue);
                 $XmlDoc->AddField('Level_Of_Difficulty', $ItemDetails->Level_Of_Difficulty->CurrentValue);
                 $XmlDoc->AddField('Beverage_Pairing', $ItemDetails->Beverage_Pairing->CurrentValue);
                 $XmlDoc->AddField('Vegetarian_Subsitution', $ItemDetails->Vegetarian_Subsitution->CurrentValue);
                 $XmlDoc->AddField('Calories', $ItemDetails->Calories->CurrentValue);
                 $XmlDoc->AddField('Other', $ItemDetails->Other->CurrentValue);
                 $XmlDoc->AddField('Image', $ItemDetails->Image->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $ItemDetails->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('ItemID', $ItemDetails->ItemID->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportField('Time_to_Table', $ItemDetails->Time_to_Table->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportField('Level_Of_Difficulty', $ItemDetails->Level_Of_Difficulty->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportField('Beverage_Pairing', $ItemDetails->Beverage_Pairing->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportField('Vegetarian_Subsitution', $ItemDetails->Vegetarian_Subsitution->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportField('Calories', $ItemDetails->Calories->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportField('Other', $ItemDetails->Other->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportField('Image', $ItemDetails->Image->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $ItemDetails->ItemID->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     ew_ExportAddValue($sExportStr, $ItemDetails->Time_to_Table->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     ew_ExportAddValue($sExportStr, $ItemDetails->Level_Of_Difficulty->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     ew_ExportAddValue($sExportStr, $ItemDetails->Beverage_Pairing->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     ew_ExportAddValue($sExportStr, $ItemDetails->Vegetarian_Subsitution->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     ew_ExportAddValue($sExportStr, $ItemDetails->Calories->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     ew_ExportAddValue($sExportStr, $ItemDetails->Other->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     ew_ExportAddValue($sExportStr, $ItemDetails->Image->ExportValue($ItemDetails->Export, $ItemDetails->ExportOriginalValue), $ItemDetails->Export);
                     echo ew_ExportLine($sExportStr, $ItemDetails->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($ItemDetails->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($ItemDetails->Export);
     }
 }
 function ExportData()
 {
     global $GiftCertificates;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "h";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     // Export all
     if ($GiftCertificates->ExportAll) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         // Export 1 page only
         $this->SetUpStartRec();
         // Set up start record position
         // Set the last record to display
         if ($this->lDisplayRecs < 0) {
             $this->lStopRec = $this->lTotalRecs;
         } else {
             $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
         }
     }
     if ($GiftCertificates->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($GiftCertificates->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $GiftCertificates->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'GiftCertificateID', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'CustomerID', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftEmail', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftPhone', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftFirstName', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftLastName', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftAmount', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftMessage', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftSendMethod', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftSendAddress1', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftSendAddress2', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftSendCity', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftSendState', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftSendZip', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'GiftSendEmail', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'PromoCodeID', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'DateMailed', $GiftCertificates->Export);
             ew_ExportAddValue($sExportStr, 'Redeemed', $GiftCertificates->Export);
             echo ew_ExportLine($sExportStr, $GiftCertificates->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $GiftCertificates->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($GiftCertificates->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('GiftCertificateID', $GiftCertificates->GiftCertificateID->CurrentValue);
                 $XmlDoc->AddField('CustomerID', $GiftCertificates->CustomerID->CurrentValue);
                 $XmlDoc->AddField('GiftEmail', $GiftCertificates->GiftEmail->CurrentValue);
                 $XmlDoc->AddField('GiftPhone', $GiftCertificates->GiftPhone->CurrentValue);
                 $XmlDoc->AddField('GiftFirstName', $GiftCertificates->GiftFirstName->CurrentValue);
                 $XmlDoc->AddField('GiftLastName', $GiftCertificates->GiftLastName->CurrentValue);
                 $XmlDoc->AddField('GiftAmount', $GiftCertificates->GiftAmount->CurrentValue);
                 $XmlDoc->AddField('GiftMessage', $GiftCertificates->GiftMessage->CurrentValue);
                 $XmlDoc->AddField('GiftSendMethod', $GiftCertificates->GiftSendMethod->CurrentValue);
                 $XmlDoc->AddField('GiftSendAddress1', $GiftCertificates->GiftSendAddress1->CurrentValue);
                 $XmlDoc->AddField('GiftSendAddress2', $GiftCertificates->GiftSendAddress2->CurrentValue);
                 $XmlDoc->AddField('GiftSendCity', $GiftCertificates->GiftSendCity->CurrentValue);
                 $XmlDoc->AddField('GiftSendState', $GiftCertificates->GiftSendState->CurrentValue);
                 $XmlDoc->AddField('GiftSendZip', $GiftCertificates->GiftSendZip->CurrentValue);
                 $XmlDoc->AddField('GiftSendEmail', $GiftCertificates->GiftSendEmail->CurrentValue);
                 $XmlDoc->AddField('PromoCodeID', $GiftCertificates->PromoCodeID->CurrentValue);
                 $XmlDoc->AddField('DateMailed', $GiftCertificates->DateMailed->CurrentValue);
                 $XmlDoc->AddField('Redeemed', $GiftCertificates->Redeemed->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $GiftCertificates->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('GiftCertificateID', $GiftCertificates->GiftCertificateID->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('CustomerID', $GiftCertificates->CustomerID->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftEmail', $GiftCertificates->GiftEmail->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftPhone', $GiftCertificates->GiftPhone->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftFirstName', $GiftCertificates->GiftFirstName->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftLastName', $GiftCertificates->GiftLastName->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftAmount', $GiftCertificates->GiftAmount->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftMessage', $GiftCertificates->GiftMessage->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftSendMethod', $GiftCertificates->GiftSendMethod->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftSendAddress1', $GiftCertificates->GiftSendAddress1->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftSendAddress2', $GiftCertificates->GiftSendAddress2->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftSendCity', $GiftCertificates->GiftSendCity->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftSendState', $GiftCertificates->GiftSendState->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftSendZip', $GiftCertificates->GiftSendZip->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('GiftSendEmail', $GiftCertificates->GiftSendEmail->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('PromoCodeID', $GiftCertificates->PromoCodeID->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('DateMailed', $GiftCertificates->DateMailed->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportField('Redeemed', $GiftCertificates->Redeemed->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftCertificateID->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->CustomerID->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftEmail->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftPhone->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftFirstName->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftLastName->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftAmount->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftMessage->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftSendMethod->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftSendAddress1->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftSendAddress2->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftSendCity->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftSendState->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftSendZip->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->GiftSendEmail->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->PromoCodeID->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->DateMailed->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     ew_ExportAddValue($sExportStr, $GiftCertificates->Redeemed->ExportValue($GiftCertificates->Export, $GiftCertificates->ExportOriginalValue), $GiftCertificates->Export);
                     echo ew_ExportLine($sExportStr, $GiftCertificates->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($GiftCertificates->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($GiftCertificates->Export);
     }
 }
 function ExportData()
 {
     global $password_reset_requests;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "v";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     $this->SetUpStartRec();
     // Set up start record position
     // Set the last record to display
     if ($this->lDisplayRecs < 0) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
     }
     if ($password_reset_requests->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($password_reset_requests->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $password_reset_requests->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'id', $password_reset_requests->Export);
             ew_ExportAddValue($sExportStr, 'CustomerID', $password_reset_requests->Export);
             ew_ExportAddValue($sExportStr, 'token_id', $password_reset_requests->Export);
             ew_ExportAddValue($sExportStr, 'expires', $password_reset_requests->Export);
             echo ew_ExportLine($sExportStr, $password_reset_requests->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $password_reset_requests->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($password_reset_requests->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('id', $password_reset_requests->id->CurrentValue);
                 $XmlDoc->AddField('CustomerID', $password_reset_requests->CustomerID->CurrentValue);
                 $XmlDoc->AddField('token_id', $password_reset_requests->token_id->CurrentValue);
                 $XmlDoc->AddField('expires', $password_reset_requests->expires->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $password_reset_requests->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('id', $password_reset_requests->id->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                     echo ew_ExportField('CustomerID', $password_reset_requests->CustomerID->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                     echo ew_ExportField('token_id', $password_reset_requests->token_id->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                     echo ew_ExportField('expires', $password_reset_requests->expires->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $password_reset_requests->id->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                     ew_ExportAddValue($sExportStr, $password_reset_requests->CustomerID->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                     ew_ExportAddValue($sExportStr, $password_reset_requests->token_id->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                     ew_ExportAddValue($sExportStr, $password_reset_requests->expires->ExportValue($password_reset_requests->Export, $password_reset_requests->ExportOriginalValue), $password_reset_requests->Export);
                     echo ew_ExportLine($sExportStr, $password_reset_requests->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($password_reset_requests->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($password_reset_requests->Export);
     }
 }
 function ExportData()
 {
     global $PromoCodes;
     $sCsvStr = "";
     // Default export style
     $sExportStyle = "h";
     // Load recordset
     $rs = $this->LoadRecordset();
     $this->lTotalRecs = $rs->RecordCount();
     $this->lStartRec = 1;
     // Export all
     if ($PromoCodes->ExportAll) {
         $this->lStopRec = $this->lTotalRecs;
     } else {
         // Export 1 page only
         $this->SetUpStartRec();
         // Set up start record position
         // Set the last record to display
         if ($this->lDisplayRecs < 0) {
             $this->lStopRec = $this->lTotalRecs;
         } else {
             $this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
         }
     }
     if ($PromoCodes->Export == "xml") {
         $XmlDoc = new cXMLDocument();
     } else {
         echo "";
         echo ew_ExportHeader($PromoCodes->Export);
         // Horizontal format, write header
         if ($sExportStyle != "v" || $PromoCodes->Export == "csv") {
             $sExportStr = "";
             ew_ExportAddValue($sExportStr, 'PromoCodeID', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'PromoCodeName', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'PromoCodeType', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'Amount', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'ValidFrom', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'ValidTo', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'Message', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'One_Time_Only', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'New_Customer_Only', $PromoCodes->Export);
             ew_ExportAddValue($sExportStr, 'multiple_use', $PromoCodes->Export);
             echo ew_ExportLine($sExportStr, $PromoCodes->Export);
         }
     }
     // Move to first record
     $this->lRecCnt = $this->lStartRec - 1;
     if (!$rs->EOF) {
         $rs->MoveFirst();
         $rs->Move($this->lStartRec - 1);
     }
     while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
         $this->lRecCnt++;
         if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
             $this->LoadRowValues($rs);
             // Render row for display
             $PromoCodes->RowType = EW_ROWTYPE_VIEW;
             // Render view
             $this->RenderRow();
             if ($PromoCodes->Export == "xml") {
                 $XmlDoc->BeginRow();
                 $XmlDoc->AddField('PromoCodeID', $PromoCodes->PromoCodeID->CurrentValue);
                 $XmlDoc->AddField('PromoCodeName', $PromoCodes->PromoCodeName->CurrentValue);
                 $XmlDoc->AddField('PromoCodeType', $PromoCodes->PromoCodeType->CurrentValue);
                 $XmlDoc->AddField('Amount', $PromoCodes->Amount->CurrentValue);
                 $XmlDoc->AddField('ValidFrom', $PromoCodes->ValidFrom->CurrentValue);
                 $XmlDoc->AddField('ValidTo', $PromoCodes->ValidTo->CurrentValue);
                 $XmlDoc->AddField('Message', $PromoCodes->Message->CurrentValue);
                 $XmlDoc->AddField('One_Time_Only', $PromoCodes->One_Time_Only->CurrentValue);
                 $XmlDoc->AddField('New_Customer_Only', $PromoCodes->New_Customer_Only->CurrentValue);
                 $XmlDoc->AddField('multiple_use', $PromoCodes->multiple_use->CurrentValue);
                 $XmlDoc->EndRow();
             } else {
                 if ($sExportStyle == "v" && $PromoCodes->Export != "csv") {
                     // Vertical format
                     echo ew_ExportField('PromoCodeID', $PromoCodes->PromoCodeID->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('PromoCodeName', $PromoCodes->PromoCodeName->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('PromoCodeType', $PromoCodes->PromoCodeType->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('Amount', $PromoCodes->Amount->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('ValidFrom', $PromoCodes->ValidFrom->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('ValidTo', $PromoCodes->ValidTo->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('Message', $PromoCodes->Message->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('One_Time_Only', $PromoCodes->One_Time_Only->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('New_Customer_Only', $PromoCodes->New_Customer_Only->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportField('multiple_use', $PromoCodes->multiple_use->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                 } else {
                     // Horizontal format
                     $sExportStr = "";
                     ew_ExportAddValue($sExportStr, $PromoCodes->PromoCodeID->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->PromoCodeName->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->PromoCodeType->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->Amount->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->ValidFrom->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->ValidTo->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->Message->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->One_Time_Only->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->New_Customer_Only->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     ew_ExportAddValue($sExportStr, $PromoCodes->multiple_use->ExportValue($PromoCodes->Export, $PromoCodes->ExportOriginalValue), $PromoCodes->Export);
                     echo ew_ExportLine($sExportStr, $PromoCodes->Export);
                 }
             }
         }
         $rs->MoveNext();
     }
     // Close recordset
     $rs->Close();
     if ($PromoCodes->Export == "xml") {
         header("Content-Type: text/xml");
         echo $XmlDoc->XML();
     } else {
         echo ew_ExportFooter($PromoCodes->Export);
     }
 }