All pastes #538865 Raw Edit

Gurpartap Singh

public php v1 · immutable
·published 2007-06-05 04:00 UTC
rendered paste body
// take form value and lookup company table for nidfunction companysearch_form_submit($form_id, $form_values) {  if ($form_values['ticker_name'] = 'Ticker ') {  	$results = (db_query("SELECT nid FROM {node_content_company} WHERE field_ticker_value = '%s'", $form_values['company']));	  $row = db_fetch_object($results); 	  if (user_access('create content_company content') && (db_num_rows($results) == 0)) {       drupal_set_message(t('The ticker !name was not found. Please check your entry or add this company to the database below this message.', array('!name' => theme('tick', $form_values['company'] ))));       drupal_goto('node/add/content_company');     }     if (!user_access('create content_company content') && (db_num_rows($results) == 0)) {       drupal_set_message(t('The ticker %name was not found. Please send IRP an email with instructions to add the company to the database.', array('%name' => theme('tick', $form_values['company'] ))));     }     else {	    drupal_goto('node/'.$row->nid);    }  }  else {	  drupal_goto('usernode');  }}