Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. function velosurance_quote_multistep_auto_create_bikes($type, $bikes, $obj) {
  2.   $type = strtolower($type);
  3.   $total = 0;
  4.  
  5.   foreach ($bikes as $bike) {
  6.     $total += $bike['current_value'];
  7.   }
  8.  
  9.   foreach ($bikes as $bike) {
  10.     $usage = $bike['bike_usage'];
  11.  
  12.     if ($total > 2000 && $obj->owner->form_values['memberships'] == 'usa-triathlon') {
  13.       $usage = 'fitness';
  14.     }
  15.    
  16.     $specials = array(
  17.       'liability_limit' => $obj->coverages->form_values['liability_limit'],
  18.       'vehicle_contact_protection' => $obj->coverages->form_values['vehicle_contact_protection'],
  19.       'medical_payments' => $obj->coverages->form_values['medical_payments'],
  20.       'personal_insurance' => $obj->owner->form_values['personal_insurance']
  21.     );
  22.    
  23.     $node = velosurance_quote_multistep_auto_create_bike($type, $bike, $usage, $specials);
  24.     $bike_nids[]['nid'] = $node->nid;
  25.   }
  26.   return $bike_nids;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement