Advertisement
Guest User

Untitled

a guest
May 24th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.80 KB | None | 0 0
  1. <?php
  2.  
  3. require_once(dirname(__FILE__) . '/admin-page-header.php');
  4.  
  5. $step = isset($_GET['step']) ? (int)$_GET['step'] : 0;
  6.  
  7. /* Start: Front end */
  8. function display_header($title) { ?>
  9. <!DOCTYPE html>
  10. <html>
  11. <head>
  12.   <meta name="viewport" content="width=device-width" />
  13.   <meta charset="utf-8" />
  14.   <meta name="robots" content="noindex,nofollow" />
  15.   <title>Website Installation</title>
  16.   <link rel="stylesheet" type="text/css" href="install/styles.css" />
  17.   <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>
  18. </head>
  19. <body>
  20.   <div class="wrapper">
  21.     <h1 class="step-title"><?php echo $title; ?></h1>
  22. <?php }
  23.  
  24. function display_footer() { ?>
  25.   </div>
  26. </body>
  27. </html>
  28. <?php }
  29.  
  30. switch($step) {
  31.   case 0:
  32. display_header('Introduction'); ?>
  33.     <div class="container">
  34.       <p>Welcome!</p>
  35.       <p>We&#39;re glad you have chosen to join us! Before your own website website is ready, you must setup the basic
  36.         settings of the website. The following information is what you will need to setup the website, so ensure you have
  37.         the information to hand.</p>
  38.       <p>If you are unsure on how to obtain this information, you can usually find it in your webhost cPanel, otherwise
  39.         contact your webhost support for further information.</p>
  40.       <p>Once you&#39;re ready, click the button below to start the installation process.</p>
  41.       <p style="font-size: 12px;">(For everyones advantage, the installation process is only a few steps!)</p>
  42.       <a href="?step=1">Continue</a>
  43.     </div>
  44. <?php display_footer();
  45.   break;
  46.  
  47.   case 1:
  48. display_header('Database Setup'); ?>
  49.   <div class="container">
  50.     <p>Please put the correct information in the below form so a connection can be made to your database server.</p>
  51.     <form id="database-setup" method="post" action="?step=2">
  52.       <div>
  53.         <label for="db-host">Database host:</label>
  54.         <input type="text" id="db-host" name="db-host" />
  55.         <span class="field-desc">This will be an address, such as mysql.webhost.co.uk</span>
  56.       </div>
  57.       <div>
  58.         <label for="db-user">Datbase username:</label>
  59.         <input type="text" id="db-user" name="db-user" />
  60.         <span class="field-desc">This is a database user&#39;s username.</span>
  61.       </div>
  62.       <div>
  63.         <label for="db-pass">Database password:</label>
  64.         <input type="password" id="db-pass" name="db-pass" />
  65.         <span class="field-desc">This is a database users&#39;s password.</span>
  66.       </div>
  67.       <div>
  68.         <label for="db-name">Database name:</label>
  69.         <input type="text" id="db-name" name="db-name" />
  70.         <span class="field-desc">The unique name of the database</span>
  71.       </div>
  72.       <div>
  73.         <label for="table-prefix">Table prefix:</label>
  74.         <input type="text" id="table-prefix" name="table-prefix" value="web_" />
  75.         <span class="field-desc">A unique prefix for each table, this allows multiple installations in the same database.</span>
  76.       </div>
  77.       <div>
  78.         <input type="submit" id="db-submit" name="db-submit" value="Continue" />
  79.       </div>
  80.     </form>
  81.   </div>
  82. <?php display_footer();
  83.   break;
  84.  
  85.   case 2:
  86. display_header('Admin Setup'); ?>
  87.   <div class="container">
  88.     <p>This is where you create your first administrator account</p>
  89.     <form id="admin-setup" method="post" action="?step=3">
  90.       <div>
  91.         <label for="admin-user">Admin username:</label>
  92.         <input type="text" id="admin-user" name="admin-user" />
  93.       </div>
  94.       <div>
  95.         <label for="admin-email">Admin email:</label>
  96.         <input type="email" id="admin-email" name="admin-email" />
  97.       </div>
  98.       <div>
  99.         <label for="admin-pass">Admin password:</label>
  100.         <input type="password" id="admin-pass" name="admin-pass" />
  101.       </div>
  102.       <div>
  103.         <label for="admin-pass-confirm">Confirm admin password:</label>
  104.         <input type="password" id="admin-pass-confirm" name="admin-pass-confirm" />
  105.       </div>
  106.       <div>
  107.         <label for="admin-display">Admin display name:</label>
  108.         <input type="text" id="admin-display" name="admin-display" />
  109.       </div>
  110.       <div>
  111.         <input type="submit" id="admin-submit" name="admin-submit" value="Continue" />
  112.       </div>
  113.     </form>
  114.   </div>
  115. <?php display_footer();
  116.   break;
  117.  
  118.   case 3:
  119. display_header('Website Settings'); ?>
  120.   <div class="container">
  121.     <p>This is where you can configure a few of the core settings of the website</p>
  122.     <form id="website-settings" method="post" action="?step=4">
  123.       <div>
  124.         <label for="website-title">Website title:</label>
  125.         <input type="text" id="website-title" name="website-title" />
  126.       </div>
  127.       <div>
  128.         <label for="website-lang">Website language:</label>
  129.         <select id="website-lang" name="wesite-lang" form="website-settings">
  130.           <option value="english">English</option>
  131.         </select>
  132.       </div>
  133.       <div>
  134.         <label for="website-admin-email">Admin email address:</label>
  135.         <input type="email" id="website-admin-email" name="website-admin-email" value="<?php echo $_POST['admin-email']; ?>" />
  136.         <span class="field-desc">The global administrator email address. May be visible to the public</span>
  137.       </div>
  138.       <div>
  139.         <input type="submit" id="website-submit" name="website-submit" value="Finish" />
  140.       </div>
  141.     </form>
  142.   </div>
  143. <?php display_footer();
  144.   break;
  145.  
  146.   case 4:
  147. display_header('Website Installed'); ?>
  148.   <div class="container">
  149.     <p>Congratulations! Your website is now installed, and is ready to be accessed!</p>
  150.     <p>Click the below button to go to your admin panel.</p>
  151.     <a href="http://<?php echo $_SERVER['HTTP_HOST']?>/admin/">Continue</a>
  152.   </div>
  153. <?php display_footer();
  154.   break;
  155. }
  156. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement