Changeset 241 for quests/export.php


Ignore:
Timestamp:
Jan 17, 2008, 3:43:46 PM (17 years ago)
Author:
maron
Message:

Export pouze od určitých uživatelů

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quests/export.php

    r240 r241  
    1111        }
    1212
    13   if (array_key_exists('Type', $_GET)) {
    14     $Diacritical = @$_GET['Diacritical'];
    15     if (array_key_exists('CZ', $_GET)) $CZ = $_GET['CZ'];   
    16     if (array_key_exists('SK', $_GET)) $SK = $_GET['SK'];   
    17     if (array_key_exists('OtherLanguage', $_GET)) $OtherLanguage = $_GET['OtherLanguage'];
    18     if (array_key_exists('Use', $_GET)) $Use = $_GET['Use'];
    19     $Type = $_GET['Type'];
    20     $Export = $_GET['Export'];
    21     $AddTitle = $_GET['AddTitle'];
    22     $NumberVote = $_GET['NumberVote'];
    23     $Vote = $_GET['Vote'];
    24 
    25       $AddDetails = @$_GET['AddDetails'];
    26       $AddObjectives = @$_GET['AddObjectives'];
    27       $AddOfferRewardText = @$_GET['AddOfferRewardText'];
    28       $AddRequestItemsText = @$_GET['AddRequestItemsText'];
    29       $AddEndText = @$_GET['AddEndText'];
    30       $AddObjectiveText1 = @$_GET['AddObjectiveText1'];
    31       $AddObjectiveText2 = @$_GET['AddObjectiveText2'];
    32       $AddObjectiveText3 = @$_GET['AddObjectiveText3'];
    33       $AddObjectiveText4 = @$_GET['AddObjectiveText4'];
     13  if (array_key_exists('Type', $_POST)) {
     14    $Diacritical = @$_POST['Diacritical'];
     15    if (array_key_exists('CZ', $_POST)) $CZ = $_POST['CZ'];   
     16    if (array_key_exists('SK', $_POST)) $SK = $_POST['SK'];   
     17    if (array_key_exists('OtherLanguage', $_POST)) $OtherLanguage = $_POST['OtherLanguage'];
     18    if (array_key_exists('Use', $_POST)) $Use = $_POST['Use'];
     19    $Type = $_POST['Type'];
     20    $Export = $_POST['Export'];
     21    $AddTitle = $_POST['AddTitle'];
     22    $NumberVote = $_POST['NumberVote'];
     23    $Vote = $_POST['Vote'];
     24    $users = @$_POST['users'];
     25   
     26
     27      $AddDetails = @$_POST['AddDetails'];
     28      $AddObjectives = @$_POST['AddObjectives'];
     29      $AddOfferRewardText = @$_POST['AddOfferRewardText'];
     30      $AddRequestItemsText = @$_POST['AddRequestItemsText'];
     31      $AddEndText = @$_POST['AddEndText'];
     32      $AddObjectiveText1 = @$_POST['AddObjectiveText1'];       
     33      $AddObjectiveText2 = @$_POST['AddObjectiveText2'];       
     34      $AddObjectiveText3 = @$_POST['AddObjectiveText3'];       
     35      $AddObjectiveText4 = @$_POST['AddObjectiveText4'];       
    3436
    3537      if (($Export == 'Mangos') and (Licence(1) == False)) {die('Nemáte oprávnìní');}
     
    5153
    5254    $sql = "SELECT * FROM quests.quests WHERE Complete = '1' AND CountVote >= '$NumberVote' AND Vote >= '$Vote'";
    53     $Where = '';
    54     if (isset($CZ)) $Where .= " Language = '1'";
     55    $WhereLang = '';
     56    if (isset($CZ)) $WhereLang .= " Language = '1'";
    5557    if (isset($SK)) {
    56       if ($Where <> '')
    57         $Where .= " OR Language = '2'";
     58      if ($WhereLang <> '')
     59        $WhereLang .= " OR Language = '2'";
    5860      else
    59         $Where .= "Language = '2'";
     61        $WhereLang .= "Language = '2'";
    6062    }
    6163    if (isset($OtherLanguage)) {
    62       if ($Where <> '')
    63         $Where .= " OR Language = '3'";
     64      if ($WhereLang <> '')
     65        $WhereLang .= " OR Language = '3'";
    6466      else
    65         $Where .= "Language = '3'";
     67        $WhereLang .= "Language = '3'";
    6668    }
    67     if ($Where <> "")  $sql .= " AND ($Where)";
     69   
     70    $WhereUsers = '';
     71   
     72    for ($i=0; $i<Count($users); $i++):
     73      if ($WhereUsers <> '')
     74        $WhereUsers .= " OR User = ".$users[$i];
     75      else
     76        $WhereUsers .= " User = ".$users[$i];
     77    endfor;   
     78   
     79    if ($WhereLang <> '') $sql .= " AND ($WhereLang)";
     80    if ($WhereUsers <> '') $sql .=  "AND ($WhereUsers)";
     81
     82    echo $sql;
     83
    6884
    6985    $ID = $Database->SQLCommand($sql." ORDER BY vote");
     
    154170  <big><b><i>Pro server:</b></i></big><br>
    155171  <b>Export Questù:</b><br />
    156   <form action="export.php" method="get">
    157     <table border="1">
    158       <tr><th>Sql</th><th>Jazyk</th><th>Texty</th></tr>
     172  <form action="export.php" method="POST">
     173    <table border="1" cellpadding="1" cellspacing="0">
     174      <tr><th>Sql</th><th>Filtr</th><th>Jazyk</th><th>Texty</th></tr>
    159175      <tr><td>
    160176        <input type="radio" name="Export" value="Zip" checked="true"> Exportovat do zip<br>
     
    171187        <input type="checkbox" name="Use" checked="true"> Pøidat Use mangos <br>
    172188        <br />
    173         <b>Filtr:</b><br />
    174         <input type="text" name="NumberVote" value="3" size="1"> Poèet nutných hlasù <br>                                                               
    175         <input type="text" name="Vote" value="4" size="1"> Známka lep¹í nebo stejná jak                                                               
     189      </td><td>
     190        &nbsp;<input type="text" name="NumberVote" value="3" size="1"> Poèet nutných hlasù <br>                                                               
     191        &nbsp;<input type="text" name="Vote" value="4" size="1"> Známka lep¹í nebo stejná jak  <br>                                                             
     192
     193        &nbsp;<select name="users[]" size="7" multiple>
     194         
     195<?php
     196// multiple="multiple"
     197    $ID = $Database->SQLCommand("SELECT user,ID FROM `user`");
     198      while ($Line = mysql_fetch_array($ID))
     199        echo '<option value="'.$Line['ID'].'">'.$Line['user'].'</option>';
     200   
     201?>               
     202         
     203        </select><br>&nbsp; Exportovat pouze od tìchto u¾ivatalù
     204       
     205
    176206      </td><td>
    177207        <input type="checkbox" name="Diacritical" checked="true"> Vèetnì diakritiky <br> 
     
    192222      </td></tr>
    193223    </table>
    194     <br><input type="submit" value="Generovat"> SQL soubor (Sta¾ení)
     224    <br><input type="submit" value="Generovat"> SQL soubor Questù (Sta¾ení)
    195225  </form> 
    196226  <b>Èeský pøeklad MaNGOS Minimanageru:</b><br />
Note: See TracChangeset for help on using the changeset viewer.