PHP Code:
<?php echo zen_draw_form('customers', FILENAME_ADD_CUSTOMERS, zen_get_all_get_params(array('action')) . 'action=add_complete', 'post', 'onsubmit="return check_form(customers);"', true);
echo zen_hide_session_id(); ?>
<td class="formAreaTitle"><?php echo CATEGORY_PERSONAL; ?></td>
</tr>
<tr>
<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<?php
if (ACCOUNT_GENDER == 'true') {
?>
<tr>
<td class="main"><?php echo ENTRY_GENDER; ?></td>
<td class="main">
<?php
if ($error == true && $entry_gender_error == true) {
echo zen_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . ' ' . MALE . ' ' . zen_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . FEMALE . ' ' . ENTRY_GENDER_ERROR;
} else {
echo zen_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . ' ' . MALE . ' ' . zen_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . ' ' . FEMALE;
}
?></td>
</tr>
<?php
}
?>
<?php
$customers_authorization_array = array(array('id' => '0', 'text' => CUSTOMERS_AUTHORIZATION_0),
array('id' => '1', 'text' => CUSTOMERS_AUTHORIZATION_1),
array('id' => '2', 'text' => CUSTOMERS_AUTHORIZATION_2),
array('id' => '3', 'text' => CUSTOMERS_AUTHORIZATION_3)
);
// array('id' => '3', 'text' => CUSTOMERS_AUTHORIZATION_3)
?>
<tr>
<td class="main"><?php echo CUSTOMERS_AUTHORIZATION; ?></td>
<td class="main">
<?php echo zen_draw_pull_down_menu('customers_authorization', $customers_authorization_array, $cInfo->customers_authorization); ?>
</td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_firstname_error == true) {
echo zen_draw_input_field('customers_firstname', $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50)) . ' ' . ENTRY_FIRST_NAME_ERROR;
} else {
echo $cInfo->customers_firstname . zen_draw_hidden_field('customers_firstname');
}
} else {
echo zen_draw_input_field('customers_firstname', $cInfo->customers_firstname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', 50), true);
}
?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_lastname_error == true) {
echo zen_draw_input_field('customers_lastname', $cInfo->customers_lastname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50)) . ' ' . ENTRY_LAST_NAME_ERROR;
} else {
echo $cInfo->customers_lastname . zen_draw_hidden_field('customers_lastname');
}
} else {
echo zen_draw_input_field('customers_lastname', $cInfo->customers_lastname, zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', 50), true);
}
?></td>
</tr>
<?php
if (ACCOUNT_DOB == 'true') {
?>
<tr>
<td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_date_of_birth_error == true) {
echo zen_draw_input_field('customers_dob', ($cInfo->customers_dob == '0001-01-01 00:00:00' ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10"') . ' ' . ENTRY_DATE_OF_BIRTH_ERROR;
} else {
echo $cInfo->customers_dob . ($customers_dob == '0001-01-01 00:00:00' ? 'N/A' : zen_draw_hidden_field('customers_dob'));
}
} else {
echo zen_draw_input_field('customers_dob', ($customers_dob == '0001-01-01 00:00:00' ? '' : zen_date_short($cInfo->customers_dob)), 'maxlength="10"', true);
}
?></td>
</tr>
<?php
}
?>
<tr>
<td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_email_address_error == true) {
echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . ' ' . ENTRY_EMAIL_ADDRESS_ERROR;
} elseif ($entry_email_address_check_error == true) {
echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . ' ' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
} elseif ($entry_email_address_exists == true) {
echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50)) . ' ' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
} else {
echo $customers_email_address . zen_draw_hidden_field('customers_email_address');
}
} else {
echo zen_draw_input_field('customers_email_address', $cInfo->customers_email_address, zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', 50), true);
}
?></td>
</tr>
</table></td>
</tr>
<?php
if (ACCOUNT_COMPANY == 'true') {
?>
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="formAreaTitle"><?php echo CATEGORY_COMPANY; ?></td>
</tr>
<tr>
<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="main"><?php echo ENTRY_COMPANY; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_company_error == true) {
echo zen_draw_input_field('entry_company', $cInfo->entry_company, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50)) . ' ' . ENTRY_COMPANY_ERROR;
} else {
echo $cInfo->entry_company . zen_draw_hidden_field('entry_company');
}
} else {
echo zen_draw_input_field('entry_company', $cInfo->entry_company, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', 50));
}
?></td>
</tr>
</table></td>
</tr>
<?php
}
?>
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="formAreaTitle"><?php echo CATEGORY_ADDRESS; ?></td>
</tr>
<tr>
<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_street_address_error == true) {
echo zen_draw_input_field('entry_street_address', $cInfo->entry_street_address, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50)) . ' ' . ENTRY_STREET_ADDRESS_ERROR;
} else {
echo $cInfo->entry_street_address . zen_draw_hidden_field('entry_street_address');
}
} else {
echo zen_draw_input_field('entry_street_address', $cInfo->entry_street_address, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', 50), true);
}
?></td>
</tr>
<?php
if (ACCOUNT_SUBURB == 'true') {
?>
<tr>
<td class="main"><?php echo ENTRY_SUBURB; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_suburb_error == true) {
echo zen_draw_input_field('suburb', $cInfo->entry_suburb, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50)) . ' ' . ENTRY_SUBURB_ERROR;
} else {
echo $cInfo->entry_suburb . zen_draw_hidden_field('entry_suburb');
}
} else {
echo zen_draw_input_field('entry_suburb', $cInfo->entry_suburb, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', 50));
}
?></td>
</tr>
<?php
}
?>
<tr>
<td class="main"><?php echo ENTRY_CITY; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_city_error == true) {
echo zen_draw_input_field('entry_city', $cInfo->entry_city, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50)) . ' ' . ENTRY_CITY_ERROR;
} else {
echo $cInfo->entry_city . zen_draw_hidden_field('entry_city');
}
} else {
echo zen_draw_input_field('entry_city', $cInfo->entry_city, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', 50), true);
}
?></td>
</tr>
<?php
if (ACCOUNT_STATE == 'true') {
?>
<tr>
<td class="main"><?php echo ENTRY_STATE; ?></td>
<td class="main">
<?php
$entry_state = zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state);
if ($error == true) {
if ($entry_state_error == true) {
if ($entry_state_has_zones == true) {
$zones_array = array();
$zones_values = $db->Execute("select zone_name
from " . TABLE_ZONES . "
where zone_country_id = '" . zen_db_input($cInfo->entry_country_id) . "'
order by zone_name");
while (!$zones_values->EOF) {
$zones_array[] = array('id' => $zones_values->fields['zone_name'], 'text' => $zones_values->fields['zone_name']);
$zones_values->MoveNext();
}
echo zen_draw_pull_down_menu('entry_state', $zones_array) . ' ' . ENTRY_STATE_ERROR;
} else {
echo zen_draw_input_field('entry_state', zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . ' ' . ENTRY_STATE_ERROR;
}
} else {
echo $entry_state . zen_draw_hidden_field('entry_zone_id') . zen_draw_hidden_field('entry_state');
}
} else {
echo zen_draw_input_field('entry_state', zen_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)).'(Full Name)';
}
?></td>
</tr>
<?php
}
?>
<tr>
<td class="main"><?php echo ENTRY_POST_CODE; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_post_code_error == true) {
echo zen_draw_input_field('entry_postcode', $cInfo->entry_postcode, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10)) . ' ' . ENTRY_POST_CODE_ERROR;
} else {
echo $cInfo->entry_postcode . zen_draw_hidden_field('entry_postcode');
}
} else {
echo zen_draw_input_field('entry_postcode', $cInfo->entry_postcode, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', 10), true);
}
?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_country_error == true) {
echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id) . ' ' . ENTRY_COUNTRY_ERROR;
} else {
echo zen_get_country_name($cInfo->entry_country_id) . zen_draw_hidden_field('entry_country_id');
}
} else {
echo zen_draw_pull_down_menu('entry_country_id', zen_get_countries(), $cInfo->entry_country_id);
}
?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="formAreaTitle"><?php echo CATEGORY_CONTACT; ?></td>
</tr>
<tr>
<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
<td class="main">
<?php
if ($error == true) {
if ($entry_telephone_error == true) {
echo zen_draw_input_field('customers_telephone', $cInfo->customers_telephone, zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15)) . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR;
} else {
echo $cInfo->customers_telephone . zen_draw_hidden_field('customers_telephone');
}
} else {
echo zen_draw_input_field('customers_telephone', $cInfo->customers_telephone, zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', 15), true);
}
?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
<td class="main">
<?php
if ($processed == true) {
echo $cInfo->customers_fax . zen_draw_hidden_field('customers_fax');
} else {
echo zen_draw_input_field('customers_fax', $cInfo->customers_fax, zen_set_field_length(TABLE_CUSTOMERS, 'customers_fax', 15));
}
?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="formAreaTitle"><?php echo CATEGORY_OPTIONS; ?></td>
</tr>
<tr>
<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="main"><?php echo ENTRY_EMAIL_PREFERENCE; ?></td>
<td class="main">
<?php
if ($processed == true) {
if ($cInfo->customers_email_format) {
echo $customers_email_format . zen_draw_hidden_field('customers_email_format');
}
} else {
$email_pref_text = ($cInfo->customers_email_format == 'TEXT') ? true : false;
$email_pref_html = !$email_pref_text;
echo zen_draw_radio_field('customers_email_format', 'HTML', $email_pref_html) . ' ' . ENTRY_EMAIL_HTML_DISPLAY . ' ' . zen_draw_radio_field('customers_email_format', 'TEXT', $email_pref_text) . ' ' . ENTRY_EMAIL_TEXT_DISPLAY ;
}
?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
<td class="main">
<?php
if ($processed == true) {
if ($cInfo->customers_newsletter == '1') {
echo ENTRY_NEWSLETTER_YES;
} else {
echo ENTRY_NEWSLETTER_NO;
}
echo zen_draw_hidden_field('customers_newsletter');
} else {
echo zen_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'));
}
?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_PRICING_GROUP; ?></td>
<td class="main">
<?php
if ($processed == true) {
if ($cInfo->customers_group_pricing) {
$group_query = $db->Execute("select group_name, group_percentage from " . TABLE_GROUP_PRICING . " where group_id = '" . $cInfo->customers_group_pricing . "'");
echo $group_query->fields['group_name'].' '.$group_query->fields['group_percentage'].'%';
} else {
echo ENTRY_NONE;
}
echo zen_draw_hidden_field('customers_group_pricing', $cInfo->customers_group_pricing);
} else {
$group_array_query = $db->execute("select group_id, group_name, group_percentage from " . TABLE_GROUP_PRICING);
$group_array[] = array('id'=>0, 'text'=>TEXT_NONE);
while (!$group_array_query->EOF) {
$group_array[] = array('id'=>$group_array_query->fields['group_id'], 'text'=>$group_array_query->fields['group_name'].' '.$group_array_query->fields['group_percentage'].'%');
$group_array_query->MoveNext();
}
echo zen_draw_pull_down_menu('customers_group_pricing', $group_array, $cInfo->customers_group_pricing);
}
?></td>
</tr>
<tr>
<td class="main"><?php echo CUSTOMERS_REFERRAL; ?></td>
<td class="main">
<?php echo zen_draw_input_field('customers_referral', $cInfo->customers_referral, zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15)); ?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="formAreaTitle"><?php echo CATEGORY_EMAIL; ?></td>
</tr>
<tr>
<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="main"><?php echo ENTRY_EMAIL; ?></td>
<td class="main">
<? if(isset($_POST['send_welcome']) || $action=='') { ?>
<input type="checkbox" id="send_welcome" name="send_welcome" value="send" checked />
<? } else { ?>
<input type="checkbox" id="send_welcome" value="send" name="send_welcome" />
<? } ?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td align="right" class="main"><?php echo zen_image_submit('button_insert.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_CUSTOMERS, zen_get_all_get_params(array('action')), 'NONSSL') .'">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
</tr></form>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Bookmarks