Created
April 25, 2012 14:18
-
-
Save kumarmanish/2490019 to your computer and use it in GitHub Desktop.
doc_retrieval.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$state = (isset($form_state['values']['choose_a_state'])) ? $form_state['values']['choose_a_state'] : $form['choose_a_state']['#default_value']; | |
$service_guid = $this->services[0]->guid; | |
$service_items = sundoc_get_service_items_by_service_id($service_guid); | |
$jurisdiction_prices = sundoc_get_fees_by_service_id_and_state($service_guid, $state); | |
$jurisdiction_prices_new = sundoc_get_service_items_by_service_id_and_state($service_guid, $state); | |
$groups = array(); | |
foreach($service_items as $item) { | |
$matches = array(); | |
//preg_match('/^(.+)-/', $item->description, $matches); | |
$group_label = $item->description; | |
if (!array_key_exists($group_label, $groups)) { | |
$groups[$group_label] = array(); | |
$groups[$group_label]['group_key'] = strtolower(trim(com_create_guid(), '{}')); | |
$groups[$group_label]['data']['service_name'] = $item->description; | |
$groups[$group_label]['data']['guid'] = $item->guid; | |
$groups[$group_label]['data']['service_id'] = $item->service_id; | |
$groups[$group_label]['data']['price'] = $item->price; | |
} | |
} | |
$form['items'] = array( | |
'#type' => 'container', | |
'#tree' => TRUE, | |
//'#theme' => 'sundoc_doc_retrieval_selection', | |
); | |
$form['items']['service_item_type'] = array( | |
'#type' => 'radios', | |
'#options' => array( | |
'standard' => t('Standard'), | |
'rush' => t('Rush'), | |
), | |
); | |
$form['items']['groups'] = array( | |
'#type' => 'container', | |
'#tree' => TRUE, | |
); | |
$qty_options = array(1,2,3,4,5,6,7,8,9,10); | |
foreach($groups as $group_key => $group_data) { | |
$form['items']['groups'][$group_key] = array( | |
'#type' => 'container', | |
'#tree' => TRUE, | |
); | |
$form['items']['groups'][$group_key]['quantity'] = array( | |
'#type' => 'select', | |
'#options' => $qty_options, | |
'#default_value' => (isset($form_state['values']['items']['groups'][$group_key]['quantity'])) ? $form_state['values']['items']['groups'][$group_key]['quantity'] : 1, | |
); | |
$form['items']['groups'][$group_key]['service_name'] = array( | |
'#type' => 'markup', | |
'#markup' => $group_data['data']['service_name'], | |
); | |
$form['items']['groups'][$group_key]['price'] = array( | |
'#type' => 'markup', | |
'#markup' => $group_data['data']['price'], | |
); | |
$form['items']['groups'][$group_key]['sundoc_standard_guid'] = array( | |
'#type' => 'value', | |
'#value' => $group_data['sundoc_standard_guid'], | |
); | |
$form['items']['groups'][$group_key]['sundoc_rush_guid'] = array( | |
'#type' => 'value', | |
'#value' => $group_data['sundoc_rush_guid'], | |
); | |
$form['items']['groups'][$group_key]['state_fee'] = array( | |
'#type' => 'radios', | |
'#options' => array( | |
'plane' => t('Plane'), | |
'certified' => t('Certified'), | |
), | |
); | |
} | |
//Basic info | |
$form['business_name'] = $this->basicTextField('Business Name', NULL, NULL, TRUE); | |
$form['state_identification'] = $this->basicTextField('State Identification (if known)', NULL, NULL, TRUE); | |
$form['entity_type_selection'] = $this->entityDropDown('Entity Type:', NULL, NULL, TRUE); | |
return $form; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment