diff --git a/edit.php b/edit.php index c1d2458..cbb7bdc 100644 --- a/edit.php +++ b/edit.php @@ -300,16 +300,16 @@ if(!isn(r('myqeroles'))){

-

延期评论权限?

-
-

每行一个

-

- -

-

- -

-
+ + + + + + + + + +

 

\ No newline at end of file diff --git a/pmcalendar.php b/pmcalendar.php index 7ea71c4..0ff18b1 100644 --- a/pmcalendar.php +++ b/pmcalendar.php @@ -201,20 +201,22 @@ if ($act == 'newevent') { we('1'); } else if ($act == 'edityanqi') { $id = r('id'); - $idx = r('idx'); + $idx = (int)r('idx'); $del = r('del'); $content = stripslashes(r('content')); $dict = array(); $event = DB::getone("select yanqi_history from calendar where id={$id}"); - $yanqi_history = $event['yanqi_history']; + + $yanqi_history = json_decode($event['yanqi_history'],true); if(!$del) { $yanqi_history[$idx]['reason'] = $content; } else{ unset($yanqi_history[$idx]); + $yanqi_history = array_values($yanqi_history); } - $dict['yanqi_history']=json_encode($yanqi_history); + $dict['yanqi_history']=json_encode($yanqi_history,true); $sql = DB::update('calendar', $dict, "id='{$id}'"); DB::exe($sql); we('1');