$var_month = $date_array[1];
    $var_day = $date_array[2];
    $var_timestamp = $date_array[2] . "-" . $date_array[0] . "-" . $date_array[1];
    //$var_timestamp=$var_month ."/".$var_day ."-".$var_year;
    return $var_timestamp;
    // return it to the user
}
function EnumArg($name, $values)
{
    return isset($_GET[$name]) && array_search($_GET[$name], $values) !== false ? $_GET[$name] : null;
}
function DateArg($name)
{
    return isset($_GET[$name]) ? GetTimeStamp($_GET[$name]) : null;
}
$subject = EnumArg('subject', array('skill', 'team', 'love_within_team', 'love_between_teams', 'most_active_team_members'));
$from_date = DateArg('from_date');
$to_date = DateArg('to_date');
if (!$subject || !$from_date || !$to_date) {
    exit;
}
$res = mysql_query("SELECT usr.company_id FROM " . USERS . " as usr LEFT JOIN " . COMPANY . " as c on c.id=usr.company_id WHERE usr.username ='" . $_SESSION['username'] . "'");
if (!$res) {
    exit;
} else {
    if (!mysql_num_rows($res)) {
        mysql_free_result($res);
        exit;
    }
    $row = mysql_fetch_row($res);
    $company_id = $row[0];
    //$var_timestamp=$var_month ."/".$var_day ."-".$var_year;
    return $var_timestamp;
    // return it to the user
}
function EnumArg($name, $values)
{
    return isset($_GET[$name]) && array_search($_GET[$name], $values) !== false ? $_GET[$name] : null;
}
function DateArg($name)
{
    return isset($_GET[$name]) ? GetTimeStamp($_GET[$name]) : null;
}
$subject = EnumArg('subject', array('skill', 'team', 'love_within_team', 'love_between_teams', 'most_active_team_members'));
$from_date = DateArg('from_date');
$to_date = DateArg('to_date');
$category = EnumArg('category', array('sent', 'received'));
if (!$subject || !$from_date || !$to_date || !$category) {
    exit;
}
$res = mysql_query("SELECT usr.company_id FROM " . USERS . " as usr LEFT JOIN " . COMPANY . " as c on c.id=usr.company_id WHERE usr.username ='" . $_SESSION['username'] . "'");
if (!$res) {
    exit;
} else {
    if (!mysql_num_rows($res)) {
        mysql_free_result($res);
        exit;
    }
    $row = mysql_fetch_row($res);
    $company_id = $row[0];
    mysql_free_result($res);
}