Author Topic: BOI Web Scripting - PHP  (Read 897 times)

0 Members and 1 Guest are viewing this topic.

John Spikowski

  • Posts: 36
BOI Web Scripting - PHP
« on: January 30, 2018, 03:11:59 PM »
I'm happy to announce that PHP works great as a Sage 100 BOI interface for web application integration.

Code: PHP
  1. <?PHP
  2. $oscript = NEW COM("ProvideX.Script") or Die ("BOI connect failed");
  3. $oscript->Init("C:\\Sage\\Sage 100 Standard\\MAS90\\HOME");
  4. $osession = $oscript->NewObject("SY_Session");
  5. $osession->nSetUser("JRS", "MyPassword");
  6. $osession->nsetcompany("ABC");
  7. $osession->nSetDate("A/R", "20171218");
  8. $osession->nSetModule("A/R");
  9. $ocust = $oscript->NewObject("AR_Customer_svc", $osession);
  10.  
  11. PRINT '
  12. <html>
  13. <header>
  14. <title>Customer Contacts</title>
  15. </header>
  16. <body>
  17. <table>
  18. <center><h1>ABC - Customer Contacts</h1></center>
  19. <table style="width:100%">
  20.  <tr>
  21.    <th>Customer Number</th>
  22.    <th>Company Name</th>
  23.    <th>Phone Number</th>
  24.  </tr>
  25. ';
  26.  
  27. $ocust->nMoveFirst();
  28. WHILE (!$ocust->nEOF) {
  29.   PRINT "  <tr>\n";
  30.   PRINT "    <td>{$ocust->sCUSTOMERNO}</td>\n";
  31.   PRINT "    <td>{$ocust->sCUSTOMERNAME}</td>\n";
  32.   PRINT "    <td>{$ocust->sTELEPHONENO}</td>\n" ;
  33.   PRINT "  </tr>\n";
  34.   $ocust->nMoveNext();
  35. }
  36.  
  37. PRINT '
  38. </table>
  39. </body>
  40. </html>
  41. ';
  42.  
  43. UNSET($ocust);
  44. UNSET($osession);
  45. UNSET($oscript);
  46. ?>
  47.