[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/install/templates/pages/ -> install.php (source)

   1  <?php
   2  /*

   3  $Id: install.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2008 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  ?>
  13  
  14  <script language="javascript" type="text/javascript" src="ext/xmlhttp/xmlhttp.js"></script>
  15  <script language="javascript" type="text/javascript">
  16  <!--
  17  
  18    var dbServer;
  19    var dbUsername;
  20    var dbPassword;
  21    var dbName;
  22  
  23    var formSubmited = false;
  24  
  25    function handleHttpResponse_DoImport() {
  26      if (http.readyState == 4) {
  27        if (http.status == 200) {
  28          var result = /\[\[([^|]*?)(?:\|([^|]*?)){0,1}\]\]/.exec(http.responseText);
  29          result.shift();
  30  
  31          if (result[0] == '1') {
  32            document.getElementById('mBoxContents').innerHTML = '<p><img src="images/success.gif" align="right" hspace="5" vspace="5" border="0" />Database imported successfully.</p>';
  33  
  34            setTimeout("document.getElementById('installForm').submit();", 2000);
  35          } else {
  36            document.getElementById('mBoxContents').innerHTML = '<p><img src="images/failed.gif" align="right" hspace="5" vspace="5" border="0" />There was a problem importing the database. The following error had occured:</p><p><b>%s</b></p><p>Please verify the connection parameters and try again.</p>'.replace('%s', result[1]);
  37          }
  38        }
  39  
  40        formSubmited = false;
  41      }
  42    }
  43  
  44    function handleHttpResponse() {
  45      if (http.readyState == 4) {
  46        if (http.status == 200) {
  47          var result = /\[\[([^|]*?)(?:\|([^|]*?)){0,1}\]\]/.exec(http.responseText);
  48          result.shift();
  49  
  50          if (result[0] == '1') {
  51            document.getElementById('mBoxContents').innerHTML = '<p><img src="images/progress.gif" align="right" hspace="5" vspace="5" border="0" />The database structure is now being imported. Please be patient during this procedure.</p>';
  52  
  53            loadXMLDoc("rpc.php?action=dbImport&server=" + urlEncode(dbServer) + "&username=" + urlEncode(dbUsername) + "&password=" + urlEncode(dbPassword) + "&name=" + urlEncode(dbName), handleHttpResponse_DoImport);
  54          } else {
  55            document.getElementById('mBoxContents').innerHTML = '<p><img src="images/failed.gif" align="right" hspace="5" vspace="5" border="0" />There was a problem connecting to the database server. The following error had occured:</p><p><b>%s</b></p><p>Please verify the connection parameters and try again.</p>'.replace('%s', result[1]);
  56            formSubmited = false;
  57          }
  58        } else {
  59          formSubmited = false;
  60        }
  61      }
  62    }
  63  
  64    function prepareDB() {
  65      if (formSubmited == true) {
  66        return false;
  67      }
  68  
  69      formSubmited = true;
  70  
  71      showDiv(document.getElementById('mBox'));
  72  
  73      document.getElementById('mBoxContents').innerHTML = '<p><img src="images/progress.gif" align="right" hspace="5" vspace="5" border="0" />Testing database connection..</p>';
  74  
  75      dbServer = document.getElementById("DB_SERVER").value;
  76      dbUsername = document.getElementById("DB_SERVER_USERNAME").value;
  77      dbPassword = document.getElementById("DB_SERVER_PASSWORD").value;
  78      dbName = document.getElementById("DB_DATABASE").value;
  79  
  80      loadXMLDoc("rpc.php?action=dbCheck&server=" + urlEncode(dbServer) + "&username=" + urlEncode(dbUsername) + "&password=" + urlEncode(dbPassword) + "&name=" + urlEncode(dbName), handleHttpResponse);
  81    }
  82  
  83  //-->

  84  </script>
  85  
  86  <div class="mainBlock">
  87    <div class="stepsBox">
  88      <ol>
  89        <li style="font-weight: bold;">Database Server</li>
  90        <li>Web Server</li>
  91        <li>Online Store Settings</li>
  92        <li>Finished!</li>
  93      </ol>
  94    </div>
  95  
  96    <h1>New Installation</h1>
  97  
  98    <p>This web-based installation routine will correctly setup and configure osCMax Power E-Commerce to run on this server.</p>
  99    <p>Please follow the on-screen instructions that will take you through the database server, web server, and store configuration options. If help is needed at any stage, please consult the documentation or seek help at the community support forums.</p>
 100  </div>
 101  
 102  <div class="contentBlock">
 103    <div class="infoPane">
 104      <h3>Step 1: Database Server</h3>
 105  
 106      <div class="infoPaneContents">
 107        <p>The database server stores the content of the online store such as product information, customer information, and the orders that have been made.</p>
 108        <p>Please consult your server administrator if your database server parameters are not yet known.</p>
 109      </div>
 110    </div>
 111  
 112    <div id="mBox">
 113      <div id="mBoxContents"></div>
 114    </div>
 115  
 116    <div class="contentPane">
 117      <h2>Database Server</h2>
 118  
 119      <form name="install" id="installForm" action="install.php?step=2" method="post" onsubmit="prepareDB(); return false;">
 120  
 121      <table border="0" width="99%" cellspacing="0" cellpadding="5" class="inputForm">
 122        <tr>
 123          <td class="inputField"><?php echo 'Database Server<br />' . osc_draw_input_field('DB_SERVER', null, 'class="text"'); ?></td>
 124          <td class="inputDescription">The address of the database server in the form of a hostname or IP address.</td>
 125        </tr>
 126        <tr>
 127          <td class="inputField"><?php echo 'Username<br />' . osc_draw_input_field('DB_SERVER_USERNAME', null, 'class="text"'); ?></td>
 128          <td class="inputDescription">The username used to connect to the database server.</td>
 129        </tr>
 130        <tr>
 131          <td class="inputField"><?php echo 'Password<br />' . osc_draw_password_field('DB_SERVER_PASSWORD', 'class="text"'); ?></td>
 132          <td class="inputDescription">The password that is used together with the username to connect to the database server.</td>
 133        </tr>
 134        <tr>
 135          <td class="inputField"><?php echo 'Database Name<br />' . osc_draw_input_field('DB_DATABASE', null, 'class="text"'); ?></td>
 136          <td class="inputDescription">The name of the database to hold the data in.</td>
 137        </tr>
 138      </table>
 139  
 140      <p align="right"><input type="image" src="images/button_continue.gif" border="0" alt="Continue" id="inputButton" />&nbsp;&nbsp;<a href="index.php"><img src="images/button_cancel.gif" border="0" alt="Cancel" /></a></p>
 141  
 142      </form>
 143    </div>
 144  </div>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7