Wyciokazz

Awards PM

Jul 10th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.96 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.         $result = dbquery("INSERT INTO ".DB_AWARD." VALUES('', '".(isnum($_POST['award_user']) ? $_POST['award_user'] : 0)."', '".stripinput($_POST['award_img'])."', '".stripinput($_POST['award_info'])."')");
  36.   $nuot = "Administracija";
  37.      $nuo = "1";
  38.      $kam = isnum($_POST['award_user']);
  39.      $tema = "Sėkmingas pinigų pervėdimas ";
  40.      $zinute = "Gavote apdovanojimą už ".stripinput($_POST['award_info']);
  41.      $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')");
  42.         redirect(FUSION_SELF.$aidlink);
  43. } else {
  44.         opentable($locale['aw101']);
  45.         echo "<form action='".FUSION_SELF.$aidlink."' method='post'>";
  46.         $_GET['msg_send'] = $data['user_id'];  
  47.         echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl2-border'>\n<tr>\n";
  48.         echo "<td width='40%' class='tbl' style='text-align:center;'>".$locale['aw104']." <select name='award_user' class='textbox'>";
  49.         $user_list = ""; $user_types = ""; $sel = "";
  50.         $result = dbquery("SELECT u.user_id, u.user_name, u.user_avatar FROM ".DB_USERS." u ORDER BY user_level DESC, user_name ASC");
  51.         while ($data = dbarray($result)) {
  52.         $sel = ($_GET['msg_send'] == $data['user_id'] ? " selected='selected'" : "");
  53.                 $user_list .= "<option value='".$data['user_id']."'".$sel.">".$data['user_name']."</option>\n";
  54.         }
  55.         echo $user_list;
  56.         echo "</select></td></tr><tr>";
  57.         echo "<td width='40%' class='tbl' style='text-align:center;'>".$locale['aw105']." <select name='award_img' class='textbox'>";
  58.         $awardImages = makefileopts(makefilelist(INFUSIONS."awards/images/awards/", ".|..|index.php"));
  59.         $image_files = makefilelist(INFUSIONS."awards/images/awards/", ".|..|index.php", true);
  60.         $image_list = makefileopts($image_files);
  61.         echo $image_list;
  62.         echo "</select></td></tr>";
  63.         echo "<td width='50%' class='tbl' style='text-align:center;'>".$locale['aw106']."<input type='text' name='award_info' class='textbox'> </td></tr>";
  64.         echo "<tr><td width='20%' class='tbl' style='text-align:center;'><input type='submit' name='add' value='Suteikti' class='button'></td></tr></table></form>";
  65. }
  66. echo "<br /><br />\n";
  67. add_to_head("<script type='text/javascript' src='".INFUSIONS."awards/eap.js'></script>");
  68. 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'>
  69. <a href='#' onclick='return false;' style='outline:none; text-decoration:none; font-weight: none;'><b>".$locale['aw114']."</b></a>".$locale['aw115']."</span></div>\n";
  70. echo "<div class='eui_master_body' style='margin: 0em 0.2em 0em 0.2em;'>\n";
  71. //$result_award  = dbquery("SELECT * FROM ".DB_AWARD." desc limit 0,1");
  72. $limit = "5";
  73. echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
  74.                 echo "<td width='1%' class='tbl2'>&nbsp;</td>\n";
  75.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw116']."</strong></td>\n";
  76.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw108']."</strong></td>\n";
  77.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw109']."</strong></td>\n";
  78.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw110']."</strong></td>\n";
  79.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw111']."</strong></td>\n";
  80.                 echo "</tr>\n";
  81.  
  82. $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");
  83. if (dbrows($result)) {
  84. while($data = dbarray($result)){
  85. $row_color = ($i % 2 == 2 ? "tbl1" : "tbl2");
  86. echo "<tr>\n<td class='".$row_color."'>";      
  87. 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";
  88. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['award_user']."</td>\n";
  89. 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";
  90. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['award_info']."</td>\n";                
  91. 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>";
  92. echo "</tr>\n";
  93.    }
  94. }
  95. echo "</td></table>";
  96. echo "</div>";
  97. add_to_head("<script type='text/javascript' src='".INFUSIONS."awards/eap.js'></script>");
  98. 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'>
  99. <a href='#' onclick='return false;' style='outline:none; text-decoration:none; font-weight: none;'><b>".$locale['aw113']."</b></a>".$locale['aw117']."</span></div>\n";
  100. echo "<div class='eui_body' style='margin: 0em 0.2em 0em 0.2em;'>\n";
  101. $result = dbquery("SELECT * FROM ".DB_AWARD."");
  102. echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
  103.                 echo "<td width='1%' class='tbl2'>&nbsp;</td>\n";
  104.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw108']."</strong></td>\n";
  105.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw109']."</strong></td>\n";
  106.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw110']."</strong></td>\n";
  107.                 echo "<td width='10%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>".$locale['aw111']."</strong></td>\n";
  108.                 echo "</tr>\n";
  109.                 while($data = dbarray($result)){
  110.                 $row_color = ($i % 2 == 2 ? "tbl1" : "tbl2");
  111.                 echo "<tr>\n<td class='".$row_color."'>";      
  112.                 if($data['award_user']){
  113. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'> ".$data['award_user']."</td>\n";
  114. 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";
  115. echo "<td width='10%' class='".$row_color."' style='text-align:center;white-space:nowrap'>".$data['award_info']."</td>\n";                
  116. 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>";
  117. echo "</tr>\n";
  118.    }
  119. }
  120. echo "</td></table>";
  121. echo "</div>";
  122. closetable();
  123. require_once THEMES."templates/footer.php";
  124. ?>
Advertisement
Add Comment
Please, Sign In to add comment