|
@@ -13,10 +13,19 @@ $query = "INSERT INTO lesson (id, course_id, live, replay, title, subtitle ,
|
|
|
VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
|
|
VALUES (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )";
|
|
|
|
|
|
|
|
$sth = $PDO->prepare($query);
|
|
$sth = $PDO->prepare($query);
|
|
|
|
|
+
|
|
|
|
|
+/*
|
|
|
$data = strtotime($_POST["lesson_date"]);
|
|
$data = strtotime($_POST["lesson_date"]);
|
|
|
$time = strtotime($_POST["lesson_time"]) - strtotime("today");
|
|
$time = strtotime($_POST["lesson_time"]) - strtotime("today");
|
|
|
$datatime = ($data+$time)*1000;
|
|
$datatime = ($data+$time)*1000;
|
|
|
$duration = strtotime($_POST["duration"]) - strtotime("today");
|
|
$duration = strtotime($_POST["duration"]) - strtotime("today");
|
|
|
|
|
+*/
|
|
|
|
|
+
|
|
|
|
|
+$data = strtotime($_POST["lesson_date"]);
|
|
|
|
|
+$time = strtotime($_POST["lesson_time"]) - strtotime("today");
|
|
|
|
|
+$timezone = $_POST["lesson_timezone"];
|
|
|
|
|
+$datatime = ($data+$time+$timezone*60)*1000;
|
|
|
|
|
+$duration = strtotime($_POST["duration"]) - strtotime("today");
|
|
|
|
|
|
|
|
$sth->execute(array(UUID::v4(), $_POST["course_id"] , $_POST["live"] , $_POST["replay"] ,$_POST["title"] , $_POST["subtitle"] , $datatime , $duration , $_COOKIE["userid"] , $_POST["tag"] ,$_POST["summary"] , 1, $_POST["cover"] ,$_POST["teacher"] , $_POST["attachment"] , $_POST["lang"] , $_POST["speech_lang"] ,mTime() , mTime() , mTime() ));
|
|
$sth->execute(array(UUID::v4(), $_POST["course_id"] , $_POST["live"] , $_POST["replay"] ,$_POST["title"] , $_POST["subtitle"] , $datatime , $duration , $_COOKIE["userid"] , $_POST["tag"] ,$_POST["summary"] , 1, $_POST["cover"] ,$_POST["teacher"] , $_POST["attachment"] , $_POST["lang"] , $_POST["speech_lang"] ,mTime() , mTime() , mTime() ));
|
|
|
$respond=array("status"=>0,"message"=>"");
|
|
$respond=array("status"=>0,"message"=>"");
|
|
@@ -24,12 +33,11 @@ if (!$sth || ($sth && $sth->errorCode() != 0)) {
|
|
|
$error = PDO_ErrorInfo();
|
|
$error = PDO_ErrorInfo();
|
|
|
$respond['status']=1;
|
|
$respond['status']=1;
|
|
|
$respond['message']=$error[2];
|
|
$respond['message']=$error[2];
|
|
|
- echo "<div style=''>Lesson 数据添加失败:{$error[2]}</div>";
|
|
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
$respond['status']=0;
|
|
$respond['status']=0;
|
|
|
$respond['message']="成功";
|
|
$respond['message']="成功";
|
|
|
- echo "<div style=''>Lesson 数据添加成功</div>";
|
|
|
|
|
|
|
+ $respond['course_id']=$_POST["course_id"];
|
|
|
}
|
|
}
|
|
|
-//echo json_encode($respond, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
|
|
+echo json_encode($respond, JSON_UNESCAPED_UNICODE);
|
|
|
?>
|
|
?>
|