Advertisement
Guest User

SteamPros.net - Methods

a guest
Mar 16th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 34.57 KB | None | 0 0
  1. <?php
  2.  
  3. //--------------------------------------//
  4. //              STEAM PROS              //
  5. //              methods.php             //
  6. //--------------------------------------//
  7. //              Ryan Perkins            //
  8. //      rypedesigns.com 2016 (c)        //
  9. //--------------------------------------//
  10.  
  11.  
  12. class database {
  13.  
  14.     function connect()
  15.         {
  16.        
  17.         if  ( $_SERVER["REMOTE_ADDR"] == "127.0.0.1" ) 
  18.             //{ $domain = "localhost"; } else { $domain = "mysql.rypedesigns.com"; }
  19.  
  20.             $dbuser = "rype";                                                                                                                                                                                               $dbuser = "steampro_rype";
  21.             $dbpass = "databasePW";                                                                                                                                                                                         $dbpass = "k1llerthps";
  22.             $dbname = "steampro_site";                                                                                                                                                                                      $dbname = "steampro_site";
  23.             $dbhost = "steampros.net";                                                                                                                                                                                      $dbhost = "steampros.net";
  24.  
  25.         $this->id = mysql_connect($dbhost, "steampro_rype", $dbpass) or die("<br />Failed onConnect(DB); printing report..<br />" . mysql_error());
  26.         mysql_select_db($dbname, $this->id) or die ("<br />Failed onSelect('{$dbname}'); printing report..<br />" . mysql_error());
  27.         return $this->id;
  28.        
  29.         } // end connect()
  30.  
  31.     function query($query_input, $results = false, $result_name = false)
  32.         {
  33.            
  34.             global $DB;
  35.            
  36.             if  ( $this->qcount == 0 || $this->qcount == false ){
  37.                
  38.                 $this->qcount = 1;
  39.                
  40.                 } else {
  41.                
  42.                 ++$this->qcount;
  43.                
  44.                 }
  45.                
  46.             $result = @mysql_query($query_input, $this->id);
  47.            
  48.            
  49.             if  ( $result !== false && $result !== NULL ){
  50.                
  51.                 $this->error = NULL;
  52.                 $this->last_query = $query_input;
  53.                
  54.                 if  ( !isset($result_name) || $result_name == false ){
  55.                       $this->result = $result; }
  56.                
  57.                 else{ $this->$result_name = $result; }
  58.                
  59.                 if  ( $results == true || $results == "1" ){    $result_count = 0;
  60.                    
  61.                     $this->count_query = preg_replace('/LIMIT(\s*)(\d*\s*,)?(\s*)(\d*)/', '', $query_input);
  62.                     $count_result = @mysql_query($this->count_query, $this->id);
  63.                    
  64.                     while   ( $row = mysql_fetch_row($count_result) )
  65.                             { $result_count++; }
  66.                            
  67.                     $this->results = $result_count;
  68.                     return @mysql_query($query_input, $this->id);
  69.                            
  70.                     } else {
  71.                        
  72.                     return true;
  73.                    
  74.                     }
  75.                    
  76.                 } else {
  77.                    
  78.                 $this->error = mysql_error();
  79.                 $this->last_query = $query_input;
  80.                
  81.                  return $this->result = false;
  82.            
  83.                 }
  84.                
  85.         } // end query
  86.  
  87.  
  88. } // end DB
  89.  
  90.  
  91.  
  92.  
  93. class user {
  94. /*
  95.     function login($page){
  96.        
  97.         global $DB, $subpage;
  98.        
  99.         if  ( isset($_POST["username"]) && isset($_POST["password"]) ) {
  100.            
  101.             $username   =   $_POST["username"];
  102.             $password   =   md5($_POST["password"]);
  103.  
  104.             $query = "SELECT * FROM `users` WHERE `username` = '{$username}' AND `password` = '{$password}' LIMIT 1";
  105.             $DB->query($query);
  106.            
  107.             $row = mysql_fetch_array($DB->result, MYSQL_ASSOC);
  108.             if  ( isset($row) && $DB->error == NULL ) {    
  109.                
  110.                
  111.                 setcookie("id", $row["id"]);
  112.                 setcookie("username", $_POST["username"]);
  113.                 setcookie("password", $password);
  114.                
  115.                 $this->logged_in    = true;
  116.                 $this->uid              = $row["id"];
  117.                 $this->username = $_POST["username"];
  118.                 $this->password = $password;
  119.                 $this->admin        = $row["admin"];
  120.                
  121.                 } else {
  122.                
  123.                 setcookie("id", NULL);
  124.                 setcookie("username", NULL);
  125.                 setcookie("password", NULL);
  126.                
  127.                 $this->logged_in    = false;
  128.                 $this->uid              = NULL;
  129.                 $this->username = NULL;
  130.                 $this->password = NULL;            
  131.                 $this->admin        = false;
  132.                    
  133.                 }
  134.        
  135.             }
  136.        
  137.         }       //  end login()         ----------
  138.  
  139. */
  140.  
  141.     function verify($source, $setcookies) {
  142.    
  143.     global $DB;
  144.    
  145.     if  ( $source == "post" || $_POST["login"] == "1" ) {
  146.        
  147.         $username   = $_POST["username"];
  148.         $password   = md5($_POST["password"]);
  149.        
  150.         } elseif ( $source == "cookie" || isset($_COOKIE["username"]) ) {
  151.            
  152.         $username   = $_COOKIE["username"];
  153.         $password   = $_COOKIE["password"];
  154.        
  155.         }
  156.        
  157.     $query          = "SELECT * FROM `users` WHERE `username` = '{$username}' AND `password` = '{$password}' LIMIT 1";
  158.    
  159.     $DB->query($query);
  160.    
  161.     $row = mysql_fetch_array($DB->result, MYSQL_ASSOC);
  162.  
  163.             if  ( isset($row) && $DB->error == NULL ) {    
  164.            
  165.                 $this->logged_in    = true;
  166.                 $this->uid              = $row["id"];
  167.                 $this->username = $row["username"];
  168.                 $this->password = $row["password"];
  169.                 $this->admin        = $row["admin"];
  170.                
  171.                 if  ( $setcookies == "true" ) {
  172.  
  173.                     setcookie("id", $row["id"]);
  174.                     setcookie("username", $row["username"]);
  175.                     setcookie("password", $row["password"]);
  176.                     setcookie("time", time());
  177.                    
  178.                     }  
  179.  
  180.                 } else {
  181.                
  182.                 $this->logged_in    = false;
  183.                 $this->uid              = NULL;
  184.                 $this->username = NULL;
  185.                 $this->password = NULL;            
  186.                 $this->admin        = false;
  187.                
  188.                 if  ( $setcookies == "true" ) {
  189.                    
  190.                     unset($_COOKIE["id"]);
  191.                     unset($_COOKIE["username"]);
  192.                     unset($_COOKIE["password"]);
  193.                     unset($_COOKIE["time"]);
  194.                    
  195.                     }                  
  196.            
  197.             }
  198.                                             //  echo "COOKIES:"; print_r($_COOKIE); echo "<br /><br /><br />";
  199.     }       //      end verify()            ----------
  200.    
  201. }   //      end user() class    ---------------
  202.  
  203.  
  204.  
  205. class methods {
  206.  
  207.  
  208.     function administration($page) {
  209.    
  210.         global $DB, $user, $subpage;
  211.        
  212.         $this->subHeader($page);
  213.        
  214.         if      ( isset($_POST["nid"]) ) { $nid = $_POST["nid"]; }
  215.         elseif  ( isset($_GET["nid"]) )  { $nid = $_GET["nid"]; }
  216.        
  217.         // print_r($_POST);
  218.         // echo $_COOKIE["username"] . " ==> username(cookie)<br /><br /> " . $_COOKIE["password"] . " ==> password <br /><br />";
  219.        
  220.        
  221.         if  ( $user->admin !== "1" ) {  echo "<h2>Login Required!</h2>Please click the administors link at the bottom of any page and login properly to access this page."; }
  222.        
  223.         //  CHECK LOGGED IN     ---------------
  224.        
  225.         if  ( $user->logged_in == true && $user->admin == "1" ) {
  226.            
  227.             echo "<h4 style=\"text-align: center\">logged in as: {$user->username}</h4>";
  228.            
  229.            
  230.                 //  CHECK NEWS SUBMITTED        ---------------
  231.             if  ( $_POST["submit_news"] == "1" && isset($_POST["title"]) && isset($_POST["body"]) ) {
  232.                
  233.                 $title  = addslashes($_POST["title"]);
  234.                 $body   = addslashes($_POST["body"]);
  235.                 $time   = time();
  236.                 $action = $_POST["action"];
  237.                 $nid    = $_POST["nid"];
  238.                 $delete = $_POST["delete"];
  239.                
  240.                 if  ( isset($user->username) && isset($user->uid) ) {
  241.                
  242.                     if  ( $delete == "1" && isset($nid) ) {
  243.                             $query = "DELETE FROM `newsEntries` WHERE `id` = '{$nid}' limit 1";
  244.                             $DB->query($query);
  245.                            
  246.                             if  ( $DB->error == NULL ) {   
  247.                                 echo "<h2>Successfully Deleted!</h2>The news post you requested ('<b>{$title}</b>') has been successfuly removed from the database.";   }
  248.                        
  249.                         } elseif ( $action == "insert" || !isset($action) ) {
  250.                             $query = "INSERT INTO `newsEntries` ( `uid`, `username`, `title`, `body`, `time` )  VALUES ('{$user->uid}', '{$user->username}', '{$title}', '{$body}', '{$time}')";
  251.                             $DB->query($query);
  252.                            
  253.                             if  ( $DB->error == NULL ) {
  254.                                     echo "<h2>News Entry Added!</h2>Your news post named '<b>{$title}</b>' has been successfully added to the News database."; }
  255.                        
  256.                         } elseif ( $action == "update" && is_numeric($nid) ) {
  257.                             $query = "UPDATE `newsEntries` SET `title` = '{$title}', `body` = '{$body}' WHERE `id` = '{$nid}' LIMIT 1";
  258.                             $DB->query($query);
  259.                            
  260.                             if  ( $DB->error == NULL ) {
  261.                                     echo "<h2>News Entry Updated!</h2>Your news post named '<b>{$title}</b>' has been successfully updated."; }
  262.                         } else {
  263.                             echo "<h2>Sorry..</h2>There was a problem with your request. Please hit the back button and try again.";   
  264.                         }
  265.                    
  266.                         //  ECHO QUERY TROUBLESHOOTING  ---------------
  267.                     echo "<!-- {$query} -->";
  268.                    
  269.                     } else { echo "username or uid is not set. user :: "; print_r($user); }
  270.                
  271.                
  272.                     //  CHECK NEWS EDIT VARS        ---------------
  273.                 } elseif ( $subpage == "edit" ) {
  274.                
  275.                 $query  = "SELECT * FROM `newsEntries` WHERE `id` = '{$nid}' LIMIT 1";
  276.                 $DB->query($query);
  277.                
  278.                 $row    = mysql_fetch_array($DB->result, MYSQL_ASSOC);
  279.                
  280.                 if  ( $DB->error !== NULL ) { echo $DB->error; return; }
  281.                
  282.                 $title  = $row["title"];
  283.                 $body   = $row["body"];
  284.                
  285.                 echo "
  286.  
  287.                 <h2>Edit News Entry</h2>
  288.  
  289.                 <form action=\"index.php?page=administration\" method=\"post\">
  290.  
  291.                     <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" style=\"width: 70%; min-width: 400px; text-align: left; font-weight: bold; margin-left: auto; margin-right: auto\">
  292.                    
  293.                     <tr>
  294.                         <td colspan=\"2\" valign=\"top\" style=\"height: auto; padding-bottom: 6px; color: #93804f\">
  295.                        
  296.                             News Title<br />
  297.                             <input type=\"text\" name=\"title\" value=\"{$title}\" size=\"64\" style=\"width: 100%; min-width: 400px\">
  298.                            
  299.                             <br />
  300.                            
  301.                             News Body <br />
  302.                             <textarea name=\"body\" style=\"width: 100%; min-width: 400px\" rows=\"8\">{$body}</textarea>
  303.    
  304.                         </td>
  305.                     </tr>
  306.    
  307.    
  308.                     <tr>
  309.                         <td style=\"width: 100px; color: #93804f; white-space: nowrap; vertical-align: top; text-align: center; padding-top: 0px\" valign=\"top\" nowrap>
  310.    
  311.                            
  312.                             <span style=\"display: inline-block; background-color: #AA0A0A; border: 2px solid white; padding: 2px 10px 2px 10px; width: auto; border-radius: 4px\">
  313.                            
  314.                             <font style=\"color: white\">Delete?</font> <input type=\"checkbox\" name=\"delete\" value=\"1\" onClick=\"confirm('Really delete this post?')\">
  315.                                
  316.                             </span>
  317.                        
  318.                         </td>
  319.                        
  320.                         <td valign=\"top\" style=\"padding: 0px 2px 0px 10px; vertical-align: top; text-align: right\" nowrap>
  321.  
  322.                         <input type=\"hidden\" name=\"submit_news\" value=\"1\">
  323.                         <input type=\"hidden\" name=\"action\" value=\"update\">
  324.                         <input type=\"hidden\" name=\"nid\" value=\"{$nid}\">
  325.                        
  326.                         <input type=\"submit\" value=\"Edit News Entry\" style=\"width: 100%; text-align: center; margin-top: 0px\">
  327.                        
  328.                         </td>
  329.                     </tr>
  330.                    
  331.                     </table>
  332.  
  333.                     </form>
  334.                    
  335.                     ";         
  336.                
  337.                
  338.                     //  ELSE ECHO NEWS ENTRY        ---------------
  339.                 } else {
  340.                
  341.                 echo "
  342.  
  343.                     <h2>Create News Entry</h2>
  344.                    
  345.                     <div style=\"width: 70%; min-width: 480px; margin-left: auto; margin-right: auto\">
  346.                    
  347.                     <form action=\"index.php?page=administration\" method=\"post\">
  348.                        
  349.                         News Title<br />
  350.                         <input type=\"text\" name=\"title\" size=\"64\" style=\"width: 100%; min-width: 400px\">
  351.                        
  352.                         <br />
  353.                        
  354.                         News Body <br />
  355.                         <textarea name=\"body\" style=\"width: 100%; min-width: 400px\" rows=\"8\"></textarea>
  356.                        
  357.                         <br />
  358.  
  359.                         <input type=\"hidden\" name=\"submit_news\" value=\"1\">
  360.                         <input type=\"hidden\" name=\"action\" value=\"insert\">
  361.                        
  362.                         <div style=\"width: 100%; margin: 0px auto 0px auto; text-align: center\">
  363.                         <input type=\"submit\" value=\"Create News Entry\" style=\"width: 100%; text-align: center; margin-left: auto; margin-right: auto\">
  364.                         </div>
  365.                         <input type=\"hidden\" name=\"submit_news\" value=\"1\">
  366.                         <input type=\"hidden\" name=\"action\" value=\"insert\">
  367.                        
  368.                     </form>
  369.                    
  370.                     </div>
  371.                
  372.                 ";
  373.                
  374.                 }
  375.            
  376.             echo "<h2>Edit News Entries</h2>
  377.             <div align=\"center\" style=\"width: 85%; text-align: left; margin-left: auto; margin-right: auto; padding-left: 0px; padding-right: 0px\">
  378.             ";
  379.            
  380.             $i = 1;
  381.             $query = "SELECT * FROM `newsEntries` ORDER BY `id` ASC LIMIT 10";
  382.             $DB->query($query);
  383.            
  384.             while   ( $row = mysql_fetch_array($DB->result, MYSQL_ASSOC) ) {
  385.                    
  386.                    
  387.                     if  ( !isset($row["title"]) || $row["title"] == NULL ) { $row["title"] = "Unnamed News Entry"; }
  388.                     $date = date('m.d.y @ h:i A', $row["time"]);   
  389.                     echo "
  390.                     ".$row['id']."] &nbsp; <b><a href=\"?page=administration&subpage=edit&nid=".$row['id']."\">".$row['title']."</a></b> &nbsp;&nbsp; <span style=\"color: #CCCCCC\">".htmlspecialchars( substr($row['body'],0,64) )."</span>  &nbsp;&nbsp; <font style=\"color: #4090D0\">by <b>".substr($row['username'],0,5)."</b></font> <font style=\"color: #AAAAAA\"> &nbsp;&nbsp; on ".substr($date,0,8)."</font>
  391.                     <br />
  392.                     ";
  393.                     ++$i;
  394.                
  395.                     }          
  396.            
  397.             echo "</div><br /><br />
  398.             <h2>Troubleshooting Data</h2>
  399.             USER ARRAY:";
  400.             print_r($user);
  401.             echo "<br /><br />COOKIE ARRAY:";
  402.             print_r($_COOKIE);
  403.             echo "<br /><br />username> ". $user->username."<br />password> ".$user->password."<br />uid> ".$user->uid." <br />";
  404.            
  405.             } else {
  406.            
  407.             echo "<h2>Administrator Login</h2>
  408.            
  409.                 <form action=\"index.php?page=administration\" method=\"post\">
  410.                
  411.                     Username    <br />
  412.                     <input type=\"text\" maxlength=\"32\" size=\"32\" name=\"username\"><br />
  413.            
  414.                     Password    <br />
  415.                     <input type=\"password\" maxlength=\"32\" size=\"32\" name=\"password\"><br />
  416.                    
  417.                     <br />
  418.                    
  419.                     <input type=\"submit\" value=\"Login!\">
  420.                    
  421.                     <br />
  422.                     <input type=\"hidden\" name=\"login\" value=\"1\">
  423.                    
  424.                 </form>
  425.        
  426.                 ";
  427.            
  428.             }
  429.        
  430.     }
  431.  
  432.  
  433.  
  434.     function news($page)
  435.         {
  436.  
  437.             global $DB, $user, $subpage;
  438.                    
  439.             $background_image_number = rand(1, 2);
  440.  
  441.             echo "<div style=\"width: 100%; background-color: #2a2a2a; height: 405px; text-align: left; vertical-align: middle; line-height: auto; font-weight: bold; font-size: 56px; font-family: 'Trebuchet MS', Tahoma, Arial; color: white; background-image: url('images/news_img_{$background_image_number}.jpg'); background-position: top center; background-repeat: no-repeat; border-bottom: 15px solid #d1d1d1\">
  442.            
  443.                 <div align=\"center\" style=\"text-align: left; margin-left: auto; margin-right: auto; width: 65%; min-width: 675px; height: 100%\">
  444.                
  445.                     <span style=\"vertical-align: -390px; line-height: auto; letter-spacing: 4px; word-spacing: 25px\">news</span>
  446.                    
  447.                 </div>
  448.            
  449.             </div>
  450.            
  451.             <div align=\"center\" style=\"text-align: left; margin-left: auto; margin-right: auto; width: 65%; min-width: 675px\">
  452.            
  453.             ";
  454.            
  455.            
  456.             $i = 1;
  457.             $query = "SELECT * FROM `newsEntries` ORDER BY `id` DESC LIMIT 3";
  458.             $DB->query($query);
  459.            
  460.             while   ( $row = mysql_fetch_array($DB->result, MYSQL_ASSOC) ) {
  461.                    
  462.                     $date = date('m.d.y @ h:i A', $row["time"]);   
  463.                     echo "
  464.                     <h2>{$i}] &nbsp; <b>".$row['title']."</b> &nbsp; <!-- <font style=\"color: #4090D0\">by <b>".$row['username']."</b></font> &nbsp;&nbsp; --><font style=\"color: #AAAAAA; font-size: 20px\"> on ".$date."</font></h2>
  465.                     <p>".$row['body']."</p>
  466.                     ";
  467.                     ++$i;
  468.                
  469.                     }
  470.  
  471.             echo "</div>";
  472.        
  473.            
  474.         }   //  end news()      ---------------
  475.  
  476.  
  477.  
  478.  
  479.     function contact($page)
  480.         {
  481.  
  482.             global $subpage;
  483.            
  484.             $this->subHeader($page);
  485.  
  486.             echo "
  487.                    
  488.             <h2>Email Steam Pros</h2>
  489.            
  490.             <div align=\"center\" style=\"width: 100%; min-width: 480px\">
  491.  
  492.             <form action=\"?page=contact\" method=\"post\">
  493.  
  494.             <b>
  495.            
  496.             <table cellpadding=\4\" cellspacing=\"8\" align=\"left\" align=\"center\" style=\"width: 100%; min-width: 480px; margin-left: 0px; font-weight: bold; padding-left: 10%; padding-right: 10%\">
  497.  
  498.             <tr>
  499.                 <td style=\"width: 50%; text-align: right\">
  500.            
  501.                 Your Name: <br>
  502.                 <input name=\"name\" type=\"text\" maxlength=\"32\" size=\"24\" style=\"text-align: left; width: 100%\"><br>
  503.                
  504.                 </td>
  505.                 <td style=\"width: 50%; text-align: left\">
  506.              
  507.                 Phone Number: (not required)<br>
  508.                 <input name=\"email_address\" type=\"text\" maxlength=\"48\" size=\"24\" style=\"width: 100%\"><br>
  509.                
  510.                 </td>
  511.              </tr>
  512.              
  513.              <tr>
  514.                 <td style=\"width: 50; text-align: right\">
  515.  
  516.                 E-mail address: <br>
  517.                 <input name=\"email_address\" type=\"text\" maxlength=\"48\" size=\"24\" style=\"text-align: left; width: 100%\"><br>
  518.                
  519.                 </td>
  520.                 <td style=\"width: 50; text-align: left\">
  521.            
  522.                 Message Subject: <br>
  523.                 <input name=\"subject\" type=\"text\" maxlength=\"64\" size=\"24\" style=\"width: 100%\"><br>              
  524.            
  525.                 </td>
  526.             </tr>
  527.  
  528.  
  529.             <tr>
  530.                 <td colspan=\"2\" style=\"width: 100%\">
  531.                
  532.                 Message to Steam Pros: <br>    
  533.                 <textarea name=\"message\" rows=\"6\" style=\"width: 100%\"></textarea><br>
  534.            
  535.                 </td>
  536.             </tr>
  537.            
  538.            
  539.             <tr>
  540.                 <td colspan=\"2\" style=\"width: 100%; text-align: center\">
  541.                
  542.                 <input type=\"submit\" value=\"Send Message!\" style=\"width: 100%; text-align: center\"><br>  
  543.                
  544.                 </td>
  545.             </tr>
  546.            
  547.             </table>
  548.    
  549.             </b>
  550.            
  551.             </form>
  552.            
  553.             </div>
  554.  
  555.         <br />
  556.            
  557.             <div style=\"width: 100%\">
  558.            
  559.             <h2>Contact Information</h2>           
  560.            Steam Pro <br />
  561.            Wes Carollo <br />
  562.            <br />
  563.            Address: <br />
  564.            2231 Labarre St. <br />
  565.            Mandeville <br />
  566.            LA / St. Tammany Parish <br />
  567.            70448 <br />
  568.            United States <br />
  569.            <br />
  570.             Telephone:  985-626-5895 <br />
  571.             Mobile Phone Number:    985-626-5895 <br />
  572.            http://sttammanycarpetcleaner.com <br />
  573.            <br />
  574.             Information:    Serving: Mandeville, Madisonville, Covington, Lacombe, Abita Springs, Slidell, Folsom, Hammond, Ponchatoula, and Robert. Call for a quick quote or email and we will respond to you in a timely manner! <br />
  575.  
  576.             </div>
  577.  
  578.             ";
  579.            
  580.         }   //  end contact()   ---------------
  581.  
  582.  
  583.  
  584.  
  585.     function pricing($page)
  586.         {
  587.  
  588.             global $subpage;
  589.            
  590.             $this->subHeader($page);
  591.        
  592.             echo "
  593.  
  594.             <h2>General Pricing Guide</h2>
  595.            
  596.             This is a general pricing guide to get you started.  For a more detailed estimate please call. <br><br>
  597.             MINIMUM CHARGE IS $90 <br><br>
  598.            
  599.             Carpet:<br><br>
  600.             $35 per room (large living rooms will count as 2 rooms)<br>
  601.            
  602.             $50 per set of stairs<br>
  603.            
  604.             <br>
  605.            
  606.             Tile:<br><br>
  607.             $150 per kitchen/utility room area<br>
  608.            
  609.             $35 per bathroom, or $45 for master bathroom<br>
  610.            
  611.             $60 per bedroom, or $150 for living room if these are tiled<br>
  612.            
  613.              <br>
  614.            
  615.             Upholstery: <br><br>
  616.             $100 for a 3-cushion sofa, or $150+ for a sectional sofa<br>
  617.            
  618.             $75 for a 2-cushion sofa<br>
  619.            
  620.             $60 for a recliner<br>
  621.            
  622.             For a set of dining room chairs, or any other furniture, please call.<br>
  623.            
  624.             <h2>Free Estimate</h2>
  625.            
  626.             <div align=\"center\" style=\"width: 70%; min-width: 400px; text-align: left; padding-left: 15%\">
  627.            
  628.                 <form action=\"\" method=\"post\">
  629.  
  630.                 Email Address<br>
  631.                 <input type=\"text\" name=\"email\" size=\"32\">
  632.                
  633.                 <br />
  634.                
  635.                 Please tell us the exact services that you require and we will email you back with an estimate.<br>
  636.                 <textarea name=\"body\" style=\"width: 100%\" rows=\"6\"></textarea>
  637.                
  638.                 <br />
  639.                
  640.                 <input type=\"submit\" value=\"Get Estimate!\" style=\"width: 100%; text-align: center\">
  641.                
  642.                 </form>
  643.            
  644.             </div>";       
  645.            
  646.         }   //  end pricing()   ---------------
  647.  
  648.  
  649.  
  650.  
  651.     function about($page)
  652.         {
  653.  
  654.             global $subpage;
  655.  
  656.             $this->subHeader($page);
  657.            
  658.             echo "
  659.            
  660.             <h2>About Wes Carollo and Steam Pro</h2>
  661.            
  662.             Wes Carollo is a resident of Mandeville, Louisiana for the past thirty-five years.  Wes and Steam Pro have been a fixture in St. Tammany Parish since 1987.  He is a <font style=\"color: white\"><b>certified carpet cleaning technician</b></font> and a stickler for detail.
  663.            
  664.             <br /><br />
  665.            
  666.             The cleaning process employs a powerful truck-mounted steam extraction service.  The cleaning solution is an eco and environmentally friendly product:
  667.  
  668.             <br /><br />
  669.  
  670.             Safe for your family, your pets and your community.<br />
  671.             Services are offered seven days a week.
  672.            
  673.             <br />
  674.  
  675.             <h2>Contact Information</h2>           
  676.            Steam Pro <br />
  677.            Wes Carollo <br />
  678.            <br />
  679.            Address: <br />
  680.            2231 Labarre St. <br />
  681.            Mandeville <br />
  682.            LA / St. Tammany Parish <br />
  683.            70448 <br />
  684.            United States <br />
  685.            <br />
  686.             Telephone:  985-626-5895 <br />
  687.             Mobile Phone Number:    985-626-5895 <br />
  688.            http://sttammanycarpetcleaner.com <br />
  689.            <br />
  690.             Information:    Serving: Mandeville, Madisonville, Covington, Lacombe, Abita Springs, Slidell, Folsom, Hammond, Ponchatoula, and Robert. Call for a quick quote or email and we will respond to you in a timely manner! <br />
  691.  
  692.             ";         
  693.            
  694.         }   // end  about()     ---------------
  695.  
  696.  
  697.  
  698.  
  699.     function reviews($page)
  700.         {
  701.  
  702.             global $DB, $subpage;
  703.        
  704.             $this->subHeader($page);
  705.  
  706.                 date_default_timezone_set("US/Eastern");
  707.                                
  708.                 if  ( $_POST["submit_review"] == "1" ){
  709.                    
  710.                     // print_r($_POST);
  711.                    
  712.                     if  ( isset($_POST["rating"]) && $_POST["rating"] > 0 && $_POST["rating"] < 6 ) {   $rating = $_POST["rating"]; }
  713.                     else{ $rating = "5"; }
  714.                        
  715.                     $title = addslashes($_POST["title"]);
  716.                     $body = addslashes($_POST["body"]);
  717.                     $time = time();
  718.                     $ip = $_SERVER['REMOTE_ADDR']; 
  719.                    
  720.                     $sql_query = "INSERT INTO userReviews ( `title`, `body`, `rating`, `time`, `ip_address` ) VALUES ( '{$title}', '{$body}', '{$rating}', '{$time}', '{$ip}' )";
  721.                     echo $sql_query ."<br />";
  722.  
  723.                     if ( is_numeric($rating) && $rating >= 0 && $rating <= 5 ){
  724.  
  725.                         if ( isset($body) && $body !== "" ){ $DB->query("{$sql_query}"); }
  726.                        
  727.                     }
  728.                    
  729.                    
  730.                    
  731.                 }
  732.                
  733.                
  734.                 $sql_limit = 7;
  735.                 $DB->query("SELECT * FROM `userReviews` ORDER BY `id` DESC LIMIT {$sql_limit}");
  736.                
  737.                 echo "
  738.                 <h2>Customer Reviews</h2>
  739.                
  740.                 <table style=\"width: 100%\" cellpadding=\"0\" cellspacing=\"0\">
  741.                
  742.                 ";
  743.                
  744.                 $i = 0;
  745.                
  746.                 while   ( $row = mysql_fetch_array($DB->result, MYSQL_ASSOC) ){
  747.                        
  748.                         ++$i;
  749.                         $title = $row["title"];
  750.                         $body = $row["body"];
  751.                         $date = date('m.d.y @ h:i A', $row["time"]);
  752.                         $rating = $row["rating"];
  753.                         $starHTML = ratingStars($rating);
  754.                        
  755.                         echo "
  756.                         <tr><td valign=\"bottom\" style=\"width: 36px; border-top: 1px solid #505050; border-right: 1px solid #505050; padding-right: 6px; padding-bottom: 0px; text-align: right; font-size: 16px; font-weight: bold; height: 24px\">#{$i}</td><td style=\"border-top: 1px solid #505050; padding-bottom: 0px; padding-left: 6px; font-size: 16px; font-weight: bold; height: 24px\"> <font style=\"color: #FFDD66\">{$starHTML}</font> &nbsp;&nbsp; {$title} &nbsp;&nbsp; {$date}</td></tr>
  757.                         <tr><td style=\"border-right: 1px solid #505050; padding-top: 0px\">&nbsp;</td><td valign=\"top\" style=\"color: #93804f; vertical-align: top; padding-left: 6px; padding-top: 0px; padding-bottom: 18px\">{$body}</td></tr>
  758.                         ";
  759.                    
  760.                 }
  761.            
  762.                 echo "
  763.                 </table>
  764.  
  765.                 <h2>Submit Review</h2>
  766.                
  767.                 <form action=\"index.php?page=reviews\" method=\"post\">
  768.                
  769.                 <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" style=\"width: 50%; min-width: 400px; text-align: left; font-weight: bold; margin-left: auto; margin-right: auto\">
  770.                
  771.                 <tr>
  772.                     <td colspan=\"2\" valign=\"top\" style=\"height: auto; padding-bottom: 6px; color: #93804f\">
  773.                    
  774.                         Review Title
  775.                         <input type=\"text\" name=\"title\" size=\"64\" style=\"width: 100%; min-width: 400px\">
  776.                             <br />
  777.                         Review Body
  778.                             <br />
  779.                         <textarea name=\"body\" style=\"width: 100%; min-width: 400px\" rows=\"4\"></textarea>
  780.  
  781.                     </td>
  782.                 </tr>
  783.  
  784.  
  785.                 <tr>
  786.                     <td style=\"width: 100px; color: #93804f; white-space: nowrap; vertical-align: top; text-align: center; padding-top: 0px\" valign=\"top\" nowrap>
  787.  
  788.                        
  789.                         <span style=\"display: inline-block; background-color: #104596; border: 2px solid white; padding: 8px 0px 8px 0px; width: 100%; border-radius: 7px\">
  790.                        
  791.                         <span class=\"rating\">
  792.                             <input type=\"radio\" class=\"rating-input\"
  793.                                 id=\"rating-input-1-5\" name=\"rating\" value=\"5\">
  794.                             <label for=\"rating-input-1-5\" class=\"rating-star\"></label>
  795.                             <input type=\"radio\" class=\"rating-input\"
  796.                                 id=\"rating-input-1-4\" name=\"rating\" value=\"4\">
  797.                             <label for=\"rating-input-1-4\" class=\"rating-star\"></label>
  798.                             <input type=\"radio\" class=\"rating-input\"
  799.                                 id=\"rating-input-1-3\" name=\"rating\" value=\"3\">
  800.                             <label for=\"rating-input-1-3\" class=\"rating-star\"></label>
  801.                             <input type=\"radio\" class=\"rating-input\"
  802.                                 id=\"rating-input-1-2\" name=\"rating\" value=\"2\">
  803.                             <label for=\"rating-input-1-2\" class=\"rating-star\"></label>
  804.                             <input type=\"radio\" class=\"rating-input\"
  805.                                 id=\"rating-input-1-1\" name=\"rating\" value=\"1\">
  806.                             <label for=\"rating-input-1-1\" class=\"rating-star\"></label>
  807.                         </span>
  808.                            
  809.                         </span>
  810.                        
  811.                         <br />
  812.                         <font style=\"color: white\">Rating</font>
  813.                    
  814.                     </td>
  815.                    
  816.                     <td valign=\"top\" style=\"padding: 0px 2px 0px 10px; vertical-align: top; text-align: right\" nowrap>
  817.                    
  818.                     <input type=\"submit\" value=\"Submit Review!\" style=\"width: 100%; text-align: center; margin-top: 0px\">
  819.                    
  820.                     </td>
  821.                 </tr>
  822.                
  823.                 </table>
  824.                
  825.                 <input type=\"hidden\" name=\"submit_review\" value=\"1\">
  826.                
  827.                 </form>
  828.                
  829.                
  830.                
  831.                
  832.                 <hr>
  833.  
  834.                 <!-- <div align=\"center\" style=\"width: 50%; min-width: 400px; text-align: left; margin-left: auto; margin-right: auto\">
  835.  
  836.                
  837.                 <form action=\"index.php?page=reviews\" method=\"post\">
  838.                    
  839.                     Review Title
  840.                     <input type=\"text\" name=\"title\" size=\"64\" style=\"width: 100%; min-width: 400px\">
  841.                         <br />
  842.                     Review Body
  843.                         <br />
  844.                     <textarea name=\"body\" style=\"width: 100%; min-width: 400px\" rows=\"4\"></textarea>
  845.                         <br />
  846.                        
  847.                
  848.                     <span style=\"display: inline-block; width: 100%; text-align: left; white-space: nowrap\">
  849.                    
  850.                     Rating
  851.                    
  852.                     <span class=\"rating\">
  853.                         <input type=\"radio\" class=\"rating-input\"
  854.                             id=\"rating-input-1-5\" name=\"rating\" value=\"5\">
  855.                         <label for=\"rating-input-1-5\" class=\"rating-star\"></label>
  856.                         <input type=\"radio\" class=\"rating-input\"
  857.                             id=\"rating-input-1-4\" name=\"rating\" value=\"4\">
  858.                         <label for=\"rating-input-1-4\" class=\"rating-star\"></label>
  859.                         <input type=\"radio\" class=\"rating-input\"
  860.                             id=\"rating-input-1-3\" name=\"rating\" value=\"3\">
  861.                         <label for=\"rating-input-1-3\" class=\"rating-star\"></label>
  862.                         <input type=\"radio\" class=\"rating-input\"
  863.                             id=\"rating-input-1-2\" name=\"rating\" value=\"2\">
  864.                         <label for=\"rating-input-1-2\" class=\"rating-star\"></label>
  865.                         <input type=\"radio\" class=\"rating-input\"
  866.                             id=\"rating-input-1-1\" name=\"rating\" value=\"1\">
  867.                         <label for=\"rating-input-1-1\" class=\"rating-star\"></label>
  868.                     </span>
  869.                    
  870.                     <span style=\"display: inline-block; background-color: yellow; width: 100%; white-space: nowrap; text-align: right\">
  871.                         <input type=\"submit\" value=\"Submit Review!\" style=\"width: 100%; text-align: center\">
  872.                     </span>
  873.                    
  874.                     </span>
  875.                    
  876.                     !--
  877.                     <div class=\"middle\" style=\"text-align: center\">
  878.                         <input type=\"submit\" value=\"Submit Review!\" style=\"width: 80%; text-align: center\">
  879.                     </div>
  880.                     --
  881.                    
  882.                     <input type=\"hidden\" name=\"submit_review\" value=\"1\">
  883.  
  884.                 </form>
  885.                
  886.                 -->
  887.                    
  888.                 </div>
  889.                
  890.                 ";
  891.  
  892.         }   //  end reviews()   ---------------
  893.  
  894.  
  895.  
  896.     function surfaces($page)
  897.         {      
  898.        
  899.             global $subpage;
  900.            
  901.             $this->subHeader($page);
  902.  
  903.                 echo "
  904.                    
  905.                     <table style=\"width: 100%; height: 100%\">
  906.                    
  907.                     <tr>
  908.                    
  909.                         <td style=\"text-align: right; width: 175px; padding-right: 16px; font-size: 20px\" valign=\"top\">
  910.                    
  911.                         <h2 style=\"text-align: right; border-bottom-width: 1px; font-size: 24px; margin-left: auto; margin-right: auto; margin-bottom: 14px; width: 100%\">Surface Types</h2>
  912.                        
  913.                         <p style=\"margin-top: 0px; line-height: 26px\">
  914.                        
  915.                         <a href=\"?page=surfaces&subpage=upholstery\">Upholstery</a> --<br />
  916.                         <a href=\"?page=surfaces&subpage=tile\">Tile & Grout</a> --<br />
  917.                         <a href=\"?page=surfaces&subpage=carpets\">Carpets</a> --<br />
  918.                        
  919.                         </p>
  920.                        
  921.                         </td>
  922.                        
  923.                         <td valign=\"top\" class=\"content\">";
  924.                                        
  925.                 if  ( $subpage == "tile" ) {        // TILE & GROUT
  926.            
  927.                     echo "
  928.  
  929.                     <h2>Steam Tile and Grout Cleaning</h2>
  930.                      
  931.                    
  932.                     Steam Pro is equipped with a powerful, truck-mounted system to clean your ceramic, porcelain, or travertine grouted tile floors.
  933.  
  934.                     <br />
  935.                    
  936.                     <h3>I accomplish this by:</h3>
  937.                     Removing loose dirt using the best vacuuming methods
  938.                    
  939.                     <br /><br />
  940.                    
  941.                     Using an acid based tile restoring chemical especially formulated for thoroughly cleaning ceramic tiles and grout joints
  942.                    
  943.                     <br /><br />
  944.                    
  945.                     Thoroughly rinsing off surfaces a number of times in order to make sure that no cleaning materials remain
  946.                    
  947.                     <br /><br />
  948.                    
  949.                     <font style=\"color: white\">I won't leave your home until I have completed cleaning the tiles and grout joints to your satisfaction. <a href=\"?page=contact\">Contact me</a> for a FREE Estimate.</font>
  950.                    
  951.                     <br /><br />
  952.                    
  953.                     Steam Pro serves Mandeville, Covington, Slidell, Hammond, Abita Springs, Lacombe, LA and surrounding St. Tammany areas.
  954.                    
  955.                     <br /><br />
  956.                    
  957.                     Residential and Commercial.
  958.                    
  959.                     <br /><br />
  960.                    
  961.                     <font style=\"color: white\">Available for Emergencies!</font>
  962.                    
  963.                     ";
  964.                    
  965.                     } elseif ( $subpage == "carpets" ) {        //  CARPETS
  966.  
  967.                     echo "
  968.                    
  969.                     <h2>Affordable Carpet Cleaning Service</h2>
  970.                    
  971.                     To be filled in..<br /><br />
  972.                     Steam Pro serves Mandeville, Covington, Slidell, Hammond, Abita Springs, Lacombe, LA and surrounding areas.            
  973.                    
  974.                     ";
  975.                    
  976.                     } else {        // UPHOLSTERY DEFAULT
  977.            
  978.                     echo "
  979.                        
  980.                     <h2>Upholstery Cleaning Service</h2>
  981.                     Steam Pro can restore your fabric upholstered furniture to look new again, and smell fresh!  Do you have an old or dingy looking couch.  How about a sofa with a stain?  A love seat that someone spilled their dinner on?  A car that stinks after it rained or you can't get to stop smelling like your dog?  This is what I have been doing for a living since 1987, let me help you.  Give me a call or text at <font style=\"color: white\">985-626-5895</font> to talk to me or click here for a free estimate and I will get back to you within 24 hours.
  982.                        
  983.                     <br /><br />
  984.                        
  985.                     The cleaning process employs a powerful truck-mounted steam extraction service.  The cleaning solution is an eco and environmentally friendly product:
  986.                    
  987.                     <br /><br />
  988.                        
  989.                     .: <font style=\"color: white\">Safe for your family, your pets and your community.</font><br />
  990.                     .: <font style=\"color: white\">Services are offered seven days a week</font><br />
  991.                     .: <font style=\"color: white\">Emergency flood extraction is available twenty-four hours a day</font><br />
  992.                    
  993.                     <br /><br />
  994.                        
  995.                     Regular upholstery cleaning will help extend the life of upholstered furniture by maintaining appearance and reducing wear. In most cases, spills need immediate treatment and should be blotted up with a sponge or towel. Follow the cleaning instructions attached to your upholstered furniture.
  996.                    
  997.                     <br /><br />
  998.                        
  999.                     When selecting a cleaning service, the main factor to consider is the operator's skill and ability. Upholstery cleaning professionals of long standing reputation can usually be relied upon to provide satisfactory service.
  1000.                    
  1001.                     <br />
  1002.                        
  1003.                     <h2>Dry vs. Steam Cleaning on Upholstery</h2>
  1004.                    
  1005.                     Do not use water based cleaning solution on a fabric labeled for dry cleaning only. If you are unsure, rather be safe than sorry. \"Use the professional's dry cleaning only\" type labels will require professional cleaning.
  1006.                        
  1007.                     <br /><br />
  1008.                    
  1009.                     Notwithstanding the cleaning instructions, upholstered furniture should be professionally cleaned periodically to remove soil, keep sanitary, restore freshness, preserve appearance, and protect your investment.
  1010.                    
  1011.                     <br /><br />
  1012.                    
  1013.                     Steam Pro provides upholstery cleaning services for both residential homes and commercial offices.  Steam Pro also provides upholstery and carpet cleaning for your car, truck, or boat.
  1014.                     <br /><br />
  1015.                    
  1016.                     <font style=\"color: white\">Upholstery Cleaning in Mandeville , Madisonville , Covington , Lacombe , Abita Springs , Slidell , Folsom, Hammond, Ponchatoula, and Robert LA.</font>            
  1017.                    
  1018.                         ";
  1019.                    
  1020.                        
  1021.                     }
  1022.  
  1023.                 echo "
  1024.                    
  1025.                         </td>
  1026.                    
  1027.                     </tr>
  1028.                    
  1029.                 </table>
  1030.                
  1031.                 </div>";
  1032.  
  1033.            
  1034.         }   //  end     surfaces()  ---------------
  1035.  
  1036.  
  1037.  
  1038.  
  1039.     function subHeader($page) {
  1040.  
  1041.             global $subpage;
  1042.            
  1043.             if  ( isset($page) && isset($subpage) ) {
  1044.                 $pageTitle      =   "{$page}>{$subpage}";
  1045.                 } else {
  1046.                 $pageTitle      =   $page;
  1047.                 }
  1048.            
  1049.             //  <span style=\"height: 48px; display: inline-block; vertical-align: bottom; padding-bottom: 0px; margin-bottom: 0px; margin-top: auto; line-height: auto; font-size: 36px; letter-spacing: 4px; word-spacing: 25px; border: 4px solid #d1d1d1; border-bottom-width: 0px; background-color: #505050\">{$pageTitle}</span>
  1050.                
  1051.             echo "
  1052.             <div style=\"width: 100%; background-color: #4A4A4A; height: 55px; text-align: center; vertical-align: middle; font-weight: bold; font-size: 36px; font-family: 'Trebuchet MS', Tahoma, Arial; color: white; background-image: url('images/tile_h5_light.png'); background-position: bottom; background-repeat: repeat-x; border-bottom: 8px solid #d1d1d1; padding-top: 0px; margin-bottom: 0px\">
  1053.                
  1054.                 <div align=\"center\" style=\"padding: 0px 8px 0px 0px; text-align: left; background-color: transparent; margin-left: auto; margin-right: auto; width: 65%; min-width: 675px; height: 40px; padding-top: 11px;\">
  1055.                
  1056.                 <span style=\"height: 100%; display: inline-block; margin: 0px 0px 0px 0px; padding: 0px 30px 0px 24px; background-color: #303030; color: #DDDDDD; border-width: 4px 4px 0px 4px; border-color: #d1d1d1; border-style: solid; border-radius: 10px 10px 0px 0px; vertical-align: bottom; font-size: 36px\">{$pageTitle}</span>
  1057.                    
  1058.                 </div>
  1059.                
  1060.             </div>
  1061.                
  1062.             <div align=\"center\" style=\"text-align: left; margin-left: auto; margin-right: auto; width: 65%; min-width: 675px\"
  1063.             ";
  1064.            
  1065.     }   // end  subHeader() ---------------
  1066.    
  1067.    
  1068.    
  1069.    
  1070. }       //  end methods()       ----------------------------------------
  1071.  
  1072. if  ( $launchDatabase !== "false" ) {   $DB = new database();       $DB->connect(); }
  1073. if  ( $launchUser        !== "false" )  {   $user = new user(); }
  1074.  
  1075. if  ( $_POST["login"] == "1" && isset($_POST["username"]) ) {      
  1076.         $user->verify("post", "true");
  1077.     } elseif ( isset($_COOKIE["username"]) ) {
  1078.         $user->verify("cookie", "false");
  1079.     } elseif ( !isset($_POST["login"]) && !isset($_COOKIE["username"]) ) {
  1080.         $user->logged_in    = false;
  1081.     }
  1082.  
  1083. // if   ( $_POST["login"] == "1" && isset($_POST["username"]) && isset($_POST["password"]) || isset($_COOKIE["username"]) ) {   $user->verify("true");  }
  1084.  
  1085. if  ( $launchMethods !== "false" )  {   $methods = new methods();       }
  1086.  
  1087. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement