1
This commit is contained in:
parent
16b7483e81
commit
46146961e6
@ -201,13 +201,20 @@ if ($act == 'newevent') {
|
|||||||
we('1');
|
we('1');
|
||||||
} else if ($act == 'edityanqi') {
|
} else if ($act == 'edityanqi') {
|
||||||
$id = r('id');
|
$id = r('id');
|
||||||
|
$idx = r('idx');
|
||||||
|
$del = r('del');
|
||||||
$content = stripslashes(r('content'));
|
$content = stripslashes(r('content'));
|
||||||
$data_array = json_decode($content,true);
|
$dict = array();
|
||||||
$data_array['date'] =date("Y-m-d H:i:s");
|
$event = DB::getone("select yanqi_history from calendar where id={$id}");
|
||||||
$dict = array(
|
$yanqi_history = $event['yanqi_history'];
|
||||||
'yanqi_remark' => json_encode($data_array)
|
if(!$del) {
|
||||||
);
|
$yanqi_history[$idx]['reason'] = $content;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
unset($yanqi_history[$idx]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$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');
|
||||||
@ -236,7 +243,7 @@ if ($act == 'newevent') {
|
|||||||
if (!$yanqi_history) $yanqi_history = '[]';
|
if (!$yanqi_history) $yanqi_history = '[]';
|
||||||
$yanqi_history = json_decode($yanqi_history,true);
|
$yanqi_history = json_decode($yanqi_history,true);
|
||||||
$isYanqi = strtotime($event['start'])<strtotime($dict['end'])?1:2;
|
$isYanqi = strtotime($event['start'])<strtotime($dict['end'])?1:2;
|
||||||
$yanqi_history[] = array('isYanqi'=>$isYanqi,'date1'=>$event['start'],'date2'=>$dict['end'],'user'=>$user['name'],'reason'=>$reason);
|
array_unshift($yanqi_history,array('isYanqi'=>$isYanqi,'date1'=>$event['start'],'date2'=>$dict['end'],'user'=>$user['name'],'reason'=>$reason));
|
||||||
$dict['yanqi_history']=json_encode($yanqi_history,true);
|
$dict['yanqi_history']=json_encode($yanqi_history,true);
|
||||||
|
|
||||||
$sql = DB::update('calendar', $dict, "id='{$id}'");
|
$sql = DB::update('calendar', $dict, "id='{$id}'");
|
||||||
|
Loading…
Reference in New Issue
Block a user