You are here

function uc_order_search_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_order/uc_order.module \uc_order_search_form()

Form to input search parameters for orders.

See also

uc_order_search_form_submit()

1 string reference to 'uc_order_search_form'
uc_order_usearch in uc_order/uc_order.admin.inc
Displays a search form to browse all received orders.

File

uc_order/uc_order.module, line 899

Code

function uc_order_search_form() {
  $form['search'] = array(
    '#type' => 'fieldset',
    '#title' => t('Search options'),
    '#collapsible' => TRUE,
    '#collapsed' => arg(4) == 'results' ? TRUE : FALSE,
  );
  $form['search']['table1'] = array(
    '#value' => '<table><tbody style="border: 0em;"><tr><td colspan="4">',
  );
  $form['search']['desc'] = array(
    '#value' => '<div>' . t("Search for customers based on any of the following fields.  Use * as a wildcard to match any character.<br />For example, searching by last name for 's*' will return all customers whose last name starts with an s.<br />(<em>Leave a field empty to ignore it in the search.</em>)") . '</div>',
  );
  $form['search']['table2'] = array(
    '#value' => '</td></tr><tr><td>',
  );
  $form['search']['billing_first_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Billing first name'),
    '#default_value' => arg(5) != '0' ? arg(5) : '',
    '#size' => 24,
    '#maxlength' => 32,
  );
  $form['search']['table3'] = array(
    '#value' => '</td><td>',
  );
  $form['search']['billing_last_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Billing last name'),
    '#default_value' => arg(6) != '0' ? arg(6) : '',
    '#size' => 24,
    '#maxlength' => 32,
  );
  $form['search']['table4'] = array(
    '#value' => '</td><td>',
  );
  $form['search']['billing_company'] = array(
    '#type' => 'textfield',
    '#title' => t('Billing company'),
    '#default_value' => arg(7) != '0' ? arg(7) : '',
    '#size' => 24,
    '#maxlength' => 96,
  );
  $form['search']['table5'] = array(
    '#value' => '</td></tr><tr><td>',
  );
  $form['search']['shipping_first_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Shipping first name'),
    '#default_value' => arg(8) != '0' ? arg(8) : '',
    '#size' => 24,
    '#maxlength' => 32,
  );
  $form['search']['table6'] = array(
    '#value' => '</td><td>',
  );
  $form['search']['shipping_last_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Shipping last name'),
    '#default_value' => arg(9) != '0' ? arg(9) : '',
    '#size' => 24,
    '#maxlength' => 32,
  );
  $form['search']['table7'] = array(
    '#value' => '</td><td>',
  );
  $form['search']['shipping_company'] = array(
    '#type' => 'textfield',
    '#title' => t('Shipping company'),
    '#default_value' => arg(10) != '0' ? arg(10) : '',
    '#size' => 24,
    '#maxlength' => 96,
  );
  $form['search']['table8'] = array(
    '#value' => '</td></tr><tr><td>',
  );
  $form['search']['use_dates'] = array(
    '#type' => 'checkbox',
    '#title' => t('Search using date range.'),
    '#description' => t('Specify dates to the right if checked.'),
    '#default_value' => arg(11) != 0 ? 1 : 0,
  );
  $form['search']['table9'] = array(
    '#value' => '</td><td>',
  );
  $timestamp = arg(11) == 0 ? time() : arg(11);
  $form['search']['start_date'] = array(
    '#type' => 'date',
    '#title' => t('Start date'),
    '#default_value' => array(
      'year' => format_date($timestamp, 'custom', 'Y'),
      'month' => format_date($timestamp, 'custom', 'n'),
      'day' => format_date($timestamp, 'custom', 'j'),
    ),
  );
  $form['search']['table10'] = array(
    '#value' => '</td><td>',
  );
  $timestamp = arg(12) == 0 ? time() : arg(12);
  $form['search']['end_date'] = array(
    '#type' => 'date',
    '#title' => t('End date'),
    '#default_value' => array(
      'year' => format_date($timestamp, 'custom', 'Y'),
      'month' => format_date($timestamp, 'custom', 'n'),
      'day' => format_date($timestamp, 'custom', 'j'),
    ),
  );
  $form['search']['table11'] = array(
    '#value' => '</td></tr><tr><td colspan="3">',
  );
  $form['search']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Search'),
  );
  $form['search']['table12'] = array(
    '#value' => '</td></tr></tbody></table>',
  );
  return $form;
}