You are here

function uc_store_customer_search_form in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_store/uc_store.admin.inc \uc_store_customer_search_form()
1 string reference to 'uc_store_customer_search_form'
uc_store_customer_search in uc_store/uc_store.module
Display the customer search page.

File

uc_store/uc_store.module, line 850
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_customer_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: 0px;"><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']['first_name'] = array(
    '#type' => 'textfield',
    '#title' => t('First name'),
    '#default_value' => arg(5) != '0' ? arg(5) : '',
    '#size' => 24,
    '#maxlength' => 32,
  );
  $form['search']['table3'] = array(
    '#value' => '</td><td>',
  );
  $form['search']['last_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Last name'),
    '#default_value' => arg(6) != '0' ? arg(6) : '',
    '#size' => 24,
    '#maxlength' => 32,
  );
  $form['search']['table4'] = array(
    '#value' => '</td><td>',
  );
  $form['search']['email'] = array(
    '#type' => 'textfield',
    '#title' => t('E-mail'),
    '#default_value' => arg(7) != '0' ? arg(7) : '',
    '#size' => 24,
    '#maxlength' => 96,
  );
  $form['search']['table5'] = array(
    '#value' => '</td><td>',
  );
  $form['search']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Search'),
  );
  $form['search']['table6'] = array(
    '#value' => '</td></tr></tbody></table>',
  );
  return $form;
}