Advertisement
Guest User

Untitled

a guest
Apr 5th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.47 KB | None | 0 0
  1. <?php
  2. require("config.php");
  3. $spojeni = mysql_connect("$m_server","$m_user","$m_password");
  4. mysql_select_db("$m_db", $spojeni);
  5.  
  6. $con_users = mysql_query("SELECT * FROM `cp_users` WHERE `username` = '".$_SESSION["nick"]."' LIMIT 1", $spojeni);
  7. $info_users = mysql_fetch_array($con_users);
  8.  
  9.  $user_ip_adressess = $_SERVER["REMOTE_ADDR"];
  10. date_default_timezone_set("Europe/Bratislava");
  11. $mytime     = date("d.m.Y H:i:s");
  12. $mytime_server     = date("H:i:s");
  13. $mytime_tickets     = date("H:i, d.m.Y");
  14. $commenttime     = date("d.m.Y, H:i");
  15.  $tticketday     = date("d.m.Y");
  16. $ttickethour     = date("H:i");
  17.  
  18.  
  19. // ----------------------- | Groups | ------------------------ //
  20.  
  21.         $user_group = $info_users["group"];
  22.     if($user_group == "0")    { $user_group_name = 'Zákazník'; $user_group_styles = ' '; }
  23.  
  24.     if($user_group == "1")    { $user_group_name = 'V.I.P. Zákazník'; $user_group_styles = ' '; }
  25.  
  26.     if($user_group == "2")    { $user_group_name = 'Sponzoring'; $user_group_styles = ' '; }
  27.  
  28.     if($user_group == "3")    { $user_group_name = 'Zákaznícka podpora'; $user_group_styles = 'color:#2f9a17;'; }
  29.  
  30.     if($user_group == "4")    { $user_group_name = 'Administrátor'; $user_group_styles = 'color:#dd9031;'; }
  31.  
  32.     if($user_group >= "5")    { $user_group_name = 'Majiteľ'; $user_group_styles = 'color:#df5f5f;';}
  33.  
  34. // -------------------- | Credits info | -------------------- //
  35.  
  36.         $cp_user_credits = $info_users["credits"];
  37.     if($cp_user_credits >= "0")    { $user_credits_name = 'danger'; }
  38.  
  39.     if($cp_user_credits >= "15")    { $user_credits_name = 'primary';  }
  40.  
  41.     if($cp_user_credits >= "50")    { $user_credits_name = 'default';  }
  42.  
  43.     $credits_show = "<h5 style='text-align:right;float:right;'>Stav konta: <strong><a href='/control_panel/credits/buy'><span class='h3 label label-$user_credits_name' style='font-size:13px;'>$info_users[credits] €</span></a></strong></h5>";
  44.    
  45. // ----------------------- | User status | ----------------------- //
  46.  
  47.         $active_status = $info_users["active"];
  48.     if($active_status == "0")    { $active_status_on = 'Neaktivovaný'; $active_status_color = "orange"; }
  49.  
  50.     if($active_status == "1")    { $active_status_on = 'Aktívny'; $active_status_color = "green"; }
  51.  
  52. // --- | Functions | --- //
  53. $client_ip = $_SERVER["REMOTE_ADDR"];
  54. function Nebezpeci($jaky) { if(!strstr($jaky, '<') && !strstr($jaky, '>') && !strstr($jaky, '$') && !strstr($jaky, '"') && !strstr($jaky, "'") && !strstr($jaky, "`") && !strstr($jaky, ";") && !strstr($jaky, "+") && !strstr($jaky, "ě") && !strstr($jaky, "š") && !strstr($jaky, "č") && !strstr($jaky, "ř") && !strstr($jaky, "ž") && !strstr($jaky, "ý") && !strstr($jaky, "á") && !strstr($jaky, "í") && !strstr($jaky, "é") && !strstr($jaky, "=") && !strstr($jaky, "¨") && !strstr($jaky, "ú") && !strstr($jaky, "§") && !strstr($jaky, "@") && !strstr($jaky, "©") && !strstr($jaky, "™") && !strstr($jaky, ";") && !strstr($jaky, "›") && !strstr($jaky, "+") && !strstr($jaky, "*") && !strstr($jaky, "Ă") & !strstr($jaky, "%") && !strstr($jaky, ".") && !strstr($jaky, "/") && !strstr($jaky, "\\")) {  } else { Chyba('Nemozete zadavat znaky s diagritikou ( Bez uvozoviek, lomitok, ciariek  ).'); exit(); }}
  55. function AddLogAcc($title,$event,$icon,$type) { $vysledek = mysql_query("INSERT INTO `cp_userlog` (`ID` , `title`,`username` ,`message` , `site`, `time`, `ip`, `icon` ,`type`)VALUES ('', '".mysql_real_escape_string($title)."','".$_SESSION["userid"]."', '".mysql_real_escape_string($event)."', '".$page_uri."', 'xxxx', '".$_SERVER["REMOTE_ADDR"]."', '".mysql_real_escape_string($icon)."', '".mysql_real_escape_string($type)."')"); }
  56. function AddLog($title,$event,$site,$icon,$type) { $vysledek = mysql_query("INSERT INTO `cp_userlog` (`ID` , `title`,`username` ,`message` , `site`,`time`,`ip`,`icon` ,`type`)VALUES ('', '".mysql_real_escape_string($title)."','".$_SESSION["nick"]."', '".mysql_real_escape_string($event)."', '$actual_address', NOW(), '".$_SERVER["REMOTE_ADDR"]."', '".mysql_real_escape_string($icon)."', '".mysql_real_escape_string($type)."')"); }
  57. function AddAdminLog($action) { $vysledek = mysql_query("INSERT INTO `ap_logs` (`id` , `user`,`ip` ,`time` , `action`)VALUES ('', '".$_SESSION["nick"]."','".$_SERVER["REMOTE_ADDR"]."', NOW(), '".mysql_real_escape_string($action)."')"); }
  58. function ref_page($kam,$kedy) { echo '<meta http-equiv="refresh" content="'.$kedy.';url='.$kam.'">'; }
  59. function CheckLine($path, $variable) { if(file_exists($path)) { $lines = file($path); $result = "";foreach($lines as $line){$contents = explode(' ', $line, 2);if($contents[0] == $variable){$result = $contents[1];$order = array("\r\n", "\n", "\r"); $result = str_replace($order, "", $result);break;}}return $result;}}
  60. function Secure($code) { return mysql_real_escape_string(HTMLSpecialChars($code)); }
  61.  
  62.  
  63.  
  64. function generate_password( $length = 8 ) {
  65. $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?";
  66. $password = substr( str_shuffle( $chars ), 0, $length );
  67. return $password;
  68. }
  69.  
  70.  
  71. function Warning($text) {
  72. echo "<div class='alert alert-warning alert-warning-rw' role='alert'><i class='fa fa-exclamation'></i>&nbsp;&nbsp; $text</div>";
  73. }
  74.  
  75. function Info($text) {
  76. echo "<div class='alert alert-primary alert-styled-left'>
  77.        <span class='text-semibold'>$text</div>";
  78. }
  79. function Chyba($text)
  80. {
  81. echo "<div class='alert alert-danger alert-styled-left alert-bordered'>
  82.       <span class='text-semibold'>$text</div>";
  83.  }
  84. function Ok($text)
  85. {
  86. echo "<div class='alert alert-success alert-styled-left alert-arrow-left alert-bordered'>
  87. <span class='text-semibold'>$text</div>"; }
  88.  
  89. $previous = "javascript:history.go(-3)";
  90. if(isset($_SERVER['HTTP_REFERER'])) {
  91.     $previous = $_SERVER['HTTP_REFERER'];
  92. }
  93. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  94.  
  95.  
  96. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'smtp_email' LIMIT 1", $spojeni);
  97. $nastavenia = mysql_fetch_array($zistinastavenia);
  98. $hodnota = $nastavenia["value"];
  99. $publicemail = $hodnota;
  100.  
  101. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  102.  
  103. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'smtp_password' LIMIT 1", $spojeni);
  104. $nastavenia = mysql_fetch_array($zistinastavenia);
  105. $hodnota = $nastavenia["value"];
  106. $publicemailpassword = $hodnota;
  107.  
  108. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  109.  
  110.  
  111. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'title' LIMIT 1", $spojeni);
  112. $nastavenia = mysql_fetch_array($zistinastavenia);
  113. $hodnota = $nastavenia["value"];
  114. $web_title = $hodnota;
  115.  
  116. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  117.  
  118.  
  119. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'name' LIMIT 1", $spojeni);
  120. $nastavenia = mysql_fetch_array($zistinastavenia);
  121. $hodnota = $nastavenia["value"];
  122. $web_name = $hodnota;
  123.  
  124. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  125.  
  126. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'description' LIMIT 1", $spojeni);
  127. $nastavenia = mysql_fetch_array($zistinastavenia);
  128. $hodnota = $nastavenia["value"];
  129. $web_description = $hodnota;
  130.  
  131.  
  132. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  133.  
  134. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'keywords' LIMIT 1", $spojeni);
  135. $nastavenia = mysql_fetch_array($zistinastavenia);
  136. $hodnota = $nastavenia["value"];
  137. $web_keywords = $hodnota;
  138.  
  139. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  140.  
  141. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'text_logo' LIMIT 1", $spojeni);
  142. $nastavenia = mysql_fetch_array($zistinastavenia);
  143. $hodnota = $nastavenia["value"];
  144. $web_logo = $hodnota;
  145.  
  146. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  147.  
  148. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'footer' LIMIT 1", $spojeni);
  149. $nastavenia = mysql_fetch_array($zistinastavenia);
  150. $hodnota = $nastavenia["value"];
  151. $web_footer = $hodnota;
  152.  
  153. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  154.  
  155. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'url_link' LIMIT 1", $spojeni);
  156. $nastavenia = mysql_fetch_array($zistinastavenia);
  157. $hodnota = $nastavenia["value"];
  158. $web_ulink = $hodnota;
  159.  
  160.  
  161. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  162.  
  163. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'vip_link' LIMIT 1", $spojeni);
  164. $nastavenia = mysql_fetch_array($zistinastavenia);
  165. $hodnota = $nastavenia["value"];
  166. $web_viplink = $hodnota;
  167.  
  168.  
  169. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  170.  
  171. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'query_link' LIMIT 1", $spojeni);
  172. $nastavenia = mysql_fetch_array($zistinastavenia);
  173. $hodnota = $nastavenia["value"];
  174. $web_querylink = $hodnota;
  175.  
  176. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  177.  
  178. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'mail_user' LIMIT 1", $spojeni);
  179. $nastavenia = mysql_fetch_array($zistinastavenia);
  180. $hodnota = $nastavenia["value"];
  181. $MainMail_user = $hodnota;
  182.  
  183.  
  184. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  185.  
  186. $zistinastavenia = mysql_query("SELECT * FROM `cp_config` WHERE `name` = 'mail_password' LIMIT 1", $spojeni);
  187. $nastavenia = mysql_fetch_array($zistinastavenia);
  188. $hodnota = $nastavenia["value"];
  189. $MainMail_password = $hodnota;
  190.  
  191. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement