function disp($message, $level)
{
    global $verbosity;
    # Get verbrosity level.
    # If the level of the message is less than the vebrosity level, display the message.
    # If verbrosity level >=3, display the duration
    $message = ($verbosity >= 3 && $level <= $verbosity ? " (" . getDuration($verbosity) . " s) " : "") . ($level <= $verbosity ? $message : "");
    echo empty($message) ? "" : $message . "\n";
    if ($level <= 1) {
        die("\n");
    }
}
        $array_duration = getDuration($activity_step * 60);
        $action_ = "insert_booking";
        $update_status = "";
    } else {
        $booking_action = "Edit booking";
        $sql = "SELECT user_id, book_start, book_end, validated, misc_info ";
        $sql .= "FROM rs_data_bookings ";
        $sql .= "WHERE book_id = " . $_REQUEST["book_id"] . " ";
        $sql .= "AND object_id = " . $_REQUEST["object_id"] . ";";
        $booking = db_query($database_name, $sql, "no", "no");
        $booking_ = fetch_array($booking);
        $booker_id = $booking_["user_id"];
        $start_date = date($date_format, strtotime($booking_["book_start"]));
        $start_hour = date("H:i", strtotime($booking_["book_start"]));
        $misc_info = $booking_["misc_info"];
        $array_duration = getDuration(strtotime($booking_["book_end"]) - strtotime($booking_["book_start"]));
        $action_ = "update_booking";
        if ($booker_id == $_COOKIE["bookings_user_id"] || getObjectInfos($_REQUEST["object_id"], "current_user_is_manager") || $_COOKIE["bookings_profile_id"] == "4") {
            $update_status = "";
        }
    }
    $duration_days = $array_duration["days"];
    $duration_hours = $array_duration["hours"];
    $duration_minutes = $array_duration["minutes"];
    ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>
