Advertisement
Guest User

Untitled

a guest
May 13th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 86.27 KB | None | 0 0
  1. <?php
  2. require_once "../includes/config.php";
  3.  
  4. $date = date("m-d-Y");
  5. $time = date("g:ia");
  6.  
  7. // $arr = array_merge(&$_ENV,&$_GET,&$_POST,&$_COOKIE,&$_SESSION);
  8. // while(list($key) = each($arr)) unset(${$key});
  9.  
  10. global $_SERVER;
  11. global $_GET;
  12. global $_POST;
  13. $ip = $_SERVER["REMOTE_ADDR"];
  14.  
  15. if (isset($sid)) {
  16.  
  17.     session_id($sid);
  18.    
  19. }
  20.  
  21. session_start();
  22.  
  23. $sid = session_id();
  24.  
  25. if (!$hm_theme) {
  26.  
  27.     $result = MYSQL_QUERY("SELECT themeID FROM " . "$db_prefix" . "temps_themes WHERE deefault = '1' AND type = '1'");
  28.     while($r=mysql_fetch_array($result))
  29.     {    
  30.    
  31.         $hm_theme=$r["themeID"];
  32.        
  33.     }
  34.    
  35. } // End theme check
  36.  
  37. if (!$hm_lang) {
  38.  
  39.     $result = MYSQL_QUERY("SELECT languageID FROM " . "$db_prefix" . "settings_language WHERE deefault = '1'");
  40.     while($r=mysql_fetch_array($result))
  41.     {    
  42.    
  43.         $hm_lang=$r["languageID"];
  44.        
  45.     }
  46.    
  47. } // End language check
  48.  
  49. $result = MYSQL_QUERY("SELECT file FROM " . "$db_prefix" . "settings_language WHERE languageID = '$hm_lang'");
  50. while($r=mysql_fetch_array($result))
  51. {    
  52.  
  53.     $lang_url=$r["file"];
  54.    
  55. }
  56.  
  57. require "../language/" . $lang_url . ".php";
  58.  
  59. $result = MYSQL_QUERY("SELECT folder FROM " . "$db_prefix" . "temps_themes WHERE themeID = '$hm_theme'");
  60. while($r=mysql_fetch_array($result))
  61. {    
  62.  
  63.     $theme_url=$r["folder"];
  64.    
  65. }
  66.  
  67. $login = $_GET['login'];
  68.  
  69. switch($login) {
  70.  
  71.     case "login":
  72.    
  73.         $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "logs_admin (date, time, IP)".
  74.         "VALUES ('$date', '$time', '$ip')");
  75.        
  76.         $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE deefault = '1' AND type = '1' AND name = 'admin_login'");
  77.         while($r=mysql_fetch_array($result))
  78.         {
  79.        
  80.             $content=$r["content"];
  81.             require "../themes/$theme_url/modules/vars.php";
  82.             require "../themes/$theme_url/modules/admin/admin_header.php";
  83.             echo ThemeIt($content);
  84.             require "../themes/$theme_url/modules/admin/admin_footer.php";
  85.            
  86.         }
  87.    
  88.     break; // End login case
  89.    
  90.     case "signup":
  91.    
  92.         $rep = $_GET['rep'];
  93.    
  94.         $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "logs_admin (date, time, IP)".
  95.         "VALUES ('$date', '$time', '$ip')");
  96.        
  97.         $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE deefault = '1' AND type = '1' AND name = 'admin_signup'");
  98.         while($r=mysql_fetch_array($result))
  99.         {
  100.        
  101.             $content=$r["content"];
  102.             require "../themes/$theme_url/modules/vars.php";
  103.             require "../themes/$theme_url/modules/admin/admin_header.php";
  104.             echo ThemeIt($content);
  105.             require "../themes/$theme_url/modules/admin/admin_footer.php";
  106.            
  107.         }
  108.    
  109.     break; // End signup case
  110.    
  111.     case "new_acct":
  112.    
  113.         $uname = $_POST['uname'];
  114.         $pword = $_POST['pword'];
  115.         $pre_pword = $_POST['pword'];
  116.         $bizname = $_POST['bizname'];
  117.         $referral_id = $_POST['referral_id'];
  118.         $fname = $_POST['fname'];
  119.         $lname = $_POST['lname'];
  120.         $pword_verf = $_POST['pword_verf'];
  121.         $email = $_POST['email'];
  122.         $email_verf = $_POST['email_verf'];
  123.        
  124.         if(!$uname)
  125.             echo "<font color=\"red\">You did not type a username, please click back on your web browser and try again.</font><br><br>";
  126.         else if(!$pword)
  127.             echo "<font color=\"red\">You did not type a password, please click back on your web browser and try again.</font><br><br>";
  128.         else if(!$bizname)
  129.             echo "<font color=\"red\">You did not type a business name, please click back on your web browser and try again.</font><br><br>";
  130.         else if(!$fname)
  131.             echo "<font color=\"red\">You did not type a first name, please click back on your web browser and try again.</font><br><br>";
  132.         else if(!$lname)
  133.             echo "<font color=\"red\">You did not type a last name, please click back on your web browser and try again.</font><br><br>";
  134.         else if(!$pword_verf)
  135.             echo "<font color=\"red\">You did not type a verification password, please click back on your web browser and try again.</font><br><br>";
  136.         else if(!$email)
  137.             echo "<font color=\"red\">You did not type an email address, please click back on your web browser and try again.</font><br><br>";
  138.         else if(!$email_verf)
  139.             echo "<font color=\"red\">You did not type a verification email address, please click back on your web browser and try again.</font><br><br>";
  140.         else{
  141.        
  142.             $pword = md5("$pword");
  143.             $pword_verf = md5("$pword_verf");
  144.            
  145.             $conf_code = substr(md5("$uname"), 0, 4);
  146.                
  147.             if($email != $email_verf)
  148.                 echo "<font color=\"red\">Your email addresses did not match, please click back on your web browser and try again.</font><br><br>";
  149.                
  150.             if($pword != $pword_verf)
  151.                 echo "<font color=\"red\">Your passwords did not match, please click back on your web browser and try again.</font><br><br>";
  152.            
  153.             $result = MYSQL_QUERY ("SELECT username FROM " . $db_prefix . "users_accounts WHERE username = '$uname'");
  154.             $count = mysql_num_rows($result);
  155.            
  156.             $result = MYSQL_QUERY ("SELECT emailaddr FROM " . $db_prefix . "users_accounts WHERE emailaddr = '$email'");
  157.             $count2 = mysql_num_rows($result);
  158.            
  159.             if($count < 1 && $count2 < 1) {
  160.            
  161.                 $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "users_accounts (username, password, bizname, ownerID, emailaddr, userlevel, firstname, lastname, signupdate, signuptime, confirmed, conf_code)".
  162.                 "VALUES ('$uname', '$pword', '$bizname', '$referral_id', '$email', '3', '$fname', '$lname', '$date', '$time', '0', '$conf_code')");
  163.                    
  164.                 echo "Your account was created sucessfully $fname $lname! Please <a href=\"admin.php?login=login\"><b>Click Here</b></a> to log in.";
  165.                
  166.                 // The message
  167.                 $message = "Thank you $bizname for creating an AdsCampaign account, there is one last step that you need to do before you can login to your account.\n\nPlease login to Second Life and go to an AdsCampaign terminal and type in the following keyword:\n\nKeyword: $conf_code\n\nOnce you do that your account will be successfully activated. Thank you.\n\nYour username and password is as follows:\n\nUsername: $uname\nPassword: $pre_pword";
  168.                
  169.                 // In case any of our lines are larger than 70 characters, we should use wordwrap()
  170.                 $message = wordwrap($message, 70);
  171.                
  172.                 $headers = 'From: support@adscampaign.com' . "\r\n" .
  173.                    'Reply-To: support@adscampaign.com' . "\r\n" .
  174.                    'X-Mailer: PHP/' . phpversion();
  175.  
  176.                
  177.                 // Send
  178.                 mail($email, 'One last step to confirm your AdsCampaign Account', $message, $headers);
  179.                
  180.                 // Send
  181.                 mail('support@adscampaign.com', 'One last step to confirm your AdsCampaign Account', $message, $headers);
  182.                
  183.             }else{
  184.            
  185.                 echo "<font color=\"red\">That username or password is already in use, please click back on your web browser and try again.</font>";
  186.                
  187.             }
  188.            
  189.         }
  190.    
  191.     break; // End new_acct case
  192.    
  193.     case "not":
  194.    
  195.         ob_start();
  196.        
  197.             $result = MYSQL_QUERY("SELECT name, folder FROM " . "$db_prefix" . "temps_themes WHERE deefault = '1' AND type = '1'");
  198.             while($r=mysql_fetch_array($result))
  199.             {    
  200.            
  201.                 $name=$r["name"];
  202.                 $theme_url=$r["folder"];
  203.                
  204.             }
  205.            
  206.             $result = MYSQL_QUERY("SELECT file FROM " . "$db_prefix" . "settings_language WHERE deefault = '1'");
  207.             while($r=mysql_fetch_array($result))
  208.             {    
  209.            
  210.                 $file=$r["file"];
  211.                
  212.             }
  213.            
  214.             require "../language/" . $file . ".php";
  215.            
  216.             $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE deefault = '1' AND type = '1' AND name = 'admin_redirect'");
  217.             while($r=mysql_fetch_array($result))
  218.             {
  219.            
  220.                 $content=$r["content"];
  221.                 $redirect_title = $redir_nli_title;
  222.                 $redirect_message = $redir_nli_message;
  223.                 $redirect_description = $redir_nli_description;
  224.                 require "../themes/$theme_url/modules/vars.php";
  225.                 require "../themes/$theme_url/modules/admin/admin_header.php";
  226.                 echo ThemeIt($content);
  227.                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  228.                
  229.             }
  230.        
  231.             echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; URL=admin.php?login=login\">";
  232.        
  233.         ob_end_flush();
  234.    
  235.     break; // End not case
  236.    
  237.     case "verify":
  238.    
  239.         $uname = $_POST['uname'];
  240.         $pword = $_POST['pword'];
  241.         $pword = md5("$pword");
  242.        
  243.         $result = MYSQL_QUERY ("SELECT username, password, confirmed FROM " . $db_prefix . "users_accounts WHERE username = '$uname' AND password = '$pword'");
  244.         while($r=mysql_fetch_array($result))
  245.         {
  246.        
  247.             $confirmed = $r['confirmed'];
  248.        
  249.         }
  250.         $count = mysql_num_rows($result);
  251.        
  252.         if($count < 1 || $confirmed < 1) {
  253.        
  254.             ob_start();
  255.            
  256.                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE deefault = '1' AND type = '1' AND name = 'admin_redirect'");
  257.                 while($r=mysql_fetch_array($result))
  258.                 {
  259.                
  260.                     $content=$r["content"];
  261.                     $redirect_title = $redir_il_title;
  262.                     $redirect_message = $redir_il_message;
  263.                     $redirect_description = $redir_il_description;
  264.                     require "../themes/$theme_url/modules/vars.php";
  265.                     require "../themes/$theme_url/modules/admin/admin_header.php";
  266.                     echo ThemeIt($content);
  267.                     require "../themes/$theme_url/modules/admin/admin_footer.php";
  268.                    
  269.                 }
  270.                
  271.                 echo "<META HTTP-EQUIV=Refresh CONTENT=\"6; URL=admin.php?login=login\">";
  272.            
  273.             ob_end_flush();
  274.            
  275.         }else{
  276.        
  277.             ob_start();
  278.            
  279.                 $result = MYSQL_QUERY ("SELECT * FROM " . $db_prefix . "users_accounts WHERE username = '$uname' AND password = '$pword'");
  280.                 while($r=mysql_fetch_array($result))
  281.                 {    
  282.                
  283.                     $hm_theme=$r["themeID"];
  284.                     $hm_lang=$r["languageID"];
  285.                     $hm_usrlvl=$r["userlevel"];
  286.                     $hm_usrID=$r["userID"];
  287.                     $lastlog_name = $r['username'];
  288.                     $lastlog_date = $r['lastlogindate'];
  289.                     $lastlog_time = $r['lastlogintime'];
  290.                     $lastlog_ip = $r['lastloginip'];
  291.                    
  292.                 }
  293.                
  294.                 $_SESSION["hm_uname"] = "$uname";
  295.                 $_SESSION["hm_pword"] = "$pword";
  296.                 $_SESSION["hm_theme"] = "$hm_theme";
  297.                 $_SESSION["hm_lang"] = "$hm_lang";
  298.                 $_SESSION["hm_usrlvl"] = "$hm_usrlvl";
  299.                 $_SESSION["hm_usrID"] = "$hm_usrID";
  300.                 $_SESSION["hm_lastlog_date"] = "$lastlog_date";
  301.                 $_SESSION["hm_lastlog_time"] = "$lastlog_time";
  302.                 $_SESSION["hm_lastlog_ip"] = "$lastlog_ip";
  303.                
  304.                 $result = MYSQL_QUERY("UPDATE " . $db_prefix . "users_accounts SET lastlogindate = '$date', lastlogintime = '$time', lastloginip = '$ip' WHERE username = '$uname' AND password = '$pword'");
  305.                
  306.                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE deefault = '1' AND type = '1' AND name = 'admin_redirect'");
  307.                 while($r=mysql_fetch_array($result))
  308.                 {
  309.                
  310.                     $content=$r["content"];
  311.                     $redirect_title = $redir_li_title;
  312.                     $redirect_message = $redir_li_message;
  313.                     $redirect_description = $redir_li_description;
  314.                     require "../themes/$theme_url/modules/vars.php";
  315.                     require "../themes/$theme_url/modules/admin/admin_header.php";
  316.                     echo ThemeIt($content);
  317.                     require "../themes/$theme_url/modules/admin/admin_footer.php";
  318.                    
  319.                 }
  320.                
  321.                 echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; URL=admin.php?nav=start&sid=$sid\">";
  322.            
  323.             ob_end_flush();
  324.            
  325.         } // End credentials check
  326.        
  327.     break; // End verify case
  328.    
  329.     case "override":
  330.    
  331.         if ($hm_usrlvl == 1){
  332.    
  333.             $uname = $_POST['uname'];
  334.             $pword = $_POST['pword'];
  335.            
  336.             $result = MYSQL_QUERY ("SELECT username, password FROM " . $db_prefix . "users_accounts WHERE username = '$uname' AND password = '$pword'");
  337.             $count = mysql_num_rows($result);
  338.            
  339.             if($count < 1) {
  340.            
  341.                 ob_start();
  342.                
  343.                     $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE deefault = '1' AND type = '1' AND name = 'admin_redirect'");
  344.                     while($r=mysql_fetch_array($result))
  345.                     {
  346.                    
  347.                         $content=$r["content"];
  348.                         $redirect_title = $redir_il_title;
  349.                         $redirect_message = $redir_il_message;
  350.                         $redirect_description = $redir_il_description;
  351.                         require "../themes/$theme_url/modules/vars.php";
  352.                         require "../themes/$theme_url/modules/admin/admin_header.php";
  353.                         echo ThemeIt($content);
  354.                         require "../themes/$theme_url/modules/admin/admin_footer.php";
  355.                        
  356.                     }
  357.                    
  358.                     echo "<META HTTP-EQUIV=Refresh CONTENT=\"6; URL=admin.php?login=login\">";
  359.                
  360.                 ob_end_flush();
  361.                
  362.             }else{
  363.            
  364.                 ob_start();
  365.                
  366.                     $result = MYSQL_QUERY ("SELECT * FROM " . $db_prefix . "users_accounts WHERE username = '$uname' AND password = '$pword'");
  367.                     while($r=mysql_fetch_array($result))
  368.                     {    
  369.                    
  370.                         $hm_theme=$r["themeID"];
  371.                         $hm_lang=$r["languageID"];
  372.                         $hm_usrlvl=$r["userlevel"];
  373.                         $hm_usrID=$r["userID"];
  374.                         $lastlog_name = $r['username'];
  375.                         $lastlog_date = $r['lastlogindate'];
  376.                         $lastlog_time = $r['lastlogintime'];
  377.                         $lastlog_ip = $r['lastloginip'];
  378.                        
  379.                     }
  380.                    
  381.                     $_SESSION["hm_uname"] = "$uname";
  382.                     $_SESSION["hm_pword"] = "$pword";
  383.                     $_SESSION["hm_theme"] = "$hm_theme";
  384.                     $_SESSION["hm_lang"] = "$hm_lang";
  385.                     $_SESSION["hm_usrlvl"] = "$hm_usrlvl";
  386.                     $_SESSION["hm_usrID"] = "$hm_usrID";
  387.                     $_SESSION["hm_lastlog_date"] = "$lastlog_date";
  388.                     $_SESSION["hm_lastlog_time"] = "$lastlog_time";
  389.                     $_SESSION["hm_lastlog_ip"] = "$lastlog_ip";
  390.                    
  391.                     $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE deefault = '1' AND type = '1' AND name = 'admin_redirect'");
  392.                     while($r=mysql_fetch_array($result))
  393.                     {
  394.                    
  395.                         $content=$r["content"];
  396.                         $redirect_title = $redir_li_title;
  397.                         $redirect_message = $redir_li_message;
  398.                         $redirect_description = $redir_li_description;
  399.                         require "../themes/$theme_url/modules/vars.php";
  400.                         require "../themes/$theme_url/modules/admin/admin_header.php";
  401.                         echo ThemeIt($content);
  402.                         require "../themes/$theme_url/modules/admin/admin_footer.php";
  403.                        
  404.                     }
  405.                    
  406.                     echo "<META HTTP-EQUIV=Refresh CONTENT=\"3; URL=admin.php?nav=start&sid=$sid\">";
  407.                
  408.                 ob_end_flush();
  409.                
  410.             } // End credentials check
  411.            
  412.         }
  413.        
  414.     break; // End override case
  415.  
  416. } // End login switch
  417.  
  418. $hm_uname = $_SESSION['hm_uname'];
  419. $hm_pword = $_SESSION['hm_pword'];
  420. $hm_PayPal = $_SESSION['hm_PayPal'];
  421. $hm_amount = $_SESSION['hm_amount'];
  422. $hm_theme = $_SESSION['hm_theme'];
  423. $hm_lang = $_SESSION['hm_lang'];
  424. $hm_usrlvl = $_SESSION['hm_usrlvl'];
  425. $hm_usrID = $_SESSION['hm_usrID'];
  426. $lastlog_name = $hm_uname;
  427. $lastlog_date = $_SESSION['hm_lastlog_date'];
  428. $lastlog_time = $_SESSION['hm_lastlog_time'];
  429. $lastlog_ip = $_SESSION['hm_lastlog_ip'];
  430.  
  431. if (!$login) {
  432.  
  433.     if (!$hm_uname) {
  434.    
  435.         header("location:admin.php?login=not");
  436.    
  437.     }else{
  438.    
  439.         if (!$hm_pword) {
  440.    
  441.             header("location:admin.php?login=not");
  442.        
  443.         }else{
  444.        
  445.             $result = MYSQL_QUERY ("SELECT username, password FROM " . $db_prefix . "users_accounts WHERE username = '$hm_uname' AND password = '$hm_pword'");
  446.             $count = mysql_num_rows($result);
  447.            
  448.             if($count < 1) {
  449.            
  450.                 header("location:admin.php?login=not");
  451.                
  452.                 $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "logs_hack (username, date, time, IP)".
  453.                 "VALUES ('$hm_uname', '$date', '$time', '$ip')");
  454.                
  455.             }else{
  456.            
  457.                 $nav = $_GET['nav'];
  458.                
  459.                 if (!$nav) {
  460.                
  461.                     header("location:admin.php?nav=start&sid=$sid");
  462.                    
  463.                 }else{
  464.                
  465.                     switch($nav) {
  466.                    
  467.                         case "start":
  468.                        
  469.                             if ($hm_usrlvl == 1) {
  470.  
  471.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  472.                                
  473.                                 echo GetTemplate("admin_top");
  474.                                 echo GetTemplate("admin_navigation");
  475.                                 echo GetTemplate("admin_content");
  476.                                
  477.                                 $filename[0] = "0";
  478.                                 $boxtitle[0] = "0";
  479.                                 $filenum = 0;
  480.                                
  481.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_start' AND type = '1' ORDER BY position");
  482.                                 while($r=mysql_fetch_array($result))
  483.                                 {
  484.                                
  485.                                     $filenum++;
  486.                                     $filename[] = $r["file"];
  487.                                     $boxtitle[] = $r["boxtitle"];
  488.                                    
  489.                                 }
  490.                                
  491.                                 $filenum++;
  492.                                
  493.                                 for ($i = 1; $i < $filenum; $i++) {
  494.                                
  495.                                     $box_title = $boxtitle["$i"];
  496.                                     echo GetTemplate("admin_box_top");
  497.                                     require "../themes/$theme_url/modules/admin/". $filename["$i"] . ".php";
  498.                                     echo GetTemplate("admin_box_content");
  499.                                     echo GetTemplate("admin_box_bottom");
  500.                                
  501.                                 }
  502.                                
  503.                                 echo GetTemplate("admin_bottom");
  504.                                
  505.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  506.                                
  507.                             }else if ($hm_usrlvl == 2) {
  508.                            
  509.                                 require "../themes/$theme_url/modules/rep/rep_header.php";
  510.                                
  511.                                 echo GetTemplate("rep_top");
  512.                                 echo GetTemplate("rep_navigation");
  513.                                 echo GetTemplate("rep_content");
  514.                                
  515.                                 $filename[0] = "0";
  516.                                 $boxtitle[0] = "0";
  517.                                 $filenum = 0;
  518.                                
  519.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_start' AND type = '2' ORDER BY position");
  520.                                 while($r=mysql_fetch_array($result))
  521.                                 {
  522.                                
  523.                                     $filenum++;
  524.                                     $filename[] = $r["file"];
  525.                                     $boxtitle[] = $r["boxtitle"];
  526.                                    
  527.                                 }
  528.                                
  529.                                 $filenum++;
  530.                                
  531.                                 for ($i = 1; $i < $filenum; $i++) {
  532.                                
  533.                                     $box_title = $boxtitle["$i"];
  534.                                     echo GetTemplate("rep_box_top");
  535.                                     require "../themes/$theme_url/modules/rep/". $filename["$i"] . ".php";
  536.                                     echo GetTemplate("rep_box_content");
  537.                                     echo GetTemplate("rep_box_bottom");
  538.                                
  539.                                 }
  540.                                
  541.                                 echo GetTemplate("rep_bottom");
  542.                                
  543.                                 require "../themes/$theme_url/modules/rep/rep_footer.php";
  544.                                
  545.                             }else if ($hm_usrlvl == 3) {
  546.                            
  547.                                 require "../themes/$theme_url/modules/client/client_header.php";
  548.                                
  549.                                 echo GetTemplate("client_top");
  550.                                 echo GetTemplate("client_navigation");
  551.                                 echo GetTemplate("client_content");
  552.                                
  553.                                 $filename[0] = "0";
  554.                                 $boxtitle[0] = "0";
  555.                                 $filenum = 0;
  556.                                
  557.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_start' AND type = '3' ORDER BY position");
  558.                                 while($r=mysql_fetch_array($result))
  559.                                 {
  560.                                
  561.                                     $filenum++;
  562.                                     $filename[] = $r["file"];
  563.                                     $boxtitle[] = $r["boxtitle"];
  564.                                    
  565.                                 }
  566.                                
  567.                                 $filenum++;
  568.                                
  569.                                 for ($i = 1; $i < $filenum; $i++) {
  570.                                
  571.                                     $box_title = $boxtitle["$i"];
  572.                                     echo GetTemplate("client_box_top");
  573.                                     require "../themes/$theme_url/modules/client/". $filename["$i"] . ".php";
  574.                                     echo GetTemplate("client_box_content");
  575.                                     echo GetTemplate("client_box_bottom");
  576.                                
  577.                                 }
  578.                                
  579.                                 echo GetTemplate("client_bottom");
  580.                                
  581.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  582.                                
  583.                             }
  584.                        
  585.                         break; // End start case
  586.                    
  587.                         case "addfunds":
  588.                        
  589.                             if ($hm_usrlvl == 1) {
  590.                            
  591.                                 //
  592.                                
  593.                             }else{
  594.                            
  595.                                 require "../themes/$theme_url/modules/client/client_header.php";
  596.                                
  597.                                 echo GetTemplate("client_top");
  598.                                 echo GetTemplate("client_navigation");
  599.                                 echo GetTemplate("client_content");
  600.                                
  601.                                 $filename[0] = "0";
  602.                                 $boxtitle[0] = "0";
  603.                                 $filenum = 0;
  604.                                
  605.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_addfunds' AND type = '3' ORDER BY position");
  606.                                 while($r=mysql_fetch_array($result))
  607.                                 {
  608.                                
  609.                                     $filenum++;
  610.                                     $filename[] = $r["file"];
  611.                                     $boxtitle[] = $r["boxtitle"];
  612.                                    
  613.                                 }
  614.                                
  615.                                 $filenum++;
  616.                                
  617.                                 for ($i = 1; $i < $filenum; $i++) {
  618.                                
  619.                                     $box_title = $boxtitle["$i"];
  620.                                     echo GetTemplate("client_box_top");
  621.                                     require "../themes/$theme_url/modules/client/". $filename["$i"] . ".php";
  622.                                     echo GetTemplate("client_box_content");
  623.                                     echo GetTemplate("client_box_bottom");
  624.                                
  625.                                 }
  626.                                
  627.                                 echo GetTemplate("client_bottom");
  628.                                
  629.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  630.                                
  631.                             }
  632.                        
  633.                         break; // End addfunds case
  634.                    
  635.                         case "alltickets":
  636.                        
  637.                             if ($hm_usrlvl == 1) {
  638.                            
  639.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  640.                                
  641.                                 echo GetTemplate("admin_top");
  642.                                 echo GetTemplate("admin_navigation");
  643.                                 echo GetTemplate("admin_content");
  644.                                
  645.                                 $filename[0] = "0";
  646.                                 $boxtitle[0] = "0";
  647.                                 $filenum = 0;
  648.                                
  649.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_alltickets' AND type = '1' ORDER BY position");
  650.                                 while($r=mysql_fetch_array($result))
  651.                                 {
  652.                                
  653.                                     $filenum++;
  654.                                     $filename[] = $r["file"];
  655.                                     $boxtitle[] = $r["boxtitle"];
  656.                                    
  657.                                 }
  658.                                
  659.                                 $filenum++;
  660.                                
  661.                                 for ($i = 1; $i < $filenum; $i++) {
  662.                                
  663.                                     $box_title = $boxtitle["$i"];
  664.                                     echo GetTemplate("client_box_top");
  665.                                     require "../themes/$theme_url/modules/admin/". $filename["$i"] . ".php";
  666.                                     echo GetTemplate("admin_box_content");
  667.                                     echo GetTemplate("admin_box_bottom");
  668.                                
  669.                                 }
  670.                                
  671.                                 echo GetTemplate("admin_bottom");
  672.                                
  673.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  674.                                
  675.                             }else{
  676.                            
  677.                                 require "../themes/$theme_url/modules/client/client_header.php";
  678.                                
  679.                                 echo GetTemplate("client_top");
  680.                                 echo GetTemplate("client_navigation");
  681.                                 echo GetTemplate("client_content");
  682.                                
  683.                                 $filename[0] = "0";
  684.                                 $boxtitle[0] = "0";
  685.                                 $filenum = 0;
  686.                                
  687.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_alltickets' AND type = '3' ORDER BY position");
  688.                                 while($r=mysql_fetch_array($result))
  689.                                 {
  690.                                
  691.                                     $filenum++;
  692.                                     $filename[] = $r["file"];
  693.                                     $boxtitle[] = $r["boxtitle"];
  694.                                    
  695.                                 }
  696.                                
  697.                                 $filenum++;
  698.                                
  699.                                 for ($i = 1; $i < $filenum; $i++) {
  700.                                
  701.                                     $box_title = $boxtitle["$i"];
  702.                                     echo GetTemplate("client_box_top");
  703.                                     require "../themes/$theme_url/modules/client/". $filename["$i"] . ".php";
  704.                                     echo GetTemplate("client_box_content");
  705.                                     echo GetTemplate("client_box_bottom");
  706.                                
  707.                                 }
  708.                                
  709.                                 echo GetTemplate("client_bottom");
  710.                                
  711.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  712.                                
  713.                             }
  714.                        
  715.                         break; // End alltickets case
  716.                    
  717.                         case "readticket":
  718.                        
  719.                             if ($hm_usrlvl == 1) {
  720.                            
  721.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  722.                                
  723.                                 echo GetTemplate("admin_top");
  724.                                 echo GetTemplate("admin_navigation");
  725.                                 echo GetTemplate("admin_content");
  726.                                
  727.                                 $filename[0] = "0";
  728.                                 $boxtitle[0] = "0";
  729.                                 $filenum = 0;
  730.                                
  731.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_readticket' AND type = '1' ORDER BY position");
  732.                                 while($r=mysql_fetch_array($result))
  733.                                 {
  734.                                
  735.                                     $filenum++;
  736.                                     $filename[] = $r["file"];
  737.                                     $boxtitle[] = $r["boxtitle"];
  738.                                    
  739.                                 }
  740.                                
  741.                                 $filenum++;
  742.                                
  743.                                 for ($i = 1; $i < $filenum; $i++) {
  744.                                
  745.                                     $box_title = $boxtitle["$i"];
  746.                                     require "../themes/$theme_url/modules/admin/". $filename["$i"] . ".php";
  747.                                     echo GetTemplate("client_box_top");
  748.                                     echo GetTemplate("admin_box_content");
  749.                                     echo GetTemplate("admin_box_bottom");
  750.                                
  751.                                 }
  752.                                
  753.                                 echo GetTemplate("admin_bottom");
  754.                                
  755.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  756.                                
  757.                             }else{
  758.                            
  759.                                 require "../themes/$theme_url/modules/client/client_header.php";
  760.                                
  761.                                 echo GetTemplate("client_top");
  762.                                 echo GetTemplate("client_navigation");
  763.                                 echo GetTemplate("client_content");
  764.                                
  765.                                 $filename[0] = "0";
  766.                                 $boxtitle[0] = "0";
  767.                                 $filenum = 0;
  768.                                
  769.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_readticket' AND type = '3' ORDER BY position");
  770.                                 while($r=mysql_fetch_array($result))
  771.                                 {
  772.                                
  773.                                     $filenum++;
  774.                                     $filename[] = $r["file"];
  775.                                     $boxtitle[] = $r["boxtitle"];
  776.                                    
  777.                                 }
  778.                                
  779.                                 $filenum++;
  780.                                
  781.                                 for ($i = 1; $i < $filenum; $i++) {
  782.                                
  783.                                     $box_title = $boxtitle["$i"];
  784.                                     require "../themes/$theme_url/modules/client/". $filename["$i"] . ".php";
  785.                                     echo GetTemplate("client_box_top");
  786.                                     echo GetTemplate("client_box_content");
  787.                                     echo GetTemplate("client_box_bottom");
  788.                                
  789.                                 }
  790.                                
  791.                                 echo GetTemplate("client_bottom");
  792.                                
  793.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  794.                                
  795.                             }
  796.                        
  797.                         break; // End readticket case
  798.                        
  799.                         case "updateticket":
  800.                                
  801.                             if ($hm_usrlvl == 1) {
  802.                            
  803.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  804.                                
  805.                                 $box_title = "Update Successful";
  806.                                
  807.                                 echo GetTemplate("admin_top");
  808.                                 echo GetTemplate("admin_navigation");
  809.                                 echo GetTemplate("admin_content");
  810.                                 echo GetTemplate("admin_box_top");
  811.                                
  812.                                 $ticket_prebody = $_POST["ticket_prebody"];
  813.                                 $ticket_ticketID = $_POST["ticket_ID"];
  814.                                 $ticket_body = $ticket_prebody . "<br>-------------------------------------------------------<br>Admin Response on $date at $time<br><br>" . $_POST["ticketreply"];
  815.                                
  816.                                 $result = MYSQL_QUERY("UPDATE " . $db_prefix . "support_tickets SET body = '$ticket_body' WHERE ticketID = '$ticket_ticketID'");
  817.                                    
  818.                                 $box_content = "<div style=\"text-align: center\">Ticket Updated Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  819.                            
  820.                                 echo GetTemplate("admin_box_content");
  821.                                 echo GetTemplate("admin_box_bottom");
  822.                                 echo GetTemplate("admin_bottom");
  823.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  824.                            
  825.                             }else{
  826.                            
  827.                                 require "../themes/$theme_url/modules/client/client_header.php";
  828.                                
  829.                                 $box_title = "Update Successful";
  830.                                
  831.                                 echo GetTemplate("client_top");
  832.                                 echo GetTemplate("client_navigation");
  833.                                 echo GetTemplate("client_content");
  834.                                 echo GetTemplate("client_box_top");
  835.                                
  836.                                 $ticket_prebody = $_POST["ticket_prebody"];
  837.                                 $ticket_ticketID = $_POST["ticket_ID"];
  838.                                 $ticket_body = $ticket_prebody . "<br>-------------------------------------------------------<br>User Response on $date at $time<br><br>" . $_POST["ticketreply"];
  839.                                
  840.                                 $result = MYSQL_QUERY("UPDATE " . $db_prefix . "support_tickets SET body = '$ticket_body' WHERE ticketID = '$ticket_ticketID'");
  841.                                    
  842.                                 $box_content = "<div style=\"text-align: center\">Ticket Updated Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  843.                            
  844.                                 echo GetTemplate("client_box_content");
  845.                                 echo GetTemplate("client_box_bottom");
  846.                                 echo GetTemplate("client_bottom");
  847.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  848.                            
  849.                             }
  850.                        
  851.                         break; // End updateticket case
  852.                        
  853.                         case "newticket":
  854.                                
  855.                             if ($hm_usrlvl == 1) {
  856.                            
  857.                                 //
  858.                            
  859.                             }else{
  860.                            
  861.                                 require "../themes/$theme_url/modules/client/client_header.php";
  862.                                
  863.                                 echo GetTemplate("client_top");
  864.                                 echo GetTemplate("client_navigation");
  865.                                 echo GetTemplate("client_content");
  866.                                
  867.                                 $filename[0] = "0";
  868.                                 $boxtitle[0] = "0";
  869.                                 $filenum = 0;
  870.                                
  871.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_newticket' AND type = '3' ORDER BY position");
  872.                                 while($r=mysql_fetch_array($result))
  873.                                 {
  874.                                
  875.                                     $filenum++;
  876.                                     $filename[] = $r["file"];
  877.                                     $boxtitle[] = $r["boxtitle"];
  878.                                    
  879.                                 }
  880.                                
  881.                                 $filenum++;
  882.                                
  883.                                 for ($i = 1; $i < $filenum; $i++) {
  884.                                
  885.                                     $box_title = $boxtitle["$i"];
  886.                                     require "../themes/$theme_url/modules/client/". $filename["$i"] . ".php";
  887.                                     echo GetTemplate("client_box_top");
  888.                                     echo GetTemplate("client_box_content");
  889.                                     echo GetTemplate("client_box_bottom");
  890.                                
  891.                                 }
  892.                                
  893.                                 echo GetTemplate("client_bottom");
  894.                                
  895.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  896.                            
  897.                             }
  898.                        
  899.                         break; // End newticket case
  900.                        
  901.                         case "newticket_post":
  902.                                
  903.                             if ($hm_usrlvl == 1) {
  904.                            
  905.                                 //
  906.                            
  907.                             }else{
  908.                            
  909.                                 require "../themes/$theme_url/modules/client/client_header.php";
  910.                                
  911.                                 $box_title = "Update Successful";
  912.                                
  913.                                 echo GetTemplate("client_top");
  914.                                 echo GetTemplate("client_navigation");
  915.                                 echo GetTemplate("client_content");
  916.                                 echo GetTemplate("client_box_top");
  917.                                
  918.                                 $ticket_body = $_POST["ticket_body"];
  919.                                 $ticket_subject = $_POST["ticket_subject"];
  920.                                 $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "support_tickets (userID, subject, body, ticketdate, tickettime)".
  921.                                 "VALUES ('$hm_usrID', '$ticket_subject', '$ticket_body', '$date', '$time')");
  922.                                    
  923.                                 $box_content = "<div style=\"text-align: center\">Ticket Sent Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  924.                            
  925.                                 echo GetTemplate("client_box_content");
  926.                                 echo GetTemplate("client_box_bottom");
  927.                                 echo GetTemplate("client_bottom");
  928.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  929.                            
  930.                             }
  931.                        
  932.                         break; // End newticket_post case
  933.                    
  934.                         case "acctlist":
  935.                        
  936.                             if ($hm_usrlvl == 1) {
  937.  
  938.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  939.                                
  940.                                 echo GetTemplate("admin_top");
  941.                                 echo GetTemplate("admin_navigation");
  942.                                 echo GetTemplate("admin_content");
  943.                                
  944.                                 $filename[0] = "0";
  945.                                 $boxtitle[0] = "0";
  946.                                 $filenum = 0;
  947.                                
  948.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_acctlist' AND type = '1' ORDER BY position");
  949.                                 while($r=mysql_fetch_array($result))
  950.                                 {
  951.                                
  952.                                     $filenum++;
  953.                                     $filename[] = $r["file"];
  954.                                     $boxtitle[] = $r["boxtitle"];
  955.                                    
  956.                                 }
  957.                                
  958.                                 $filenum++;
  959.                                
  960.                                 for ($i = 1; $i < $filenum; $i++) {
  961.                                
  962.                                     $box_title = $boxtitle["$i"];
  963.                                     echo GetTemplate("admin_box_top");
  964.                                     require "../themes/$theme_url/modules/admin/". $filename["$i"] . ".php";
  965.                                     echo GetTemplate("admin_box_content");
  966.                                     echo GetTemplate("admin_box_bottom");
  967.                                
  968.                                 }
  969.                                
  970.                                 echo GetTemplate("admin_bottom");
  971.                                
  972.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  973.                                
  974.                             }else if ($hm_usrlvl == 2) {
  975.  
  976.                                 require "../themes/$theme_url/modules/rep/rep_header.php";
  977.                                
  978.                                 echo GetTemplate("rep_top");
  979.                                 echo GetTemplate("rep_navigation");
  980.                                 echo GetTemplate("rep_content");
  981.                                
  982.                                 $filename[0] = "0";
  983.                                 $boxtitle[0] = "0";
  984.                                 $filenum = 0;
  985.                                
  986.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_acctlist' AND type = '2' ORDER BY position");
  987.                                 while($r=mysql_fetch_array($result))
  988.                                 {
  989.                                
  990.                                     $filenum++;
  991.                                     $filename[] = $r["file"];
  992.                                     $boxtitle[] = $r["boxtitle"];
  993.                                    
  994.                                 }
  995.                                
  996.                                 $filenum++;
  997.                                
  998.                                 for ($i = 1; $i < $filenum; $i++) {
  999.                                
  1000.                                     $box_title = $boxtitle["$i"];
  1001.                                     echo GetTemplate("rep_box_top");
  1002.                                     require "../themes/$theme_url/modules/rep/". $filename["$i"] . ".php";
  1003.                                     echo GetTemplate("rep_box_content");
  1004.                                     echo GetTemplate("rep_box_bottom");
  1005.                                
  1006.                                 }
  1007.                                
  1008.                                 echo GetTemplate("rep_bottom");
  1009.                                
  1010.                                 require "../themes/$theme_url/modules/rep/rep_footer.php";
  1011.                                
  1012.                             }
  1013.                        
  1014.                         break; // End acctlist case
  1015.                    
  1016.                         case "allcamps":
  1017.                        
  1018.                             if ($hm_usrlvl == 1) {
  1019.  
  1020.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  1021.                                
  1022.                                 echo GetTemplate("admin_top");
  1023.                                 echo GetTemplate("admin_navigation");
  1024.                                 echo GetTemplate("admin_content");
  1025.                                
  1026.                                 $filename[0] = "0";
  1027.                                 $boxtitle[0] = "0";
  1028.                                 $filenum = 0;
  1029.                                
  1030.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_allcamps' AND type = '1' ORDER BY position");
  1031.                                 while($r=mysql_fetch_array($result))
  1032.                                 {
  1033.                                
  1034.                                     $filenum++;
  1035.                                     $filename[] = $r["file"];
  1036.                                     $boxtitle[] = $r["boxtitle"];
  1037.                                    
  1038.                                 }
  1039.                                
  1040.                                 $filenum++;
  1041.                                
  1042.                                 for ($i = 1; $i < $filenum; $i++) {
  1043.                                
  1044.                                     $box_title = $boxtitle["$i"];
  1045.                                     echo GetTemplate("admin_box_top");
  1046.                                     require "../themes/$theme_url/modules/admin/". $filename["$i"] . ".php";
  1047.                                     echo GetTemplate("admin_box_content");
  1048.                                     echo GetTemplate("admin_box_bottom");
  1049.                                
  1050.                                 }
  1051.                                
  1052.                                 echo GetTemplate("admin_bottom");
  1053.                                
  1054.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  1055.                                
  1056.                             }
  1057.                        
  1058.                         break; // End allcamps case
  1059.                    
  1060.                         case "new_campaign":
  1061.                        
  1062.                             $campaignID = $_GET["id"];
  1063.                            
  1064.                             if ($hm_usrlvl == 1) {
  1065.  
  1066.                                 //
  1067.                                
  1068.                             }else{
  1069.                            
  1070.                                 $campaign_catID = 1;
  1071.                                 $campaign_langID = 1;
  1072.                                
  1073.                                 $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "settings_language WHERE languageID = '$campaign_langID'");
  1074.                                 while($r=mysql_fetch_array($result))
  1075.                                 {
  1076.                                
  1077.                                     $campaign_language = $r["name"];
  1078.                                     $campaign_language_dropbox = "<select name=\"campaign_languageID\"><option value=\"$campaign_langID\" selected> $campaign_language</option>";
  1079.                                    
  1080.                                 }
  1081.                                                                
  1082.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "settings_language WHERE active = '1'");
  1083.                                 while($r=mysql_fetch_array($result))
  1084.                                 {
  1085.                                
  1086.                                     $languagename = $r["name"];
  1087.                                     $languageID = $r["languageID"];
  1088.                                    
  1089.                                     if($languageID <> $campaign_langID) {
  1090.                                    
  1091.                                         $campaign_language_dropbox = $campaign_language_dropbox . "<option value=\"$languageID\"> $languagename</option>";
  1092.                                        
  1093.                                     }
  1094.                                    
  1095.                                 }
  1096.                                
  1097.                                 $campaign_language_dropbox = $campaign_language_dropbox . "</select>";
  1098.                                
  1099.                                 //
  1100.                                
  1101.                                 $result = MYSQL_QUERY("SELECT categoryName FROM " . "$db_prefix" . "categories WHERE catID = '$campaign_catID'");
  1102.                                 while($r=mysql_fetch_array($result))
  1103.                                 {
  1104.                                
  1105.                                     $campaign_category = $r["categoryName"];
  1106.                                     $campaign_category_dropbox = "<select name=\"campaign_categoryID\"><option value=\"$campaign_catID\" selected> $campaign_category</option>";
  1107.                                    
  1108.                                 }
  1109.                                                                
  1110.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "categories WHERE active = '1'");
  1111.                                 while($r=mysql_fetch_array($result))
  1112.                                 {
  1113.                                
  1114.                                     $categoryname = $r["categoryName"];
  1115.                                     $categoryID = $r["catID"];
  1116.                                    
  1117.                                     if($categoryID <> $campaign_catID) {
  1118.                                    
  1119.                                         $campaign_category_dropbox = $campaign_category_dropbox . "<option value=\"$categoryID\"> $categoryname</option>";
  1120.                                        
  1121.                                     }
  1122.                                    
  1123.                                 }
  1124.                                
  1125.                                 $campaign_category_dropbox = $campaign_category_dropbox . "</select>";
  1126.                                
  1127.                                 $box_title = $client_new_campaigns_title;
  1128.                                
  1129.                                 require "../themes/$theme_url/modules/client/client_header.php";
  1130.                                
  1131.                                 echo GetTemplate("client_top");
  1132.                                 echo GetTemplate("client_navigation");
  1133.                                 echo GetTemplate("client_content");
  1134.                                 echo GetTemplate("client_box_top");
  1135.                                    
  1136.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '3' AND name = 'client_campaign_content'");
  1137.                                 while($r=mysql_fetch_array($result))
  1138.                                 {
  1139.                                
  1140.                                     $content=$r["content"];
  1141.                                     include "../themes/$theme_url/modules/vars.php";
  1142.                                     $box_content = ThemeIt($content);
  1143.                                    
  1144.                                 }
  1145.                                
  1146.                                 echo GetTemplate("client_box_content");
  1147.                                 echo GetTemplate("client_box_bottom");
  1148.                                 echo GetTemplate("client_bottom");
  1149.                                
  1150.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  1151.                                
  1152.                             }
  1153.                        
  1154.                         break; // End new_campaign case
  1155.                    
  1156.                         case "view_campaign":
  1157.                        
  1158.                             $campaignID = $_GET["id"];
  1159.                            
  1160.                             if ($hm_usrlvl == 1) {
  1161.  
  1162.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "activeadverts WHERE adID = '$campaignID'");
  1163.                                 while($r=mysql_fetch_array($result))
  1164.                                 {
  1165.                                
  1166.                                     $campaign_mediaURL = $r["mediaURL"];
  1167.                                     $campaign_displayTXT = $r["displayTXT"];
  1168.                                     $campaign_keywd = $r["keywd"];
  1169.                                     $campaign_catID = $r["catID"];
  1170.                                     $campaign_langID = $r["languageID"];
  1171.                                     $campaign_clicks = $r["clicks"];
  1172.                                     $campaign_hourCap = $r["hourCap"];
  1173.                                     $campaign_targetURL = $r["targetURL"];
  1174.                                     $campaign_campName = $r["campName"];
  1175.                                     $adType = $r["adType"];
  1176.                                    
  1177.                                 }
  1178.                                
  1179.                                 $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "settings_language WHERE languageID = '$campaign_langID'");
  1180.                                 while($r=mysql_fetch_array($result))
  1181.                                 {
  1182.                                
  1183.                                     $campaign_language = $r["name"];
  1184.                                     $campaign_language_dropbox = "<select name=\"campaign_languageID\"><option value=\"$campaign_langID\" selected> $campaign_language</option>";
  1185.                                    
  1186.                                 }
  1187.                                
  1188.                                 //
  1189.                                
  1190.                                 $result = MYSQL_QUERY("SELECT categoryName FROM " . "$db_prefix" . "categories WHERE catID = '$campaign_catID'");
  1191.                                 while($r=mysql_fetch_array($result))
  1192.                                 {
  1193.                                
  1194.                                     $campaign_category = $r["categoryName"];
  1195.                                     $campaign_category_dropbox = "<select name=\"campaign_categoryID\"><option value=\"$campaign_catID\" selected> $campaign_category</option>";
  1196.                                    
  1197.                                 }
  1198.                                
  1199.                                 $box_title = $client_new_campaigns_title;
  1200.                                
  1201.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  1202.                                
  1203.                                 echo GetTemplate("admin_top");
  1204.                                 echo GetTemplate("admin_navigation");
  1205.                                 echo GetTemplate("admin_content");
  1206.                                 echo GetTemplate("admin_box_top");
  1207.                                    
  1208.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '2' AND name = 'rep_viewcampaign_content'");
  1209.                                 while($r=mysql_fetch_array($result))
  1210.                                 {
  1211.                                
  1212.                                     $content=$r["content"];
  1213.                                     include "../themes/$theme_url/modules/vars.php";
  1214.                                     $box_content = ThemeIt($content);
  1215.                                    
  1216.                                 }
  1217.                                
  1218.                                 echo GetTemplate("admin_box_content");
  1219.                                 echo GetTemplate("admin_box_bottom");
  1220.                                 echo GetTemplate("admin_bottom");
  1221.                                
  1222.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  1223.                                
  1224.                             }else if ($hm_usrlvl == 2) {
  1225.  
  1226.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "activeadverts WHERE adID = '$campaignID'");
  1227.                                 while($r=mysql_fetch_array($result))
  1228.                                 {
  1229.                                
  1230.                                     $campaign_mediaURL = $r["mediaURL"];
  1231.                                     $campaign_displayTXT = $r["displayTXT"];
  1232.                                     $campaign_keywd = $r["keywd"];
  1233.                                     $campaign_catID = $r["catID"];
  1234.                                     $campaign_langID = $r["languageID"];
  1235.                                     $campaign_clicks = $r["clicks"];
  1236.                                     $campaign_hourCap = $r["hourCap"];
  1237.                                     $campaign_targetURL = $r["targetURL"];
  1238.                                     $campaign_campName = $r["campName"];
  1239.                                     $adType = $r["adType"];
  1240.                                    
  1241.                                 }
  1242.                                
  1243.                                 $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "settings_language WHERE languageID = '$campaign_langID'");
  1244.                                 while($r=mysql_fetch_array($result))
  1245.                                 {
  1246.                                
  1247.                                     $campaign_language = $r["name"];
  1248.                                     $campaign_language_dropbox = "<select name=\"campaign_languageID\"><option value=\"$campaign_langID\" selected> $campaign_language</option>";
  1249.                                    
  1250.                                 }
  1251.                                
  1252.                                 //
  1253.                                
  1254.                                 $result = MYSQL_QUERY("SELECT categoryName FROM " . "$db_prefix" . "categories WHERE catID = '$campaign_catID'");
  1255.                                 while($r=mysql_fetch_array($result))
  1256.                                 {
  1257.                                
  1258.                                     $campaign_category = $r["categoryName"];
  1259.                                     $campaign_category_dropbox = "<select name=\"campaign_categoryID\"><option value=\"$campaign_catID\" selected> $campaign_category</option>";
  1260.                                    
  1261.                                 }
  1262.                                
  1263.                                 $box_title = $client_new_campaigns_title;
  1264.                                
  1265.                                 require "../themes/$theme_url/modules/rep/rep_header.php";
  1266.                                
  1267.                                 echo GetTemplate("rep_top");
  1268.                                 echo GetTemplate("rep_navigation");
  1269.                                 echo GetTemplate("rep_content");
  1270.                                 echo GetTemplate("rep_box_top");
  1271.                                    
  1272.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '2' AND name = 'rep_viewcampaign_content'");
  1273.                                 while($r=mysql_fetch_array($result))
  1274.                                 {
  1275.                                
  1276.                                     $content=$r["content"];
  1277.                                     include "../themes/$theme_url/modules/vars.php";
  1278.                                     $box_content = ThemeIt($content);
  1279.                                    
  1280.                                 }
  1281.                                
  1282.                                 echo GetTemplate("rep_box_content");
  1283.                                 echo GetTemplate("rep_box_bottom");
  1284.                                 echo GetTemplate("rep_bottom");
  1285.                                
  1286.                                 require "../themes/$theme_url/modules/rep/rep_footer.php";
  1287.                                
  1288.                             }
  1289.                        
  1290.                         break; // End view_campaign case
  1291.                    
  1292.                         case "edit_campaign":
  1293.                        
  1294.                             $campaignID = $_GET["id"];
  1295.                            
  1296.                             if ($hm_usrlvl == 1) {
  1297.  
  1298.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "activeadverts WHERE adID = '$campaignID'");
  1299.                                 while($r=mysql_fetch_array($result))
  1300.                                 {
  1301.                                
  1302.                                     $campaign_mediaURL = $r["mediaURL"];
  1303.                                     $campaign_displayTXT = $r["displayTXT"];
  1304.                                     $campaign_keywd = $r["keywd"];
  1305.                                     $campaign_catID = $r["catID"];
  1306.                                     $campaign_langID = $r["languageID"];
  1307.                                     $campaign_clicks = $r["clicks"];
  1308.                                     $campaign_hourCap = $r["hourCap"];
  1309.                                     $campaign_targetURL = $r["targetURL"];
  1310.                                     $campaign_campName = $r["campName"];
  1311.                                     $adType = $r["adType"];
  1312.                                    
  1313.                                 }
  1314.                                
  1315.                                 $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "settings_language WHERE languageID = '$campaign_langID'");
  1316.                                 while($r=mysql_fetch_array($result))
  1317.                                 {
  1318.                                
  1319.                                     $campaign_language = $r["name"];
  1320.                                     $campaign_language_dropbox = "<select name=\"campaign_languageID\"><option value=\"$campaign_langID\" selected> $campaign_language</option>";
  1321.                                    
  1322.                                 }
  1323.                                                                
  1324.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "settings_language WHERE active = '1'");
  1325.                                 while($r=mysql_fetch_array($result))
  1326.                                 {
  1327.                                
  1328.                                     $languagename = $r["name"];
  1329.                                     $languageID = $r["languageID"];
  1330.                                    
  1331.                                     if($languageID <> $campaign_langID) {
  1332.                                    
  1333.                                         $campaign_language_dropbox = $campaign_language_dropbox . "<option value=\"$languageID\"> $languagename</option>";
  1334.                                        
  1335.                                     }
  1336.                                    
  1337.                                 }
  1338.                                
  1339.                                 $campaign_language_dropbox = $campaign_language_dropbox . "</select>";
  1340.                                
  1341.                                 //
  1342.                                
  1343.                                 $result = MYSQL_QUERY("SELECT categoryName FROM " . "$db_prefix" . "categories WHERE catID = '$campaign_catID'");
  1344.                                 while($r=mysql_fetch_array($result))
  1345.                                 {
  1346.                                
  1347.                                     $campaign_category = $r["categoryName"];
  1348.                                     $campaign_category_dropbox = "<select name=\"campaign_categoryID\"><option value=\"$campaign_catID\" selected> $campaign_category</option>";
  1349.                                    
  1350.                                 }
  1351.                                                                
  1352.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "categories WHERE active = '1'");
  1353.                                 while($r=mysql_fetch_array($result))
  1354.                                 {
  1355.                                
  1356.                                     $categoryname = $r["categoryName"];
  1357.                                     $categoryID = $r["catID"];
  1358.                                    
  1359.                                     if($categoryID <> $campaign_catID) {
  1360.                                    
  1361.                                         $campaign_category_dropbox = $campaign_category_dropbox . "<option value=\"$categoryID\"> $categoryname</option>";
  1362.                                        
  1363.                                     }
  1364.                                    
  1365.                                 }
  1366.                                
  1367.                                 $campaign_category_dropbox = $campaign_category_dropbox . "</select>";
  1368.                                
  1369.                                 $box_title = $client_new_campaigns_title;
  1370.                                
  1371.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  1372.                                
  1373.                                 echo GetTemplate("admin_top");
  1374.                                 echo GetTemplate("admin_navigation");
  1375.                                 echo GetTemplate("admin_content");
  1376.                                 echo GetTemplate("admin_box_top");
  1377.                                    
  1378.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '1' AND name = 'admin_campaign_content'");
  1379.                                 while($r=mysql_fetch_array($result))
  1380.                                 {
  1381.                                
  1382.                                     $content=$r["content"];
  1383.                                     include "../themes/$theme_url/modules/vars.php";
  1384.                                     $box_content = ThemeIt($content);
  1385.                                    
  1386.                                 }
  1387.                                
  1388.                                 echo GetTemplate("admin_box_content");
  1389.                                 echo GetTemplate("admin_box_bottom");
  1390.                                 echo GetTemplate("admin_bottom");
  1391.                                
  1392.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  1393.                                
  1394.                             }else{
  1395.                            
  1396.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "activeadverts WHERE userID = '$hm_usrID' AND adID = '$campaignID'");
  1397.                                 while($r=mysql_fetch_array($result))
  1398.                                 {
  1399.                                
  1400.                                     $campaign_mediaURL = $r["mediaURL"];
  1401.                                     $campaign_displayTXT = $r["displayTXT"];
  1402.                                     $campaign_keywd = $r["keywd"];
  1403.                                     $campaign_catID = $r["catID"];
  1404.                                     $campaign_langID = $r["languageID"];
  1405.                                     $campaign_clicks = $r["clicks"];
  1406.                                     $campaign_hourCap = $r["hourCap"];
  1407.                                     $campaign_targetURL = $r["targetURL"];
  1408.                                     $campaign_campName = $r["campName"];
  1409.                                     $adType = $r["adType"];
  1410.                                    
  1411.                                 }
  1412.                                
  1413.                                 $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "settings_language WHERE languageID = '$campaign_langID'");
  1414.                                 while($r=mysql_fetch_array($result))
  1415.                                 {
  1416.                                
  1417.                                     $campaign_language = $r["name"];
  1418.                                     $campaign_language_dropbox = "<select name=\"campaign_languageID\"><option value=\"$campaign_langID\" selected> $campaign_language</option>";
  1419.                                    
  1420.                                 }
  1421.                                                                
  1422.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "settings_language WHERE active = '1'");
  1423.                                 while($r=mysql_fetch_array($result))
  1424.                                 {
  1425.                                
  1426.                                     $languagename = $r["name"];
  1427.                                     $languageID = $r["languageID"];
  1428.                                    
  1429.                                     if($languageID <> $campaign_langID) {
  1430.                                    
  1431.                                         $campaign_language_dropbox = $campaign_language_dropbox . "<option value=\"$languageID\"> $languagename</option>";
  1432.                                        
  1433.                                     }
  1434.                                    
  1435.                                 }
  1436.                                
  1437.                                 $campaign_language_dropbox = $campaign_language_dropbox . "</select>";
  1438.                                
  1439.                                 //
  1440.                                
  1441.                                 $result = MYSQL_QUERY("SELECT categoryName FROM " . "$db_prefix" . "categories WHERE catID = '$campaign_catID'");
  1442.                                 while($r=mysql_fetch_array($result))
  1443.                                 {
  1444.                                
  1445.                                     $campaign_category = $r["categoryName"];
  1446.                                     $campaign_category_dropbox = "<select name=\"campaign_categoryID\"><option value=\"$campaign_catID\" selected> $campaign_category</option>";
  1447.                                    
  1448.                                 }
  1449.                                                                
  1450.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "categories WHERE active = '1'");
  1451.                                 while($r=mysql_fetch_array($result))
  1452.                                 {
  1453.                                
  1454.                                     $categoryname = $r["categoryName"];
  1455.                                     $categoryID = $r["catID"];
  1456.                                    
  1457.                                     if($categoryID <> $campaign_catID) {
  1458.                                    
  1459.                                         $campaign_category_dropbox = $campaign_category_dropbox . "<option value=\"$categoryID\"> $categoryname</option>";
  1460.                                        
  1461.                                     }
  1462.                                    
  1463.                                 }
  1464.                                
  1465.                                 $campaign_category_dropbox = $campaign_category_dropbox . "</select>";
  1466.                                
  1467.                                 $box_title = $client_new_campaigns_title;
  1468.                                
  1469.                                 require "../themes/$theme_url/modules/client/client_header.php";
  1470.                                
  1471.                                 echo GetTemplate("client_top");
  1472.                                 echo GetTemplate("client_navigation");
  1473.                                 echo GetTemplate("client_content");
  1474.                                 echo GetTemplate("client_box_top");
  1475.                                    
  1476.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '3' AND name = 'client_campaign_content'");
  1477.                                 while($r=mysql_fetch_array($result))
  1478.                                 {
  1479.                                
  1480.                                     $content=$r["content"];
  1481.                                     include "../themes/$theme_url/modules/vars.php";
  1482.                                     $box_content = ThemeIt($content);
  1483.                                    
  1484.                                 }
  1485.                                
  1486.                                 echo GetTemplate("client_box_content");
  1487.                                 echo GetTemplate("client_box_bottom");
  1488.                                 echo GetTemplate("client_bottom");
  1489.                                
  1490.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  1491.                                
  1492.                             }
  1493.                        
  1494.                         break; // End edit_campaign case
  1495.                        
  1496.                         case "campaign_post":
  1497.                                
  1498.                             $campaignID = $_POST["campaignID"];
  1499.                             $clicks = $_POST["clicks"];
  1500.                             $campaign_clicks = $_POST["campaign_clicks"];
  1501.                             $campaign_adType = $_POST["campaign_adType"];
  1502.                             $adType = $_POST["adType"];
  1503.                            
  1504.                             $result = MYSQL_QUERY("SELECT funds FROM " . "$db_prefix" . "users_accounts WHERE userID = '$hm_usrID'");
  1505.                             while($r=mysql_fetch_array($result))
  1506.                             {
  1507.                            
  1508.                                 // $acct_clicks=$r["funds"];
  1509.                                 $acct_funds=$r["funds"];
  1510.                                
  1511.                             }
  1512.                            
  1513.                             require "../includes/funds_calculator.php";
  1514.                                
  1515.                             if ($have_enough == 1) {
  1516.                                
  1517.                                 if ($hm_usrlvl == 1) {
  1518.                                
  1519.                                     $result = MYSQL_QUERY("UPDATE " . $db_prefix . "users_accounts SET funds = '$new_funds' WHERE userID = '$hm_usrID'");
  1520.                                
  1521.                                     require "../themes/$theme_url/modules/admin/admin_header.php";
  1522.                                    
  1523.                                     $box_title = "Update Successful";
  1524.                                    
  1525.                                     echo GetTemplate("admin_top");
  1526.                                     echo GetTemplate("admin_navigation");
  1527.                                     echo GetTemplate("admin_content");
  1528.                                     echo GetTemplate("admin_box_top");
  1529.                                    
  1530.                                     $campaign_mediaURL = $_POST["campaign_mediaURL"];
  1531.                                     $campaign_displayTXT = $_POST["campaign_displayTXT"];
  1532.                                     $campaign_keywd = $_POST["campaign_keywd"];
  1533.                                     $campaign_catID = $_POST["campaign_categoryID"];
  1534.                                     $campaign_langID = $_POST["campaign_languageID"];
  1535.                                     $campaign_hourCap = $_POST["campaign_hourCap"];
  1536.                                     $campaign_targetURL = $_POST["campaign_targetURL"];
  1537.                                     $campaign_campName = $_POST["campaign_campName"];
  1538.                                     $campaign_confirm = $_POST["campaign_confirm"];
  1539.                                    
  1540.                                     if ($campaignID >= 1) {
  1541.                                    
  1542.                                         $result = MYSQL_QUERY("UPDATE " . $db_prefix . "activeadverts SET mediaURL = '$campaign_mediaURL', displayTXT = '$campaign_displayTXT', keywd = '$campaign_keywd', catID = '$campaign_catID', languageID = '$campaign_langID', clicks = '$campaign_clicks', hourCap = '$campaign_hourCap', targetURL = '$campaign_targetURL', campName = '$campaign_campName', adType = '$campaign_adType', confirmed = '$campaign_confirm' WHERE adID = '$campaignID'");
  1543.                                        
  1544.                                     }else{
  1545.                                    
  1546.                                         $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "activeadverts (userID, mediaURL, displayTXT, keywd, catID, languageID, clicks, hourCap, targetURL, campName)".
  1547.                                         "VALUES ('$hm_usrID', '$campaign_mediaURL', '$campaign_displayTXT', '$campaign_keywd', '$campaign_catID', '$campaign_langID', '$campaign_clicks', '$campaign_hourCap', '$campaign_targetURL', '$campaign_campName')");
  1548.                                        
  1549.                                     }
  1550.                                    
  1551.                                     $box_content = "<div style=\"text-align: center\">Campaign Settings Updated Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  1552.                                
  1553.                                     echo GetTemplate("admin_box_content");
  1554.                                     echo GetTemplate("admin_box_bottom");
  1555.                                     echo GetTemplate("admin_bottom");
  1556.                                     require "../themes/$theme_url/modules/admin/admin_footer.php";
  1557.                                
  1558.                                 }else{
  1559.                                    
  1560.                                     $result = MYSQL_QUERY("UPDATE " . $db_prefix . "users_accounts SET funds = '$new_funds' WHERE userID = '$hm_usrID'");
  1561.                                
  1562.                                     require "../themes/$theme_url/modules/client/client_header.php";
  1563.                                    
  1564.                                     $box_title = "Update Successful";
  1565.                                    
  1566.                                     echo GetTemplate("client_top");
  1567.                                     echo GetTemplate("client_navigation");
  1568.                                     echo GetTemplate("client_content");
  1569.                                     echo GetTemplate("client_box_top");
  1570.                                    
  1571.                                     $campaign_mediaURL = $_POST["campaign_mediaURL"];
  1572.                                     $campaign_displayTXT = $_POST["campaign_displayTXT"];
  1573.                                     $campaign_keywd = $_POST["campaign_keywd"];
  1574.                                     $campaign_catID = $_POST["campaign_categoryID"];
  1575.                                     $campaign_langID = $_POST["campaign_languageID"];
  1576.                                     $campaign_hourCap = $_POST["campaign_hourCap"];
  1577.                                     $campaign_targetURL = $_POST["campaign_targetURL"];
  1578.                                     $campaign_campName = $_POST["campaign_campName"];
  1579.                                     $campaign_confirm = $_POST["campaign_confirm"];
  1580.                                    
  1581.                                     if ($campaignID >= 1) {
  1582.                                    
  1583.                                         $result = MYSQL_QUERY("UPDATE " . $db_prefix . "activeadverts SET mediaURL = '$campaign_mediaURL', displayTXT = '$campaign_displayTXT', keywd = '$campaign_keywd', catID = '$campaign_catID', languageID = '$campaign_langID', clicks = '$campaign_clicks', hourCap = '$campaign_hourCap', targetURL = '$campaign_targetURL', campName = '$campaign_campName', adType = '$campaign_adType', confirmed = '$campaign_confirm' WHERE userID = '$hm_usrID' AND adID = '$campaignID'");
  1584.                                        
  1585.                                     }else{
  1586.                                    
  1587.                                         $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "activeadverts (userID, mediaURL, displayTXT, keywd, catID, languageID, clicks, hourCap, targetURL, campName)".
  1588.                                         "VALUES ('$hm_usrID', '$campaign_mediaURL', '$campaign_displayTXT', '$campaign_keywd', '$campaign_catID', '$campaign_langID', '$campaign_clicks', '$campaign_hourCap', '$campaign_targetURL', '$campaign_campName')");
  1589.                                        
  1590.                                     }
  1591.                                    
  1592.                                     $box_content = "<div style=\"text-align: center\">Campaign Settings Updated Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  1593.                                
  1594.                                     echo GetTemplate("client_box_content");
  1595.                                     echo GetTemplate("client_box_bottom");
  1596.                                     echo GetTemplate("client_bottom");
  1597.                                     require "../themes/$theme_url/modules/client/client_footer.php";
  1598.                                
  1599.                                 }
  1600.                                
  1601.                             }else{
  1602.                            
  1603.                                 require "../themes/$theme_url/modules/client/client_header.php";
  1604.                                    
  1605.                                     $box_title = "Oops!";
  1606.                                    
  1607.                                     echo GetTemplate("client_top");
  1608.                                     echo GetTemplate("client_navigation");
  1609.                                     echo GetTemplate("client_content");
  1610.                                     echo GetTemplate("client_box_top");
  1611.                                    
  1612.                                     $box_content = "<div style=\"text-align: center\">Sorry, you do not have the funds or clicks available on your account, please try again.</div>";
  1613.                                
  1614.                                     echo GetTemplate("client_box_content");
  1615.                                     echo GetTemplate("client_box_bottom");
  1616.                                     echo GetTemplate("client_bottom");
  1617.                                     require "../themes/$theme_url/modules/client/client_footer.php";
  1618.                                
  1619.                             }
  1620.                        
  1621.                         break; // End campaign_post case
  1622.                        
  1623.                         case "genprofile":
  1624.                        
  1625.                             $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "users_accounts WHERE username = '$hm_uname'");
  1626.                             while($r=mysql_fetch_array($result))
  1627.                             {
  1628.                            
  1629.                                 $profile_firstname = $r["firstname"];
  1630.                                 $profile_lastname = $r["lastname"];
  1631.                                 $profile_emailaddr = $r["emailaddr"];
  1632.                                 $profile_phone = $r["phone"];
  1633.                                 $profile_fax = $r["fax"];
  1634.                                 $profile_street = $r["street"];
  1635.                                 $profile_city = $r["city"];
  1636.                                 $profile_state = $r["state"];
  1637.                                 $profile_zipcode = $r["zipcode"];
  1638.                                 $profile_country = $r["country"];
  1639.                                 $profile_aolim = $r["aolim"];
  1640.                                 $profile_msnim = $r["msnim"];
  1641.                                 $profile_icqim = $r["icqim"];
  1642.                                 $profile_yahooim = $r["yahooim"];
  1643.                                 $profile_themeID = $r["themeID"];
  1644.                                 $profile_languageID = $r["languageID"];
  1645.                                
  1646.                             }
  1647.                            
  1648.                             $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "settings_language WHERE languageID = '$profile_languageID'");
  1649.                             while($r=mysql_fetch_array($result))
  1650.                             {
  1651.                            
  1652.                                 $profile_language = $r["name"];
  1653.                                 $profile_language_dropbox = "<select name=\"profile_language\"><option value=\"$profile_languageID\" selected> $profile_language</option>";
  1654.                                
  1655.                             }
  1656.                            
  1657.                             $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "settings_language WHERE active = '1'");
  1658.                             while($r=mysql_fetch_array($result))
  1659.                             {
  1660.                            
  1661.                                 $languagename = $r["name"];
  1662.                                 $languageID = $r["languageID"];
  1663.                                
  1664.                                 if($languageID <> $profile_languageID) {
  1665.                                
  1666.                                     $profile_language_dropbox = $profile_language_dropbox . "<option value=\"$languageID\"> $languagename</option>";
  1667.                                    
  1668.                                 }
  1669.                                
  1670.                             }
  1671.                            
  1672.                             $profile_language_dropbox = $profile_language_dropbox . "</select>";
  1673.                            
  1674.                             $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "temps_themes WHERE themeID = '$profile_themeID'");
  1675.                             while($r=mysql_fetch_array($result))
  1676.                             {
  1677.                            
  1678.                                 $profile_theme = $r["name"];
  1679.                                 $profile_theme_dropbox = "<select name=\"profile_theme\"><option value=\"$profile_themeID\" selected> $profile_theme</option>";
  1680.                                
  1681.                             }
  1682.                            
  1683.                             $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "temps_themes WHERE active = '1'");
  1684.                             while($r=mysql_fetch_array($result))
  1685.                             {
  1686.                            
  1687.                                 $themename = $r["name"];
  1688.                                 $themeID = $r["themeID"];
  1689.                                
  1690.                                 if($themeID <> $profile_themeID) {
  1691.                                
  1692.                                     $profile_theme_dropbox = $profile_theme_dropbox . "<option value=\"$themeID\"> $themename</option>";
  1693.                                    
  1694.                                 }
  1695.                                
  1696.                             }
  1697.                            
  1698.                             $profile_theme_dropbox = $profile_theme_dropbox . "</select>";
  1699.                            
  1700.                             $box_title = $general_profile_title;
  1701.                            
  1702.                             if ($hm_usrlvl == 1) {
  1703.                            
  1704.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  1705.                                 echo GetTemplate("admin_top");
  1706.                                 echo GetTemplate("admin_navigation");
  1707.                                 echo GetTemplate("admin_content");
  1708.                                 echo GetTemplate("admin_box_top");
  1709.                                
  1710.                             }else if ($hm_usrlvl == 2) {
  1711.                            
  1712.                                 require "../themes/$theme_url/modules/rep/rep_header.php";
  1713.                                 echo GetTemplate("rep_top");
  1714.                                 echo GetTemplate("rep_navigation");
  1715.                                 echo GetTemplate("rep_content");
  1716.                                 echo GetTemplate("rep_box_top");
  1717.                                
  1718.                             }else if ($hm_usrlvl == 3) {
  1719.                            
  1720.                                 require "../themes/$theme_url/modules/client/client_header.php";
  1721.                                 echo GetTemplate("client_top");
  1722.                                 echo GetTemplate("client_navigation");
  1723.                                 echo GetTemplate("client_content");
  1724.                                 echo GetTemplate("client_box_top");
  1725.                                
  1726.                             }
  1727.                                
  1728.                             $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '1' AND name = 'admin_genprofile_content'");
  1729.                             while($r=mysql_fetch_array($result))
  1730.                             {
  1731.                            
  1732.                                 $content=$r["content"];
  1733.                                 include "../themes/$theme_url/modules/vars.php";
  1734.                                 $box_content = ThemeIt($content);
  1735.                                
  1736.                             }
  1737.                            
  1738.                             if ($hm_usrlvl == 1) {
  1739.                            
  1740.                                 echo GetTemplate("admin_box_content");
  1741.                                 echo GetTemplate("admin_box_bottom");
  1742.                                 echo GetTemplate("admin_bottom");
  1743.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  1744.                                
  1745.                             }else if ($hm_usrlvl == 2) {
  1746.                            
  1747.                                 echo GetTemplate("rep_box_content");
  1748.                                 echo GetTemplate("rep_box_bottom");
  1749.                                 echo GetTemplate("rep_bottom");
  1750.                                 require "../themes/$theme_url/modules/rep/rep_footer.php";
  1751.                                
  1752.                             }else if ($hm_usrlvl == 3) {
  1753.                            
  1754.                                 echo GetTemplate("client_box_content");
  1755.                                 echo GetTemplate("client_box_bottom");
  1756.                                 echo GetTemplate("client_bottom");
  1757.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  1758.                                
  1759.                             }
  1760.                            
  1761.                         break; // End genprofile case
  1762.                        
  1763.                         case "genprofile_update":
  1764.                        
  1765.                             $box_title = "Update Successful";
  1766.                            
  1767.                             if ($hm_usrlvl == 1) {
  1768.                            
  1769.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  1770.                                 echo GetTemplate("admin_top");
  1771.                                 echo GetTemplate("admin_navigation");
  1772.                                 echo GetTemplate("admin_content");
  1773.                                 echo GetTemplate("admin_box_top");
  1774.                                
  1775.                             }else if ($hm_usrlvl == 2) {
  1776.                            
  1777.                                 require "../themes/$theme_url/modules/rep/rep_header.php";
  1778.                                 echo GetTemplate("rep_top");
  1779.                                 echo GetTemplate("rep_navigation");
  1780.                                 echo GetTemplate("rep_content");
  1781.                                 echo GetTemplate("rep_box_top");
  1782.                                
  1783.                             }else if ($hm_usrlvl == 3) {
  1784.                            
  1785.                                 require "../themes/$theme_url/modules/client/client_header.php";
  1786.                                 echo GetTemplate("client_top");
  1787.                                 echo GetTemplate("client_navigation");
  1788.                                 echo GetTemplate("client_content");
  1789.                                 echo GetTemplate("client_box_top");
  1790.                                
  1791.                             }
  1792.                            
  1793.                             $profile_firstname = $_POST['profile_firstname'];
  1794.                             $profile_lastname = $_POST['profile_lastname'];
  1795.                             $profile_emailaddr = $_POST['profile_emailaddr'];
  1796.                             $profile_phone = $_POST['profile_phone'];
  1797.                             $profile_fax = $_POST['profile_fax'];
  1798.                             $profile_street = $_POST['profile_street'];
  1799.                             $profile_city = $_POST['profile_city'];
  1800.                             $profile_state = $_POST['profile_state'];
  1801.                             $profile_zipcode = $_POST['profile_zipcode'];
  1802.                             $profile_country = $_POST['profile_country'];
  1803.                             $profile_aolim = $_POST['profile_aolim'];
  1804.                             $profile_msnim = $_POST['profile_msnim'];
  1805.                             $profile_icqim = $_POST['profile_icqim'];
  1806.                             $profile_yahooim = $_POST['profile_yahooim'];
  1807.                             $profile_theme = $_POST['profile_theme'];
  1808.                             $profile_language = $_POST['profile_language'];
  1809.                            
  1810.                             $result = MYSQL_QUERY("UPDATE " . $db_prefix . "users_accounts SET firstname = '$profile_firstname', lastname = '$profile_lastname', emailaddr = '$profile_emailaddr', phone = '$profile_phone', fax = '$profile_fax', street = '$profile_street', city = '$profile_city', state = '$profile_state', zipcode = '$profile_zipcode', country = '$profile_country', aolim = '$profile_aolim', msnim = '$profile_msnim', icqim = '$profile_icqim', yahooim = '$profile_yahooim', themeID = '$profile_theme', languageID = '$profile_language' WHERE username = '$hm_uname' AND password = '$hm_pword'");
  1811.                            
  1812.                             $box_content = "<div style=\"text-align: center\">General Profile Settings Updated Successfully!<br><a href=\"admin.php?nav=genprofile\">Click here to return to the General Profile Settings</a>.</div>";
  1813.                            
  1814.                             if ($hm_usrlvl == 1) {
  1815.                            
  1816.                                 echo GetTemplate("admin_box_content");
  1817.                                 echo GetTemplate("admin_box_bottom");
  1818.                                 echo GetTemplate("admin_bottom");
  1819.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  1820.                                
  1821.                             }else if ($hm_usrlvl == 2) {
  1822.                            
  1823.                                 echo GetTemplate("rep_box_content");
  1824.                                 echo GetTemplate("rep_box_bottom");
  1825.                                 echo GetTemplate("rep_bottom");
  1826.                                 require "../themes/$theme_url/modules/rep/rep_footer.php";
  1827.                                
  1828.                             }else if ($hm_usrlvl == 3) {
  1829.                            
  1830.                                 echo GetTemplate("client_box_content");
  1831.                                 echo GetTemplate("client_box_bottom");
  1832.                                 echo GetTemplate("client_bottom");
  1833.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  1834.                                
  1835.                             }
  1836.                        
  1837.                         break; // End genprofile_update case
  1838.                        
  1839.                         case "editprofile":
  1840.                        
  1841.                             if($hm_usrlvl == 1){
  1842.                            
  1843.                                 $userID = $_GET["userID"];
  1844.                                
  1845.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "users_accounts WHERE userID = '$userID'");
  1846.                                 while($r=mysql_fetch_array($result))
  1847.                                 {
  1848.                                
  1849.                                     $profile_firstname = $r["firstname"];
  1850.                                     $profile_lastname = $r["lastname"];
  1851.                                     $profile_emailaddr = $r["emailaddr"];
  1852.                                     $profile_phone = $r["phone"];
  1853.                                     $profile_fax = $r["fax"];
  1854.                                     $profile_street = $r["street"];
  1855.                                     $profile_city = $r["city"];
  1856.                                     $profile_state = $r["state"];
  1857.                                     $profile_zipcode = $r["zipcode"];
  1858.                                     $profile_country = $r["country"];
  1859.                                     $profile_aolim = $r["aolim"];
  1860.                                     $profile_msnim = $r["msnim"];
  1861.                                     $profile_icqim = $r["icqim"];
  1862.                                     $profile_yahooim = $r["yahooim"];
  1863.                                     $profile_funds = $r["funds"];
  1864.                                     $profile_userID = $r["userID"];
  1865.                                     $profile_userlevel = $r["userlevel"];
  1866.                                     $profile_acctType = $r["acctType"];
  1867.                                    
  1868.                                 }
  1869.                                
  1870.                                 $box_title = $general_profile_title;
  1871.                                
  1872.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  1873.                                
  1874.                                 echo GetTemplate("admin_top");
  1875.                                 echo GetTemplate("admin_navigation");
  1876.                                 echo GetTemplate("admin_content");
  1877.                                 echo GetTemplate("admin_box_top");
  1878.                                    
  1879.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '1' AND name = 'admin_editprofile_content'");
  1880.                                 while($r=mysql_fetch_array($result))
  1881.                                 {
  1882.                                
  1883.                                     $content=$r["content"];
  1884.                                     include "../themes/$theme_url/modules/vars.php";
  1885.                                     $box_content = ThemeIt($content);
  1886.                                    
  1887.                                 }
  1888.                                
  1889.                                 echo GetTemplate("admin_box_content");
  1890.                                 echo GetTemplate("admin_box_bottom");
  1891.                                 echo GetTemplate("admin_bottom");
  1892.                                
  1893.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  1894.                                
  1895.                             }
  1896.                            
  1897.                         break; // End editprofile case
  1898.                        
  1899.                         case "viewprofile":
  1900.                        
  1901.                             if($hm_usrlvl == 2){
  1902.                            
  1903.                                 $userID = $_GET["userID"];
  1904.                                
  1905.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "users_accounts WHERE userID = '$userID'");
  1906.                                 while($r=mysql_fetch_array($result))
  1907.                                 {
  1908.                                
  1909.                                     $profile_firstname = $r["firstname"];
  1910.                                     $profile_lastname = $r["lastname"];
  1911.                                     $profile_emailaddr = $r["emailaddr"];
  1912.                                     $profile_phone = $r["phone"];
  1913.                                     $profile_fax = $r["fax"];
  1914.                                     $profile_street = $r["street"];
  1915.                                     $profile_city = $r["city"];
  1916.                                     $profile_state = $r["state"];
  1917.                                     $profile_zipcode = $r["zipcode"];
  1918.                                     $profile_country = $r["country"];
  1919.                                     $profile_aolim = $r["aolim"];
  1920.                                     $profile_msnim = $r["msnim"];
  1921.                                     $profile_icqim = $r["icqim"];
  1922.                                     $profile_yahooim = $r["yahooim"];
  1923.                                     $profile_funds = $r["funds"];
  1924.                                     $profile_userID = $r["userID"];
  1925.                                    
  1926.                                 }
  1927.                                
  1928.                                 $box_title = $general_profile_title;
  1929.                                
  1930.                                 require "../themes/$theme_url/modules/rep/rep_header.php";
  1931.                                
  1932.                                 echo GetTemplate("rep_top");
  1933.                                 echo GetTemplate("rep_navigation");
  1934.                                 echo GetTemplate("rep_content");
  1935.                                 echo GetTemplate("rep_box_top");
  1936.                                    
  1937.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '2' AND name = 'rep_viewprofile_content'");
  1938.                                 while($r=mysql_fetch_array($result))
  1939.                                 {
  1940.                                
  1941.                                     $content=$r["content"];
  1942.                                     include "../themes/$theme_url/modules/vars.php";
  1943.                                     $box_content = ThemeIt($content);
  1944.                                    
  1945.                                 }
  1946.                                
  1947.                                 echo GetTemplate("rep_box_content");
  1948.                                 echo GetTemplate("rep_box_bottom");
  1949.                                 echo GetTemplate("rep_bottom");
  1950.                                
  1951.                                 require "../themes/$theme_url/modules/rep/rep_footer.php";
  1952.                                
  1953.                             }
  1954.                            
  1955.                         break; // End viewprofile case
  1956.                        
  1957.                         case "editprofile_update":
  1958.                        
  1959.                             if ($hm_usrlvl == 1) {
  1960.                            
  1961.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  1962.                                
  1963.                                 $box_title = "Update Successful";
  1964.                            
  1965.                                 echo GetTemplate("admin_top");
  1966.                                 echo GetTemplate("admin_navigation");
  1967.                                 echo GetTemplate("admin_content");
  1968.                                 echo GetTemplate("admin_box_top");
  1969.                            
  1970.                                 $profile_firstname = $_POST['profile_firstname'];
  1971.                                 $profile_lastname = $_POST['profile_lastname'];
  1972.                                 $profile_emailaddr = $_POST['profile_emailaddr'];
  1973.                                 $profile_phone = $_POST['profile_phone'];
  1974.                                 $profile_fax = $_POST['profile_fax'];
  1975.                                 $profile_street = $_POST['profile_street'];
  1976.                                 $profile_city = $_POST['profile_city'];
  1977.                                 $profile_state = $_POST['profile_state'];
  1978.                                 $profile_zipcode = $_POST['profile_zipcode'];
  1979.                                 $profile_country = $_POST['profile_country'];
  1980.                                 $profile_aolim = $_POST['profile_aolim'];
  1981.                                 $profile_msnim = $_POST['profile_msnim'];
  1982.                                 $profile_icqim = $_POST['profile_icqim'];
  1983.                                 $profile_yahooim = $_POST['profile_yahooim'];
  1984.                                 $profile_funds = $_POST['profile_funds'];
  1985.                                 $profile_userID = $_POST['profile_userID'];
  1986.                                 $profile_userlevel = $_POST['profile_userlevel'];
  1987.                                 $profile_acctType = $_POST['profile_acctType'];
  1988.                                
  1989.                                 $result = MYSQL_QUERY("UPDATE " . $db_prefix . "users_accounts SET firstname = '$profile_firstname', lastname = '$profile_lastname', emailaddr = '$profile_emailaddr', phone = '$profile_phone', fax = '$profile_fax', street = '$profile_street', city = '$profile_city', state = '$profile_state', zipcode = '$profile_zipcode', country = '$profile_country', aolim = '$profile_aolim', msnim = '$profile_msnim', icqim = '$profile_icqim', yahooim = '$profile_yahooim', funds = '$profile_funds', userlevel = '$profile_userlevel', acctType = '$profile_acctType' WHERE userID = '$profile_userID'");
  1990.                                
  1991.                                 $box_content = "<div style=\"text-align: center\">Client's Profile Settings Updated Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  1992.                            
  1993.                                 echo GetTemplate("admin_box_content");
  1994.                                 echo GetTemplate("admin_box_bottom");
  1995.                                 echo GetTemplate("admin_bottom");
  1996.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  1997.                                
  1998.                             }
  1999.                        
  2000.                         break; // End editprofile_update case
  2001.                        
  2002.                         case "settings":
  2003.                        
  2004.                             if ($hm_usrlvl == 1) {
  2005.                        
  2006.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "settings_settings WHERE active = '1'");
  2007.                                 while($r=mysql_fetch_array($result))
  2008.                                 {
  2009.                                
  2010.                                     $settings_custservicemail = $r["custservicemail"];
  2011.                                     $settings_billingmail = $r["billingmail"];
  2012.                                     $settings_supportmail = $r["supportmail"];
  2013.                                     $settings_paypalmail = $r["paypalmail"];
  2014.                                     $settings_adminmail = $r["adminmail"];
  2015.                                     $settings_webmastermail = $r["webmastermail"];
  2016.                                     $settings_websiteurl = $r["websiteurl"];
  2017.                                     $settings_street = $r["street"];
  2018.                                     $settings_city = $r["city"];
  2019.                                     $settings_state = $r["state"];
  2020.                                     $settings_zipcode = $r["zipcode"];
  2021.                                     $settings_country = $r["country"];
  2022.                                     $settings_checkname = $r["checkname"];
  2023.                                     $settings_supportsiteurl = $r["supportsiteurl"];
  2024.                                     $settings_compname = $r["compname"];
  2025.                                    
  2026.                                 }
  2027.                                
  2028.                                 $result = MYSQL_QUERY("SELECT name, settingsID FROM " . "$db_prefix" . "settings_settings WHERE active = '1'");
  2029.                                 while($r=mysql_fetch_array($result))
  2030.                                 {
  2031.                                
  2032.                                     $settings_name = $r["name"];
  2033.                                     $settings_setting = $r["settingsID"];
  2034.                                     $settings_setting_dropbox = "<select name=\"profile_language\"><option value=\"$settings_setting\" selected> $settings_name</option>";
  2035.                                    
  2036.                                 }
  2037.                                
  2038.                                 $result = MYSQL_QUERY("SELECT name, settingsID FROM " . "$db_prefix" . "settings_settings");
  2039.                                 while($r=mysql_fetch_array($result))
  2040.                                 {
  2041.                                
  2042.                                     $settingsname = $r["name"];
  2043.                                     $settingsID = $r["settingsID"];
  2044.                                    
  2045.                                     if($settingsID <> $settings_setting) {
  2046.                                    
  2047.                                         $settings_setting_dropbox = $settings_setting_dropbox . "<option value=\"$settingsID\"> $settingsname</option>";
  2048.                                        
  2049.                                     }
  2050.                                    
  2051.                                 }
  2052.                                
  2053.                                 $settings_setting_dropbox = $settings_setting_dropbox . "</select>";
  2054.                                
  2055.                                 $result = MYSQL_QUERY("SELECT name FROM " . "$db_prefix" . "temps_themes WHERE themeID = '$profile_themeID'");
  2056.                                 while($r=mysql_fetch_array($result))
  2057.                                 {
  2058.                                
  2059.                                     $profile_theme = $r["name"];
  2060.                                     $profile_theme_dropbox = "<select name=\"profile_theme\"><option value=\"$profile_themeID\" selected> $profile_theme</option>";
  2061.                                    
  2062.                                 }
  2063.                                
  2064.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "temps_themes WHERE active = '1'");
  2065.                                 while($r=mysql_fetch_array($result))
  2066.                                 {
  2067.                                
  2068.                                     $themename = $r["name"];
  2069.                                     $themeID = $r["themeID"];
  2070.                                    
  2071.                                     if($themeID <> $profile_themeID) {
  2072.                                    
  2073.                                         $profile_theme_dropbox = $profile_theme_dropbox . "<option value=\"$themeID\"> $themename</option>";
  2074.                                        
  2075.                                     }
  2076.                                    
  2077.                                 }
  2078.                                
  2079.                                 $profile_theme_dropbox = $profile_theme_dropbox . "</select>";
  2080.                                
  2081.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  2082.                                
  2083.                                 $box_title = $cp_settings_title;
  2084.                                
  2085.                                 echo GetTemplate("admin_top");
  2086.                                 echo GetTemplate("admin_navigation");
  2087.                                 echo GetTemplate("admin_content");
  2088.                                 echo GetTemplate("admin_box_top");
  2089.                                    
  2090.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '1' AND name = 'admin_settings_content'");
  2091.                                 while($r=mysql_fetch_array($result))
  2092.                                 {
  2093.                                
  2094.                                     $content=$r["content"];
  2095.                                     include "../themes/$theme_url/modules/vars.php";
  2096.                                     $box_content = ThemeIt($content);
  2097.                                    
  2098.                                 }
  2099.                                
  2100.                                 echo GetTemplate("admin_box_content");
  2101.                                 echo GetTemplate("admin_box_bottom");
  2102.                                 echo GetTemplate("admin_bottom");
  2103.                                
  2104.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  2105.                                
  2106.                             };
  2107.                        
  2108.                         break; // End settings case
  2109.                        
  2110.                         case "settings_update":
  2111.                        
  2112.                             if ($hm_usrlvl == 1) {
  2113.                        
  2114.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  2115.                                
  2116.                                 $box_title = "Update Successful";
  2117.                            
  2118.                                 echo GetTemplate("admin_top");
  2119.                                 echo GetTemplate("admin_navigation");
  2120.                                 echo GetTemplate("admin_content");
  2121.                                 echo GetTemplate("admin_box_top");
  2122.                                    
  2123.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '1' AND name = 'admin_settings_update_content'");
  2124.                                 while($r=mysql_fetch_array($result))
  2125.                                 {
  2126.                                
  2127.                                     $content=$r["content"];
  2128.                                     include "../themes/$theme_url/modules/vars.php";
  2129.                                     echo ThemeIt($content);
  2130.                                    
  2131.                                 }
  2132.                                
  2133.                                 $settings_custservicemail = $_POST["settings_custservicemail"];
  2134.                                 $settings_billingmail = $_POST["settings_billingmail"];
  2135.                                 $settings_supportmail = $_POST["settings_supportmail"];
  2136.                                 $settings_paypalmail = $_POST["settings_paypalmail"];
  2137.                                 $settings_adminmail = $_POST["settings_adminmail"];
  2138.                                 $settings_webmastermail = $_POST["settings_webmastermail"];
  2139.                                 $settings_websiteurl = $_POST["settings_websiteurl"];
  2140.                                 $settings_ns1 = $_POST["settings_ns1"];
  2141.                                 $settings_ns2 = $_POST["settings_ns2"];
  2142.                                 $settings_ns3 = $_POST["settings_ns3"];
  2143.                                 $settings_ns4 = $_POST["settings_ns4"];
  2144.                                 $settings_street = $_POST["settings_street"];
  2145.                                 $settings_city = $_POST["settings_city"];
  2146.                                 $settings_state = $_POST["settings_state"];
  2147.                                 $settings_zipcode = $_POST["settings_zipcode"];
  2148.                                 $settings_country = $_POST["settings_country"];
  2149.                                 $settings_checkname = $_POST["settings_checkname"];
  2150.                                 $settings_supportsiteurl = $_POST["settings_supportsiteurl"];
  2151.                                 $settings_compname = $_POST["settings_compname"];
  2152.                                
  2153.                                 $result = MYSQL_QUERY("UPDATE " . $db_prefix . "settings_settings SET custservicemail = '$settings_custservicemail', billingmail = '$settings_billingmail', supportmail = '$settings_supportmail', paypalmail = '$settings_paypalmail', adminmail = '$settings_adminmail', webmastermail = '$settings_webmastermail', websiteurl = '$settings_websiteurl', ns1 = '$settings_ns1', ns2 = '$settings_ns2', ns3 = '$settings_ns3', ns4 = '$settings_ns4', street = '$settings_street', city = '$settings_city', state = '$settings_state', zipcode = '$settings_zipcode', country = '$settings_country', checkname = '$settings_checkname', supportsiteurl = '$settings_supportsiteurl', compname = '$settings_compname' WHERE active = '1'");
  2154.                                
  2155.                                 $box_content = "<div style=\"text-align: center\">Control Panel Settings Updated Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  2156.  
  2157.                                 echo GetTemplate("admin_box_content");
  2158.                                 echo GetTemplate("admin_box_bottom");
  2159.                                 echo GetTemplate("admin_bottom");
  2160.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  2161.                                
  2162.                             };
  2163.                        
  2164.                         break; // End settings_update case
  2165.                        
  2166.                         case "newspost":
  2167.                        
  2168.                             if ($hm_usrlvl == 1) {
  2169.                        
  2170.                                 $newstype = $_GET['newstype'];
  2171.                                
  2172.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  2173.                                
  2174.                                 echo GetTemplate("admin_top");
  2175.                                 echo GetTemplate("admin_navigation");
  2176.                                 echo GetTemplate("admin_content");
  2177.                                
  2178.                                 if($newstype == "3") {
  2179.                                
  2180.                                     $box_title = "Client News Management";
  2181.                                     $newscontent = "client";
  2182.                                
  2183.                                 } elseif ($newstype == "4") {
  2184.                                
  2185.                                     $box_title = "Affiliate News Management";
  2186.                                     $newscontent = "affiliate";
  2187.                                
  2188.                                 } else {
  2189.                                
  2190.                                     $box_title = "Error: News Type Not Selected";
  2191.                                    
  2192.                                 };
  2193.                                
  2194.                                 echo GetTemplate("admin_box_top");
  2195.                                    
  2196.                                 $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND type = '1' AND name = 'admin_" . $newscontent . "newspost_content'");
  2197.                                 while($r=mysql_fetch_array($result))
  2198.                                 {
  2199.                                
  2200.                                     $content=$r["content"];
  2201.                                     include "../themes/$theme_url/modules/vars.php";
  2202.                                     $box_content = ThemeIt($content);
  2203.                                    
  2204.                                 }
  2205.                                
  2206.                                 echo GetTemplate("admin_box_content");
  2207.                                 echo GetTemplate("admin_box_bottom");
  2208.                                
  2209.                                 $result = MYSQL_QUERY("SELECT * FROM " . "$db_prefix" . "news_news WHERE type = '$newstype' ORDER BY newsID LIMIT 5");
  2210.                                 while($r=mysql_fetch_array($result))
  2211.                                 {
  2212.                                
  2213.                                     $news_newsID = $r["newsID"];
  2214.                                     $news_userID = $r["userID"];
  2215.                                     $news_title = $r["title"];
  2216.                                     $news_body = $r["body"];
  2217.                                     $news_date = $r["date"];
  2218.                                     $news_time = $r["time"];
  2219.                                     $news_type = $r["type"];
  2220.                                    
  2221.                                     $result2 = MYSQL_QUERY("SELECT username FROM " . "$db_prefix" . "users_accounts WHERE userID = '$news_userID'");
  2222.                                     while($r=mysql_fetch_array($result2))
  2223.                                     {
  2224.                                    
  2225.                                         $news_poster = $r["username"];
  2226.                                        
  2227.                                     }
  2228.                                    
  2229.                                     $box_title = $news_title;
  2230.                                     echo GetTemplate("admin_box_top");
  2231.                                     $box_content = $news_body;
  2232.                                     echo GetTemplate("admin_box_content");
  2233.                                     // echo GetTemplate("admin_affiliatenewspost");
  2234.                                    
  2235.                                     if($newstype == "3") {
  2236.                                    
  2237.                                         echo GetTemplate("admin_clientnewspost");
  2238.                                    
  2239.                                     } elseif ($newstype == "4") {
  2240.                                    
  2241.                                         echo GetTemplate("admin_affiliatenewspost");
  2242.                                    
  2243.                                     } else {
  2244.                                    
  2245.                                         //
  2246.                                        
  2247.                                     };
  2248.                                    
  2249.                                     echo GetTemplate("admin_box_bottom");
  2250.                                    
  2251.                                 }
  2252.                                
  2253.                                 echo GetTemplate("admin_bottom");
  2254.                                
  2255.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  2256.                                
  2257.                             };
  2258.                        
  2259.                         break; // End newspost case
  2260.                        
  2261.                         case "news_post":
  2262.                        
  2263.                             if ($hm_usrlvl == 1) {
  2264.                            
  2265.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  2266.                                
  2267.                                 $box_title = "News Post Successful";
  2268.                                
  2269.                                 echo GetTemplate("admin_top");
  2270.                                 echo GetTemplate("admin_navigation");
  2271.                                 echo GetTemplate("admin_content");
  2272.                                 echo GetTemplate("admin_box_top");
  2273.                                
  2274.                                 $news_title = $_POST["news_title"];
  2275.                                 $news_body = $_POST["news_body"];
  2276.                                
  2277.                                 $result = MYSQL_QUERY("INSERT INTO " . $db_prefix . "news_news (userID, title, body, type, date, time)".
  2278.                                 "VALUES ('$hm_usrID', '$news_title', '$news_body', '3', '$date', '$time')");
  2279.                                
  2280.                                 $box_content = "<div style=\"text-align: center\">News Posted Successfully!<br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  2281.                            
  2282.                                 echo GetTemplate("admin_box_content");
  2283.                                 echo GetTemplate("admin_box_bottom");
  2284.                                 echo GetTemplate("admin_bottom");
  2285.                                 require "../themes/$theme_url/modules/admin/admin_footer.php";
  2286.                            
  2287.                             }
  2288.                        
  2289.                         break; // End news_post case
  2290.                        
  2291.                         case "purchase":
  2292.                                
  2293.                             if ($hm_usrlvl == 1) {
  2294.                            
  2295.                                 //
  2296.                            
  2297.                             }else{
  2298.                            
  2299.                                 require "../themes/$theme_url/modules/client/client_header.php";
  2300.                                
  2301.                                 $box_title = "Funds Added Successfully";
  2302.                                
  2303.                                 echo GetTemplate("client_top");
  2304.                                 echo GetTemplate("client_navigation");
  2305.                                 echo GetTemplate("client_content");
  2306.                                 echo GetTemplate("client_box_top");
  2307.                                
  2308.                                 if ($hm_PayPal == 1) {
  2309.                                
  2310.                                     $_SESSION["hm_PayPal"] = "0";
  2311.                                
  2312.                                     $result = MYSQL_QUERY("SELECT funds FROM " . "$db_prefix" . "users_accounts WHERE userID = '$hm_usrID'");
  2313.                                     while($r=mysql_fetch_array($result))
  2314.                                     {
  2315.                                    
  2316.                                         $current_funds = $r["funds"];
  2317.                                        
  2318.                                     }
  2319.                                    
  2320.                                     $add_funds = $current_funds + $hm_amount;
  2321.                                    
  2322.                                     // update their funds right here
  2323.                                     $result = MYSQL_QUERY("UPDATE " . $db_prefix . "users_accounts SET funds = '$add_funds' WHERE userID = '$hm_usrID'");
  2324.                                        
  2325.                                     $box_content = "<div style=\"text-align: center\">The funds have been added to your account successfully. <br><a href=\"admin.php?nav=start\">Click here to return home</a>.</div>";
  2326.                                    
  2327.                                 }
  2328.                                
  2329.                                 echo GetTemplate("client_box_content");
  2330.                                 echo GetTemplate("client_box_bottom");
  2331.                                 echo GetTemplate("client_bottom");
  2332.                                 require "../themes/$theme_url/modules/client/client_footer.php";
  2333.                            
  2334.                             }
  2335.                        
  2336.                         break; // End purchase case
  2337.                        
  2338.                         case "quik":
  2339.                                
  2340.                             if ($hm_usrlvl == 1) {
  2341.                            
  2342.                                 $qa_uman = $_POST["qa_uman"];
  2343.                                
  2344.                                 require "../themes/$theme_url/modules/admin/admin_header.php";
  2345.                                
  2346.                                 echo GetTemplate("admin_top");
  2347.                                 echo GetTemplate("admin_navigation");
  2348.                                 echo GetTemplate("admin_content");
  2349.                                
  2350.                                 $filename[0] = "0";
  2351.                                 $boxtitle[0] = "0";
  2352.                                 $filenum = 0;
  2353.                                
  2354.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_quik' AND type = '1' ORDER BY position");
  2355.                                 while($r=mysql_fetch_array($result))
  2356.                                 {
  2357.                                
  2358.                                     $filenum++;
  2359.                                     $filename[] = $r["file"];
  2360.                                     $boxtitle[] = $r["boxtitle"];
  2361.                                    
  2362.                                 }
  2363.                                
  2364.                                 $filenum++;
  2365.                                
  2366.                                 for ($i = 1; $i < $filenum; $i++) {
  2367.                                
  2368.                                     $box_title = $boxtitle["$i"];
  2369.                                     echo GetTemplate("admin_box_top");
  2370.                                     require "../themes/$theme_url/modules/admin/". $filename["$i"] . ".php";
  2371.                                     echo GetTemplate("admin_box_content");
  2372.                                     echo GetTemplate("admin_box_bottom");
  2373.                                    
  2374.                                 }
  2375.                            
  2376.                             }else if ($hm_usrlvl == 2) {
  2377.                            
  2378.                                 $qa_uman = $_POST["qa_uman"];
  2379.                                
  2380.                                 require "../themes/$theme_url/modules/rep/rep_header.php";
  2381.                                
  2382.                                 echo GetTemplate("rep_top");
  2383.                                 echo GetTemplate("rep_navigation");
  2384.                                 echo GetTemplate("rep_content");
  2385.                                
  2386.                                 $filename[0] = "0";
  2387.                                 $boxtitle[0] = "0";
  2388.                                 $filenum = 0;
  2389.                                
  2390.                                 $result = MYSQL_QUERY("SELECT file, boxtitle FROM " . "$db_prefix" . "temps_priority WHERE active = '1' AND page = 'nav_quik' AND type = '2' ORDER BY position");
  2391.                                 while($r=mysql_fetch_array($result))
  2392.                                 {
  2393.                                
  2394.                                     $filenum++;
  2395.                                     $filename[] = $r["file"];
  2396.                                     $boxtitle[] = $r["boxtitle"];
  2397.                                    
  2398.                                 }
  2399.                                
  2400.                                 $filenum++;
  2401.                                
  2402.                                 for ($i = 1; $i < $filenum; $i++) {
  2403.                                
  2404.                                     $box_title = $boxtitle["$i"];
  2405.                                     echo GetTemplate("rep_box_top");
  2406.                                     require "../themes/$theme_url/modules/rep/". $filename["$i"] . ".php";
  2407.                                     echo GetTemplate("rep_box_content");
  2408.                                     echo GetTemplate("rep_box_bottom");
  2409.                                    
  2410.                                 }
  2411.                            
  2412.                             }
  2413.                        
  2414.                         break; // End purchase case
  2415.                    
  2416.                     } // End nav switch
  2417.                    
  2418.                 } // End nav check
  2419.                
  2420.             } // End session credentials verification
  2421.        
  2422.         } // End no password
  2423.        
  2424.     } // End no username
  2425.    
  2426. } // End login redirect
  2427.  
  2428. function GetTemplate ($which) {
  2429.    
  2430.     extract($GLOBALS);
  2431.    
  2432.     $result = MYSQL_QUERY("SELECT content FROM " . "$db_prefix" . "temps_temps WHERE themeID = '$hm_theme' AND name = '$which'");
  2433.     while($r=mysql_fetch_array($result))
  2434.     {
  2435.    
  2436.         $content=$r["content"];
  2437.         require "../themes/$theme_url/modules/vars.php";
  2438.         return ThemeIt($content);
  2439.        
  2440.     }
  2441.  
  2442. }
  2443.  
  2444. function ThemeIt ($what) {
  2445.  
  2446.     extract($GLOBALS);
  2447.    
  2448.     $what = str_replace("{", "$", $what);
  2449.     $what = str_replace("}", "", $what);
  2450.     $what = addslashes($what);
  2451.     eval ("\$what = \"$what\";");
  2452.     $what = stripslashes($what);
  2453.    
  2454.     return $what;
  2455.    
  2456. }
  2457.  
  2458. // echo $php_errormsg;
  2459. // if (!$result) { echo("ERROR: " . mysql_error() . "\n");  }
  2460. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement