This commit is contained in:
罗松柏 2021-03-04 15:13:03 +08:00
commit c7590ad0bc
2 changed files with 15 additions and 13 deletions

View File

@ -300,16 +300,16 @@ if(!isn(r('myqeroles'))){
</p> </p>
</form> </form>
<!--延期评论权限--> <!--延期评论权限-->
<h3>延期评论权限?</h3> <!--<h3>延期评论权限?</h3>-->
<form name="form1" method="post" action=""> <!--<form name="form1" method="post" action="">-->
<p>每行一个</p> <!-- <p>每行一个</p>-->
<p> <!-- <p>-->
<textarea name="yqeroles" id="yqeroles" cols="45" rows="5" style="width:90%;height:300px;"><?=implode("\n",$YQEROLES)?></textarea> <!-- <textarea name="yqeroles" id="yqeroles" cols="45" rows="5" style="width:90%;height:300px;">--><?//=implode("\n",$YQEROLES)?><!--</textarea>-->
</p> <!-- </p>-->
<p> <!-- <p>-->
<input type="submit" name="myqeroles" id="button" value="提交"> <!-- <input type="submit" name="myqeroles" id="button" value="提交">-->
</p> <!-- </p>-->
</form> <!--</form>-->
<p>&nbsp;</p> <p>&nbsp;</p>
</body> </body>
</html> </html>

View File

@ -201,20 +201,22 @@ if ($act == 'newevent') {
we('1'); we('1');
} else if ($act == 'edityanqi') { } else if ($act == 'edityanqi') {
$id = r('id'); $id = r('id');
$idx = r('idx'); $idx = (int)r('idx');
$del = r('del'); $del = r('del');
$content = stripslashes(r('content')); $content = stripslashes(r('content'));
$dict = array(); $dict = array();
$event = DB::getone("select yanqi_history from calendar where id={$id}"); $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) { if(!$del) {
$yanqi_history[$idx]['reason'] = $content; $yanqi_history[$idx]['reason'] = $content;
} }
else{ else{
unset($yanqi_history[$idx]); 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}'"); $sql = DB::update('calendar', $dict, "id='{$id}'");
DB::exe($sql); DB::exe($sql);
we('1'); we('1');