HOW TO Insert Existing PHP Code to WOrdPress
I have an existing functionality from our companies website that lets you enter your reference order number and it will provide you a list of all items status on that order(It actually uses SOAP that contacts our company database to provide the status. Please take note that our website is hosted thru an external provider). Now we got a web developer that develop our website using WordPress how can i insert/use the fuctionality that i have before with PHP website to the New Wordpress Website.
Please see Code
?php
class philipshow extends modul {
function __construct($name = __CLASS__) {
parent::__construct($name);
$this-process();
}
protected function process() {
$s = Request::postVars('workordernumber');
$key = $s['key'];
$wsdl = "http://x.x.x.x/WOTracking.svc?wsdl";
$client = new SoapClient($wsdl, array(
"trace"=1,
"exceptions"=0));
$parameter-WorkOrderNumber = $key;
$value = $client-GetWorkOrderMasterDetail($parameter);
$content = $client-__getLastResponse();
// Loads the XML
$xml = simplexml_load_string($content);
$xml-registerXPathNamespace('a', 'http://schemas.xxxx');
$woresult = $xml-xpath('//a:WorkOrder');
$det= array();
foreach ($woresult as $workorder) {
$wo['CustName'] = $workorder-xpath('a:xxx')[0];
$wo['PONumber'] = $workorder-xpath('a:xxx')[0];
......
}
$this-woresults = $wo;
$woitems = $xml-xpath('//a:WorkOrderItems/a:WorkOrderItemInformation');
foreach ($woitems as $woi) {
$items['ItemNo']= $woi-xpath('a:itemno')[0] ;
$items['Descript'] = $woi-xpath('a:itemdesc')[0];
.......
array_push($det,$items);
}
$this-wodetails = $det;
}
}
?
TPL Code
!-- left-side --
!-- left-side --
{$wohead = $obj-woresults}
{$woitemdetails = $obj-wodetails}
!-- center-side --
{$count=1}
div
div class="border-box company_article clr"
h3spanraquo;/spannbsp;Sales Order span Status/span/h3
ph6Customer Name : {$wohead.CustName} /h6
h6Purchase Order Number : {$wohead.PONumber}/h6
h6Our Ref No. : {$wohead.WONumber} /h6
/p
p
table border="1" style="width:100%"
tr
b
tdItem #/td
tdDescription/td
tdSize/td
tdQuantity/td
tdUOM/td
tdStatus/td
/b
/tr
{foreach $woitemdetails as $detail}
tr
td {$detail.ItemNo}/td
td {$detail.Descript}/td
td {$detail.Size}/td
td {$detail.Quantity}/td
td {$detail.UOM}/td
td{$detail.Status}/td
/tr
{/foreach}
/table
/div
/div
!-- center-side --