index.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?PHP
  2. include "../pcdl/html_head.php";
  3. ?>
  4. <body>
  5. <?php
  6. require_once("../pcdl/head_bar.php");
  7. ?>
  8. <style>
  9. .content_block{
  10. flex: 0 0 auto;
  11. width: 25%;
  12. padding: 10px;
  13. }
  14. .index_inner{
  15. width: 960px;
  16. margin-left: auto;
  17. margin-right: auto;
  18. }
  19. .content_inner{
  20. display:flex;
  21. }
  22. .h3{
  23. font-size: 16px;
  24. }
  25. .index_list_categories{
  26. margin: 2em 0;
  27. }
  28. .index_list_categories a:hover{
  29. color: var(--tool-link-hover-color);
  30. }
  31. /*.index_list_categories a,a:link{
  32. color: var(--main-color);
  33. }*/
  34. .index_list_categories button{
  35. border: none;
  36. }
  37. .pd-10{
  38. padding:10px;
  39. }
  40. .card li{
  41. white-space: unset;
  42. }
  43. .card code{
  44. white-space: unset;
  45. }
  46. </style>
  47. <div class="index_inner" >
  48. <div class="index_list_categories">
  49. <div class="title_bar">
  50. <span class="title h3"><?php echo $_local->gui->speaker ?></span>
  51. <span class="title_more"><a href="../course"><?php echo $_local->gui->more ?></a></span>
  52. </div>
  53. <div class="content">
  54. <div id="course_list_new" class="content_inner">
  55. </div>
  56. </div>
  57. </div>
  58. <script>
  59. $.get("../course/teacher_list.php",function(data,status){
  60. let xDiv = document.getElementById("course_list_new");
  61. if(xDiv){
  62. xDiv.innerHTML=data;
  63. }
  64. });
  65. </script>
  66. <div class="card" style="margin:1em;">
  67. 过滤
  68. </div>
  69. <div id="course_list">
  70. </div >
  71. <script>
  72. $.get("../course/course_list.php",function(data,status){
  73. let arrData = JSON.parse(data);
  74. let html="";
  75. for (const iterator of arrData) {
  76. html += '<div class="card" style="display:flex;margin:1em;padding:10px;">';
  77. html += '<div style="flex:7;">';
  78. html += '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../course/course.php?id='+iterator.id+'">'+iterator.title+'</a></div>';
  79. html += '<div class="summary" style="padding-bottom:5px;">'+iterator.subtitle+'</div>';
  80. let summary = "";
  81. try{
  82. summary = marked(iterator.summary);
  83. }
  84. catch(e){
  85. }
  86. html += '<div class="summary" style="padding-bottom:5px;">'+summary+'</div>';
  87. html += '</div>';
  88. html += '<div style="flex:3;max-width:15em;">';
  89. html += '</div>';
  90. html += '</div>';
  91. $("#course_list").html(html);
  92. }
  93. });
  94. </script>
  95. </div>
  96. <?php
  97. include "../pcdl/html_foot.php";
  98. ?>