Location: PHPKode > projects > Computer Service Company Database > SOLOCMS/dogbert/network-setup.php
<? include ('db.php'); ?>
<? include ('header.php'); ?>
<form action=network-setup.php method=post > 
  <select name="servers" >
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  </select>Servers<br>
 <select name="users" >
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
  <option value="13">13</option>
  <option value="14">14</option>
  <option value="15">15</option>
  <option value="16">16</option>
  <option value="17">17</option>
  <option value="18">18</option>
  <option value="19">19</option>
  <option value="20">20</option>
  </select>Users
  <br>
  <select name="desktops" >
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
  <option value="13">13</option>
  <option value="14">14</option>
  <option value="15">15</option>
  <option value="16">16</option>
  <option value="17">17</option>
  <option value="18">18</option>
  <option value="19">19</option>
  <option value="20">20</option>
  </select>Desktops
  <br>
  <select name="xpproup" >
  <option value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
  <option value="13">13</option>
  <option value="14">14</option>
  <option value="15">15</option>
  <option value="16">16</option>
  <option value="17">17</option>
  <option value="18">18</option>
  <option value="19">19</option>
  <option value="20">20</option>
  </select>XP Pro Software Upgrades
  <br>
  <select name="office" >
  <option value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
  <option value="13">13</option>
  <option value="14">14</option>
  <option value="15">15</option>
  <option value="16">16</option>
  <option value="17">17</option>
  <option value="18">18</option>
  <option value="19">19</option>
  <option value="20">20</option>
  </select>Office 2003 Basic Software
  <br>
  <select name="printers" >
  <option value="0">0</option>
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
  <option value="13">13</option>
  <option value="14">14</option>
  <option value="15">15</option>
  <option value="16">16</option>
  <option value="17">17</option>
  <option value="18">18</option>
  <option value="19">19</option>
  <option value="20">20</option>
  </select>Printers
     <br> <input type="submit" name="submit" value="Preview">


</form>

<?php 

// if new client form is submitted do this:

        if (isset($_POST['submit']))

        {
		 $result = mysql_query("SELECT * FROM networksetup WHERE id = 1");

        $row = mysql_fetch_assoc($result); 

               $servers = ($_POST['servers']);
               
               $desktops = ($_POST['desktops']);
               
               $printers = ($_POST['printers']);

               $users = ($_POST['users']);

               $xpproup = ($_POST['xpproup']);
			
			   $serveroscost = $servers * $row['sbs2003'];
			   
			   $desktoposcost = $xpproup * $row['xppro'];
			
			   if ($desktops <= 5) {
			   $avcost = $row['avg5']; }
			   
			   if ($desktops > 5) {
			   		if ($desktops <= 10) {
			        $avcost = $row['avg10']; }
			   else {$avcost = $row['avg20'];}
			   }
			   
			   if ($users <= 5) {
			   $calcost = 0; }
			   
			   if ($users > 5) {
			   		if ($users <= 10) {
			        $calcost = $row['cal5']; }
			   else {$calcost = $row['cal5'] * 2;}
			   }
			   
			   $officecost = $office * $row['officebasic'];
			
			   $serverinstallcost = $servers * $row['sbs2003_install'];
			
			   $desktopinstallcost = $desktops * $row['desktop_install'];

			   $printerinstallcost = $printers * $row['printer_install'];

			   $userinstallcost = $users * $row['user_install'];
?>
<? echo "Based on:<br>".$servers." Servers <br>".$desktops." Desktops <br>".$users." Users <br>".$printers." printers <br>".$xpproup." Upgrades to XP Pro"; ?>
<table border="1">
  <tr>
    <th>Item</th>
    <th>Amount</th>
    <th>Cost</th>
    <th>Total</th>
  </tr>
  <tr><td colspan="4">SOFTWARE</td></tr>
  <tr>
    <td><? echo"{$row['sbs2003_desc']}"; ?></td>
    <td><? echo $servers; ?></td>
    <td><? echo"{$row['sbs2003']}"; ?></td>
    <td><? echo $serveroscost; ?></td>
  </tr>
  <tr>
    <td><? echo"{$row['xppro_desc']}"; ?></td>
    <td><? echo $xpproup; ?></td>
    <td><? echo"{$row['xppro']}"; ?></td>
    <td><? echo $desktoposcost; ?></td>
  </tr>
  <tr>
    <td><? echo"{$row['officebasic_desc']}"; ?></td>
    <td><? echo $office; ?></td>
    <td><? echo"{$row['officebasic']}"; ?></td>
    <td><? echo $officecost; ?></td>
  </tr>
 <? if ($desktops <= 5) {?>
			 <tr>
    <td><? echo"{$row['avg5_desc']}"; ?></td>
    <td><? echo $desktops; ?></td>
    <td><? echo"{$row['avg5']}"; ?></td>
    <td><? echo $avcost; ?></td>
  </tr>
  <? } ?>
  <? if ($desktops > 5) {
			   		if ($desktops <= 10) { ?>
			        <tr>
    <td><? echo"{$row['avg10_desc']}"; ?></td>
    <td><? echo $desktops; ?></td>
    <td><? echo"{$row['avg10']}"; ?></td>
    <td><? echo $avcost; ?></td>
  </tr> <? } 
			  if ($desktops > 10) { ?>
			   <tr>
    <td><? echo"{$row['avg20_desc']}"; ?></td>
    <td><? echo $desktops; ?></td>
    <td><? echo"{$row['avg20']}"; ?></td>
    <td><? echo $avcost; ?></td>
  </tr> <? }
			   ?>
			 
  <? } ?>
  <tr><td colspan="4">Labor</td></tr>
  <tr>
    <td><? echo"{$row['sbs2003_install_desc']}"; ?></td>
    <td><? echo $servers; ?></td>
    <td><? echo"{$row['sbs2003_install']}"; ?></td>
    <td><? echo $serverinstallcost; ?></td>
  </tr>
  <tr>
    <td><? echo"{$row['desktop_install_desc']}"; ?></td>
    <td><? echo $desktops; ?></td>
    <td><? echo"{$row['desktop_install']}"; ?></td>
    <td><? echo $desktopinstallcost; ?></td>
  </tr>
    <tr>
    <td><? echo"{$row['printer_install_desc']}"; ?></td>
    <td><? echo $printers; ?></td>
    <td><? echo"{$row['printer_install']}"; ?></td>
    <td><? echo $printerinstallcost; ?></td>
  </tr>
    <tr>
    <td><? echo"{$row['user_install_desc']}"; ?></td>
    <td><? echo $users; ?></td>
    <td><? echo"{$row['user_install']}"; ?></td>
    <td><? echo $userinstallcost; ?></td>
  </tr>
    <tr>
    <td></td>
    <td></td>
    <td>Total without Tax</td>
    <td><? echo $userinstallcost + $printerinstallcost + $desktopinstallcost + $serverinstallcost + $officecost + $desktoposcost + $serveroscost; ?></td>
  </tr>

</table>


<?
 } 

?>
<? include ('navigation.php'); ?>
<? include ('footer.php'); ?>
Return current item: Computer Service Company Database