Hey everyone;
I am pretty new to PHP coding, but was required to learn some for my Work Study job at college. Currently I am converting an HTML script from a Journal Report using the SOAP protocol. I was able to configure the information I needed into a table format, however I am not certain how to get the totals of the individual columns. Any help will be appreciated!!!
[php]
<?php $x=1; //Requestor Information $xml = simplexml_load_file("J1.xml"); $Info = $xml->children("soap", true)->Body-> children("ns3", true)->ReportResponse-> children()->Requestor; foreach ($Info as $info) { echo $info->ID, "" , $info->Name, "
", $info->Email, "
"; } //Vendor Info $Report = $xml->children("soap", true)->Body-> children("ns3", true)->ReportResponse->children("ns3", true)->Report-> children("ns2", true)->Report->children("ns2", true)->Vendor ->children("ns2",true)->ID; foreach ($Report as $report) { echo $report, "
", "
"; } //Meat and Potatoes $Items = $xml->children("soap", true)->Body-> children("ns3", true)->ReportResponse->children("ns3", true)->Report-> children("ns2", true)->Report->children("ns2", true)->Customer-> children("ns2", true)->ReportItems; echo "
---Name--- | "; echo "---Type--- | "; echo "---Begin--- | "; echo "---End--- | "; echo "---HTML--- | "; echo "---PDF--- | "; echo "---TOTAL--- |
---|---|---|---|---|---|---|
"; echo $items->children("ns2",true)->ItemName; echo " | "; echo $items->children("ns2",true)->ItemDataType; echo " | "; echo $items->children("ns2",true)->ItemPerformance->children("ns2",true)->Period->children("ns2",true)->Begin; echo " | "; echo $items->children("ns2",true)->ItemPerformance->children("ns2",true)->Period->children("ns2",true)->End; echo " | "; $Type=$items->children("ns2",true)->ItemPerformance->children("ns2",true)->Instance; foreach ($Type as $type) { echo $type->children("ns2",true)->Count; echo " | "; } echo " |
"; echo "Total Number of Items: ", $x, "
"; ?>
[/php]