PDA

View Full Version : DOB drop down



bagged89s10
01-22-2004, 09:21 PM
how can i make a drop down for the date of birth field in account create and account edit. i tried to use this contribution



Dropdown menu for dob when create an account. short and easy.

I'll change only one file : /catalog/create_account.php


1. between lines 31 - 34
// if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
// first line
if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS[dob_month] . '/' . $HTTP_POST_VARS[dob_day] . '/' . $HTTP_POST_VARS[dob_year]);
// last line

2. between lines 345 - 372
<!-- <td class="main"><?php echo tep_draw_input_field('dob') . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td> -->
<td class="main">
<?php
// 1. first line

for ($i=1; $i<32; $i++) {
$dob_day[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i));
}

for ($i=1; $i<13; $i++) {
$dob_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
}

$today = getdate();
$first_year = $today['year'] - 77;
$last_year = $today['year'] - 17;
for ($i=$first_year; $i < $last_year; $i++) {
$dob_year[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i));
}


echo tep_draw_pull_down_menu('dob_day', $dob_day);
echo tep_draw_pull_down_menu('dob_month', $dob_month);
echo tep_draw_pull_down_menu('dob_year', $dob_year);

// last line
?>
</td>




but the BTS makes in ms2-max makes the files different and i cannot figure out how to edit this into mine. Any info will help.

thanks