visuddhinanda 5 лет назад
Родитель
Сommit
5d69bd2a27
3 измененных файлов с 25 добавлено и 5 удалено
  1. 3 3
      app/course/index.php
  2. 20 0
      app/course/my_course_edit.php
  3. 2 2
      app/course/my_course_update.php

+ 3 - 3
app/course/index.php

@@ -73,7 +73,7 @@ include "../pcdl/html_head.php";
 	</script>
 	<div class="course_block">	
 		<div class="title" >
-		连载中
+		<?php echo $_local->gui->in_progress; ?>
 		</div>
 		<div id="course_list_ongoing">
 		</div >
@@ -81,7 +81,7 @@ include "../pcdl/html_head.php";
 
 	<div class="course_block">	
 		<div class="title" >
-		已完结
+		<?php echo $_local->gui->already_over; ?>
 		</div>
 		<div id="course_list_complete">
 		</div >
@@ -113,7 +113,7 @@ include "../pcdl/html_head.php";
 			if(iterator.status==40){
 				html_complete += html;
 			}
-			else if(iterator.status==30){
+			else if(iterator.status==30 || iterator.status==20 ){
 				html_ongoing += html;
 			}
         }

+ 20 - 0
app/course/my_course_edit.php

@@ -114,6 +114,26 @@ echo '<div id="userfilelist">';
     echo '<div style="flex:8;"><input type="input" name = "attachment" value="'.$course_info["attachment"].'" /></div>';
     echo '</div>';
 
+    echo '<div style="display:flex;">';
+    echo '<div style="flex:2;">Status</div>';
+    echo '<div style="flex:8;">';
+    $arrStatus = array(array("id"=>0,"string"=>"deleted"),
+                       array("id"=>20,"string"=>$_local->gui->not_started),
+                       array("id"=>30,"string"=>$_local->gui->in_progress),
+                       array("id"=>40,"string"=>$_local->gui->already_over));
+    echo "<select name = 'status'>";
+    foreach ($arrStatus as $key => $value) {
+        # code...
+
+        echo "<option ";
+        if((int)$course_info["status"]==$value["id"]){
+            echo " selected ";
+        }        
+        echo " value='{$value["id"]}'>{$value["string"]}</option>";
+    }
+    echo "</select>";
+    echo '</div>';
+    echo '</div>';
 echo '</div>';
 ?>
 

+ 2 - 2
app/course/my_course_update.php

@@ -6,10 +6,10 @@ require_once '../public/function.php';
 global $PDO;
 PDO_Connect("sqlite:"._FILE_DB_COURSE_);
 
-$query="UPDATE course SET  title = ? , subtitle = ? ,  summary = ? , teacher = ?  , tag = ?  , lang = ?  , attachment = ? , receive_time = ?  , modify_time = ?   where  id = ?  ";
+$query="UPDATE course SET  title = ? , subtitle = ? ,  summary = ? , teacher = ?  , tag = ?  , lang = ?  , attachment = ? , status = ? , receive_time = ?  , modify_time = ?   where  id = ?  ";
 $sth = $PDO->prepare($query);
 
-$sth->execute(array( $_POST["title"] , $_POST["subtitle"] ,  $_POST["summary"] ,   $_POST["teacher"]  ,  $_POST["tag"] ,  $_POST["lang"] , $_POST["attachment"] , mTime() , mTime() , $_POST["course"]));
+$sth->execute(array( $_POST["title"] , $_POST["subtitle"] ,  $_POST["summary"] ,   $_POST["teacher"]  ,  $_POST["tag"] ,  $_POST["lang"] , $_POST["attachment"] ,$_POST["status"] , mTime() , mTime() , $_POST["course"]));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();