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 --

Topic soap php forms posts Wordpress

Category Web


Generally speaking, you can typically take PHP code and place a comment at the top:

<?php
/* Plugin Name: My SOAP Plugin
*/
?>

You can then create a folder for the plugin inside /wp-content/plugins/ (for example, /wp-conten/plugins/my-soap-plugin/) and place the PHP file inside that folder. At that point, you can activate the plugin from wp-admin.

Depending on what specifically the PHP file does, it may need editing. For example, if it refers to any specific paths on a server, you'll need to adjust those as you almost certainly didn't have the file inside of a /wp-content/plugins/ folder before. Other changes will likely be needed - for example, you'll have to figure out what to do with the SOAP data - show it on a new admin screen? Display it on the front end for logged-in users associated with that data? - so it might require a significant amount of development work.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.