Пример #1
0
?>
</tr>
<?php 
// Print out the log file.
try {
    $log = ZuoraAPIHelper::getFileContents($OUTPUT_FILE);
    $log_array = explode("\n", $log);
    foreach ($log_array as $line) {
        $columns = explode($SEPARATOR, $line);
        if (count($columns) > 1) {
            echo "<tr>";
            foreach ($columns as $value) {
                echo "<td>" . $value . "</td>";
            }
            echo "</tr>\n";
        }
    }
} catch (Exception $e) {
}
?>
  </table>
<p>Log File:<br/>
<pre>
<?php 
echo ZuoraAPIHelper::getFileContents($LOG_FILE);
?>
</pre>
</p>
 </body>
</html>
Пример #2
0
 $errorCount = 0;
 $resultArray = array();
 $payloadChunks = array_chunk($payload, $logIndex);
 $chunkCount = 0;
 $recordCount = 0;
 foreach ($payloadChunks as $chunk) {
     $chunkCount++;
     # Create the XML for the operation/object.
     $xml = ZuoraAPIHelper::printXMLWithNS($operation, $object, $fieldList, $chunk, $debug, 0, $defaultApiNamespace, $defaultObjectNamespace, false);
     if ($showRequest) {
         $soapRequest = createRequest($header->data["session"], $xml);
         fwrite($lf, "Request:\n");
         fwrite($lf, xml_pretty_printer($soapRequest, true) . "\n");
         continue;
     }
     $result = ZuoraAPIHelper::bulkOperation($client, $header, $operation, $xml, count($chunk), $debug, TRUE, $objectCount);
     $successCount += $result["successCount"];
     $errorCount += $result["errorCount"];
     $resultArray[] = $result;
     $recordCount += count($chunk);
     // Print a Summary of results
     fwrite($lf, "Chunk " . $chunkCount . ", " . $recordCount . " records processed: successfully " . $operation . "d " . $result["successCount"] . " out of " . count($chunk) . " ZObjects. Number of errors: " . $result["errorCount"] . ". Total errors: " . $errorCount . "/" . $recordCount . ".\n");
     if ($result["errorCount"] > 0) {
         fwrite($lf, "The following ZObjects failed:\n");
         $errorList = $result["errorList"];
         for ($i = 0; $i < count($errorList); $i++) {
             $error = $errorList[$i];
             // Please note the offset by 1 for the header.
             $recordIndex = $recordCount - count($chunk) + $error["index"] + 1;
             fwrite($lf, $recordIndex . "," . $error["code"] . "," . $error["message"] . "\n");
             fwrite($of, date($DATE_FORMAT, time()) . $SEPARATOR . $error["message"] . $SEPARATOR . $recordIndex . $SEPARATOR . $error["code"] . $SEPARATOR . $chunkCount . "\n");
Пример #3
0
                                                                                         <td><input tabindex="108" type="text" size="3" name="object-ns" value="<?php echo $_SESSION['object-ns'] ?>"/></td>
                                                                                 </tr>
                                                                         </table>
                                                                 </td>
                                                         </tr>
                                                 </table>
                                         </td>
                                 </tr>
                         </table>
                 </td>
         </tr>
 </table>
 <table width="99%" border="0" cellpadding="0" cellspacing="0" align="center">
         <tr>
                 <td>Enter your query text or call xml here:<br />
                         <textarea tabindex="7" rows="10" cols="60" name="body" wrap="virtual"><?php echo ZuoraAPIHelper::xmlspecialchars($_SESSION['body']) ?></textarea><br />
                         <input tabindex="8" type="submit" value="Submit" name="submit"/><input tabindex="11" type="submit" value="Clear" name="reset"/>
                         <input tabindex="9" type="checkbox" name="csv">CSV Output</input>&nbsp;
                         <input tabindex="10" type="checkbox" name="queryMore">Use QueryMore to get all results</input><br />
                 </td>
                 <td>
                         <table>
                                 <tr>
                                         <td>API Call Templates:</td>
                                         <td></td>
                                 </tr>
                                 <tr>
                                         <td>- Pick an Operation:</td>
                                         <td><select tabindex="92" onChange="document.getElementById('operation').value = this.value;" name="template-op">
                                                 <option value=""></option>
                                                 <?php
Пример #4
0
 public static function joinTables($table1Data, $table2Data, $key = "")
 {
     $indexes = ZuoraAPIHelper::getTableJoinKeyIndexes($table1Data, $table2Data, $key);
     return ZuoraAPIHelper::joinTablesWithIndexes($table1Data, $table2Data, $indexes[1], $indexes[2]);
     /*
             $index1 = -1;
             $counter1 = 0;
             $index2 = -1;
             foreach($table1Data[0] as $header1) {
                 $counter2 = 0;
     	    if (strlen($key) > 0) {
     		if (strcasecmp($key,$header1) != 0) {
     //	    	    print "Key Found: " . $key . " != " . $header1 . "<br/>\n";
                         $counter1++;
     		    continue;
                     }
     //	    	print "Key Found: " . $key . " == " . $header1 . "<br/>\n";
                 }
                 foreach ($table2Data[0] as $header2) {
     //	    	print "Header compare: " . $header1 . " == " . $header2 . "<br/>\n";
                 	if (strcasecmp($header1,$header2) == 0) {
                 	    $key = $header1;
                 	    $index1 = $counter1;
                 	    $index2 = $counter2;
     //	    	    print "Found Key: " . $key . ", index1: " . $index1 . ", index2: " . $index2 . "<br/>\n";
                 	    break;
                 	 }
                 	 $counter2++;
                 }
                 if ($index1 >= 0) {
                     break;
                 }
                 $counter1++;
             }
             $line = array();
             // Create the header.
             foreach($table1Data[0] as $header1) {
                 $line[] = $header1;
             }
             $counter = 0;
             foreach ($table2Data[0] as $header2) {
                 $line[] = $header2;
                 $counter++;
             }
             $output[] = $line;
     
             for ($i = 1; $i < count($table1Data); $i++) {
                 // Start the line
                 $line = array();
                 foreach($table1Data[$i] as $data1) {
                     $line[] = $data1;
                 }
     
                 $key1 = "";
                 if ($index1 >= 0) {
                     $key1 = $table1Data[$i][$index1];
                 }
                 for ($j = 1; $j < count($table2Data); $j++) {
                     $key2 = "";
                     if ($index2 >= 0) {
                         $key2 = $table2Data[$j][$index2];
                     }
                     $completeLine = $line;
     //		print "Data key compare: " . $key1 . " == " . $key2 . "<br/>\n";
                     if (strcasecmp($key1,$key2) == 0) {
     //		    print "Data key found: " . $key1 . "<br/>\n";
                         $counter = 0;
                         foreach ($table2Data[$j] as $data2) {
                             $completeLine[] = $data2;
                             $counter++;
                         }
                         $output[] = $completeLine;
                     }
                 }
             }
             return $output;
     */
 }