my_lesson_edit.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <script language="javascript" src="../media/img_dlg.js"></script>
  2. <style>
  3. .file_list_block{
  4. width:90%;
  5. }
  6. </style>
  7. <div class="tool_bar">
  8. <?php
  9. require_once "../path.php";
  10. require_once "../public/_pdo.php";
  11. require_once '../media/function.php';
  12. global $PDO;
  13. PDO_Connect("sqlite:"._FILE_DB_COURSE_);
  14. $query = "select * from lesson where id = '{$_GET["lesson"]}' limit 0,1";
  15. $Fetch = PDO_FetchAll($query);
  16. if(count($Fetch)==0)
  17. {
  18. echo "无法找到此课程。可能该课程已经被拥有者删除。";
  19. exit;
  20. }
  21. $lesson_info = $Fetch[0];
  22. $query = "select * from course where id = '{$lesson_info["course_id"]}' limit 0,1";
  23. $Fetch = PDO_FetchAll($query);
  24. if(count($Fetch)==0)
  25. {
  26. echo "无法找到此课程。可能该课程已经被拥有者删除。";
  27. exit;
  28. }
  29. $course_info = $Fetch[0];
  30. echo '<div>';
  31. echo '<a href="../course/my_course_index.php?course='.$course_info["id"].'">'.$course_info["title"].'</a> > '.$lesson_info["title"];
  32. echo '</div>';
  33. echo '<div></div>';
  34. echo '</div>';
  35. $coverList = array();
  36. $coverList[] = $lesson_info["cover"];
  37. $covers = media_get($coverList);
  38. foreach ($covers as $value) {
  39. $cover["{$value["id"]}"] = $value["link"];
  40. }
  41. $coverlink = $cover["{$lesson_info["cover"]}"];
  42. if(substr($coverlink,0,6)=="media:"){
  43. $cover_html = '<div style="width: 20em;"><img src="'._DIR_USER_IMG_LINK_.'/'.substr($coverlink,6).'" width="100%" height="auto"></div>';
  44. }
  45. else{
  46. $cover_html = '<div style="width: 20em;"><img src="'.$coverlink.'" width="50" height="50"></div>';
  47. }
  48. echo '<div style="display:flex;">';
  49. echo '<div style="flex:8;padding:0 0.8em;">';
  50. echo '<form action="../course/my_course_index.php" onsubmit="return lesson_validate_form(this)" method="POST">';
  51. echo '<input type="hidden" name="lesson" value="'.$lesson_info["id"].'" />';
  52. echo '<input type="hidden" name="op" value="update" />';
  53. echo '<div id="userfilelist">';
  54. echo '<div style="display:flex;">';
  55. echo '<div style="flex:2;">'.'标题'.'</div>';
  56. echo '<div style="flex:8;">';
  57. echo '<input type="input" id="form_title" name = "title" value="'.$lesson_info["title"].'" />';
  58. echo '<span id = "error_form_title" ></span>';
  59. echo '</div>';
  60. echo '</div>';
  61. echo '<div style="display:flex;">';
  62. echo '<div style="flex:2;">'.'副标题'.'</div>';
  63. echo '<div style="flex:8;"><input type="input" name = "subtitle" value="'.$lesson_info["subtitle"].'" /></div>';
  64. echo '</div>';
  65. $strDate = date("Y-m-d",$lesson_info["date"]/1000);
  66. $strTime = date("H:i",$lesson_info["date"]/1000);
  67. $strDuration = date("H:i",$lesson_info["duration"]);
  68. echo 'Date: <input type="date" name="lesson_date" value="'.$strDate.'"/>';
  69. echo 'Time: <input type="time" name="lesson_time" value="'.$strTime.'"/>';
  70. echo 'Duration: <input type="time" name="duration" value="'.$strDuration.'"/>';
  71. echo '<div style="display:flex;">';
  72. echo '<div style="flex:2;">'.'直播'.'</div>';
  73. echo '<div style="flex:8;"><textarea name="live" style="height:6em;">'.$lesson_info["live"].'</textarea></div>';
  74. echo '</div>';
  75. echo '<div style="display:flex;">';
  76. echo '<div style="flex:2;">'.'录播'.'</div>';
  77. echo '<div style="flex:8;"><textarea name="replay" style="height:6em;">'.$lesson_info["replay"].'</textarea></div>';
  78. echo '</div>';
  79. echo '<div style="display:flex;">';
  80. echo '<div style="flex:2;">'.'简介'.'</div>';
  81. echo '<div style="flex:8;"><textarea name="summary" style="height:6em;">'.$lesson_info["summary"].'</textarea></div>';
  82. echo '</div>';
  83. echo '<div style="display:flex;">';
  84. echo '<div style="flex:2;">'.'老师'.'</div>';
  85. echo '<div id="teacher_id" style="flex:8;"></div>';
  86. echo '<input id="form_teacher" type="hidden" name="teacher" value="'.$lesson_info["teacher"].'" />';
  87. echo '</div>';
  88. echo '</div>';
  89. ?>
  90. <input type="submit" />
  91. </form>
  92. </div>
  93. <div style="flex:2;border-left: 1px solid var(--tool-line-color);padding-left: 12px;">
  94. <div style="width:100%;padding:4px;">
  95. <?php
  96. echo $lesson_info["link"];
  97. ?>
  98. </div>
  99. <div>创建时间:
  100. <?php
  101. echo strftime("%b-%d-%Y",$lesson_info["create_time"]/1000);
  102. ?>
  103. </div>
  104. <div>修改时间:
  105. <?php
  106. echo strftime("%b-%d-%Y",$lesson_info["modify_time"]/1000);
  107. ?>
  108. </div>
  109. <div>点击:</div>
  110. <div><svg t="1600445373282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2368" width="32" height="32"><path fill="silver" d="M854.00064 412.66688h-275.99872v-35.99872c48-102.00064 35.99872-227.99872 0-288-12.00128-18.00192-35.99872-35.99872-54.00064-35.99872s-35.99872 6.00064-35.99872 54.00064c0 96-6.00064 137.99936-24.00256 179.99872-12.00128 29.99808-77.99808 96-156.00128 120.00256v480c12.00128 6.00064 35.99872 24.00256 54.00064 29.99808 18.00192 12.00128 48 18.00192 60.00128 18.00192h306.00192c77.99808 0 108.00128-29.99808 108.00128-66.00192 0-18.00192 0-29.99808-18.00192-35.99872V796.672c41.99936 0 83.99872-12.00128 83.99872-48 0-29.99808-12.00128-35.99872-18.00192-35.99872v-35.99872h6.00064c24.00256 0 60.00128-35.99872 60.00128-60.00128 0-18.00192-6.00064-35.99872-18.00192-41.99936-6.00064-6.00064-24.00256-6.00064-24.00256-6.00064v-35.99872s12.00128 0 24.00256-12.00128c18.00192-12.00128 18.00192-42.00448 18.00192-42.00448v-12.00128c0-29.99808-48-54.00064-96-54.00064zM67.99872 478.6688l35.99872 408.00256c6.00064 24.00256 24.00256 48 48 48h83.99872c6.00064 0 12.00128-6.00064 18.00192-12.00128s12.00128-6.00064 18.00192-12.00128V412.66688H128c-35.99872 0-60.00128 35.99872-60.00128 66.00192z" p-id="2369"></path></svg></div>
  111. <div>收藏:</div>
  112. </div>
  113. </div>
  114. <script>
  115. name_selector_init("teacher_id",{input_id:"form_teacher"});
  116. img_dlg_init("img_cover",{input_id:"cover_id"});
  117. </script>