function printCalendarContents($client)
{
    putTitle('These are you events for ' . getCalendar($client, $_GET['showThisCalendar'])['summary'] . ' calendar:');
    foreach (retrieveEvents($client, $_GET['showThisCalendar']) as $event) {
        print '<div style="font-size:10px;color:grey;">' . date('Y-m-d H:m', strtotime($event['created']));
        putLink('?showThisEvent=' . htmlentities($event['id']) . '&calendarId=' . htmlentities($_GET['showThisCalendar']), $event['summary']);
        print '</div>';
        print '<br>';
    }
}
示例#2
0
function getBlockCode_Results($iBlockID)
{
    $sAction = strip_tags($_GET['action']);
    switch ($sAction) {
        case 'browse':
            $sCode = getProfilesByDate($_GET['date']);
            break;
        default:
            $sCode = getCalendar();
    }
    return $sCode;
}
示例#3
0
function XAJAX_showCalendar($m, $j, $f)
{
    if (empty($m)) {
        $m = date('n');
    }
    if (empty($j)) {
        $j = date('Y');
    }
    $objResponse = new xajaxResponse();
    $content = '<table border="0" cellpadding="1" cellspacing="1" class="border"><tr><td class="Cnorm"><a href="javascript:close' . $f . '();">schliessen</a></td></tr></table>';
    $content .= getCalendar($m, $j, 'javascript:void(0);" onclick="set' . $f . '(\'{jahr}-{mon}-{tag}\')', 'javascript:void(0);" onclick="xajax_XAJAX_showCalendar({mon},{jahr},\'' . $f . '\')', '');
    $objResponse->assign('skalender' . $f, 'style.display', 'block');
    $objResponse->assign('skalender' . $f, 'innerHTML', $content);
    // return object
    return $objResponse;
}
示例#4
0
function getBlogContentForCoverPage()
{
    global $blogid, $blog, $service, $stats, $skinSetting;
    global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry;
    global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList;
    $categories = getCategories($blogid);
    $totalPosts = getEntriesTotalCount($blogid);
    $pd_category = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true);
    $pd_categoryXhtml = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true, true);
    $pd_archive = getArchives($blogid);
    $pd_calendar = getCalendarView(getCalendar($blogid, true));
    $pd_tags = getRandomTags($blogid);
    $pd_notices = getNotices($blogid);
    $pd_recentEntry = getRecentEntries($blogid);
    $pd_recentComment = getRecentComments($blogid);
    $pd_recentTrackback = getRecentTrackbacks($blogid);
    $pd_link = getLinks($blogid);
    $pd_authorList = User::getUserNamesOfBlog($blogid);
}
            }
        }
        $result = $conn->query($sql);
        while ($r = $result->fetch_assoc()) {
            $rows[] = array('data' => $r);
        }
    }
    $conn->close();
    return $rows;
}
if (isset($_GET["action"])) {
    switch ($_GET["action"]) {
        case "search":
            $rows = searchEvent($_GET["criteria"]);
            break;
        case "sort":
            $rows = sortEvent($_GET["criteria"], $_GET["order"]);
            break;
        case "filter":
            $rows = filterEvent($_GET["year"], $_GET["month"], $_GET["target"], $_GET["location"]);
            break;
        case "calendar":
            $rows = getCalendar($_GET["year"], $_GET["month"]);
            break;
    }
    exit(json_encode($rows));
} else {
    $rows = putCSV($_FILES['csv']['tmp_name']);
    header("Location: " . $_SERVER['HTTP_REFERER']);
    exit;
}
示例#6
0
文件: calendar.php 项目: akochnov/fts
if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_GET['origin']) && isset($_GET['destination'])) {
    require_once "../as/aviasales.php";
    $origin = $_GET['origin'];
    $dest = $_GET['destination'];
    $compare = isset($_GET['compare']) ? (100 - $_GET['compare']) / 100 : 0.85;
    echo 'Highlighted <span class="highlighted">' . (1 - $compare) * 100 . '%+</span> below average<br><br>';
    $originIata = getCityCode($origin);
    $destIata = getCityCode($dest);
    $dates = array('2015-09', '2015-10', '2015-11', '2015-12', '2016-01', '2016-02', '2016-03', '2016-03');
    //$dates = array('2016-02');
    echo 'From: ' . $origin . '</br> To: ' . $dest . '</br></br>';
    //Table header
    echo '<table>';
    echo '<tr><th>Date</th><th>Price</th><th>Average</th><th>Transfers</th><th>Return at</th><th>Link</th></tr>';
    foreach ($dates as $date) {
        $calendar = getCalendar($originIata, $destIata, $date);
        $average = getAverage($originIata, $destIata, $date);
        if (array_key_exists('success', $calendar) && $calendar['success'] == 1 && array_key_exists('data', $calendar)) {
            $color = false;
            foreach ($calendar['data'] as $day => $data) {
                if ($color) {
                    echo '<tr class="colored">';
                } else {
                    echo '<tr>';
                }
                $color = !$color;
                $tdHighlited = $data['price'] / $average < $compare ? '<td class="highlighted">' : '<td>';
                $link = getSearchLink($originIata, $destIata, $day, substr($data['return_at'], 0, 10));
                echo '<td>' . $day . '</td>' . $tdHighlited . $data['price'] . '</td>';
                echo '<td>' . round($average) . '</td>';
                echo '<td>' . $data['transfers'] . '</td><td>' . $data['return_at'] . '</td>';
示例#7
0
    echo json_encode($result);
});
$app->post('/huolto', function () {
    $result = updateHuolto($_POST["id"], $_POST["username"], $_POST["password"], $_POST["tekija"], $_POST["pvm"], $_POST["huom"], $_POST["huoltotarve"]);
    echo json_encode($result);
});
$app->post('/kompoedit', function () {
    $result = editKompo($_POST["id"], $_POST["malli"], $_POST["tyyppi"], $_POST["valmistaja"], $_POST["myyja"], $_POST["tarkvali"], $_POST["selite"]);
    echo json_encode($result);
});
$app->get('/getcalendar/:month', function ($month) {
    $result = getCalendar($month);
    echo json_encode($result);
});
$app->get('/getcalendar/:month/pretty', function ($month) {
    $result = getCalendar($month);
    echo "<pre>";
    echo json_encode($result, JSON_PRETTY_PRINT);
    echo "</pre>";
});
$app->get('/daymodal/:date', function ($date) {
    $result = getDayView($date);
    echo json_encode($result);
});
$app->get('/daymodal/:date/pretty', function ($date) {
    $result = getDayView($date);
    echo "<pre>";
    echo json_encode($result, JSON_PRETTY_PRINT);
    echo "</pre>";
});
$app->get('/huoltodata/:huoltoid', function ($huoltoid) {
示例#8
0
$totalPosts = getEntriesTotalCount($blogid);
$categories = getCategories($blogid);
if (preg_match("@\\[##_category_##\\]@iU", $view)) {
    dress('category', getCategoriesView($totalPosts, $categories, isset($category) ? $category : true), $view, false, true);
}
if (preg_match("@\\[##_category_list_##\\]@iU", $view)) {
    dress('category_list', getCategoriesView($totalPosts, $categories, isset($category) ? $category : true, true), $view, false, true);
}
dress('count_total', $stats['total'], $view);
dress('count_today', $stats['today'], $view);
dress('count_yesterday', $stats['yesterday'], $view);
if (preg_match("@\\[##_archive_rep_##\\]@iU", $view)) {
    dress('archive_rep', getArchivesView(getArchives($blogid), $skin->archive), $view, false, true);
}
if (preg_match("@\\[##_calendar_##\\]@iU", $view)) {
    dress('calendar', getCalendarView(getCalendar($blogid, isset($period) ? $period : true)), $view, false, true);
}
if (preg_match("@\\[##_random_tags_##\\]@iU", $view)) {
    dress('random_tags', getRandomTagsView(getRandomTags($blogid), $skin->randomTags), $view, false, true);
}
if (preg_match("@\\[##_rct_notice_##\\]@iU", $view)) {
    $noticeView = getRecentNoticesView(getRecentNotices($blogid), $skin->recentNotice, $skin->recentNoticeItem);
    dress('rct_notice', $noticeView, $view, false, true);
}
if (preg_match("@\\[##_rct_page_##\\]@iU", $view)) {
    $pageView = getRecentPagesView(getPages($blogid), $skin->recentPage, $skin->recentPageItem);
    dress('rct_page', $pageView, $view, false, true);
}
if (preg_match("@\\[##_author_rep_##\\]@iU", $view)) {
    dress('author_rep', getAuthorListView(User::getUserNamesOfBlog($blogid), $skin->authorList), $view, false, true);
}
示例#9
0
文件: weekends.php 项目: akochnov/fts
echo '<table>';
echo '<tr><th>Origin</th><th>Destination</th><th>Date</th><th>Days</th><th>Return at</th><th>Price</th><th>Average</th><th>Link</th></tr>';
$month = '';
foreach ($origins as $origin) {
    foreach ($destinations as $destination) {
        foreach ($weekends as $weekend) {
            foreach (array('Friday', 'Saturday') as $day) {
                //Get IATA codes
                $originIata = getCityCode($origin);
                $destIata = getCityCode($destination['destination_name']);
                if ($originIata && $destIata) {
                    //Define average rate for dest/month
                    $curMonth = date('Y-m', strtotime($weekend['Friday']));
                    if ($month != $curMonth) {
                        $month = $curMonth;
                        $calendar = getCalendar($originIata, $destIata, $curMonth);
                        $average = round(getAverageFromCalendar($calendar));
                    }
                    $cheap = getCheap($originIata, $destIata, $weekend[$day], $weekend['Sunday']);
                    if (array_key_exists('success', $cheap) && true == $cheap['success'] && array_key_exists('data', $cheap) && array_key_exists($destIata, $cheap['data'])) {
                        //loop through variants
                        foreach ($cheap['data'][$destIata] as $variant) {
                            $departure_at = date('Y-m-d H:i', strtotime($variant['departure_at']));
                            $return_at = date('Y-m-d H:i', strtotime($variant['return_at']));
                            $expires_at = $variant['expires_at'];
                            $airline = $variant['airline'];
                            $flight_number = $variant['flight_number'];
                            $price = $variant['price'];
                            $dest = $destination['destination_name'];
                            //Count trip duration
                            $day1 = new DateTime($weekend[$day]);
示例#10
0
<?php

// Insert calendar
if (isset($_POST["formsub"])) {
    $day = $_POST["day"];
    $calendar_id = $_POST['calendar_name'];
    // get holiday list
    $result = getCalendar($calendar_id, $db);
    // get calendar year
    $year = getCalendarYear($calendar_id, $db);
    // check if given year is leap year or not
    if (calLeapYear($year)) {
        $dayspermonth[1] = 29;
    }
    // build holiday list
    for ($c = 0; $c < count($result); $c++) {
        $mm[] = $result[$c]['caltp_month'] . "." . $result[$c]['caltp_day'] . ":" . $result[$c]['caltp_holiday'];
    }
    // loop month
    for ($m = 1; $m <= $month; $m++) {
        // loop days of the month
        for ($d = 1; $d <= $dayspermonth[$m - 1]; $d++) {
            // add holiday
            $event = "nothing special";
            $status = $day == 1 || $day == 2 ? "0" : "1";
            #determind date is 1:saturday or 2:sunday
            // add special holiday
            for ($e = 0; $e < count($mm); $e++) {
                $holidays = explode(":", $mm[$e]);
                if ($holidays[0] == $m . "." . $d) {
                    $status = 0;
示例#11
0
		}
		
		
	}
	
	</style>
</head>
<body>

<div id="wrapper">

<?php 
$startMonth = 8;
$endMonth = 12;
for ($s = $startMonth; $s <= $endMonth; $s++) {
    echo getCalendar($s, '2015');
}
?>

</div>

<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>

$('<div />')
	.append('<p>Width: '+ $(document.body).outerWidth() +' height: '+ $(document.body).outerHeight() +'</p>')
	.prependTo(document.body);
</script>
</body>
</html>
示例#12
0
<?php

#   Copyright by Manuel
#   Support www.ilch.de
defined('main') or die('no direct access');
$m = date('n');
$j = date('Y');
$where1 = mktime(0, 0, 0, $m, 1, $j);
$where2 = mktime(24, 0, 0, $m, date('t', $where1), $j);
$data = array();
$result = db_query('SELECT * 
	FROM prefix_kalender 
	WHERE (time > ' . $where1 . ' AND time < ' . $where2 . ')
		AND ' . $_SESSION['authright'] . ' <= recht
	ORDER BY time LIMIT 50');
while ($row = db_fetch_assoc($result)) {
    $t_id = $row['id'];
    $t_d = date('j', $row['time']);
    $t_m = date('n', $row['time']);
    $t_y = date('Y', $row['time']);
    $date = mktime(0, 0, 0, $t_m, $t_d, $t_y);
    $data[$date][] = $row;
}
echo getCalendar($m, $j, '?kalender-v1-m{mon}-y{jahr}-d{tag}', '?kalender-v0-m{mon}-y{jahr}', $data, 1);
示例#13
0
        }
        //Ganze Liste
    } elseif (isset($data)) {
        $i = 1;
        foreach ($data as $date => $data1) {
            $text = '';
            foreach ($data1 as $info) {
                $text .= '<a href="?kalender-v' . $view . '-e' . $info['id'] . '">' . $info['title'] . '</a>;&nbsp;';
            }
            $aus['LIST_I'] = date('d.m.Y', $date);
            $aus['LIST_D'] = $arr_day[date('w', $date)];
            $aus['LIST_T'] = $text;
            $class = $i % 2 ? 'Cnorm' : 'Cmite';
            $aus['LIST_CLASS'] = $i + 1 == date('j') && $month == date('n') && $year == date('Y') ? 'Cdark' : $class;
            $tpl->set_ar_out($aus, 1);
            unset($aus);
            $i++;
        }
    } else {
        $aus['LIST_I'] = '-';
        $aus['LIST_D'] = '-';
        $aus['LIST_T'] = '-';
        $aus['LIST_CLASS'] = 'Cnorm';
        $tpl->set_ar_out($aus, 1);
        unset($aus);
    }
}
# kalender
$tpl->set('calender', getCalendar($month, $year, 'index.php?kalender-v1-m{mon}-y{jahr}-d{tag}', 'index.php?kalender-v' . $view . '-m{mon}-y{jahr}', $data));
$tpl->out(3);
$design->footer();
示例#14
0
function getAverage($origin, $destination, $departDate)
{
    return getAverageFromCalendar(getCalendar($origin, $destination, $departDate));
}
示例#15
0
include_once "../lib/ini.setting.php";
include_once "ini.config.php";
include_once "ini.dbstring.php";
include_once "ini.functions.php";
sec_session_start();
include_once "mod.login.php";
// check user role and authentication
checkSession($_SESSION['sess_user_role']);
checkLogin("admin", $_SESSION['sess_user_role']);
include_once "mod.admin.php";
include_once "mod.calendar.php";
include_once "ctrl.checklogin.php";
include_once "ctrl.admin.php";
include_once "ctrl.calendar.php";
if (isset($_GET['cid'])) {
    $tmpl = getCalendar($_GET['cid'], $db);
}
?>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Kinntai system</title>
    <link href="<?php 
echo CSS;
?>
/import.css" rel="stylesheet" type="text/css"/>
    <script src="<?php 
echo JS;
?>
/jquery.min.js"></script>
</head>
示例#16
0
        getEvents();
        break;
    case 'add':
        addEvent();
        break;
    case 'update':
        updateEvent();
        break;
    case 'resize':
        resizeEvent();
        break;
    case 'del':
        deleteEvent();
        break;
    case 'get_cal':
        getCalendar();
        break;
    case 'mail_event':
        mailEvent();
        break;
    default:
        break;
}
function addEvent()
{
    global $error;
    $order_id = $_SESSION['order_id'];
    $color = DEFAULT_COLOR;
    $arr_submit = array(array('cal_id', 'int', false, ''), array('color', 'string', false, DEFAULT_COLOR), array('date_end', 'int', false, ''), array('date_start', 'int', false, ''), array('str_date_end', 'string', false, ''), array('str_date_start', 'string', false, ''), array('title', 'string', false, ''), array('allDay', 'bool', false, ''), array('location', 'string', false, ''), array('phone', 'phone', false, ''), array('myurl', 'string', false, ''), array('description', 'string', false, ''), array('cal_type', 'textonly', false, ''), array('interval', 'string', false, ''), array('weekdays', 'string', false, ''), array('monthday', 'textonly', false, ''), array('yearmonthday', 'int', false, ''), array('yearmonth', 'int', false, ''), array('order_id', 'int', false, $order_id));
    $frm_submitted = validate_var($arr_submit);
    $frm_submitted['title'] = stripslashes($frm_submitted['title']);
示例#17
0
    You should have received a copy of the GNU General Public License
    along with Cybermin; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

 2006 Namont Nicolas
 

 include/calendrier.php V0.1
*/
// on verifie si le mois et l'annee existe et sont de type numerique
if (TRUE == isset($_GET["month"]) and TRUE == isset($_GET["year"]) and TRUE == is_numeric($_GET["month"]) and TRUE == is_numeric($_GET["year"])) {
    $month = $_GET["month"];
    $year = $_GET["year"];
    if ($month == 13) {
        $month = 1;
        $year++;
    }
    if ($month == 0) {
        $month = 12;
        $year--;
    }
} else {
    $month = date("n");
    $year = date("Y");
}
$epn = $_SESSION["idepn"];
echo getCalendar($year, $month, $epn);
?>

 private function putCalendarTitle()
 {
     global $client;
     $this->putTitle('These are you events for ' . getCalendar($client, $_GET['showThisCalendar'])['summary'] . ' calendar:');
 }
示例#19
0
    ?>
)"/></li>
                                    <?php 
}
?>
                                </ul>
                            </td>
                        </tr>
                    </table>

                    <table width="100%" border="0" style="border: none" id="bp">
                        <tr style="border: none">
                            <td style="padding-right: 20px; border: none" width="75%">
                                <h4>BP Pemda</h4>
                                <?php 
echo getCalendar($bulan_ini, $tahun_ini, $tanggal_libur_bp_all);
?>
                            </td>
                            <td style="border: none" width="25%">
                                <h4>Libur bulan <?php 
echo $bulan[$bulan_ini];
?>
 (BP Pemda)</h4>
                                <ul class="bullets">
                                    <?php 
foreach ($libur_bp as $libur) {
    ?>
                                    <li><?php 
    echo date("j F Y", strtotime($libur['tanggal']));
    ?>
 - <?php