Example #1
0
	$.ajax({
		url: "<?php 
echo url::createURL(["api", "strtotime"]);
?>
?value="+$("#ende").val()
	}).done(function(res) {
		ende = res;
		check(start, ende);
	});
});
function check(start, ende)
{
	if(start!=0 && ende != 0)
	{
		$.getJSON("<?php 
echo url::createURL(["api", "hastime"]);
?>
?start="+start+"&ende="+ende, function (data) {
			console.log(data);
			$("#check").show();
			if(data["status"]==1)
			{
				$("#result").html("<h1 style='color:green;'>Hat Zeit</h1>");
			}
			else {
				$("#result").html("<h1 style='color:red;'>Hat keine Zeit</h1>");
				$("#result").append("Da sind Termine in folgenden Kalendern:<br>")
				$.each(data["detais"], function(key, value){
					if(value==0)
					{
						$("#result").append("<b>"+key+"</b><br>");
Example #2
0
">Logout</a></center>
				<?php 
}
?>
				!-->
				<!--
				<center>
					<a href="https://github.com/sspssp/opencalendar"><img src="http://www.aha.io/assets/integration_logos/github-bb449e0ffbacbcb7f9c703db85b1cf0b.png" height="100"></a>
				</center>
				!-->
			</div>
<?php 
include __DIR__ . "/../../layout/bottom.php";
?>
	<script src="<?php 
echo url::createURL(["ical", "event.js", $name]);
?>
"></script>
	<script>
	$(document).ready(function() {

    // page is now ready, initialize the calendar...

    var date = new Date();
			var d = date.getDate();
			var m = date.getMonth();
			var y = date.getFullYear();

    $('#calendar').fullCalendar({
    	events: eventList,
    	firstDay: 1,
Example #3
0
<?php

include __DIR__ . "/../../layout/top.php";
?>
<link href="<?php 
echo url::createURL(["bower", "leaflet", "dist", "leaflet.css"]);
?>
" rel="stylesheet" />
<script src='<?php 
echo url::createURL(["bower", "leaflet", "dist", "leaflet.js"]);
?>
'></script>
<div class="row">
	<div class="col-md-3"></div>
	<div class="col-md-6">
		<h1><?php 
echo $event["SUMMARY"];
?>
</h1>
		<?php 
if ($img != NULL) {
    ?>
		<div class="headline" style="width:100%;overflow:hidden;max-height:300px;">
		<div style=""><img src="<?php 
    echo $img;
    ?>
" style="width:100%;margin-top:-100px;"></div>
		</div>
		<?php 
}
?>
Example #4
0
	<div class="col-md-3"></div>
	<div class="col-md-6">
		<form method="post">
			<h1>Friend</h1>
			<h3>Name</h3>
			<p>Name of your Friend</p>
			<input name="name" class="form-control" value="<?php 
if (isset($friend["name"])) {
    echo $friend["name"];
}
?>
">
			<h3>API-URL</h3>
			<p>API-URL from your friend</p>
			<input name="url" class="form-control"  value="<?php 
if (isset($friend["url"])) {
    echo $friend["url"];
}
?>
">
			<br><br>
			<input type="submit" class="btn btn-success" value="Save">
			<a href="<?php 
echo url::createURL(["admin", "calendar"]);
?>
" class="btn btn-danger">Exit</a>
		</form>
	</div>
</div>
<?php 
include __DIR__ . "/../../layout/bottom.php";
Example #5
0
        $exists = false;
        $googleLink = NULL;
        foreach ($app->icals["ical"] as $ical) {
            if ($ical["name"] == $name) {
                $exists = true;
                if (isset($ical["publicGoogleLink"])) {
                    $googleLink = $ical["publicGoogleLink"];
                }
            }
        }
        if (!$exists) {
            $app->render("dontExist.php");
            $app->stop(404);
        }
        $app->render("public.php", ["name" => $name, "googleLink" => $googleLink, "calender" => $app->icals["ical"]]);
    });
    $app->post("/login", function () use($app) {
        $name = $app->request->params("name");
        $pass = $app->request->params("pass");
        foreach ($app->user as $user) {
            if ($user["name"] == $name && $user["pass"] == hash("sha512", $pass)) {
                $_SESSION["login"] = true;
            }
        }
        $app->redirect(url::createURL(["public"]));
    });
    $app->get("/logout", function () use($app) {
        $_SESSION["login"] = false;
        $app->redirect(url::createURL(["public"]));
    });
});
Example #6
0
		</li>
      </ul>
	<?php 
} else {
    ?>
      <ul class="nav navbar-nav navbar-right">
		<li class="dropdown">
		<a href="#" class="dropdown-toggle <?php 
    if (isset($page) && $page == "calendar") {
        echo 'active';
    }
    ?>
" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-sign-in"></i> Login</a>
			<div class="dropdown-menu" style="min-width:400px;">
				<form  style="padding:10px;" method="post" action="<?php 
    echo url::createURL(["login"]);
    ?>
">
					<input name="name" class="form-control" placeholder="Username"><br>
					<input name="pass" type="password" class="form-control" placeholder="Password"><br>
					<input type="submit" value="Login" class="btn btn-success" style="width:100%">
				</form>
			</div>
		</li>
      </ul>
	<?php 
}
?>
    </div>
  </div>
</nav>
Example #7
0
<?php

include __DIR__ . "/../../layout/top.php";
?>
<div class="row">
	<div class="col-md-12">
		<h1>API</h1>
		The API-Endpoint is:<br>
		<input class="form-control" value="<?php 
echo url::createURL(["api"]);
?>
" disabled>
		<h3>Has Time</h3>
		Check if a the owner of the openCalender has time:<br>
		<h4>Endpoint (GET)</h4>
		<input class="form-control" value="/hastime" disabled>
		<h4>Params</h4>
		<li><b>start</b> UNIX Timestamp</li>
		<li><b>ende</b> UNIWX Timestamp</li>

		<h4>Return</h4>
		<li><b>status</b> 1 if the owener has time, 0 if not</li>
		<li><b>detais</b> List of Calenders and a status for each Calender</li>
		<li><b>dates</b> <i>optional</i> Return a list of Entrys in the same time of the Request per Calender</li>
		<pre>
{
	"status":0,
	"detais":
	{
		"soeren":"0",
		"work":1
Example #8
0
     $friends = $app->friends;
     $friends[$name]["name"] = $app->request->params("name");
     $friends[$name]["url"] = $app->request->params("url");
     file_put_contents(__DIR__ . "/../../config/friends.json", json_encode($friends));
     echo "OK … Please Wait …";
     echo '<script>setTimeout("window.location.href=\'' . url::createURL(["admin", "friends"]) . '\';", 2000);</script>';
 });
 $app->get("/friends/:name/rm", function ($name) use($app) {
     $public = 0;
     $friends = $app->friends;
     if (isset($friends[$name])) {
         unset($friends[$name]);
     }
     file_put_contents(__DIR__ . "/../../config/friends.json", json_encode($friends));
     echo "OK … Please Wait …";
     echo '<script>setTimeout("window.location.href=\'' . url::createURL(["admin", "friends"]) . '\';", 2000);</script>';
 });
 $app->get("/find", function () use($app) {
     $app->render("admin/find.php");
 });
 $app->post("/find", function () use($app) {
     $curl = new curl();
     $start = strtotime($app->request->params("start"));
     $ende = strtotime($app->request->params("ende"));
     $results = [];
     foreach ($app->friends as $key => $friend) {
         $res = $curl->get($friend["url"] . "/hastime?start=" . $start . "&ende=" . $ende);
         $details = json_decode($res->body, true);
         $result = ["name" => $friend["name"], "key" => $key, "status" => $details["status"]];
         $results[] = $result;
     }
Example #9
0
     #public
     #$title = "Event";
     #var_dump($event);
     $tags = [];
     if (isset($event["DESCRIPTION"]) && strpos(strtolower($event['DESCRIPTION']), strtolower("#public")) !== false) {
         $tags[] = "public";
     } elseif (isset($event["DESCRIPTION"]) && strpos(strtolower($event['DESCRIPTION']), strtolower("#location")) !== false) {
         $tags[] = "location";
     } elseif (isset($event["DESCRIPTION"]) && strpos(strtolower($event['DESCRIPTION']), strtolower("#privat")) !== false) {
         $tags[] = "private";
     }
     $eventDetails->setTags($tags);
     if (isset($event['LOCATION']) && !empty($event['LOCATION'])) {
         $eventDetails->setLocation($event['LOCATION']);
     }
     $eventDetails->setURL(url::createURL(["calendar", "event", $name, $event['UID']]));
     /*if(!$privat)
     		{
     			$aneventJS = '{ title: "'.$title.'", url: "'.url::createURL(["calendar", "event", $name, $event['UID']]).'", start: new Date('.date("Y", $start).', '.(date("n", $start)-1).', '.date("j", $start).', '.date("H", $start).', '.date("i", $start).',  '.date("s", $start).'), end: new Date('.date("Y", $ende).', '.(date("n", $ende)-1).', '.date("j", $ende).', '.date("H", $ende).', '.date("i", $ende).',  '.date("s", $ende).') },';
     			$js .= $eventJS;
     			$anjs .= $aneventJS;
     		}
     		*/
     $eventDetails->setColor("#3a87ad");
     $eventjs->addEvent($eventDetails);
 }
 #$js .= "]";
 #$anjs .= "]";
 #exit();
 if (isset($_SESSION["login"]) && $_SESSION["login"] == true) {
     echo $eventjs->getCode(false);
Example #10
0
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">New Friend</h4>
      </div>
      <div class="modal-body">
		<p>Key: (better only lower case letters a-z)</p>
        <input class="form-control" id="newName">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary" id="createNew">Save changes</button>
      </div>
    </div>
  </div>
</div>
<?php 
include __DIR__ . "/../../layout/bottom.php";
?>
<script>
$("#createNew").click(function () {
	window.location.href="<?php 
echo url::createURL(["admin", "friends"]);
?>
/"+$("#newName").val();
});
</script>
Example #11
0
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand bname" href="#">Projekte</a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
      <ul class="nav navbar-nav">
		<li><a class="blink" href="<?php 
echo url::createURL([""]);
?>
"><i class="fa fa-link"></i> Link1</a></li>
		<li><a class="blink" href="<?php 
echo url::createURL([""]);
?>
"><i class="fa fa-share"></i> Link2</a></li>
		<li><a class="blink" href="<?php 
echo url::createURL([""]);
?>
"><i class="fa fa-archive"></i> Link3</a></li>
      </ul>
    </div>
  </div>
</nav>

<div class="container-fluid">
	<div class="container-fluid" style="padding-top:90px;">