Wyciokazz

Awards3

Jul 10th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.98 KB | None | 0 0
  1. <?php
  2. /*-------------------------------------------------------+
  3. | PHP-Fusion Content Management System
  4. | Copyright © 2002 - 2008 Nick Jones
  5. | http://www.php-fusion.co.uk/
  6. | Name: Awards
  7. | Author: Flyingduck / http://flyingduck.dk/
  8. | Angepasst an v7: ObiWan / http:/www.futigo.de
  9. +--------------------------------------------------------+
  10. | Adapted to v7.02.03: Maksas / http:ltfusions.lt
  11. +--------------------------------------------------------+
  12. | This program is released as free software under the
  13. | Affero GPL license. You can redistribute it and/or
  14. | modify it under the terms of this license which you
  15. | can read by viewing the included agpl.txt or online
  16. | at www.gnu.org/licenses/agpl.html. Removal of this
  17. | copyright header is strictly prohibited without
  18. | written permission from the original author(s).
  19. +--------------------------------------------------------*/
  20. require_once "../../maincore.php";
  21. //require_once THEMES."templates/admin_header.php";
  22. require_once THEMES."templates/header.php";
  23. if (!checkrights("AW") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }
  24.  
  25. include INFUSIONS."awards/infusion_db.php";
  26. if (file_exists(INFUSIONS."awards/locale/".$settings['locale'].".php")) {
  27.         include INFUSIONS."awards/locale/".$settings['locale'].".php";
  28. } else {
  29.         include INFUSIONS."awards/locale/German.php";
  30. }
  31. if (isset($_GET['delete']) && isnum($_GET['delete'])) {
  32.         $result = dbquery("DELETE FROM ".DB_AWARD." WHERE award_id='".$_GET['delete']."'");
  33.         redirect(FUSION_SELF.$aidlink);
  34. } elseif (isset($_POST['add'])){
  35. if(isnum($_POST['award_user'])) {
  36.         $result = dbquery("INSERT INTO ".DB_AWARD." VALUES('', '".$_POST['award_user']."', '".stripinput($_POST['award_img'])."', '".stripinput($_POST['award_info'])."')");
  37.   $nuot = "Administracija";
  38.      $nuo = "1";
  39.      $kam = $_POST['award_user'];
  40.      $tema = "Sėkmingas pinigų pervėdimas ";
  41.      $zinute = "Gavote apdovanojimą už ".stripinput($_POST['award_info']);
  42.      $result2 = dbquery("INSERT INTO ".DB_MESSAGES." (message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES('".$kam."','".$nuo."','".$tema."','".$zinute."','y','0','".time()."','0')");
  43.  redirect(FUSION_SELF.$aidlink);
  44. } else {
  45. die("HAAAAAAACK!!!!!!!!!!");
  46. }
  47. } else {
  48.         opentable($locale['aw101']);
  49.         echo "<form action='".FUSION_SELF.$aidlink."' method='post'>";
  50.         $_GET['msg_send'] = $data['user_id'];  
  51.         echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl2-border'>\n<tr>\n";
  52.         echo "<td width='40%' class='tbl' style='text-align:center;'>".$locale['aw104']." <select name='award_user' class='textbox'>";
  53.         $user_list = ""; $user_types = ""; $sel = "";
  54.         $result = dbquery("SELECT u.user_id, u.user_name, u.user_avatar FROM ".DB_USERS." u ORDER BY user_level DESC, user_name ASC");
  55.         while ($data = dbarray($result)) {
  56.         $sel = ($_GET['msg_send'] == $data['user_id'] ? " selected='selected'" : "");
  57.                 $user_list .= "<option value='".$data['user_id']."'".$sel.">".$data['user_name']."</option>\n";
  58.         }
  59.         echo $user_list;
  60.         echo "</select></td></tr><tr>";
  61.         echo "<td width='40%' class='tbl' style='text-align:center;'>".$locale['aw105']." <select name='award_img' class='textbox'>";
  62.         $awardImages = makefileopts(makefilelist(INFUSIONS."awards/images/awards/", ".|..|index.php"));
  63.         $image_files = makefilelist(INFUSIONS."awards/images/awards/", ".|..|index.php", true);
  64.         $image_list = makefileopts($image_files);
  65.         echo $image_list;
  66.         echo "</select></td></tr>";
  67.         echo "<td width='50%' class='tbl' style='text-align:center;'>".$locale['aw106']."<input type='text' name='award_info' class='textbox'> </td></tr>";
  68.         echo "<tr><td width='20%' class='tbl' style='text-align:center;'><input type='submit' name='add' value='Suteikti' class='button'></td></tr></table></form>";
  69. }
  70. echo "<br /><br />\n";
  71. add_to_head("<script type='text/javascript' src='".INFUSIONS."awards/eap.js'></script>");
  72. echo "<div class='side-label eui_master_head' style='margin-bottom:1px' title='".$locale['aw113']."'><img width='22' src='".INFUSIONS."awards/images/plus.png' style='border: 0px none; vertical-align: middle;'><span class='small'>
  73. <a href='#' onclick='return false;' style='outline:none; text-decoration:none; font-weight: none;'><b>".$locale['aw114']."</b></a>".$locale['aw115']."</span></div>\n";
  74. echo "<div class='eui_master_body' style='margin: 0em 0.2em 0em 0.2em;'>\n";
  75. //$result_award  = dbquery("SELECT * FROM ".DB_AWARD." desc limit 0,1");
  76. $limit = "5";
  77. echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
  78.                 echo "<td width='1%' class='tbl2'>&nbsp;</td>\n";
  79.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw116']."</strong></td>\n";
  80.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw108']."</strong></td>\n";
  81.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw109']."</strong></td>\n";
  82.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw110']."</strong></td>\n";
  83.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw111']."</strong></td>\n";
  84.                 echo "</tr>\n";
  85.  
  86. $result = dbquery(" SELECT award_user, award_id, award_img, award_info FROM ".DB_AWARD." WHERE award_user  ORDER BY award_id DESC LIMIT 0,$limit");
  87. if (dbrows($result)) {
  88. while($data = dbarray($result)){
  89. $row_color = ($i % 2 == 2 ? "tbl1" : "tbl2");
  90. echo "<tr>\n<td class='".$row_color."'>";      
  91. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".number_format(dbcount("(award_id)", DB_AWARD, "award_user='".$data['award_user']."'"))." </td>\n";
  92. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['award_user']."</td>\n";
  93. echo "<td width='10%' class='".$row_color."'style='text-align:center;white-space:nowrap' ><img src='".INFUSIONS."awards/images/awards/".$data['award_img']."'></td>\n";
  94. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['award_info']."</td>\n";                
  95. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&amp;delete=".$data['award_id']."'>".$locale['aw112']."</a></td>";
  96. echo "</tr>\n";
  97.    }
  98. }
  99. echo "</td></table>";
  100. echo "</div>";
  101. add_to_head("<script type='text/javascript' src='".INFUSIONS."awards/eap.js'></script>");
  102. echo "<div class='side-label eui_head' style='margin-bottom:1px' title='".$locale['aw113']."'><img width='22' src='".INFUSIONS."awards/images/plus.png' style='border: 0px none; vertical-align: middle;'><span class='small'>
  103. <a href='#' onclick='return false;' style='outline:none; text-decoration:none; font-weight: none;'><b>".$locale['aw113']."</b></a>".$locale['aw117']."</span></div>\n";
  104. echo "<div class='eui_body' style='margin: 0em 0.2em 0em 0.2em;'>\n";
  105. $result = dbquery("SELECT * FROM ".DB_AWARD."");
  106. echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
  107.                 echo "<td width='1%' class='tbl2'>&nbsp;</td>\n";
  108.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw108']."</strong></td>\n";
  109.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw109']."</strong></td>\n";
  110.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw110']."</strong></td>\n";
  111.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw111']."</strong></td>\n";
  112.                 echo "</tr>\n";
  113.                 while($data = dbarray($result)){
  114.                 $row_color = ($i % 2 == 2 ? "tbl1" : "tbl2");
  115.                 echo "<tr>\n<td class='".$row_color."'>";      
  116.                 if($data['award_user']){
  117. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'> ".$data['award_user']."</td>\n";
  118. echo "<td width='10%' class='".$row_color."'style='text-align:center;white-space:nowrap' ><img src='".INFUSIONS."awards/images/awards/".$data['award_img']."'></td>\n";
  119. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['award_info']."</td>\n";                
  120. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'><a href='".FUSION_SELF.$aidlink."&amp;delete=".$data['award_id']."'>".$locale['aw112']."</a></td>";
  121. echo "</tr>\n";
  122.    }
  123. }
  124. echo "</td></table>";
  125. echo "</div>";
  126. closetable();
  127. require_once THEMES."templates/footer.php";
  128. ?>
Advertisement
Add Comment
Please, Sign In to add comment