CSSEL133fix $refresh = (isset($HTTP_POST_VARS['refresh']) ? $HTTP_POST_VARS['refresh'] : 'false'); // <- CSSEL133fix // -> OSC-99 - Gestion des agents commerciaux require(DIR_WS_CLASSES . 'commissions.php'); $commissions = new Commissions(); // <- OSC-99 - Gestion des agents commerciaux $error = false; $processed = false; if (tep_not_null($action)) { switch ($action) { case 'update': $customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']); $customers_firstname = tep_db_prepare_input($HTTP_POST_VARS['customers_firstname']); $customers_lastname = tep_db_prepare_input($HTTP_POST_VARS['customers_lastname']); $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']); $customers_telephone = tep_db_prepare_input($HTTP_POST_VARS['customers_telephone']); $customers_fax = tep_db_prepare_input($HTTP_POST_VARS['customers_fax']); $customers_newsletter = tep_db_prepare_input($HTTP_POST_VARS['customers_newsletter']); $customers_gender = tep_db_prepare_input($HTTP_POST_VARS['customers_gender']); $customers_dob = tep_db_prepare_input($HTTP_POST_VARS['customers_dob']); $coeff_partner = tep_db_prepare_input($HTTP_POST_VARS['coeff_partner']); $is_partner = tep_db_prepare_input($HTTP_POST_VARS['is_partner']); $default_address_id = tep_db_prepare_input($HTTP_POST_VARS['default_address_id']); $entry_street_address = tep_db_prepare_input($HTTP_POST_VARS['entry_street_address']); $entry_suburb = tep_db_prepare_input($HTTP_POST_VARS['entry_suburb']); $entry_postcode = tep_db_prepare_input($HTTP_POST_VARS['entry_postcode']); $entry_city = tep_db_prepare_input($HTTP_POST_VARS['entry_city']); $entry_country_id = tep_db_prepare_input($HTTP_POST_VARS['entry_country_id']); $entry_company = tep_db_prepare_input($HTTP_POST_VARS['entry_company']); // -> TVAINT $entry_tva_intracom = tep_db_prepare_input($HTTP_POST_VARS['entry_tva_intracom']); // <- TVAINT // -> OSC-98 - Gestion RIB/IBAN $customers_rib_iban = tep_db_prepare_input($HTTP_POST_VARS['customers_rib_iban']); // <- OSC-98 - Gestion RIB/IBAN // -> OSC-78: Gestion de catégories réservées aux professionnels // On nettoie (au besoin) le contenu de la variable qui va servir à définir le groupe du client: PRO/Particulier // html_radio_field_customers_group_id = attribut 'name' du CHAMP radio html. $html_radio_field_customers_group_id = tep_db_prepare_input($HTTP_POST_VARS['html_radio_field_customers_group_id']); // <- OSC-78: Gestion de catégories réservées aux professionnels // -> OSC-99 - Gestion des agents commerciaux if ( tep_db_prepare_input($HTTP_POST_VARS['is_commercial']) == '1' ) { $is_commercial = 1; } else { $is_commercial = 0; } $commercials_id = tep_db_prepare_input($HTTP_POST_VARS['commercials_id']); // <- OSC-99 - Gestion des agents commerciaux $entry_state = tep_db_prepare_input($HTTP_POST_VARS['entry_state']); // -> CSSEL133fix if (isset($HTTP_POST_VARS['entry_zone_id'])) { $entry_zone_id = tep_db_prepare_input($HTTP_POST_VARS['entry_zone_id']); } else { $entry_zone_id = 0; } if ($refresh != 'true') { // <- CSSEL133fix if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) { $error = true; $entry_firstname_error = true; } else { $entry_firstname_error = false; } if (strlen($customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) { $error = true; $entry_lastname_error = true; } else { $entry_lastname_error = false; } if (ACCOUNT_DOB == 'true') { if (checkdate(substr(tep_date_raw($customers_dob), 4, 2), substr(tep_date_raw($customers_dob), 6, 2), substr(tep_date_raw($customers_dob), 0, 4))) { $entry_date_of_birth_error = false; } else { $error = true; $entry_date_of_birth_error = true; } } if (strlen($customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { $error = true; $entry_email_address_error = true; } else { $entry_email_address_error = false; } // -> TVAINT if (ACCOUNT_COMPANY == 'true') { if ( (strlen($entry_company) != 0) && (strlen($entry_company) < ENTRY_COMPANY_MIN_LENGTH) ) { $error = true; $entry_company_error = true; } else { $entry_company_error = false; } if ( ENTRY_TVA_INTRACOM_CHECK == 'true') { if (strlen($entry_tva_intracom) != 0) { // Begin update for TVA_INTRACOM_v3.9 if ($entry_country_id != false) { $country_code_query = tep_db_query("select countries_iso_code_2 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$entry_country_id . "'"); $country_code_value = tep_db_fetch_array($country_code_query); $countries_array = array('countries_iso_code_2' => $country_code_value['countries_iso_code_2']); if ( (array_search($countries_array['countries_iso_code_2'], array_keys(tep_get_tva_intracom_array())) === false) || ($countries_array['countries_iso_code_2'] != substr(strtoupper(trim($entry_tva_intracom)),0,2)) ) { $error = true; $entry_tva_intracom_error = 'true'; } else { $entry_tva_intracom_error = 'false'; } } // End update for TVA_INTRACOM_v3.9 $result_tva = tep_verif_tva(strtoupper(rtrim($tva_intracom))); if ($result_tva == 'false') { $error = true; $entry_tva_intracom_error = 'true'; } elseif ($result_tva == 'no_verif') { $error = true; $entry_tva_intracom_error = 'no_verif'; } else { //$entry_tva_intracom_error = 'false'; // Begin update for TVA_INTRACOM_v3.9 if ($entry_tva_intracom_error != 'true') { $entry_tva_intracom_error = 'false'; } // End update for TVA_INTRACOM_v3.9 } } } else { if ( (strlen($entry_tva_intracom) != 0) && (strlen($entry_tva_intracom) < ENTRY_TVA_INTRACOM_MIN_LENGTH) ) { $error = true; $entry_tva_intracom_error = 'true'; } else { $entry_tva_intracom_error = 'false'; } } } // <- TVAINT if (!tep_validate_email($customers_email_address)) { $error = true; $entry_email_address_check_error = true; } else { $entry_email_address_check_error = false; } if (strlen($entry_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) { $error = true; $entry_street_address_error = true; } else { $entry_street_address_error = false; } if (strlen($entry_postcode) < ENTRY_POSTCODE_MIN_LENGTH) { $error = true; $entry_post_code_error = true; } else { $entry_post_code_error = false; } if (strlen($entry_city) < ENTRY_CITY_MIN_LENGTH) { $error = true; $entry_city_error = true; } else { $entry_city_error = false; } if ($entry_country_id == false) { $error = true; $entry_country_error = true; } else { $entry_country_error = false; } if (ACCOUNT_STATE == 'true') { if ($entry_country_error == true) { $entry_state_error = true; } else { $zone_id = 0; $entry_state_error = false; $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "'"); $check_value = tep_db_fetch_array($check_query); $entry_state_has_zones = ($check_value['total'] > 0); if ($entry_state_has_zones == true) { $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry_country_id . "' and zone_name = '" . tep_db_input($entry_state) . "'"); if (tep_db_num_rows($zone_query) == 1) { $zone_values = tep_db_fetch_array($zone_query); $entry_zone_id = $zone_values['zone_id']; } else { $error = true; $entry_state_error = true; } } else { if ($entry_state == false) { $error = true; $entry_state_error = true; } } } } if (strlen($customers_telephone) < ENTRY_TELEPHONE_MIN_LENGTH) { $error = true; $entry_telephone_error = true; } else { $entry_telephone_error = false; } $check_email = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "' and customers_id != '" . (int)$customers_id . "'"); if (tep_db_num_rows($check_email)) { $error = true; $entry_email_address_exists = true; } else { $entry_email_address_exists = false; } // -> CSSEL133fix } // End if (!$refresh) if (($error == false) && ($refresh != 'true')) { // <- CSSEL133fix $sql_data_array = array('customers_firstname' => $customers_firstname, 'customers_lastname' => $customers_lastname, 'customers_email_address' => $customers_email_address, 'customers_telephone' => $customers_telephone, 'customers_fax' => $customers_fax, 'customers_newsletter' => $customers_newsletter); // -> OSC-99 - Gestion des agents commerciaux $sql_data_array['is_commercial'] = $is_commercial; // <- OSC-99 - Gestion des agents commerciaux $sql_data_array['coeff_partner'] = $coeff_partner; // -> OSC-99 - Gestion des partenaires $sql_data_array['is_partner'] = $is_partner; // <- OSC-99 - Gestion des partenaire if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $customers_gender; if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($customers_dob); tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "'"); tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customers_id . "'"); if ($entry_zone_id > 0) $entry_state = ''; $sql_data_array = array('entry_firstname' => $customers_firstname, 'entry_lastname' => $customers_lastname, 'entry_street_address' => $entry_street_address, 'entry_postcode' => $entry_postcode, 'entry_city' => $entry_city, 'entry_country_id' => $entry_country_id); if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $entry_company; // -> TVAINT if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_tva_intracom'] = $entry_tva_intracom; // <- TVAINT if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $entry_suburb; if (ACCOUNT_STATE == 'true') { if ($entry_zone_id > 0) { $sql_data_array['entry_zone_id'] = $entry_zone_id; $sql_data_array['entry_state'] = ''; } else { $sql_data_array['entry_zone_id'] = '0'; $sql_data_array['entry_state'] = $entry_state; } } tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'"); // -> OSC-78: Gestion de catégories réservées aux professionnels // Si le compte du client représente une société // (ceci est visiblement quelque chose qui peut être vérifié si un NOM a été donné au champ représentant le nom de la société), on ajoutait anciennement // un élément au tableau sql // Ce tableau sql est un mécanisme mis en place par OSCommerce afin de gérer à la volée toutes les informations d'un coup. // Cependant, le $sql_data_array est utilisé dans la table address_book surtout. // customers_group_id = champ sql UNIQUEMENT de la table customers pas address_book. // Si placé en dessous de TVAINT, cela provoquerait une erreur sql de champ inexistant (-logique car on a décidé que le champ customers_group_id n'existe pas dans cette table) // Donc, ici, on va juste faire un update à part. if (ACCOUNT_COMPANY == 'true') { // Ancienne action: $sql_data_array['customers_group_id'] = $html_radio_field_customers_group_id; // Nouvelle action: on ne met à jour que le champ customers_group_id pour le client ayant l'id $customers_id, dans la table customers. // A noter, la constante TABLE_CUSTOMERS n'est pas disponible ici. tep_db_query("UPDATE customers SET customers_group_id=" . (int)$html_radio_field_customers_group_id . " WHERE customers_id='" . (int)$customers_id . "'"); } // <- OSC-78: Gestion de catégories réservées aux professionnels // -> OSC-98 - Gestion RIB/IBAN tep_db_query("UPDATE customers SET customers_rib_iban='" . $customers_rib_iban . "' WHERE customers_id='" . (int)$customers_id . "'"); // <- OSC-98 - Gestion RIB/IBAN // -> OSC-99 - Gestion des agents commerciaux foreach($HTTP_POST_VARS['commissions_configuration_customer'] as $id => $commissions_configuration_customer) { $commissions_configuration_delete = tep_db_prepare_input($HTTP_POST_VARS['commissions_configuration_delete'][$id]); echo "commissions_configuration_delete=$commissions_configuration_delete"; if ( $commissions_configuration_delete == 'y' ) { echo "delete"; $commissions->deleteCommissionsConfiguration($id); } else { $commissions_configuration_value = trim(tep_db_prepare_input($HTTP_POST_VARS['commissions_configuration_value'][$id])); if ( $commissions_configuration_value != "" ) { if ( $id == "new" ) { $commissions->insertCommissionsConfiguration($customers_id, $commissions_configuration_customer, $commissions_configuration_value); } else { $commissions->updateCommissionsConfiguration($id, $customers_id, $commissions_configuration_customer, $commissions_configuration_value); } } } } if ( $commercial_selected == "" ) $commercials_id = "NULL"; else $commercials_id = $commercial_selected; tep_db_query("UPDATE customers SET commercials_id=" . $commercials_id . " WHERE customers_id='" . (int)$customers_id . "'"); // <- OSC-99 - Gestion des agents commerciaux tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id)); } else if ($error == true) { $cInfo = new objectInfo($HTTP_POST_VARS); $processed = true; // -> CSSEL133fix } else if ($refresh == 'true') { $cInfo = new objectInfo($HTTP_POST_VARS); } // <- CSSEL133fix break; case 'deleteconfirm': $customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']); if (isset($HTTP_POST_VARS['delete_reviews']) && ($HTTP_POST_VARS['delete_reviews'] == 'on')) { $reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'"); while ($reviews = tep_db_fetch_array($reviews_query)) { tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews['reviews_id'] . "'"); } tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'"); } else { tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . (int)$customers_id . "'"); } tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customers_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customers_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customers_id . "'"); tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$customers_id . "'"); tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')))); break; default: // -> OSC-98 - Gestion RIB/IBAN // -> OSC-99 - Gestion des agents commerciaux // -> TVAINT $customers_query = tep_db_query("select c.customers_id, c.customers_rib_iban, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, c.entry_tva_intracom, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_default_address_id, c.commercials_id, c.is_commercial, c.is_partner, c.coeff_partner from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'"); // <- TVAINT // <- OSC-99 - Gestion des agents commerciaux // <- OSC-98 - Gestion RIB/IBAN $customers = tep_db_fetch_array($customers_query); $cInfo = new objectInfo($customers); } } ?> > <?php echo TITLE; ?> CSSEL133fix if ($refresh == 'true') { $entry_state = ''; $cInfo->entry_state = ''; } // <- CSSEL133fix if ($action == 'edit' || $action == 'update') { ?>
'1', 'text' => ENTRY_NEWSLETTER_YES), array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO)); ?> customers_default_address_id); ?> CSSEL133fix */ ?> OSC-99 - Gestion des agents commerciaux ?> .
OSC-98 - Gestion RIB/IBAN ?> OSC-99 - Gestion des agents commerciaux ?>
customers_gender) . '  ' . MALE . '  ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '  ' . FEMALE . ' ' . ENTRY_GENDER_ERROR; } else { echo ($cInfo->customers_gender == 'm') ? MALE : FEMALE; echo tep_draw_hidden_field('customers_gender'); } } else { echo tep_draw_radio_field('customers_gender', 'm', false, $cInfo->customers_gender) . '  ' . MALE . '  ' . tep_draw_radio_field('customers_gender', 'f', false, $cInfo->customers_gender) . '  ' . FEMALE; } ?>
customers_firstname, 'maxlength="32"') . ' ' . ENTRY_FIRST_NAME_ERROR; } else { echo $cInfo->customers_firstname . tep_draw_hidden_field('customers_firstname'); } } else { echo tep_draw_input_field('customers_firstname', $cInfo->customers_firstname, 'maxlength="32"', true); } ?>
customers_lastname, 'maxlength="32"') . ' ' . ENTRY_LAST_NAME_ERROR; } else { echo $cInfo->customers_lastname . tep_draw_hidden_field('customers_lastname'); } } else { echo tep_draw_input_field('customers_lastname', $cInfo->customers_lastname, 'maxlength="32"', true); } ?>
customers_dob), 'maxlength="10"') . ' ' . ENTRY_DATE_OF_BIRTH_ERROR; } else { echo $cInfo->customers_dob . tep_draw_hidden_field('customers_dob'); } } else { echo tep_draw_input_field('customers_dob', tep_date_short($cInfo->customers_dob), 'maxlength="10"', true); } ?>
customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR; } elseif ($entry_email_address_check_error == true) { echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_CHECK_ERROR; } elseif ($entry_email_address_exists == true) { echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"') . ' ' . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS; } else { echo $customers_email_address . tep_draw_hidden_field('customers_email_address'); } } else { echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"', true); } ?>
customers_rib_iban, 'size="64", maxlength="64"');?>
retrieveAllCommercialsAsDropDown(); $commercial_selected = $cInfo->commercials_id; echo tep_draw_pull_down_menu('commercial_selected', $commercials_array, $commercial_selected,'');?>
entry_company, 'maxlength="32"') . ' ' . ENTRY_COMPANY_ERROR; } else { echo $cInfo->entry_company . tep_draw_hidden_field('entry_company'); } } else { echo tep_draw_input_field('entry_company', $cInfo->entry_company, 'maxlength="32"'); } ?>
entry_tva_intracom, 'maxlength="32"') . ' ' . ENTRY_CONTROL_TVA_INTRACOM ; } if ($entry_tva_intracom_error == 'no_verif') { echo tep_draw_input_field('entry_tva_intracom', '', 'maxlength="32"') . ' ' . ENTRY_NO_VERIF_TVA_INTRACOM; } if ($entry_tva_intracom_error == 'false') { echo $cInfo->entry_tva_intracom . tep_draw_hidden_field('entry_tva_intracom'); } } else { echo tep_draw_input_field('entry_tva_intracom', $cInfo->entry_tva_intracom, 'maxlength="32"'); } } else { if ($error == true) { if ($entry_tva_intracom_error == 'true') { echo tep_draw_input_field('entry_tva_intracom', $cInfo->entry_tva_intracom, 'maxlength="32"') . ' ' . ENTRY_TVA_INTRACOM_ERROR; } else { echo $cInfo->entry_tva_intracom . tep_draw_hidden_field('entry_tva_intracom'); } } else { echo tep_draw_input_field('entry_tva_intracom', $cInfo->entry_tva_intracom, 'maxlength="32"'); } } ?>
VDVOISIN: gestion des voisins if ($error == true) { if ($entry_street_address_error == true) { echo tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="100" size="80"') . ' ' . ENTRY_STREET_ADDRESS_ERROR; } else { echo $cInfo->entry_street_address . tep_draw_hidden_field('entry_street_address'); } } else { echo tep_draw_input_field('entry_street_address', $cInfo->entry_street_address, 'maxlength="100" size="80"', true); } // <- VDVOISIN ?>
VDVOISIN: gestion des voisins if ($error == true) { if ($entry_suburb_error == true) { echo tep_draw_input_field('suburb', $cInfo->entry_suburb, 'maxlength="100" size="80"') . ' ' . ENTRY_SUBURB_ERROR; } else { echo $cInfo->entry_suburb . tep_draw_hidden_field('entry_suburb'); } } else { echo tep_draw_input_field('entry_suburb', $cInfo->entry_suburb, 'maxlength="100" size="80"'); // <- VDVOISIN } ?>
entry_postcode, 'maxlength="8"') . ' ' . ENTRY_POST_CODE_ERROR; } else { echo $cInfo->entry_postcode . tep_draw_hidden_field('entry_postcode'); } } else { echo tep_draw_input_field('entry_postcode', $cInfo->entry_postcode, 'maxlength="8"', true); } ?>
entry_city, 'maxlength="32"') . ' ' . ENTRY_CITY_ERROR; } else { echo $cInfo->entry_city . tep_draw_hidden_field('entry_city'); } } else { echo tep_draw_input_field('entry_city', $cInfo->entry_city, 'maxlength="32"', true); } ?>
CSSEL133fix $entry_state = tep_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state); $zones_array = array(); $zones_query = tep_db_query("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$cInfo->entry_country_id . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']); } if (count($zones_array) > 0) { echo tep_draw_pull_down_menu('entry_zone_id', $zones_array, $cInfo->entry_zone_id); echo tep_draw_hidden_field('entry_state', ''); } else { echo tep_draw_input_field('entry_state', $entry_state); } // <- CSSEL133fix ?>
CSSEL133fix echo css_get_country_list('entry_country_id', $cInfo->entry_country_id,'onChange="return refresh_form(customers);"'); // <- CSSEL133fix ?>
customers_telephone, 'maxlength="32"') . ' ' . ENTRY_TELEPHONE_NUMBER_ERROR; } else { echo $cInfo->customers_telephone . tep_draw_hidden_field('customers_telephone'); } } else { echo tep_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"', true); } ?>
customers_fax . tep_draw_hidden_field('customers_fax'); } else { echo tep_draw_input_field('customers_fax', $cInfo->customers_fax, 'maxlength="32"'); } ?>
customers_newsletter == '1') { echo ENTRY_NEWSLETTER_YES; } else { echo ENTRY_NEWSLETTER_NO; } echo tep_draw_hidden_field('customers_newsletter'); } else { echo tep_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0')); } ?>
retrieveCommissionsConfiguration($cInfo->customers_id); $allcid = $all[$cInfo->customers_id]; $allcid['new'] = array('id' => 'new'); foreach ($allcid as $commission) { $id = $commission['id']; ?>
is_commercial == "1")?true:false); ?>
retrieveAllCommercialCustomersAsDropDown($cInfo->customers_id, $extra_id=$commission['customers_id']); $commercial_selected = $commission['customers_id']; echo tep_get_infobulle('client:', 'Commission pour un client en particulier ou pour les autres') . tep_draw_pull_down_menu('commissions_configuration_customer[' . $id . ']', $commercial_customers_array, $commission['customers_id'], '') . '  ' . tep_get_infobulle('montant:','montant fixe ou pourcentage du total HT de la commande.
Exemple:
- "10" pour un montant de 10€ par commande
- "10%" pour un montant de 10% sur le montant HT de la commande') . '  ' . tep_draw_input_field('commissions_configuration_value[' . $id . ']', $commission['value'], 'size="15"'); if ( $id != 'new' ) echo '  ' . tep_draw_checkbox_field('commissions_configuration_delete[' . $id . ']', 'y', false) . "supprimer"; ?>
.
OSC-99 - Gestion des Partenaires---------------------------------------------------- ?>
is_partner == "1")?true:false); ?>
coeff_partner, 'maxlength="32"'); echo utf8_decode("Attention: Coeff x1 : prix d'achat = prix coûtant+ tva" ); ?>
' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
OSC-99 - Gestion des agents commerciaux ?>
'' . TEXT_INFO_HEADING_DELETE_CUSTOMER . ''); $contents = array('form' => tep_draw_form('customers', FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_DELETE_INTRO . '

' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . ''); if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0) $contents[] = array('text' => '
' . tep_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews)); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (isset($cInfo) && is_object($cInfo)) { $heading[] = array('text' => '' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . ''); // -> MANORM155 // -> OSC-99 - Gestion des agents commerciaux $contents[] = array('align' => 'center', 'text' => tep_button("Editer", tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit')) . '  ' . tep_button('Supprimer', tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm')) . '  ' . tep_button('Email', tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address))); $contents[] = array('align' => 'center', 'text' => tep_button('Commandes', tep_href_link(FILENAME_ORDERS, 'cID=' . $cInfo->customers_id)) . '  ' . tep_button('Nouvelle Commande', tep_href_link(FILENAME_CREATE_ORDER, 'Customer='. $cInfo->customers_id))); if ( $cInfo->is_commercial == '1' ) { $contents[] = array('align' => 'center', 'text' => tep_button('Commissions', tep_href_link(FILENAME_COMMISSIONS, 'cID=' . $cInfo->customers_id))); } // <- MANORM155 // <- OSC-99 - Gestion des agents commerciaux $contents[] = array('text' => '
' . TEXT_DATE_ACCOUNT_CREATED . ' ' . tep_date_short($cInfo->date_account_created)); $contents[] = array('text' => '
' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->date_account_last_modified)); $contents[] = array('text' => '
' . TEXT_INFO_DATE_LAST_LOGON . ' ' . tep_date_short($cInfo->date_last_logon)); $contents[] = array('text' => '
' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $cInfo->number_of_logons); $contents[] = array('text' => '
' . TEXT_INFO_COUNTRY . ' ' . $cInfo->countries_name); $contents[] = array('text' => '
' . TEXT_INFO_NUMBER_OF_REVIEWS . ' ' . $cInfo->number_of_reviews); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' ' . "\n"; } ?>
VD : recherche par numéro de client et société également if ( (int)$keywords > 0 ) $search = "where c.customers_id = " . $keywords; else $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%' or a.entry_company like '%" . $keywords. "%'"; // <- VD } // -> OSC-99 - Gestion des agents commerciaux if (isset($HTTP_GET_VARS['search_commercial']) && tep_not_null($HTTP_GET_VARS['search_commercial']) && $HTTP_GET_VARS['search_commercial']=='Y') { if ( $search != "" ) $search .= " and "; else $search = "where "; $search .= "c.is_commercial = 1"; } // -> VD : tri des clients par numero de commande $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.is_commercial, a.entry_country_id, a.entry_company from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_id desc"; // <- VD // <- OSC-99 - Gestion des agents commerciaux $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows); $customers_query = tep_db_query($customers_query_raw); while ($customers = tep_db_fetch_array($customers_query)) { $info_query = tep_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'"); $info = tep_db_fetch_array($info_query); if ((!isset($HTTP_GET_VARS['cID']) || (isset($HTTP_GET_VARS['cID']) && ($HTTP_GET_VARS['cID'] == $customers['customers_id']))) && !isset($cInfo)) { $country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$customers['entry_country_id'] . "'"); $country = tep_db_fetch_array($country_query); if (!$country) { $country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '73'"); $country = tep_db_fetch_array($country_query); } $reviews_query = tep_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers['customers_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); $customer_info = array_merge($country, $info, $reviews); $cInfo_array = array_merge($customers, $customer_info); $cInfo = new objectInfo($cInfo_array); } if (isset($cInfo) && is_object($cInfo) && ($customers['customers_id'] == $cInfo->customers_id)) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?>
Société  
customers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?> display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?>
' . tep_image_button('button_reset.gif', IMAGE_RESET) . ''; ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '