Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.77 KB | None | 0 0
  1. <?php
  2.   if($_SESSION['user_admin']>=$adminRights['whisper_log']) {
  3.   }
  4. ?>
  5. <style type="text/css">
  6.   .aviso{
  7.     background-color: #008000;
  8.     padding: 10px;
  9.     text-align: center;
  10.     opacity: 0.85;
  11.     color: white;
  12.     border-radius: 4px;
  13.     border: 1px solid #005B00;
  14.   }
  15.  
  16.   .aviso_erro{
  17.     background-color: #FF6600;
  18.     padding: 10px;
  19.     text-align: center;
  20.     opacity: 0.85;
  21.     color: white;
  22.     border-radius: 4px;
  23.     border: 1px solid #005B00;
  24.   }
  25.  
  26.  
  27.   .itemlist{
  28.     background-color: #333333;
  29.     border: 1px solid black;
  30.     border-radius: 6px;
  31.     color: white;
  32.     text-align: center;
  33.   }
  34.  
  35.   .topLine{
  36.     background-color: #1E1810;
  37.     border: 1px solid black;
  38.     border-radius: 6px;
  39.     color: white;
  40.     text-align: center;
  41.   }
  42.  
  43.   #reborndes{
  44.     background-color: #333;
  45.     padding:3px;
  46.     text-align: center;
  47.     border-radius: 5px;
  48.       border: 1px solid #202020;
  49.       color: white;
  50.   }
  51.  
  52.   #reborndes a{
  53.     color: #C0C0C0;
  54.   }
  55.  
  56.   input[type="submit"]{
  57.     color: white;
  58.   }
  59.  
  60.   #aligenter{}
  61. </style>
  62. <h2>Logs PMS</h2>
  63.   <form action="index.php?s=admin&a=whisper_log" method="GET">
  64.   <table>
  65.       <input type="hidden" name="s" value="admin"/>
  66.   <input type="hidden" name="a" value="whisper_log"/>
  67.     <tr>
  68.       <td class="topLine">
  69.         <input type="text" name="id" size="11" maxlength="11" placeholder="ID do char"/>
  70.       </td>
  71.       <td class="topLine">
  72.         OU
  73.       </td>
  74.  
  75.       <td class="topLine">
  76.         <input type="text" name="nick" size="11" maxlength="11" placeholder="Nick do char"/>
  77.       </td>
  78.  
  79.       <td class="topLine" rowspan="4"><input type="submit" name="submit" value="Procurar"/></td>
  80.     </tr>
  81.   </table>
  82.   </form>
  83. <?php
  84.   if(isset($_GET['submit']) && $_GET['submit']="suchen" && empty($_GET['who_name'] || $_GET['nick'])){
  85.       $msgtxt = "Porfavor digite algum valor... nenhum resultado encontrado.";
  86.   }
  87.  
  88.  
  89.    if(isset($_GET['submit']) && $_GET['submit']="suchen" && !empty($_GET['who_name'] || $_GET['nick']) ){
  90.       if(isset($_GET['who_name']) && empty($_GET['nick'])){
  91.   // PRIMEIRA AÇÃO
  92.         echo"<div class=\"aviso\">Você filtrou as mensagens desejadas pelo ID: <b>".$_GET['who_name']."</b>.</div>";
  93.         $CPSeite = 50;
  94.         if(isset($_GET['pageid'])) {
  95.           if(!checkInt($_GET['pageid']) || !($_GET['pageid']>0)) $aSeite = 1;
  96.           else $aSeite = $_GET['pageid'];
  97.         } else {
  98.           $aSeite = 1;
  99.         }
  100.         $sqlCmd = "SELECT COUNT(*) as logs FROM log.chat_log WHERE who_name='".$_GET['who_name']."'";
  101.         $sqlQry = mysql_query($sqlCmd,$sqlServ);
  102.         $getSum = mysql_fetch_object($sqlQry);
  103.         $cSeite = calcPages($getSum->logs,$aSeite,$CPSeite);
  104.         $maxRange = 5;
  105.         $maxStep = 15;
  106.         if(($aSeite-$maxRange)>0) $sStart = $aSeite-$maxRange;
  107.         else $sStart = 1;
  108.         if(($aSeite+$maxRange)<=$cSeite[0]) $sEnde = $aSeite+$maxRange;
  109.         else $sEnde = $cSeite[0];
  110.         echo "<table>
  111.          <tr>
  112.            <th class='topLine'>Id&nbsp;&nbsp;&nbsp;</th>
  113.            <th class='topLine'>Horário</th>
  114.            <th class='topLine'>Nick</th>
  115.            <th class='topLine'>Destinatário</th>
  116.            <th class='topLine'>Mensagem</th>
  117.          </tr>";
  118.         $selectplayer0 = "SELECT id, name FROM player.player WHERE id='".$_GET['id']."'";
  119.         $selectplayer1 = mysql_query($selectplayer0,$sqlServ);
  120.         $linha = mysql_fetch_assoc($selectplayer1);
  121.         $abfragen1 = "SELECT * FROM log.whisper_log WHERE whom_name='".$linha['name']."' LIMIT ".$cSeite[1].",".$CPSeite;
  122.         $abfragen2 = mysql_query($abfragen1,$sqlServ);
  123.         $totalstatic = mysql_num_rows($abfragen2);
  124.         $abfragen3333 = mysql_fetch_object($selectplayer1);
  125.         if($totalstatic > 0){
  126.         }else{
  127.           $msgtxt = "<a style=\"color:#fff;\">Nenhum resultado foi encontrado.</a>";
  128.           echo"<div class=\"aviso_erro\">".$msgtxt."</div>";
  129.         }
  130.         $i1 = 0;
  131.         $i2 = 1;
  132.         while($abfragen3 = mysql_fetch_object($abfragen2)) {
  133.           $i1++;
  134.           if ($i1 == $i2) {
  135.             $i2 = $i2 + 2;
  136.             $class = "tdunkel";
  137.           } else {
  138.             $class = "thell";
  139.           }
  140.  
  141.           echo "  <tr>
  142.            <td class='".$class."' id=\"reborndes\">".$abfragen3->id."</td>
  143.            <td class='".$class."' id=\"reborndes\">".$abfragen3->time."</td>
  144.            <td class='".$class."' id=\"reborndes\">".$abfragen3->from_msg."</td>
  145.            <td class='".$class."' id=\"reborndes\">".$abfragen3->to_msg."</td>
  146.            <td class='".$class."' id=\"reborndes\">".$abfragen3->msg_text."</td>
  147.          </tr>";
  148.         }
  149.         echo "</table>";
  150.  
  151.  
  152.  
  153.         $ACPSeite = 50;
  154.         if(isset($_GET['pageid'])) {
  155.           if(!checkInt($_GET['pageid']) || !($_GET['pageid']>0)) $AaSeite = 1;
  156.           else $AaSeite = $_GET['pageid'];
  157.         } else {
  158.           $AaSeite = 1;
  159.         }
  160.         $sqlCmdRRR = "SELECT COUNT(*) as logs FROM log.whisper_log WHERE from_msg='".$linha['name']."'";
  161.         $sqlQryRRR = mysql_query($sqlCmdRRR,$sqlServ);
  162.         $getSumRRR = mysql_fetch_object($sqlQryRRR);
  163.         $cSeiteRRR = calcPages($getSumRRR->logs,$AaSeite,$ACPSeite);
  164.         $maxRange = 5;
  165.         $maxStep = 15;
  166.         if(($AaSeite-$maxRange)>0) $sStart = $AaSeite-$maxRange;
  167.         else $sStart = 1;
  168.         if(($AaSeite+$maxRange)<=$cSeiteRRR[0]) $sEnde = $AaSeite+$maxRange;
  169.         else $sEnde = $cSeiteRRR[0];
  170.  
  171.  
  172.     echo "<a id=\"aligenter\" href=\"index.php?s=admin&a=whisper_log\"><input type=\"submit\" name=\"submit\" value=\"Retornar\"/></a>";
  173.     echo '<table><tr><td class="tdunkel">';
  174.     if(($AaSeite-$maxStep)>0)
  175.       echo '     <a href="index.php?s=admin&a=whisper_log&id='.$linha['id'].'&nick=&submit=Procurar&pageid='.($AaSeite-$maxStep).'">'.($AaSeite-$maxStep).'</a> &laquo;';
  176.     else echo '     <a href="index.php?s=admin&a=whisper_log&id='.$linha['id'].'&nick=&submit=Procurar&pageid=1">1</a> &laquo;';
  177.       echo'   </td>';
  178.     for($i=$sStart;$i<=$sEnde;$i++) {
  179.       $sKlasse = ($i==$AaSeite) ? "topLine" : "thell";
  180.       echo'   <td class="'.$sKlasse.'" style="text-align:center;">';
  181.       echo'     <a href="index.php?s=admin&a=whisper_log&id='.$linha['id'].'&nick=&submit=Procurar&pageid='.$i.'">'.$i.'</a>';
  182.       echo'   </td>';
  183.     }
  184.     echo'   <td class="tdunkel" style="text-align:right;">';
  185.     if(($AaSeite+$maxStep)<=$cSeiteRRR[0]) echo '     &raquo; <a href="index.php?s=admin&a=whisper_log&id='.$linha['id'].'&nick=&submit=Procurar&pageid='.($AaSeite+$maxStep).'">'.($AaSeite+$maxStep).'</a>';
  186.     else echo '     &raquo; <a href="index.php?s=admin&a=whisper_log&id='.$linha['id'].'&nick=&submit=Procurar&pageid='.$cSeiteRRR[0].'">'.$cSeiteRRR[0].'</a>';
  187.     echo'   </td>';
  188.     echo' </tr>';
  189.     echo'</table>';
  190.       }
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.   if(isset($_GET['nick']) && empty($_GET['id'])){
  202.   // SEGUNDA AÇÃO
  203.         echo"<div class=\"aviso\">Você filtrou as mensagens desejadas pelo NICK: <b>".$_GET['nick']."</b>.</div>";
  204.         $CPSeite = 50;
  205.         if(isset($_GET['page'])) {
  206.           if(!checkInt($_GET['page']) || !($_GET['page']>0)) $aSeite = 1;
  207.           else $aSeite = $_GET['page'];
  208.         } else {
  209.           $aSeite = 1;
  210.         }
  211.         $sqlCmd = "SELECT COUNT(*) as logs FROM log.whisper_log WHERE from_msg ='".$_GET['nick']."'";
  212.         $sqlQry = mysql_query($sqlCmd,$sqlServ);
  213.         $getSum = mysql_fetch_object($sqlQry);
  214.         $cSeite = calcPages($getSum->logs,$aSeite,$CPSeite);
  215.         $maxRange = 5;
  216.         $maxStep = 15;
  217.         if(($aSeite-$maxRange)>0) $sStart = $aSeite-$maxRange;
  218.         else $sStart = 1;
  219.         if(($aSeite+$maxRange)<=$cSeite[0]) $sEnde = $aSeite+$maxRange;
  220.         else $sEnde = $cSeite[0];
  221.         echo "<table>
  222.          <tr>
  223.            <th class='topLine'>Id&nbsp;&nbsp;&nbsp;</th>
  224.            <th class='topLine'>Horário</th>
  225.            <th class='topLine'>Nick</th>
  226.            <th class='topLine'>Destinatário</th>
  227.            <th class='topLine'>Mensagem</th>
  228.          </tr>";
  229.         $abfragen1 = "SELECT * FROM log.whisper_log WHERE from_msg ='".$_GET['nick']."' LIMIT ".$cSeite[1].",".$CPSeite;
  230.         $abfragen2 = mysql_query($abfragen1,$sqlServ);
  231.         $i1 = 0;
  232.         $i2 = 1;
  233.         $totalstaticm = mysql_num_rows($abfragen2);
  234.         $abfragen3333 = mysql_fetch_object($abfragen2);
  235.         if($totalstaticm > 0){  }else{
  236.           $msgtxt = "<a style=\"color:#fff;\">Nenhum resultado foi encontrado.</a>";
  237.           echo"<div class=\"aviso_erro\">".$msgtxt."</div>";
  238.         }
  239.         while($abfragen3 = mysql_fetch_object($abfragen2)) {
  240.           $i1++;
  241.           if ($i1 == $i2) {
  242.             $i2 = $i2 + 2;
  243.             $class = "tdunkel";
  244.           } else {
  245.             $class = "thell";
  246.           }
  247.           echo "  <tr>
  248.            <td class='".$class."' id=\"reborndes\">".$abfragen3->id."</td>
  249.            <td class='".$class."' id=\"reborndes\">".$abfragen3->time."</td>
  250.            <td class='".$class."' id=\"reborndes\">".$abfragen3->from_msg."</td>
  251.            <td class='".$class."' id=\"reborndes\">".$abfragen3->to_msg."</td>
  252.            <td class='".$class."' id=\"reborndes\">".$abfragen3->msg_text."</td>
  253.          </tr>";
  254.       }
  255.         echo "</table><br />";
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.         $ACPSeite = 50;
  265.         if(isset($_GET['pagefrom'])) {
  266.           if(!checkInt($_GET['pagefrom']) || !($_GET['pagefrom']>0)) $AaSeite = 1;
  267.           else $AaSeite = $_GET['pagefrom'];
  268.         } else {
  269.           $AaSeite = 1;
  270.         }
  271.         $sqlCmdRRR = "SELECT COUNT(*) as logs FROM log.whisper_log WHERE from_msg='".$_GET['nick']."'";
  272.         $sqlQryRRR = mysql_query($sqlCmdRRR,$sqlServ);
  273.         $getSumRRR = mysql_fetch_object($sqlQryRRR);
  274.         $cSeiteRRR = calcPages($getSumRRR->logs,$AaSeite,$ACPSeite);
  275.         $maxRange = 5;
  276.         $maxStep = 15;
  277.         if(($AaSeite-$maxRange)>0) $sStart = $AaSeite-$maxRange;
  278.         else $sStart = 1;
  279.         if(($AaSeite+$maxRange)<=$cSeiteRRR[0]) $sEnde = $AaSeite+$maxRange;
  280.         else $sEnde = $cSeiteRRR[0];
  281.  
  282.  
  283.     echo "<a id=\"aligenter\" href=\"index.php?s=admin&a=whisper_log\"><input type=\"submit\" name=\"submit\" value=\"Retornar\"/></a>";
  284.     echo '<table><tr><td class="tdunkel">';
  285.     if(($AaSeite-$maxStep)>0)
  286.       echo '     <a href="index.php?s=admin&a=whisper_log&id=&nick='.$abfragen3333->from_msg.'&submit=Procurar&pagefrom='.($AaSeite-$maxStep).'">'.($AaSeite-$maxStep).'</a> &laquo;';
  287.     else echo '     <a href="index.php?s=admin&a=whisper_log&id=&nick='.$abfragen3333->from_msg.'&submit=Procurar&pagefrom=1">1</a> &laquo;';
  288.       echo'   </td>';
  289.     for($i=$sStart;$i<=$sEnde;$i++) {
  290.       $sKlasse = ($i==$AaSeite) ? "topLine" : "thell";
  291.       echo'   <td class="'.$sKlasse.'" style="text-align:center;">';
  292.       echo'     <a href="index.php?s=admin&a=whisper_log&id=&nick='.$abfragen3333->from_msg.'&submit=Procurar&pagefrom='.$i.'">'.$i.'</a>';
  293.       echo'   </td>';
  294.     }
  295.     echo'   <td class="tdunkel" style="text-align:right;">';
  296.     if(($AaSeite+$maxStep)<=$cSeiteRRR[0]) echo '     &raquo; <a href="index.php?s=admin&a=whisper_log&id=&nick='.$abfragen3333->from_msg.'&submit=Procurar&pagefrom='.($AaSeite+$maxStep).'">'.($AaSeite+$maxStep).'</a>';
  297.     else echo '     &raquo; <a href="index.php?s=admin&a=whisper_log&id=&nick='.$abfragen3333->from_msg.'&submit=Procurar&pagefrom='.$cSeiteRRR[0].'">'.$cSeiteRRR[0].'</a>';
  298.     echo'   </td>';
  299.     echo' </tr>';
  300.     echo'</table>';
  301.  
  302.  
  303.  
  304.   }
  305.  
  306.  
  307.  
  308. }else{
  309.   echo"<div class=\"aviso\">Todas as mensagens... para filtrar basta pesquisar acima.<br /><a style=\"color:#FF6600;\">".$msgtxt."</a></div>";
  310.     $CPSeite = 50;
  311.     if(isset($_GET['page'])) {
  312.       if(!checkInt($_GET['page']) || !($_GET['page']>0)) $aSeite = 1;
  313.       else $aSeite = $_GET['page'];
  314.     } else {
  315.       $aSeite = 1;
  316.     }
  317.     $sqlCmd = "SELECT COUNT(*) as logs FROM log.whisper_log";
  318.     $sqlQry = mysql_query($sqlCmd,$sqlServ);
  319.     $getSum = mysql_fetch_object($sqlQry);
  320.     $cSeite = calcPages($getSum->logs,$aSeite,$CPSeite);
  321.     $maxRange = 5;
  322.     $maxStep = 15;
  323.     if(($aSeite-$maxRange)>0) $sStart = $aSeite-$maxRange;
  324.     else $sStart = 1;
  325.     if(($aSeite+$maxRange)<=$cSeite[0]) $sEnde = $aSeite+$maxRange;
  326.     else $sEnde = $cSeite[0];
  327.     echo "<table>
  328.      <tr>
  329.        <th class='topLine'>Id&nbsp;&nbsp;&nbsp;</th>
  330.        <th class='topLine'>Horário</th>
  331.        <th class='topLine'>Nick</th>
  332.        <th class='topLine'>Destinatário</th>
  333.        <th class='topLine'>Mensagem</th>
  334.      </tr>";
  335.     $abfragen1 = "SELECT * FROM log.whisper_log LIMIT ".$cSeite[1].",".$CPSeite;
  336.     $abfragen2 = mysql_query($abfragen1,$sqlServ);
  337.     $i1 = 0;
  338.     $i2 = 1;
  339.     while($abfragen3 = mysql_fetch_object($abfragen2)) {
  340.       $i1++;
  341.       if ($i1 == $i2) {
  342.         $i2 = $i2 + 2;
  343.         $class = "tdunkel";
  344.       } else {
  345.         $class = "thell";
  346.       }
  347.  
  348.       echo "  <tr>
  349.        <td class='".$class."' id=\"reborndes\">".$abfragen3->id."</td>
  350.        <td class='".$class."' id=\"reborndes\">".$abfragen3->time."</td>
  351.        <td class='".$class."' id=\"reborndes\">".$abfragen3->from_msg."</td>
  352.        <td class='".$class."' id=\"reborndes\">".$abfragen3->to_msg."</td>
  353.        <td class='".$class."' id=\"reborndes\">".$abfragen3->msg_text."</td>
  354.      </tr>";
  355.     }
  356.     echo "</table><br />";
  357.  
  358. $CPSeite = 50;
  359. if(isset($_GET['page'])) {
  360.   if(!checkInt($_GET['page']) || !($_GET['page']>0)) $aSeite = 1;
  361.   else $aSeite = $_GET['page'];
  362. } else {
  363.   $aSeite = 1;
  364. }
  365. $sqlCmd = "SELECT COUNT(*) as logs FROM log.whisper_log";
  366. $sqlQry = mysql_query($sqlCmd,$sqlServ);
  367. $getSum = mysql_fetch_object($sqlQry);
  368. $cSeite = calcPages($getSum->logs,$aSeite,$CPSeite);
  369. $maxRange = 5;
  370. $maxStep = 15;
  371. if(($aSeite-$maxRange)>0) $sStart = $aSeite-$maxRange;
  372. else $sStart = 1;
  373. if(($aSeite+$maxRange)<=$cSeite[0]) $sEnde = $aSeite+$maxRange;
  374. else $sEnde = $cSeite[0];
  375. echo '<table>
  376.  <tr>
  377.    <td class="tdunkel">';
  378. if(($aSeite-$maxStep)>0) echo '     <a href="index.php?s=admin&a=whisper_log&page='.($aSeite-$maxStep).'">'.($aSeite-$maxStep).'</a> &laquo;';
  379. else echo '     <a href="index.php?s=admin&a=whisper_log&page=1">1</a> &laquo;';
  380.   echo'   </td>';
  381. for($i=$sStart;$i<=$sEnde;$i++) {
  382.   $sKlasse = ($i==$aSeite) ? "topLine" : "thell";
  383.   echo'   <td class="'.$sKlasse.'" style="text-align:center;">';
  384.   echo'     <a href="index.php?s=admin&a=whisper_log&page='.$i.'">'.$i.'</a>';
  385.   echo'   </td>';
  386. }
  387. echo'   <td class="tdunkel" style="text-align:right;">';
  388. if(($aSeite+$maxStep)<=$cSeite[0]) echo '     &raquo; <a href="index.php?s=admin&a=whisper_log&page='.($aSeite+$maxStep).'">'.($aSeite+$maxStep).'</a>';
  389. else echo '     &raquo; <a href="index.php?s=admin&a=whisper_log&page='.$cSeite[0].'">'.$cSeite[0].'</a>';
  390. echo'   </td>';
  391. echo' </tr>';
  392. echo'</table>';
  393.  
  394.  
  395.  
  396.  
  397. }
  398.  
  399.  
  400. ?>
  401. <?php } else { echo "<p>Acesso negado!</p>"; } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement