コード例 #1
0
ファイル: AjaxAddGroup.php プロジェクト: brian-nelson/ianseo
                $Group = $group;
            }
            if (isset($_REQUEST['del'])) {
                safe_w_sql("delete from TargetGroups\n\t\t\t\t\twhere TgTournament={$_SESSION['TourId']} and TgTargetNo='{$tgt}'");
            } else {
                safe_w_sql("insert into TargetGroups\n\t\t\t\t\tset TgTournament={$_SESSION['TourId']},\n\t\t\t\t\tTgSession=" . substr($tgt, 0, 1) . ",\n\t\t\t\t\tTgSesType='" . $SesType . ($SPhase ? $SPhase : '') . "',\n\t\t\t\t\tTgTargetNo='{$tgt}',\n\t\t\t\t\tTgGroup=" . StrSafe_DB($group) . "\n\t\t\t\t\ton duplicate key update\n\t\t\t\t\tTgGroup=" . StrSafe_DB($group) . "\n\t\t\t\t\t\t\t");
            }
        }
    }
}
header('Content-Type: text/xml');
print '<response>' . "\n";
print '<error>0</error>' . "\n";
if (isset($_REQUEST['new'])) {
    require_once './lib.php';
    switch ($SesType) {
        case 'Q':
            $q = safe_r_sql(getSesSQL('Q', $Session));
            $SesRow = safe_fetch($q);
            $SesRow->Range = Range($SesRow->SesFirstTarget, $SesRow->SesTar4Session + $SesRow->SesFirstTarget - 1);
            break;
        case 'E':
            $q = safe_r_sql(getSesSQL('E', $Session, $Phase));
            $SesRow = safe_fetch($q);
            $SesRow->Range = explode(',', $SesRow->SesTar4Session);
            break;
    }
    $ret = BuildGroups($SesType, $Session, $Phase, $SesRow->Range, $Group);
    echo "<row><![CDATA[{$ret}]]></row>";
}
print '</response>' . "\n";
コード例 #2
0
ファイル: ApiGrouping.php プロジェクト: brian-nelson/ianseo
include 'Common/Templates/head.php';
echo '<select name="Session" onchange="if(this.value) {window.location.href=this.value;}">';
// fetch the Qualification sessions
echo '<option value="">==> ' . get_text('QualRound') . '</option>';
$q = safe_r_sql(getSesSQL('Q'));
while ($r = safe_fetch($q)) {
    echo '<option value="?SesType=Q&Session=' . $r->SesOrder . '"' . ($SesType == 'Q' && $r->SesOrder == $Session ? ' selected="selected"' : '') . '>' . ($r->SesName ? $r->SesName : get_text('Session') . ' ' . $r->SesOrder) . '</option>';
    if ($r->SesOrder == $Session and $SesType == 'Q') {
        $SesRow = $r;
        $SesRow->Range = Range($r->SesFirstTarget, $r->SesTar4Session + $r->SesFirstTarget - 1);
    }
}
// If Eliminations
if ($_SESSION['MenuElimDo']) {
    $OldPhase = '';
    $SQL = getSesSQL('E');
    $q = safe_r_SQL($SQL);
    while ($r = safe_fetch($q)) {
        if ($OldPhase != $r->Phase) {
            echo '<option value="">==> ' . get_text('Eliminations_' . $r->Phase) . '</option>';
            $OldPhase = $r->Phase;
        }
        echo '<option value="?SesType=E&ElPhase=' . $r->Phase . '&Session=' . $r->SesOrder . '"' . ($SesType == 'E' && $ElPhase == $r->Phase && $r->SesOrder == $Session ? ' selected="selected"' : '') . '>' . ($r->SesName ? $r->SesName : get_text('Session') . ' ' . $r->SesOrder) . '</option>';
        if ($r->SesOrder == $Session and $SesType == 'E' and $ElPhase == $r->Phase) {
            $SesRow = $r;
            $SesRow->Range = explode(',', $r->SesTar4Session);
        }
    }
}
$Sessions = array();
if ($_SESSION['MenuFinIDo']) {