<?php

namespace Drupal\restaurant_bookings\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\restaurant\Form\AppForm;
use Drupal\restaurant\Bookings\Booking;
use Symfony\Component\HttpFoundation\Session\Session;
use Drupal\restaurant\Form\MultipartForm;

/**
* BOOKINGS FORM STEP 1
*/
class AjaxBooking extends MultipartForm {

  /**
   * Returns a unique string identifying the form.
   *
   * The returned ID should be a unique string that can be a valid PHP function
   * name, since it's used in hook implementation names such as
   * hook_form_FORM_ID_alter().
   *
   * @return string
   *   The unique string identifying the form.
   */
  public function getFormId() {
    return 'ajax_booking';
  }

  public function buildForm(array $form, FormStateInterface $form_state)
  {
    /*if ($this->getSetting('requirelogin')) {

      if (! \Drupal::currentUser()->isAuthenticated()) {
        $this->addMessage($this->t('Login required to make a booking'), 'error')->http_redirect('/user/login');
      }
    } */
      
      //$form['#action'] = '/nojs/times';
      
      $form['firstname'] = array(
          '#type' => 'textfield',
          '#description' => $this->t('Customer First Name'),
          '#title' => 'Firstname',
      );
      
      $form['submit'] = array(
          '#type' => 'submit',
          '#value' => $this->t('Select Time'),
          '#attributes' => array('class' => array('edit-button'))
      );
    

    return $form;
  }


  public function submitForm(array &$form, FormStateInterface $form_state)
  {
    
  }




}
