$bookingDate をエコーする理由を理解しようとしています。コード内で実行されている echo または print ステートメントがないため、応答コンソールでエコーが発生する理由を理解するのは困難です。この問題の原因を特定できる人が現れることを願っています。
function submitBooking()
{
$outputArray = array('error' => 'yes', 'message' => 'unproccessed');
$outputMsg = '';
// Sets validation rules for the login form
$this->form_validation->set_rules('eventName', 'Event Name',
'is_natural_no_zero');
$this->form_validation->set_rules('label', 'Label',
'is_natural_no_zero');
$this->form_validation->set_rules('bookingDate', 'Booking Date',
'required');
$this->form_validation->set_rules('location', 'Location',
'required');
$this->form_validation->set_rules('arena', 'Arena',
'is_natural_no_zero');
$this->form_validation->set_rules('introduction', 'Introduction',
'required');
// Checks to see if login form was submitted properly
if (!$this->form_validation->run())
{
$outputArray['message'] =
'There was a problem submitting the form! Please refresh the window and try again!';
}
else
{
$bookingDate = $this->input->post('bookingDate');
$bookingDate = date("d-m-Y h:i:s", strtotime($bookingDate));
if ($this->eventsmodel->bookEvent($this->input->post('eventName'), $this->input->post('label'), $bookingDate, $this->input->post('location'), $this->input->post('arena'), $this->input->post('introduction')))
{
$outputArray = array('success' => 'Yes', 'message' =>
'The event was booked successfully!');
}
else
{
$outputArray['message'] =
'The event was not booked! Please try again later!';
}
}
echo json_encode($outputArray);
}