예제 #1
0
function print_termine($tag, $month, $year)
{
    global $wincolor;
    global $loosecolor;
    global $drawcolor;
    global $userID;
    global $_language;
    $_language->read_module('calendar');
    $pagebg = PAGEBG;
    $border = BORDER;
    $bghead = BGHEAD;
    $bgcat = BGCAT;
    $start_date = mktime(0, 0, 0, $month, $tag, $year);
    $end_date = mktime(23, 59, 59, $month, $tag, $year);
    unset($termin);
    $ergebnis = safe_query("SELECT * FROM " . PREFIX . "upcoming");
    $anz = mysql_num_rows($ergebnis);
    if ($anz) {
        while ($ds = mysql_fetch_array($ergebnis)) {
            if ($ds['type'] == "c") {
                if ($ds['date'] >= $start_date && $ds['date'] <= $end_date) {
                    $date = date("d.m.Y", $ds['date']);
                    $time = date("H:i", $ds['date']);
                    $squad = getsquadname($ds['squad']);
                    $oppcountry = "[flag]" . $ds['oppcountry'] . "[/flag]";
                    $oppcountry = flags($oppcountry);
                    $opponent = $oppcountry . ' <a href="' . $ds['opphp'] . '" target="_blank">' . clearfromtags($ds['opptag']) . ' / ' . clearfromtags($ds['opponent']) . '</a>';
                    $maps = clearfromtags($ds['maps']);
                    $server = clearfromtags($ds['server']);
                    $league = '<a href="' . $ds['leaguehp'] . '" target="_blank">' . clearfromtags($ds['league']) . '</a>';
                    if (isclanmember($userID)) {
                        $warinfo = cleartext($ds['warinfo']);
                    } else {
                        $warinfo = $_language->module['you_have_to_be_clanmember'];
                    }
                    $players = "";
                    $announce = "";
                    $adminaction = '';
                    if (isclanmember($userID) or isanyadmin($userID)) {
                        $anmeldung = safe_query("SELECT * FROM " . PREFIX . "upcoming_announce WHERE upID='" . $ds['upID'] . "'");
                        if (mysql_num_rows($anmeldung)) {
                            $i = 1;
                            while ($da = mysql_fetch_array($anmeldung)) {
                                if ($da['status'] == "y") {
                                    $fontcolor = $wincolor;
                                } elseif ($da['status'] == "n") {
                                    $fontcolor = $loosecolor;
                                } else {
                                    $fontcolor = $drawcolor;
                                }
                                if ($i > 1) {
                                    $players .= ', <a href="index.php?site=profile&amp;id=' . $da['userID'] . '"><font color="' . $fontcolor . '">' . getnickname($da['userID']) . '</font></a>';
                                } else {
                                    $players .= '<a href="index.php?site=profile&amp;id=' . $da['userID'] . '"><font color="' . $fontcolor . '">' . getnickname($da['userID']) . '</font></a>';
                                }
                                $i++;
                            }
                        } else {
                            $players = $_language->module['no_announced'];
                        }
                        if (issquadmember($userID, $ds['squad']) and $ds['date'] > time()) {
                            $announce = '&#8226; <a href="index.php?site=calendar&amp;action=announce&amp;upID=' . $ds['upID'] . '">' . $_language->module['announce_here'] . '</a>';
                        } else {
                            $announce = "";
                        }
                        if (isclanwaradmin($userID)) {
                            $adminaction = '<div align="right">
            <input type="button" onclick="MM_openBrWindow(\'clanwars.php?action=new&amp;upID=' . $ds['upID'] . '\',\'Clanwars\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=490\')" value="' . $_language->module['add_clanwars'] . '" />
            <input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=calendar&amp;action=editwar&amp;upID=' . $ds['upID'] . '\');return document.MM_returnValue" value="' . $_language->module['edit'] . '" />
            <input type="button" onclick="MM_confirm(\'' . $_language->module['really_delete'] . '\', \'calendar.php?action=delete&amp;upID=' . $ds['upID'] . '\')" value="' . $_language->module['delete'] . '" /></div>';
                        } else {
                            $adminaction = '';
                        }
                    } else {
                        $players = $_language->module['access_member'];
                    }
                    $bg1 = BG_1;
                    $bg2 = BG_2;
                    $bg3 = BG_3;
                    $bg4 = BG_4;
                    eval("\$upcoming_war_details = \"" . gettemplate("upcoming_war_details") . "\";");
                    echo $upcoming_war_details;
                }
            } else {
                if ($start_date <= $ds['date'] && $end_date >= $ds['date'] || $start_date >= $ds['date'] && $end_date <= $ds['enddate'] || $start_date <= $ds['enddate'] && $end_date >= $ds['enddate']) {
                    $date = date("d.m.Y", $ds['date']);
                    $time = date("H:i", $ds['date']);
                    $enddate = date("d.m.Y", $ds['enddate']);
                    $endtime = date("H:i", $ds['enddate']);
                    $title = clearfromtags($ds['title']);
                    $location = '<a href="' . $ds['locationhp'] . '" target="_blank">' . clearfromtags($ds['location']) . '</a>';
                    $dateinfo = cleartext($ds['dateinfo']);
                    $dateinfo = toggle($dateinfo, $ds['upID']);
                    $country = "[flag]" . $ds['country'] . "[/flag]";
                    $country = flags($country);
                    $players = "";
                    if (isclanmember($userID)) {
                        $anmeldung = safe_query("SELECT * FROM " . PREFIX . "upcoming_announce WHERE upID='" . $ds['upID'] . "'");
                        if (mysql_num_rows($anmeldung)) {
                            $i = 1;
                            while ($da = mysql_fetch_array($anmeldung)) {
                                if ($da['status'] == "y") {
                                    $fontcolor = $wincolor;
                                } elseif ($da['status'] == "n") {
                                    $fontcolor = $loosecolor;
                                } else {
                                    $fontcolor = $drawcolor;
                                }
                                if ($i > 1) {
                                    $players .= ', <a href="index.php?site=profile&amp;id=' . $da['userID'] . '"><font color="' . $fontcolor . '">' . getnickname($da['userID']) . '</font></a>';
                                } else {
                                    $players .= '<a href="index.php?site=profile&amp;id=' . $da['userID'] . '"><font color="' . $fontcolor . '">' . getnickname($da['userID']) . '</font></a>';
                                }
                                $i++;
                            }
                        } else {
                            $players = $_language->module['no_announced'];
                        }
                        if (isclanmember($userID) and $ds['date'] > time()) {
                            $announce = '&#8226; <a href="index.php?site=calendar&amp;action=announce&amp;upID=' . $ds['upID'] . '">' . $_language->module['announce_here'] . '</a>';
                        } else {
                            $announce = '';
                        }
                        if (isclanwaradmin($userID)) {
                            $adminaction = '<div align="right"><input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=calendar&amp;action=editdate&amp;upID=' . $ds['upID'] . '\');return document.MM_returnValue" value="' . $_language->module['edit'] . '" /><input type="button" onclick="MM_confirm(\'' . $_language->module['really_delete'] . '\', \'calendar.php?action=delete&amp;upID=' . $ds['upID'] . '\')" value="' . $_language->module['delete'] . '" /></div>';
                        } else {
                            $adminaction = '';
                        }
                    } else {
                        $players = $_language->module['access_member'];
                        $announce = '';
                        $adminaction = '';
                    }
                    $bg1 = BG_1;
                    $bg2 = BG_2;
                    $bg3 = BG_3;
                    $bg4 = BG_4;
                    eval("\$upcoming_date_details = \"" . gettemplate("upcoming_date_details") . "\";");
                    echo $upcoming_date_details;
                }
            }
        }
    } else {
        echo $_language->module['no_entries'];
    }
}
예제 #2
0
        function print_cashbox($squadID, $id)
        {
            global $_language;
            $_language->read_module('cash_box');
            $bg1 = BG_1;
            $bg2 = BG_2;
            $pagebg = PAGEBG;
            $border = BORDER;
            $bghead = BGHEAD;
            $bgcat = BGCAT;
            global $wincolor;
            global $loosecolor;
            global $drawcolor;
            global $userID;
            if ($id) {
                $squadergebnis = safe_query("SELECT squad FROM " . PREFIX . "cash_box WHERE cashID='" . $id . "'");
                $dv = mysql_fetch_array($squadergebnis);
                $squadID = $dv['squad'];
            }
            $costs_squad = '';
            if ($squadID == 0) {
                $usersquad = $_language->module['clan'];
            } else {
                $ergebnis_squad = safe_query("SELECT * FROM " . PREFIX . "cash_box_payed, " . PREFIX . "cash_box WHERE " . PREFIX . "cash_box_payed.payed='1' AND " . PREFIX . "cash_box_payed.cashID=" . PREFIX . "cash_box.cashID AND " . PREFIX . "cash_box.squad = '" . $squadID . "'");
                $anz_squad = mysql_num_rows($ergebnis_squad);
                $costs_squad = 0.0;
                if ($anz_squad) {
                    while ($dss = mysql_fetch_array($ergebnis_squad)) {
                        $costs_squad += $dss['costs'];
                    }
                }
                $ergebnis_squad = safe_query("SELECT * FROM " . PREFIX . "cash_box WHERE squad='{$squadID}'");
                $anz_squad = mysql_num_rows($ergebnis_squad);
                if ($anz_squad) {
                    while ($dss = mysql_fetch_array($ergebnis_squad)) {
                        $costs_squad -= $dss['totalcosts'];
                    }
                }
                $costs_squad = ' (' . $costs_squad . ' euro)';
                $usersquad = $_language->module['squad'] . ": " . getsquadname($squadID);
            }
            $ergebnis = safe_query("SELECT * FROM " . PREFIX . "cash_box WHERE squad='" . $squadID . "' ORDER BY paydate DESC LIMIT 0,1");
            echo '<br /><br /><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td valign="top" width="180"><b>' . $usersquad . $costs_squad . '</b></td>
        </tr>
        <tr>
          <td height="1" bgcolor="' . BG_1 . '" width="100%" colspan="4"></td>
        </tr>
        <tr><td height="15"></td></tr>';
            echo '<tr>
							<td valign="top" width="180">';
            if (mysql_num_rows($ergebnis)) {
                $ds = mysql_fetch_array($ergebnis);
                if (!$id) {
                    $id = $ds['cashID'];
                }
                $ergebnis = safe_query("SELECT * FROM " . PREFIX . "cash_box WHERE cashID='{$id}'");
                $ds = mysql_fetch_array($ergebnis);
                $date = date("d.m.Y", $ds['date']);
                $paydate = date("d.m.Y", $ds['paydate']);
                $bezahlen = safe_query("SELECT * FROM " . PREFIX . "cash_box_payed WHERE cashID='{$id}' AND payed='1' ");
                $payed = mysql_num_rows($bezahlen);
                $konto = cleartext($ds['konto']);
                $usage = $ds['usedfor'];
                if (iscashadmin($userID)) {
                    $adminaction = '<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=cash_box&amp;action=edit&amp;id=' . $id . '\');return document.MM_returnValue" value="' . $_language->module['edit'] . '" /> <input type="button" onclick="MM_confirm(\'' . $_language->module['really_delete'] . '\', \'cash_box.php?delete=true&amp;id=' . $id . '\')" value="' . $_language->module['delete'] . '" />';
                }
                eval("\$cash_box_usage = \"" . gettemplate("cash_box_usage") . "\";");
                echo $cash_box_usage;
                $all = safe_query("SELECT * FROM " . PREFIX . "cash_box WHERE squad='" . $squadID . "' ORDER BY paydate DESC");
                echo '<br /><br />';
                while ($ds = mysql_fetch_array($all)) {
                    echo '&#8226; <a href="index.php?site=cash_box&amp;id=' . $ds['cashID'] . '&amp;squad=' . $squadID . '"><b>' . $ds['usedfor'] . '</b></a><br />';
                }
                echo '</td><td width="10">&nbsp;</td>
					<td valign="top">';
                $members = array();
                $ergebnis = safe_query("SELECT * FROM " . PREFIX . "user ORDER BY nickname");
                while ($du = mysql_fetch_array($ergebnis)) {
                    if ($squadID == 0) {
                        if (isclanmember($du['userID'], $squadID)) {
                            $members[] = $du['userID'];
                        }
                    } else {
                        if (issquadmember($du['userID'], $squadID)) {
                            $members[] = $du['userID'];
                        }
                    }
                }
                eval("\$cash_box_head = \"" . gettemplate("cash_box_head") . "\";");
                echo $cash_box_head;
                if (count($members)) {
                    foreach ($members as $usID) {
                        $ergebnis = safe_query("SELECT * FROM " . PREFIX . "cash_box_payed WHERE userID='{$usID}' AND cashID='{$id}'");
                        $du = mysql_fetch_array($ergebnis);
                        $user = '******' . $usID . '"><b>' . getnickname($usID) . '</b></a>';
                        if ($du['payed']) {
                            $paydate = date("d.m.Y", $du['date']);
                            $payed = '<font color="' . $wincolor . '">' . $_language->module['paid'] . ': ' . $paydate . '</font>';
                        } else {
                            $payed = '<font color="' . $loosecolor . '">' . $_language->module['not_paid'] . '</font>';
                        }
                        if (iscashadmin($userID)) {
                            if ($du['costs']) {
                                $bg = BG_1;
                                $costs = $du['costs'];
                            } else {
                                $costs = "";
                                $bg = BG_2;
                            }
                            $payment = '<input type="text" size="7" name="payid[' . $usID . ']" value="' . $costs . '" dir="rtl" /> &#8364;';
                        } else {
                            if ($du['costs']) {
                                $costs = '<font color="' . $wincolor . '"><b>' . $du['costs'] . ' &#8364;</b></font>';
                                $bg = BG_1;
                            } else {
                                $costs = '<font color="' . $loosecolor . '">0.00 &#8364;</font>';
                                $bg = BG_2;
                            }
                            $payment = $costs;
                        }
                        eval("\$cash_box_content = \"" . gettemplate("cash_box_content") . "\";");
                        echo $cash_box_content;
                    }
                }
                if (iscashadmin($userID)) {
                    $admin = '<input type="hidden" name="id" value="' . $id . '" /><input type="submit" name="pay" value="' . $_language->module['update'] . '" />';
                }
                eval("\$cash_box_foot = \"" . gettemplate("cash_box_foot") . "\";");
                echo $cash_box_foot;
            } else {
                echo $_language->module['no_entries'];
            }
            echo '</td></tr></table>';
        }