$value) { $form_sql = "SELECT * FROM `".WPSC_TABLE_CHECKOUT_FORMS."` WHERE `id` = '$value_id' LIMIT 1"; $form_data = $wpdb->get_results($form_sql,ARRAY_A); $form_data = $form_data[0]; $bad_input = false; if($form_data['mandatory'] == 1) { switch($form_data['type']) { case "email": if(!preg_match("/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-.]+\.[a-zA-Z]{2,5}$/",$value)) { $any_bad_inputs = true; $bad_input = true; } break; case "delivery_country": if(($value != null)) { $_SESSION['delivery_country'] == $value; } break; default: break; } if($bad_input === true) { switch($form_data['name']) { case __('First Name', 'wpsc'): $bad_input_message .= __('Please enter a valid name', 'wpsc') . ""; break; case __('Last Name', 'wpsc'): $bad_input_message .= __('Please enter a valid surname', 'wpsc') . ""; break; case __('Email', 'wpsc'): $bad_input_message .= __('Please enter a valid email address', 'wpsc') . ""; break; case __('Address 1', 'wpsc'): case __('Address 2', 'wpsc'): $bad_input_message .= __('Please enter a valid address', 'wpsc') . ""; break; case __('City', 'wpsc'): $bad_input_message .= __('Please enter your town or city.', 'wpsc') . ""; break; case __('Phone', 'wpsc'): $bad_input_message .= __('Please enter a valid phone number', 'wpsc') . ""; break; case __('Country', 'wpsc'): $bad_input_message .= __('Please select your country from the list.', 'wpsc') . ""; break; default: $bad_input_message .= __('Please enter a valid', 'wpsc') . " " . strtolower($form_data['name']) . "."; break; } $bad_input_message .= "
"; } else { $meta_data[$value_id] = $value; } } else { $meta_data[$value_id] = $value; } } $new_meta_data = serialize($meta_data); update_usermeta($user_ID, 'wpshpcrt_usr_profile', $meta_data); } ?>
Purchase History | Your Details | Your Downloads

"; ?>
usermeta."` WHERE `user_id` = '".$user_ID."' AND `meta_key` = 'wpshpcrt_usr_profile';"; $saved_data = $wpdb->get_row($saved_data_sql,ARRAY_A); $meta_data = get_usermeta($user_ID, 'wpshpcrt_usr_profile'); $form_sql = "SELECT * FROM `".WPSC_TABLE_CHECKOUT_FORMS."` WHERE `active` = '1' ORDER BY `order`;"; $form_data = $wpdb->get_results($form_sql,ARRAY_A); foreach($form_data as $form_field) { $meta_data[$form_field['id']] = htmlentities(stripslashes($meta_data[$form_field['id']]), ENT_QUOTES); if($form_field['type'] == 'heading') { echo " \n\r"; } else { if($form_field['type'] == "country") { continue; } echo " \n\r \n\r"; } } ?>
\n\r"; echo "".$form_field['name'].""; echo "
\n\r"; echo $form_field['name']; if($form_field['mandatory'] == 1) { if(!(($form_field['type'] == 'country') || ($form_field['type'] == 'delivery_country'))) { echo "*"; } } echo " \n\r"; switch($form_field['type']) { case "text": case "city": case "delivery_city": echo ""; break; case "address": case "delivery_address": case "textarea": echo ""; break; case "region": case "delivery_region": echo ""; break; case "country": break; case "delivery_country": echo ""; break; case "email": echo ""; break; default: echo ""; break; } echo "
' name='submit' />