function getTeams($htmlRows)
{
    $teams = array();
    if ($htmlRows == null) {
        return "";
    }
    $teamCache = array();
    foreach ($htmlRows as $row) {
        $total = $row->find("[colspan=3]");
        if ($total != null) {
            break;
        }
        $team = $row->children(2)->plaintext;
        if (!in_array($team, $teamCache)) {
            array_push($teamCache, $team);
            $team = getTeamName($team);
            if (!in_array($team, $teams)) {
                array_push($teams, $team);
            }
        }
    }
    return implode($teams, " ");
}
Exemplo n.º 2
0
 /**
  * Get JSON-string with Premier League table
  * 
  */
 static function getPremierLeagueTable()
 {
     $filename = 'app/data/tables.json';
     $downloadFile = !file_exists($filename);
     if (!$downloadFile) {
         $fileDate = date('y-m-d', filemtime($filename));
         $today = date('y-m-d');
         $downloadFile = $fileDate !== $today;
     }
     if ($downloadFile) {
         $uri = 'http://api.football-data.org/v1/soccerseasons/398/leagueTable';
         $reqPrefs['http']['method'] = 'GET';
         $stream_context = stream_context_create($reqPrefs);
         $content = file_get_contents($uri, false, $stream_context);
         file_put_contents($filename, $content);
     }
     $data = file_get_contents($filename);
     $fixtures = json_decode($data, true);
     $str = '';
     require 'app/lib/teamNameMapper.php';
     $retArr = array();
     foreach ($fixtures['standing'] as $key => $value) {
         $standing = array();
         $standing['teamName'] = getTeamName($value['teamName']);
         $standing['position'] = $value['position'];
         $standing['playedGames'] = $value['playedGames'];
         $standing['goals'] = $value['goals'];
         $standing['goalsAgainst'] = $value['goalsAgainst'];
         $standing['wins'] = $value['wins'];
         $standing['draws'] = $value['draws'];
         $standing['losses'] = $value['losses'];
         $standing['points'] = $value['points'];
         $retArr[] = $standing;
     }
     return json_encode($retArr);
 }
Exemplo n.º 3
0
                } else {
                    $resultTeam[] = array();
                }
            }
            $resultTeams[] = $resultTeam;
        }
        $groupes[$itGroupe]['resultTeams'] = $resultTeams;
    }
    // ***************************************************************************
    //$userId = $_GET['user'];  //debug
    $userId = $_SESSION['id_joueur'];
    // faire la fonc ici qui va aller recuperer cette info dans la db
    $isChiefOfTeam = true;
    //isChiefOfTeam($_SESSION['level']); //pour l'intant true pour les tests
    // faire la fonc qui va aller recuperer le nom de la team du gars en fct de son ID
    $teamName = getTeamName($userId, $database);
    $peekData = array("userId" => $userId, "isChief" => $isChiefOfTeam, "teamName" => $teamName, "idTournoi" => $id_tournoi);
    // ***************************************************************************
    // Applying Template
    $smarty->assign("con", $connected);
    $smarty->assign("next_matches", $database->getNextMatches($connected));
    $smarty->assign("navTournois", $database->getNavTournois());
    $smarty->assign("tournoi", $tournoi);
    $smarty->assign("nbr_lb2", $nbr_lb2);
    $smarty->assign("nbr_lb3", $nbr_lb3);
    $smarty->assign("nbrteam", $nbrteam);
    $smarty->assign("groupes", $groupes);
    $smarty->assign("resultTeams", $resultTeams);
    $smarty->assign("totaux", $totaux);
    $smarty->assign("peekData", $peekData);
} else {
Exemplo n.º 4
0
 Meeting</h4>
            Below is a compilation of all the things that happened for the selected week. Notes can be written below and they will be saved with that week's data for future reference.  <br />
        </div>

        <?php 
}
?>
        <div class="pull-right"><div class="btn-group"><a class="btn" role="button" data-toggle="modal" href="#permalink-modal"><i class="icon-bookmark"></i> Permalink</a></div></div>
        <?php 
if ($results = checkForPreviousMeetingNotes(generateMeetingNotesID($start_ts, $end_ts))) {
    $previous_timestamp = $results['timestamp'];
    $previous_user = $results['user'];
    $previous_report = $results['notes'];
    echo "<h2>Meeting Notes <small>taken by {$previous_user} at the " . getTeamName() . " Meeting held on " . date("l jS F Y", $previous_timestamp);
} else {
    echo "<h2>Meeting Notes <small>you are taking at the " . getTeamName() . " Meeting today (" . date("l jS F Y") . ")";
    $previous_report = null;
}
?>
        </small></h2>
        <form action="<?php 