//default options:
$interval = 5;
$overwrite_image = false;
if (isset($options['interval'])) {
    $interval = $options['$interval'];
}
if (isset($options['overwrite_image'])) {
    $overwrite_image = true;
}
$workingdir = '/video/metavid/raw_mpeg2';
if (isset($options['use_file'])) {
    $filename = $options['use_file'];
} else {
    $filename = $workingdir . '/' . $stream_name . '.mpeg';
}
$duration = getDuration($filename);
//read the timestamp from the .srt
$srt_file = $workingdir . '/' . $stream_name . '.srt';
$srt_ary = file($srt_file);
if ($srt_ary === false) {
    die(' could not find srt file: ' . $srt_file);
}
//time stamp:
$org_start_time = intval(trim(str_replace('starttime', '', $srt_ary[2])));
class streamObject
{
}
$stream = new streamObject();
$stream->name = $stream_name;
$stream->date_start_time = $org_start_time;
$stream->sync_status = 'in_sync';
 public function create()
 {
     $messages = array();
     if (!preg_match('#^[0-9]{2}/[0-9]{2}/[0-9]{4}$#', Input::get('date'))) {
         $messages['date'] = 'La date doit être renseignée';
     }
     if (!preg_match('#^[0-9]{2}:[0-9]{2}$#', Input::get('start'))) {
         $messages['start'] = 'L\'heure de début doit être renseignée';
     }
     if (!preg_match('#^[0-9]{2}:[0-9]{2}$#', Input::get('end'))) {
         $messages['end'] = 'L\'heure de fin doit être renseignée';
     }
     $rooms = Input::get('rooms');
     if (empty($rooms)) {
         $messages['rooms'] = 'La salle doit être renseignée';
     } else {
         //            $start = newDateTime(Input::get('date'), Input::get('start'));
         //            $end = newDateTime(Input::get('date'), Input::get('start'));
         //            $end->modify(sprintf('+%d hours', getDuration(Input::get('start'), Input::get('end'))));
         //
         //            foreach (Input::get('rooms') as $ressource_id) {
         //                'SELECT count(*) FROM booking_item WHERE
         //                  start_at < :start AND DATE_ADD()
         //
         //'
         //            BookingItem::whereRessourceId($ressource_id)
         //                ->where('start_at', '<', $start->format('Y-m-d H:i:s'))
         //                ->where('start_at', '<', $start->format('Y-m-d H:i:s'))
         //                ;
         //            }
     }
     $start_at = newDateTime(Input::get('date'), Input::get('start'));
     if (!Auth::user()->isSuperAdmin() && $start_at->format('Y-m-d H:i:s') < (new \DateTime())->format('Y-m-d H:i:s')) {
         $messages['start'] = 'Vous ne pouvez pas réserver une salle dans le passé';
     }
     if (count($messages)) {
         return Response::json(array('status' => 'KO', 'messages' => $messages));
     }
     $id = Input::get('id');
     $booking_items = array();
     if ($id) {
         $booking_item = BookingItem::whereId($id)->with('booking')->first();
         if (!$booking_item) {
             App::abort(404);
         }
         $booking = $booking_item->booking;
         if (!Auth::user()->isSuperAdmin() && Auth::id() != $booking->user_id) {
             App::abort(403);
         }
         foreach ($booking->items()->where('start_at', '=', $booking_item->start_at)->get() as $item) {
             $booking_items[$item->ressource_id] = $item;
         }
         $is_new = false;
     } else {
         $booking = new Booking();
         $is_new = true;
     }
     $booking->title = Input::get('title');
     $booking->content = Input::get('description');
     if (Auth::user()->isSuperAdmin()) {
         $booking->user_id = Input::get('user_id');
         if (empty($booking->user_id)) {
             $booking->user_id = Auth::id();
         }
     } else {
         $booking->user_id = Auth::id();
     }
     $booking->is_private = Input::get('is_private', false);
     $booking->save();
     $result = array();
     foreach (Input::get('rooms') as $ressource_id) {
         if (isset($booking_items[$ressource_id])) {
             $booking_item = $booking_items[$ressource_id];
             unset($booking_items[$ressource_id]);
         } else {
             $booking_item = new BookingItem();
             $booking_item->booking_id = $booking->id;
             $booking_item->ressource_id = $ressource_id;
         }
         $booking_item->start_at = $start_at;
         $booking_item->duration = getDuration(Input::get('start'), Input::get('end'));
         $booking_item->is_open_to_registration = Input::get('is_open_to_registration', false);
         $booking_item->save();
         $result[] = $booking_item->toJsonEvent();
     }
     foreach ($booking_items as $booking_item) {
         $booking_item->delete();
     }
     try {
         $this->sendNewBookingNotification($booking, $is_new);
     } catch (\Exception $e) {
     }
     return Response::json(array('status' => 'OK', 'events' => $result));
 }
            <tr><td></td><td><input type="submit" value="Upload"></td></tr>
        </table>
    </form>
