Example #1
0
    private function _injuryHistory()
    {
        global $lng, $T_INJS;
        $p = $this;
        // Copy. Used instead of $this for readability.
        list($injhist, $stats, $match_objs) = $p->getInjHistory();
        ?>
    <div class="row">
        <div class="boxWide">
            <div class="boxTitle<?php 
        echo T_HTMLBOX_STATS;
        ?>
"><a href='javascript:void(0);' onClick="slideToggleFast('injhist');"><b>[+/-]</b></a> &nbsp;<?php 
        echo $lng->getTrn('profile/player/injhist');
        ?>
</div>
            <div class="boxBody" id="injhist">
                <table class="common">
                    <tr>
                        <td><b><?php 
        echo $lng->getTrn('common/injs');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/tournament');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/opponent');
        ?>
</b></td>
                        <td><b>MVP</b></td>
                        <td><b>Cp</b></td>
                        <td><b>Td</b></td>
                        <td><b>Int</b></td>
                        <td><b>Cas</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/score');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/result');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/dateplayed');
        ?>
</b></td>
                        <td><b><?php 
        echo $lng->getTrn('common/match');
        ?>
</b></td>
                    </tr>
                    <?php 
        foreach (array_keys($injhist) as $mid) {
            $m = $match_objs[$mid];
            foreach ($injhist[$mid] as $k => $v) {
                $injhist[$mid][$k] = ucfirst(strtolower($T_INJS[$v]));
            }
            ?>
                        <tr>
                        <td><?php 
            echo implode(', ', $injhist[$mid]);
            ?>
</td>
                        <td><?php 
            echo get_parent_name(T_NODE_MATCH, $m->match_id, T_NODE_TOURNAMENT);
            ?>
</td>
                        <td><?php 
            echo $p->owned_by_team_id == $m->team1_id ? $m->team2_name : $m->team1_name;
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['mvp'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['cp'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['td'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['intcpt'];
            ?>
</td>
                        <td><?php 
            echo $stats[$mid]['bh'] + $stats[$mid]['si'] + $stats[$mid]['ki'];
            ?>
</td>
                        <td><?php 
            echo $m->team1_score . ' - ' . $m->team2_score;
            ?>
</td>
                        <td><?php 
            echo matchresult_icon($m->is_draw ? 'D' : ($m->winner == $p->owned_by_team_id ? 'W' : 'L'));
            ?>
</td>
                        <td><?php 
            echo textdate($m->date_played, false, false);
            ?>
</td>
                        <td><a href='javascript:void(0)' onClick="window.open('index.php?section=matches&amp;type=report&amp;mid=<?php 
            echo $m->match_id;
            ?>
');"><?php 
            echo $lng->getTrn('common/view');
            ?>
</a></td>
                        </tr>
                        <?php 
        }
        ?>
                </table>
            </div>
        </div>
    </div>
    <?php 
    }
Example #2
0
    public static function userSched()
    {
        global $lng, $coach, $settings, $leagues, $divisions, $tours;
        if (!is_object($coach)) {
            status(false, "You must be logged in to schedule games");
            return;
        }
        if (isset($_POST['creategame'])) {
            // Test input
            $trid = (int) $_POST['trid'];
            $round = (int) $_POST['round'];
            $own_team = (int) $_POST['own_team'];
            $errmsg = '';
            // Logged in coach has access to the tour?
            if (!in_array($trid, array_keys($tours))) {
                $errmsg = 'You do not have access to the tournament ' . $tours[$trid]['tname'];
            }
            // Is the team is really owned by the logged in coach?
            if ($coach->coach_id != get_alt_col('teams', 'team_id', $own_team, 'owned_by_coach_id')) {
                $errmsg = 'The team ' . get_alt_col('teams', 'team_id', $own_team, 'name') . ' is not owned by you';
            }
            // Create match
            if (!$errmsg) {
                list($exitStatus, $mid) = Match::create(array('team1_id' => $own_team, 'team2_id' => get_alt_col('teams', 'name', $_POST['opposing_team_autocomplete'], 'team_id'), 'round' => $round, 'f_tour_id' => $trid));
                $backFromMatchLink = Mobile::isMobile() ? "index.php?mobile=1" : "index.php?section=matches&amp;type=report&amp;mid={$mid}";
                status(!$exitStatus, $exitStatus ? Match::$T_CREATE_ERROR_MSGS[$exitStatus] : "<a href='{$backFromMatchLink}'>Click here</a> to open the match report");
                if (!$exitStatus) {
                    echo "<br>";
                }
            } else {
                status(false, $errmsg);
            }
        }
        $trid = isset($_GET['trid']) && is_numeric($_GET['trid']) ? (int) $_GET['trid'] : 0;
        $lid = $trid ? get_parent_id(T_NODE_TOURNAMENT, $trid, T_NODE_LEAGUE) : false;
        $lname = $lid ? get_parent_name(T_NODE_TOURNAMENT, $trid, T_NODE_LEAGUE) : '- N/A -';
        $did = $trid && get_alt_col('leagues', 'lid', $lid, 'tie_teams') == 1 ? get_parent_id(T_NODE_TOURNAMENT, $trid, T_NODE_DIVISION) : false;
        $dname = $did ? get_parent_name(T_NODE_TOURNAMENT, $trid, T_NODE_DIVISION) : false;
        $_DISABLED = !$trid ? 'DISABLED' : '';
        #print_r(array($trid, $lid, $lname, $did));
        title($lng->getTrn('menu/matches_menu/usersched'));
        $LOCK_FORMS = false;
        ?>
    <div class='boxCommon'>
        <h3 class='boxTitle<?php 
        echo T_HTMLBOX_MATCH;
        ?>
'><?php 
        echo $lng->getTrn('menu/matches_menu/usersched');
        ?>
</h3>
        <div class='boxBody'>
            <form method="POST" id="usersched">
                <?php 
        echo "In tournament ";
        echo HTMLOUT::nodeList(T_NODE_TOURNAMENT, 'trid', array(T_NODE_TOURNAMENT => array('locked' => 0, 'type' => TT_FFA, 'allow_sched' => 1)), array(), array('sel_id' => $trid, 'extra_tags' => array('onChange="document.location.href = \'' . getFormAction('?section=matches&type=usersched') . '&trid=\' + $(this).val();"'), 'init_option' => '<option value="0">- ' . $lng->getTrn('matches/usersched/selecttour') . " -</option>\n"));
        echo ' as ';
        echo '<select name="round" id="round" ' . $_DISABLED . '>';
        $T_ROUNDS = Match::getRounds();
        foreach ($T_ROUNDS as $r => $d) {
            echo "<option value='{$r}' " . ($r == 1 ? 'SELECTED' : '') . ">" . $d . "</option>\n";
        }
        ?>
                </select>
                <br><br>
                Your team
                <?php 
        $teams = array();
        foreach ($coach->getTeams($lid, $did, array('sortby' => 'team_id DESC')) as $t) {
            if (!$t->rdy || $t->is_retired) {
                continue;
            }
            $teams[] = $t;
        }
        ?>
                <select name='own_team' id='own_team' <?php 
        echo $_DISABLED;
        ?>
>
                    <?php 
        echo "<optgroup class='leagues' label='{$lname}'>\n";
        if ($dname) {
            echo "<optgroup class='divisions' label='&nbsp;&nbsp;{$dname}'>\n";
        }
        foreach ($teams as $t) {
            echo "<option style='background-color: white; margin-left: -1em;' value='{$t->team_id}'>&nbsp;&nbsp;&nbsp;{$t->name}</option>\n";
        }
        ?>
                </select>
                &nbsp;
                VS.
                <input type="text" id='opposing_team_autoselect' name="opposing_team_autocomplete" size="30" maxlength="50" <?php 
        echo $_DISABLED;
        ?>
>
                <script>
                    $(document).ready(function(){
                        var options, b;

                        options = {
                            minChars:2,
                            serviceUrl:'handler.php?type=autocomplete&obj=<?php 
        echo T_OBJ_TEAM;
        ?>
&trid=<?php 
        echo $trid;
        ?>
',
                        };
                        b = $('#opposing_team_autoselect').autocomplete(options);
                    });
                </script>
                <br><br><br>
                <input type="submit" name="creategame" value="<?php 
        echo $lng->getTrn('menu/matches_menu/usersched');
        ?>
" <?php 
        if (empty($teams) || $_DISABLED) {
            echo 'DISABLED';
        }
        ?>
>
                
                <?php 
        if (Mobile::isMobile()) {
            echo '<a href="' . getFormAction('') . '">' . $lng->getTrn('common/back') . '</a>';
        }
        ?>
            </form>
        </div>
    </div>
    <?php 
    }
Example #3
0
                 <td>
                     <?php 
 $special_column_type = get_special_column_type($special_columns, $column);
 if ($special_column_type) {
     switch ($special_column_type) {
         case 'image':
             echo "<input type='text' value='{$record}' name='column__{$column}__id__{$id}' class='fileinput' id='file-{$column}-{$id}' />";
             break;
         case 'text_content':
             echo "<input type='button' class='tiny button' VALUE='[ Upravit textovĂ˝ obsah ]' class='editable-content' onclick='window.open(\"{$admin->env->basedir}admin/editor/?id={$id}\", \"window_name\", \"width=500,height=500\")' />";
             break;
         case 'password':
             echo "***********";
             break;
         case 'reference':
             echo "<a href='?plugin_id=" . get_reference_id($special_columns, $column) . "&filter_id={$id}&parent=" . get_parent_name($table_name) . "'>edit</a>";
             break;
         case 'select':
             echo "<select name='column__{$column}__id__{$id}'>";
             $select = get_column_by_name($special_columns, $column);
             foreach ($select->options as $option) {
                 echo "<option value='{$option->id}' ";
                 if ($option->id == $record) {
                     echo "selected='selected'";
                 }
                 echo ">{$option->val}</option>";
             }
             echo "</select>";
             break;
         default:
             echo "<input type='{$special_column_type}' name='column__{$column}__id__{$id}' value='{$record}' />";
Example #4
0
require_once '../model/parents_db.php';
require_once '../model/students_db.php';
require_once '../model/teachers_db.php';
date_default_timezone_set('America/New_York');
$time_zone = date_default_timezone_get();
$formatting = 'Y';
$current_date_object = new DateTime();
$current_date_f = $current_date_object->format($formatting);
if ($_SESSION['type'] == "student") {
    $userName = get_student_name($user);
} else {
    if ($_SESSION['type'] == "teacher") {
        $userName = get_teacher_name($user);
    } else {
        if ($_SESSION['type'] == "parent") {
            $userName = get_parent_name($user);
        } else {
            if ($_SESSION['type'] == "admin") {
                $userName = "******";
            }
        }
    }
}
?>

	<footer>
		<br/><br/>
		
		<div style="text-align: center">
			Logged in as <span class="text-error"><?php 
echo $userName;