echo $ROOT_URL;
?>
/add_meeting_notes.php" method="POST" id="weekly-notes">
        <textarea class="textarea span12" name="weeklynotes" placeholder="Enter Meeting Notes, e.g. Hiring, Launches, Corp IT information" style="height: 200px">
            <?php 
echo $previous_report;
?>
        </textarea>
        <script>
            $('.textarea').wysihtml5({"image": false, "color": false});
Exemplo n.º 5
0
<?php

include_once "phplib/base.php";
$time_requested = getOrSetRequestedDate();
$start_end = getWeekRange($time_requested);
$start_ts = $start_end[0];
$end_ts = $start_end[1];
$page_title = getTeamName() . " Weekly Updates - Reports";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>

<style>
.icon-time {
    -moz-transform:scale(1.2,1.2); /* Firefox */
    -webkit-transform:scale(1.2,1.2); /* Safari and Chrome */
}
</style>

<div class="container">
<h1>On Call Reporting</h1>
<?php 
if (getTeamConfig('oncall')) {
    ?>
<ul id="myTab" class="nav nav-tabs">
    <li class="active"><a href="#week" report="week" data-toggle="tab">Week</a></li>
    <li><a href="#year" report="year" data-toggle="tab">Year</a></li>
</ul>

<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="week"><div id="week-report-container"></div></div>
Exemplo n.º 6
0
                    $html .= formatSearchResults($results, 'report', $term, 3);
                    $html .= printMoreSearchTypeButton('report', $term);
                }
                if ($results = handleSearch('meeting_notes', $term)) {
                    $html .= "<h3>Meeting Notes</h3>";
                    $html .= formatSearchResults($results, 'notes', $term, 2);
                    $html .= printMoreSearchTypeButton('meeting', $term);
                }
                break;
        }
    }
} else {
    $header = "Search";
    $no_search = true;
}
$page_title = getTeamName() . " Weekly Updates - Search results for {$title}";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>

<div class="container">
<h1><?php 
echo $header;
?>
</h1>
<div class="row">
    <div class="span12">
    <?php 