</table>
<?php 
} else {
    if ($action === 'upload') {
        // Upload
        if (!isset($_POST['key']) || empty($_POST['key']) || !isset($_POST['title']) || empty($_POST['title'])) {
            die("Nothing");
        }
        //File
        //$dirMP3 = 'sound/';
        $target_path = $dirMP3 . "_tmp";
        if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
            $length = getDuration($target_path);
            //Normalize
            normalize($target_path);
            rename($target_path . ".mp3", $target_path);
        } else {
            die('Upload Failed');
        }
        // If Upload ok, save to DB
        $db = DB::getInstance();
        $seq = $db->getNextSeq();
        $key = $_POST['key'];
        $title = $_POST['title'];
        $lastId = $db->insertSound($seq, $key, $title, $length);
        //Delete from DB if file problem
        if (!metadata($target_path, $key, $title, $dirMP3 . $lastId)) {
            $db->delete($lastId);
 //  echo "<div id=loginmessage>$login_message</div>";
 $teacher = $_SESSION['user']['username'];
 $eval_update_url = "<input type=hidden id='evalurl' value='" . $conf['evaluation_url'] . "'>";
 $sqlcommand = "SELECT * FROM speakers WHERE teacher='{$teacher}'";
 $queryres = $db->query($sqlcommand);
 $students = [];
 while ($arr = $queryres->fetcharray()) {
     //print "<pre>";
     //print_r($arr);
     //print "</pre>";
     $speaker = $arr['username'];
     $targetdir = "uploads/{$speaker}/";
     $audiofiles = [];
     foreach (glob("{$targetdir}/*.mp3") as $audiofile) {
         $audioname = str_replace("{$targetdir}/{$speaker}-", "", $audiofile);
         $audiolength = getDuration($audiofile);
         $link = "<audio src=\"{$audiofile}\" controls></audio>";
         array_push($audiofiles, array('name' => $audioname, 'length' => $audiolength, 'link' => $link));
     }
     $arr['samples'] = $audiofiles;
     /* Fluency evaluation */
     $fluency_evaluationform = "<select name='fluency_evaluation' id='fluency_eval_{$speaker}' onChange='updateFluencyEval(\"{$speaker}\");'>" . PHP_EOL;
     if ($arr['fluency_evaluation']) {
         $default = "";
     } else {
         $default = "selected";
     }
     $fluency_evaluationform .= "<option {$default}>Valitse</option>" . PHP_EOL;
     foreach ($conf['grading'] as $grade) {
         if ($arr['fluency_evaluation'] == $grade) {
             $default = "selected";
Exemple #7
0
    ?>
CheckList.php', 'GTD2DoCheckList','scrollbars=yes,resizable=yes,toolbar=no'); w.focus(); return false;" tabindex="4" />
		<!-- Maybe we can integrate the checklists as an optgroup into the tasks dropdown? -->
	</div>
	<div class="TaskInput">
		<h3>Duration (mins)</h3>
		<select name="Duration_Selector" onchange="document.getElementById('Duration').value=this.value;">
			<option value="">Select One</option>
<?php 
    $DurationStr = 'SELECT Duration FROM ' . $DataBase['TablePrefix'] . 'Tasks WHERE UserID=' . $_SESSION['UserID'] . ' AND Duration <> 0 GROUP BY Duration ORDER BY Duration ASC';
    $DurationRes = mysql_query($DurationStr) or die('MySQL Error: ' . mysql_error() . '<br />MySQL Query: ' . $DurationStr . '<br />File: ' . __FILE__ . ' on line: ' . (__LINE__ - 1));
    if ($Debug) {
        $_SESSION['Debug'][] = 'MySQL Query: ' . $DurationStr . '<br />File: ' . __FILE__ . ' on line: ' . __LINE__;
    }
    while ($DurationRow = mysql_fetch_assoc($DurationRes)) {
        $ArrayDates = getDuration($DurationRow['Duration']);
        $DateParsed = FormatDuration($ArrayDates);
        //echo ' value="'.$Dateparsed.'"';
        echo '<option value="' . $DurationRow['Duration'] . '">' . $DateParsed . '</option>';
    }
    ?>
		</select><br />
		<input type="text" id="Duration" name="Duration" tabindex="5" 
			<?php 
    echo ' value="' . $TaskToEditRow['Duration'] . '"';
    ?>
		/>
		<img align="MIDDLE" src="Images/help.jpg" alt="HELP" title="Help" onclick="window.open('InputDates.php?Time='+document.getElementById('Duration').value, 'Date Calulator', 'width=450, height=350')" style="width: 25px; height: 25px;" />
	</div>
	<div class="TaskInput">
		<h3>DateDue (strtotime)</h3>
					<table border="0" cellpadding="0" cellspacing="0" width="760">
						<tr>
							<td valign="top">
								<table border="0" width="456">
									<tr>
										<td width="75">Game time:</td>
										<td><? echo date("H:i", time()); ?></td>
									</tr>
									<tr>
										<td width="75">Tick:</td>
										<td>
										<?
										echo parseInteger(IB_TICK_CURRENT).'/'.parseInteger(IB_TICK_LAST);?> 
										<?
										$s = getNextTickTime();
										if ($s > 0) { echo '(next tick in '.getDuration($s).')'; }
										elseif ((IB_TICK_CURRENT == 0) OR (IB_TICK_CURRENT == IB_TICK_LAST)) { echo '(<font color="red">OFFLINE</font>)'; } 
										else { echo '(Processing...)'; }?>
										</td>
									</tr>
									<tr>
										<td width="75">Rank:</td>
										<td><?php 
echo getPlayerRank($playerdata['id']);
?>
</td> 
									</tr>									
								</table>
							</td>
							<td width="304" valign="top">
								<table border="0" cellpadding="0" cellspacing="0" width="301">
Exemple #9
0
}
?>
<a href="<?= $back_link ?>" class="btn btn-default" role="button">&laquo; Retour</a>

<hr>

<div class="row movie-container">
	<div class="col-xs-12 col-sm-9">
		<div class="media">
			<div class="media-left">
				<img src="<?= getCover($movie['id']) ?>">
			</div>
			<div class="media-body">
				<h2><?= $movie['title'] ?></h2>
				<hr>
				<p><strong>Date de sortie :</strong> <a href="search.php?year=<?= $movie['year'] ?>"><?= $movie['year'] ?></a> (<?= getDuration($movie['runtime']) ?>)</p>
				<p>
					<strong>Genres :</strong>&nbsp;
					<?php
					foreach($genres as $genre) {
						$genre_label = strtolower($genre);
						$genre_name = $movie_genres[$genre_label];
					?>
					<a href="search.php?genre=<?= $genre_label ?>"><?= $genre_name ?></a>,&nbsp;
					<?php } ?>
				</p>
				<p>
					<strong>Acteurs :</strong>&nbsp;
					<?php foreach($actors as $actor) { ?>
					<a href="search.php?actors=<?= $actor ?>"><?= $actor ?></a>,&nbsp;
					<?php } ?>
Exemple #10
0
">
			</div>
			<div class="media-body">
				<h2><?php 
echo $movie['title'];
?>
</h2>
				<hr>
				<p><strong>Date de sortie :</strong> <a href="search.php?year=<?php 
echo $movie['year'];
?>
"><?php 
echo $movie['year'];
?>
</a> (<?php 
echo getDuration($movie['runtime']);
?>
)</p>
				<p>
					<strong>Genres :</strong>&nbsp;
					<?php 
foreach ($genres as $genre) {
    $genre_label = strtolower($genre);
    $genre_name = $movie_genres[$genre_label];
    ?>
					<a href="search.php?genre=<?php 
    echo $genre_label;
    ?>
"><?php 
    echo $genre_name;
    ?>
Exemple #11
0
<?php

include_once realpath('Dates.php');
$Array = getDuration($_GET['Time']);
?>
<script language="JavaScript">
	
	function CalculateMins()
	{
		//minutes in one hour
		var minutesHour = 60;
		//minutes in one day
		 var minutesDay = 1440;
		//minutes in one month
		var minutesMonth = 43200;
		//minutes in one year
		var minutesYear = 518400;
		var years = 0;
		var days = 0;
		var months = 0;
		var hours = 0;
		var minutes = 0;
		var total = 0;
		years = parseInt(document.getElementById("Years").value);
		if (!isNaN(years))
			years = years * minutesYear;
		months = parseInt(document.getElementById("Months").value);
		if (!isNaN(months))
			months = months * minutesMonth;
		days = parseInt(document.getElementById("Days").value);
		if (!isNaN(days))