You are here

function appointment_calendar_list_delete_form_submit in Appointment Calendar 7

Implements hook_form_submit().

File

./appointment_calendar_delete.inc, line 55
Provides Delete page for selected date if there is no booked slot(s).

Code

function appointment_calendar_list_delete_form_submit($form, &$form_state) {

  // Delete Slot.
  if ($form_state['values']['op'] == t('Yes')) {
    db_delete('appointment_date')
      ->condition('date', $form_state['values']['date'])
      ->execute();
    drupal_set_message(t('Selected Date deleted successfully'));
    drupal_goto(t('admin/config/appointment-calendar/settings/list-date'));
  }

  // Go-to Listing Page.
  if ($form_state['values']['op'] == 'No' || $form_state['values']['op'] == t('Return')) {
    drupal_goto(t('admin/config/appointment-calendar/settings/list-date'));
  }
}