home *** CD-ROM | disk | FTP | other *** search
/ Teach Yourself CGI Programming with Perl in a Week / CGIPROGRAMMINGPERL.iso / booksrc / 05cgil12.cgi < prev    next >
Encoding:
Text File  |  1995-12-08  |  2.5 KB  |  116 lines

  1. #!/usr/local/bin/perl 
  2. push(@INC, "/cgi-bin");
  3. require("cgi-lib.pl");
  4.  
  5. &ReadParse(*input);
  6. open($PRICE_FILE, "../systems/sys2.txt");
  7. while (<$PRICE_FILE>) {
  8. chop;
  9. ($item, $price) = split(/:/,$_,2) ;
  10. $price_list{$item} = $price ;
  11. }
  12.  
  13. #Determine the base price based on the system variable 
  14. $price = $price_list{$input{'cpu'}};
  15.  
  16. if ($input{'cpu'} eq "486d66") {
  17.    #set 486 only variables
  18.    $computer_name = "486DX2-66";
  19.    $video = "VLB";
  20.    $price += $price_list{$input{'memory'}};
  21.    $memory = $input{'memory'};
  22.    }
  23. else {
  24.    #not a 486 must be pentium system
  25.    $computer_name = "Pentium";
  26.    $video = "PCI";
  27.    $cache = "256K Cache" ;
  28.    if ($input{'memory'} ne "8 MEG"){
  29.       $price += $price_list{$input{'memory'}};
  30.       }
  31.  
  32.    if ($input{'memory'} eq "4 MEG"){ 
  33.       $memory = "8 MEG"; 
  34.       }      
  35.    else { $memory = $input{'memory'};}
  36.  
  37.    if ($input{'cpu'} eq "P100"){$ptype = 100}
  38.    elsif ($input{'cpu'} eq "P75"){$ptype = 75}
  39.    elsif ($input{'cpu'} eq "P60"){$ptype = 60}
  40.    }
  41.  
  42. #add extra price for monitors over 14inch
  43. $monitor = $input{'monitor'};
  44. $price += $price_list{$input{'monitor'}};
  45.  
  46. #add multimedia system
  47. if ($input{'CD-ROM'} ne "NONE") { 
  48.    $price += $price_list{$input{'CD-ROM'}}; 
  49.    if ($input{'CD-ROM'} eq "2X CDROM") { 
  50.       $multimedia="Double Speed MultiMedia System";
  51.       }
  52.    else {
  53.       $multimedia="Quad Speed MultiMedia System";
  54.       }
  55.    } 
  56.  
  57. #add 14.4 modem price
  58. if ($input{'modem'} ne "NONE") { 
  59.    $price += $price_list{$input{'modem'}}; 
  60.    $modem = $input{'modem'}; 
  61.    }
  62.  
  63. #add disk price
  64. $price += $price_list{$input{'disk'}};
  65. $DISK = $input{'disk'};
  66.  
  67. #add video
  68. $price += $price_list{$input{'video'}};
  69. $VIDEO = $input{'video'};
  70.  
  71. print &PrintHeader;
  72. #print <$in1>;
  73. print<<"print_tag";
  74. <html>
  75. <head>
  76. <title>$computer_name Systems from Austin Computer Center North </title>
  77. </head>
  78. <body>
  79. <h1 align=center> Austin Computer Center North <br>Austin Texas! </h1>
  80. <center>
  81. <img src="/accn.jpg" align=left>
  82. <table border=5>
  83. <th colspan=2 align=center> <h2>
  84. ${computer_name} $ptype for only \$$price
  85. </h2>
  86. <tr><td> <ul>
  87. <li>$memory  of Ram
  88. <li>$cache
  89. <li>Enhanced IDE In/Out Controller
  90. <li>$monitor NIL SVGA Monitor
  91. <li>$VIDEO $video SVGA Video Card
  92. <li>$multimedia
  93. </ul>
  94. <td> <ul>
  95. <li>1.44 Floppy Drive
  96. <li>$DISK Hard Drive
  97. <li>Mouse 
  98. <li>Windows 95
  99. <li>$modem
  100. </ul>
  101. <tr>
  102. <td align=right colspan=2> <h2> 1 YEAR WARRANTY PARTS & LABOR! </h2>
  103. <tr>
  104. </table>
  105. </center>
  106. </body>
  107. </html>
  108. print_tag
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.