<?php

function search_pages(){

drupal_add_js(array('sURL'=>array('adminSearching'=>url('searching/'))),'setting');
drupal_add_js(drupal_get_path('module','searching').'/searching.js');

 
 $output='<div id="product-search-link" style="position: relative; top: 1px; cursor: pointer;"'
           .'onclick="load_product_search();">'
          . t('Search for an existing product.') .'</div>';
 $output.='<div id="product-select"></div><br/>'
			.drupal_get_form('searching_form');
 
 return $output;
}


function searching_form()
{

/*
 $form['products']=array(
	'#type' => 'fieldset',
    '#title' => t('New Product'),
    '#description' => t('Use the buttons above to have these fields filled.'),
    '#collapsible' => FALSE,
  );*/
//  PRODUCT DETAILS

 $form['productcode']=array(
		'#title'=>'',
		'#type'=>'textfield',
		'#prefix'=>'<table class="formtable"><tr><td class="labeltext">PRODUCT CODE</td><td class="textbox">',
		'#suffix'=>'</td></tr>',
  );


$form['productname']=array(
	'#type'=>'textfield',
	'#title'=>'',
	'#prefix'=>'<tr><td class="labeltext">PRODUCT NAME</td><td class="textbox">',
    '#suffix'=>'</td></tr></table>',
		
   );
   
 
 return $form;
 
 }
 
 
 
 
 
 
 
 

function select_product(){



$output.= drupal_get_form('select_product_form');
print $output;
exit();





}

function select_product_form($form_state){
$form['desc'] = array(
      '#value' =>  t('Search for a product based on these fields.'),
                 
    );

/*	
$form['pcode']=array(
		'#title'=>'',
		'#type'=>'textfield',
	'#prefix'=>'<table class="formtable"><tr><td class="labeltext"> CODE</td><td class="textbox">',
		'#suffix'=>'</td></tr>',
  );
	
$form['pname']=array(
		'#title'=>'',
		'#type'=>'textfield',
	'#prefix'=>'<table class="formtable"><tr><td class="labeltext"> NAME</td><td class="textbox">',
		'#suffix'=>'</td></tr></table>',
  );*/

  
  return $form;
}