if ($no_search) {
    echo insertNotify("error", "No search term was entered, please enter something to search for. ");
    echo insertNotify("info", "<b>Tips:</b> You can either enter a phrase for a best effort search of weekly reports and on call data, or \n            specific host/service alerts. Click the search box for more information");
Exemplo n.º 7
0
function logline($message)
{
    global $error_log_file;
    $team_name = getTeamName();
    error_log(date("r") . " - {$team_name} - {$message}\n", 3, $error_log_file);
}
Exemplo n.º 8
0
<?php

include_once "phplib/base.php";
$my_username = getUsername();
$page_title = getTeamName() . " Weekly Updates - Edit your profile";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>

<div class="container">
<h1>Edit profile <small>for user <?php 
echo $my_username;
?>
</small></h1>

<?php 
if (!($profile = checkForUserProfile($my_username))) {
    echo insertNotify("info", "Welcome to your profile page! Fill in the data below");
    $profile = null;
} else {
    $sleeptracking_settings = json_decode($profile['sleeptracking_settings'], 1);
}
if (isset($_GET['succ'])) {
    echo insertNotify("success", "Thanks! Your profile details have been saved. ");
}
?>

<div class="row">
    <div class="span12">

        <form method='POST' action='<?php 
 /**
  * Function to translate game dependant terms to a readable format
  * Based on game configs in /configs/games
  *
  * @param $xlrDB string currently
  * @param $item integer team
  * @internal param \currently $xlrDB used xlrstats database
  * @internal param \team $item /weapon/map/event/bodypart
  * @return string translated string as configured in /configs/games/
  */
 public function getItemName($xlrDB, $item)
 {
     //config('/classes/xlrstats.server.inc';
     $XlrServer = new XlrServer();
     $gameName = (string) $XlrServer->serverStatus($xlrDB)->Game->attributes()->Name;
     config('games/' . $gameName . '.php');
     if ($item == 'team') {
         $temp = getTeamName();
     } elseif ($item == 'weapon') {
         $temp = getWeaponName();
     } elseif ($item == 'map') {
         $temp = getMapName();
     } elseif ($item == 'event') {
         $temp = getEventName();
     } elseif ($item == 'bodypart') {
         $temp = getBodypartName();
     } else {
         $temp = __('Undefined Item');
     }
     return $temp;
 }
Exemplo n.º 10
0
<?php

include_once "phplib/base.php";
$time_requested = getOrSetRequestedDate();
$start_end = getWeekRange($time_requested);
$start_ts = $start_end[0];
$end_ts = $start_end[1];
$oncall_period = getOnCallWeekRange($time_requested);
$oncall_start = $oncall_period[0];
$oncall_end = $oncall_period[1];
$list_of_users = getListOfPeopleWithReports();
$team_name = getTeamName();
$page_title = "{$team_name} Weekly Updates";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>

<div class="container">
<h1>Weekly updates week ending <?php 
echo date("l jS F Y", $end_ts);
?>
</h1>
<div class="row">
    <div class="span9">
    <?php 
// Welcome splash screen
if (empty($list_of_users) || !in_array(getUsername(), $list_of_users)) {
    echo "<div class='hero-unit'><h1>Welcome to {$team_name} Weekly!</h1>";
    echo "<p>{$team_name} Weekly allows the {$team_name} team to record and store our weekly updates, as well as categorise and report on ";
    echo "our on call experiences. </p><p>On the {$team_name} team? Get started by adding your first weekly update!</p>";
    echo "<p><a href='{$ROOT_URL}/add.php' class='btn btn-success btn-large'><i class='icon-white icon-plus'></i> Add Yours Now</a></p>";
Exemplo n.º 11
0
<?php

include_once "phplib/base.php";
$time_requested = getOrSetRequestedDate();
$my_username = getUsername();
$start_end = getWeekRange($time_requested);
$start_ts = $start_end[0];
$end_ts = $start_end[1];
$oncall_period = getOnCallWeekRange($time_requested);
$oncall_start = $oncall_period[0];
$oncall_end = $oncall_period[1];
$page_title = getTeamName() . " Weekly Updates - Add new update";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>

<div class="container">
<h1>Update for week ending <?php 
echo date("l jS F Y", $end_ts);
?>
</h2>
<div class="row">
    <div class="span12">
        <?php 
if (getTeamConfig('oncall')) {
    ?>
        <h2>On call report</h2>
        <?php 
    if (isset($_GET['oncall_succ'])) {
        echo insertNotify("success", "Your on call update has been saved successfully");
    }
Exemplo n.º 12
0
if (isset($_POST['btnLogout'])) {
    session_destroy();
    header('Location: login.php');
    die;
}
?>
<html>
    <head>
    <title>Hallo <?php 
echo getTeamName($_SESSION['user_id']);
?>
</title>
    </head>
    <body>
<?php 
echo getTeamName($_SESSION['user_id']);
$books = getBooks($_SESSION['user_id']);
?>
    <form method="post" action="welcome.php">
    <table>
    <tr><td>
    <select name="book">
<?php 
foreach ($books as $book) {
    ?>
    <option>
<?php 
    echo $book['name'];
    ?>
    </option>
<?php 
Exemplo n.º 13
0
<?php

include_once "phplib/base.php";
$user_requested = isset($_POST['username']) ? $_POST['username'] : getUsername();
$page_title = getTeamName() . " Weekly Updates - Updates for {$user_requested}";
include_once 'phplib/header.php';
include_once 'phplib/nav.php';
?>

<div class="container">
<h1>All Weekly Updates <small>for user <?php 
echo $user_requested;
?>
</small></h1>
<div class="row">
    <div class="span9">
    <?php 
$updates = getGenericWeeklyReportsForUser($user_requested);
if (!$updates) {
    echo insertNotify("error", "This user doesn't appear to have any weekly updates!");
} else {
    foreach ($updates as $update) {
        $pretty_time = getPrettyTime($update['timestamp']);
        $ending_date = date("l jS F Y", $update['range_end']);
        echo "<h3>Week ending {$ending_date} <small>written {$pretty_time}</small></h3>";
        echo "<div class='well well-small'><p>{$update['report']}</p></div>";
    }
}
?>
    </div>
Exemplo n.º 14
0
<div class="navbar navbar-inverse navbar-static-top">
 <div class="navbar-inner">
    <div class="container">
      <a class="brand" href="<?php 
echo $ROOT_URL;
?>
/"><?php 
echo getTeamName();
?>
weekly</a>
      <ul class="nav">
        <?php 
printHeaderNav();
?>
      </ul>
      <form class="navbar-search pull-left" action="<?php 
echo $ROOT_URL;
?>
/search.php" method="get">
        <input id="nav-search" type="text" name="query" class="search-query" placeholder="Search Reports and Notifications" value="<?php 
echo $query;
?>
">
        <script>
            $("#nav-search").on("click").popover({
                placement: "bottom",
                trigger: "focus",
                html: true,
                title: "Search Tips",
                content: "Default 'best effort' search, or: </br><small>" 
                    + "<li><b>service: query</b> - Search for alerts by service name</li>"