// ShortCode
add_action( ‘init’, ‘dcms_frm_shortcode’ );
function dcms_frm_shortcode(){
add_shortcode(‘search-form’, ‘dcms_search_form’);
}

function dcms_search_form( $atts , $content ){
global $wpdb;

$search = $_GET[‘search’]??»;
$table_name = ‘customers’;
$field_search1 = ‘customerNumber’;
$field_search2 = ‘customerName’;

if ( $search ){
$sql = «SELECT * FROM {$table_name}
WHERE {$field_search1} = ‘{$search}’ OR $field_search2 LIKE ‘%{$search}%'»;

$items = $wpdb->get_results($sql);
}

?>



NúmeroNombreTelDirecciónPaísCrédito
customerNumber ?>customerName ?>phone ?>addressLine1 ?>city ?>creditLimit ?>

No se encontraron resultados

Scroll al inicio