Complete date/time split
This commit is contained in:
parent
f3242174d3
commit
6bc25889b8
@ -37,10 +37,9 @@ function filename(){
|
|||||||
<option value="YouTube">YouTube</option>
|
<option value="YouTube">YouTube</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" name="streamkey" placeholder="Stream Key" required title="Enter a string of 0-9, a-z, A-Z, underscore or dash characters" pattern="[a-zA-Z0-9_-]+">
|
<input type="text" name="streamkey" placeholder="Stream Key" required title="Enter a string of 0-9, a-z, A-Z, underscore or dash characters" pattern="[a-zA-Z0-9_-]+">
|
||||||
<!--input type="datetime-local" name="datetime" title="Click on the date to get a popup" required-->
|
|
||||||
<div class="datetime">
|
<div class="datetime">
|
||||||
<input type="date" name="date" title="Click on the date to get a popup" required>
|
<input type="date" name="date" title="Enter the date" required>
|
||||||
<input type="time" name="time" title="Click on the time to get a popup" required></div>
|
<input type="time" name="time" title="Enter the time" required></div>
|
||||||
<input type="email" name="email" placeholder="Email to notify" title="Not required">
|
<input type="email" name="email" placeholder="Email to notify" title="Not required">
|
||||||
<input type="submit" value="Schedule Stream" name="schedule">
|
<input type="submit" value="Schedule Stream" name="schedule">
|
||||||
<p id="response"></p>
|
<p id="response"></p>
|
||||||
|
|||||||
@ -37,6 +37,47 @@ h4 {
|
|||||||
background-color:red;
|
background-color:red;
|
||||||
padding:.9em;
|
padding:.9em;
|
||||||
}
|
}
|
||||||
|
::file-selector-button {
|
||||||
|
-moz-opacity:0;
|
||||||
|
filter:alpha(opacity:0);
|
||||||
|
opacity:0;
|
||||||
|
}
|
||||||
|
.fileinput {
|
||||||
|
position:relative;
|
||||||
|
max-width:fit-content(325px);
|
||||||
|
}
|
||||||
|
#name {
|
||||||
|
padding-top:5px;
|
||||||
|
font-weight:bold;
|
||||||
|
width:100%;
|
||||||
|
text-align:center;
|
||||||
|
white-space:nowrap;
|
||||||
|
overflow:hidden;
|
||||||
|
text-overflow:ellipsis;
|
||||||
|
}
|
||||||
|
input.abs {
|
||||||
|
background-color:#cfc;
|
||||||
|
padding:14px 20px;
|
||||||
|
margin:8px 0;
|
||||||
|
border:1px solid #aaa;
|
||||||
|
border-radius:4px;
|
||||||
|
box-sizing:border-box;
|
||||||
|
cursor:pointer;
|
||||||
|
font-size:16px
|
||||||
|
}
|
||||||
|
.abs {
|
||||||
|
position:absolute;
|
||||||
|
top:0px;
|
||||||
|
left:0px;
|
||||||
|
z-index:1;
|
||||||
|
}
|
||||||
|
#input {
|
||||||
|
position:relative;
|
||||||
|
-moz-opacity:0;
|
||||||
|
filter:alpha(opacity:0);
|
||||||
|
opacity:0;
|
||||||
|
z-index:2;
|
||||||
|
}
|
||||||
input,select {
|
input,select {
|
||||||
background-color:#fff;
|
background-color:#fff;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
@ -75,15 +116,6 @@ input[type=submit] {
|
|||||||
border:none;
|
border:none;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
::file-selector-button {
|
|
||||||
-moz-opacity:0;
|
|
||||||
filter:alpha(opacity:0);
|
|
||||||
opacity:0;
|
|
||||||
}
|
|
||||||
.fileinput {
|
|
||||||
position:relative;
|
|
||||||
max-width:fit-content(325px);
|
|
||||||
}
|
|
||||||
.datetime {
|
.datetime {
|
||||||
display:flex;
|
display:flex;
|
||||||
flex-direction:rows;
|
flex-direction:rows;
|
||||||
@ -100,35 +132,3 @@ input[type=time] {
|
|||||||
padding-left:0;
|
padding-left:0;
|
||||||
padding-right:0;
|
padding-right:0;
|
||||||
}
|
}
|
||||||
#name {
|
|
||||||
padding-top:5px;
|
|
||||||
font-weight:bold;
|
|
||||||
width:100%;
|
|
||||||
text-align:center;
|
|
||||||
white-space:nowrap;
|
|
||||||
overflow:hidden;
|
|
||||||
text-overflow:ellipsis;
|
|
||||||
}
|
|
||||||
input.abs {
|
|
||||||
background-color:#cfc;
|
|
||||||
padding:14px 20px;
|
|
||||||
margin:8px 0;
|
|
||||||
border:1px solid #aaa;
|
|
||||||
border-radius:4px;
|
|
||||||
box-sizing:border-box;
|
|
||||||
cursor:pointer;
|
|
||||||
font-size:16px
|
|
||||||
}
|
|
||||||
.abs {
|
|
||||||
position:absolute;
|
|
||||||
top:0px;
|
|
||||||
left:0px;
|
|
||||||
z-index:1;
|
|
||||||
}
|
|
||||||
#input {
|
|
||||||
position:relative;
|
|
||||||
-moz-opacity:0;
|
|
||||||
filter:alpha(opacity:0);
|
|
||||||
opacity:0;
|
|
||||||
z-index:2;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -23,22 +23,22 @@ foreach($mh as $line){
|
|||||||
}
|
}
|
||||||
$upload=htmlspecialchars(basename($_FILES['file']['name']));
|
$upload=htmlspecialchars(basename($_FILES['file']['name']));
|
||||||
$key=$_POST['streamkey'];
|
$key=$_POST['streamkey'];
|
||||||
$datetime=$_POST['datetime'];
|
$date=$_POST['date'];
|
||||||
|
$time=$_POST['time'];
|
||||||
$email=$_POST['email'];
|
$email=$_POST['email'];
|
||||||
$user=$_SESSION['user'];
|
$user=$_SESSION['user'];
|
||||||
|
$target=$_POST['target'];
|
||||||
if($email){
|
if($email){
|
||||||
$to=$email;
|
$to=$email;
|
||||||
$email=':'.$email;
|
$email=':'.$email;
|
||||||
}else{
|
}else{
|
||||||
$to=$mails[$user];
|
$to=$mails[$user];
|
||||||
}
|
}
|
||||||
$date=substr($datetime, 0, 10);
|
$hour=substr($time, 0, 2);
|
||||||
$hour=substr($datetime, 11, 2);
|
$min=substr($time, 3, 2);
|
||||||
$min=substr($datetime, 14, 2);
|
$tme=$hour.$min;
|
||||||
$time=$hour.$min;
|
|
||||||
$target=$_POST['target'];
|
|
||||||
$dir='streams/';
|
$dir='streams/';
|
||||||
$name=$key.'.'.$date.'_'.$time.'_'.$user.$email.'@'.$target;
|
$name=$key.'.'.$date.'_'.$tme.'_'.$user.$email.'@'.$target;
|
||||||
$file=$dir.$name.'.upload';
|
$file=$dir.$name.'.upload';
|
||||||
print('<!DOCTYPE html>
|
print('<!DOCTYPE html>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
@ -51,15 +51,18 @@ print('<!DOCTYPE html>
|
|||||||
</form></div><div class="container">
|
</form></div><div class="container">
|
||||||
<h1>Encoding</h1>
|
<h1>Encoding</h1>
|
||||||
<p>Uploaded <b>'.$upload.'</b></p>');
|
<p>Uploaded <b>'.$upload.'</b></p>');
|
||||||
if(preg_match('/20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]/', $datetime)===false){
|
if(preg_match('/20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]/', $date)===false){
|
||||||
Back('Date/time somehow incorrect: '.$datetime);
|
Back('Date somehow incorrect: '.$date);
|
||||||
|
}
|
||||||
|
if(preg_match('/[0-2][0-9]:[0-6][0-9]/', $time)===false){
|
||||||
|
Back('Time somehow incorrect: '.$time);
|
||||||
}
|
}
|
||||||
$now=date('Y-m-dHi');
|
$now=date('Y-m-dHi');
|
||||||
if(strcmp($now, $date.$time)>0){
|
if(strcmp($now, $date.$tme)>=0){
|
||||||
Back('Scheduling '.$now.' in the past: '.$date.' '.$time);
|
Back('Scheduling '.$now.' in the past: '.$date.' '.$time);
|
||||||
}
|
}
|
||||||
$nextyear=date('Y-m-dHi', strtotime('+1 year'));
|
$nextyear=date('Y-m-dHi', strtotime('+1 year'));
|
||||||
if(strcmp($nextyear, $date.$time)<0){
|
if(strcmp($nextyear, $date.$tme)<0){
|
||||||
Back('Scheduling too far into the future: '.$date.' '.$time);
|
Back('Scheduling too far into the future: '.$date.' '.$time);
|
||||||
}
|
}
|
||||||
if($_FILES['file']['error']!=UPLOAD_ERR_OK){
|
if($_FILES['file']['error']!=UPLOAD_ERR_OK){
|
||||||
@ -71,5 +74,5 @@ if(!move_uploaded_file($_FILES['file']['tmp_name'], $file)){
|
|||||||
|
|
||||||
print('<p>Streaming <b>'.$name.'.mp4</b></p>');
|
print('<p>Streaming <b>'.$name.'.mp4</b></p>');
|
||||||
print('<p>When done encoding, email <b>'.$to.'</b></p>');
|
print('<p>When done encoding, email <b>'.$to.'</b></p>');
|
||||||
Back('Streaming on <b>'.$date.'</b> at <b>'.$hour.':'.$min.'</b>h on <b>'.$target.'</b>');
|
Back('Streaming on <b>'.$date.'</b> at <b>'.$time.'</b>h on <b>'.$target.'</b>');
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user