function action_update() { $userid = required_param('userid', PARAM_INT); $insid = required_param('association_id', PARAM_INT); $clsid = required_param('id', PARAM_INT); $users = cm_get_param('users', array()); $uid = $userid; $user = current($users); $insrecord = array(); $insrecord['id'] = $insid; $insrecord['classid'] = $clsid; $insrecord['userid'] = $uid; $startyear = $user['startyear']; $startmonth = $user['startmonth']; $startday = $user['startday']; $insrecord['assigntime'] = mktime(0, 0, 0, $startmonth, $startday, $startyear); $endyear = $user['endyear']; $endmonth = $user['endmonth']; $endday = $user['endday']; $insrecord['completetime'] = mktime(0, 0, 0, $endmonth, $endday, $endyear); $ins = new instructor($insrecord); if (($status = $ins->data_update_record()) !== true) { echo cm_error('Record not updated. Reason: ' . $status->message); } $this->action_default(); }