index.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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-bottom: 2em;
  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. </style>
  41. <div class="index_inner" >
  42. <div class="index_list_categories">
  43. <div class="title_bar">
  44. <span class="title h3">老师</span>
  45. <span class="title_more"><a href="../course">更多</a></span>
  46. </div>
  47. <div class="content">
  48. <div id="course_list_new" class="content_inner">
  49. </div>
  50. </div>
  51. </div>
  52. <script>
  53. $.get("../course/teacher_list.php",function(data,status){
  54. let xDiv = document.getElementById("course_list_new");
  55. if(xDiv){
  56. xDiv.innerHTML=data;
  57. }
  58. });
  59. </script>
  60. <div class="card" style="margin:1em;">
  61. 过滤
  62. </div>
  63. <div id="course_list">
  64. </div >
  65. <script>
  66. $.get("../course/course_list.php",function(data,status){
  67. let arrData = JSON.parse(data);
  68. let html="";
  69. for (const iterator of arrData) {
  70. html += '<div class="card" style="display:flex;margin:1em;padding:10px;">';
  71. html += '<div style="flex:7;">';
  72. 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>';
  73. html += '<div class="summary" style="padding-bottom:5px;">'+iterator.subtitle+'</div>';
  74. html += '<div class="summary" style="padding-bottom:5px;">'+iterator.summary+'</div>';
  75. html += '</div>';
  76. html += '<div style="flex:3;max-width:15em;">';
  77. html += '</div>';
  78. html += '</div>';
  79. $("#course_list").html(html);
  80. }
  81. });
  82. </script>
  83. </div>
  84. <?php
  85. include "../pcdl/html_foot.php";
  86. ?>