Example #1
0
        'credit_card_expiry_year'   => $_POST['credit_card_expiry_year'],
        'notes'                     => $_POST['notes'],
        'custom_field1'             => $_POST['custom_field1'],
        'custom_field2'             => $_POST['custom_field2'],
        'custom_field3'             => $_POST['custom_field3'],
        'custom_field4'             => $_POST['custom_field4'],
        'enabled'                   => $_POST['enabled']
    );
    
    if($_POST['credit_card_number_new'] !='') {
        $customer_data['credit_card_number'] = $_POST['credit_card_number_new'];
    }
    
    // New
    if ($op === "insert_customer") {
        $saved = $SI_CUSTOMERS->insert($customer_data);
    }
    
    // Edit
    if ( $op === 'edit_customer' ) {
        if (isset($_POST['save_customer']) && isset($_GET['id'])) {
            if (is_numeric($_GET['id'])) {
                $saved = $SI_CUSTOMERS->update($customer_data, $_GET['id']);    
            }
        }
    }
}

$smarty -> assign('saved',$saved);
$smarty -> assign('pageActive', 'customer');
$smarty -> assign('active_tab', '#people');