Warning: Undefined variable $t_os in /home/u977314867/domains/mepexpress.com.br/public_html/wp-content/plugins/mep-frete-system/mep-frete-system-os.php on line 2470

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY criado_em DESC' at line 1]
SELECT * FROM ORDER BY criado_em DESC

šŸ“‹ Painel Administrativo — MeP Express

Token Status Pagador Origem Destino Motoboy Veƭculo Data AƧƵes
// ← FECHA mpx_admin_dashboard /* ================= LOGIN ================= */ if (!empty($_POST['login_email']) && !empty($_POST['login_pass'])) { $email = sanitize_email($_POST['login_email']); $pass = $_POST['login_pass']; $user = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $TABLE WHERE email=%s", $email) ); if ($user && password_verify($pass, $user->password_hash)) { $_SESSION['mpx_admin_logged'] = true; wp_redirect('?mpx_admin=1'); exit; } else { $erro = 'E-mail ou senha invĆ”lidos.'; } } /* ================= RESET DE SENHA ================= */ if (!empty($_POST['reset_email'])) { $email = sanitize_email($_POST['reset_email']); $user = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $TABLE WHERE email=%s", $email) ); if ($user) { $token = wp_generate_password(40, false); $wpdb->update($TABLE, [ 'reset_token' => $token, 'reset_expires' => date('Y-m-d H:i:s', time() + 3600) ], ['id' => $user->id]); $link = add_query_arg([ 'mpx_admin' => 1, 'reset' => $token ], site_url()); wp_mail( $email, 'Redefinição de senha - Painel MeP Express', "Clique no link para redefinir sua senha:\n\n$link\n\nEste link expira em 1 hora." ); $sucesso = 'šŸ“© Link de redefinição enviado para seu e-mail.'; } else { $erro = 'E-mail nĆ£o encontrado.'; } } ?> Painel Administrativo

šŸ” Painel Administrativo


Warning: Undefined variable $erro in /home/u977314867/domains/mepexpress.com.br/public_html/wp-content/plugins/mep-frete-system/mep-frete-system-os.php on line 2649

Warning: Undefined variable $sucesso in /home/u977314867/domains/mepexpress.com.br/public_html/wp-content/plugins/mep-frete-system/mep-frete-system-os.php on line 2650
/* ================= FILTROS ================= */ $f = [ 'token' => sanitize_text_field($_GET['f_token'] ?? ''), 'cpf_cnpj' => sanitize_text_field($_GET['f_cpf_cnpj'] ?? ''), 'pagador' => sanitize_text_field($_GET['f_pagador'] ?? ''), 'remetente' => sanitize_text_field($_GET['f_remetente'] ?? ''), 'destinatario' => sanitize_text_field($_GET['f_destinatario'] ?? ''), 'motoboy' => sanitize_text_field($_GET['f_motoboy'] ?? ''), 'veiculo' => sanitize_text_field($_GET['f_veiculo'] ?? ''), 'status' => sanitize_text_field($_GET['f_status'] ?? ''), 'inicio' => sanitize_text_field($_GET['f_inicio'] ?? ''), 'fim' => sanitize_text_field($_GET['f_fim'] ?? ''), ]; $where = []; $params = []; foreach ($f as $k => $v) { if ($v === '') continue; switch ($k) { case 'token': $where[] = "token LIKE %s"; $params[] = "%$v%"; break; // CPF / CNPJ (campo livre) case 'cpf_cnpj': $where[] = "pag_doc LIKE %s"; $params[] = "%$v%"; break; // PAGADOR case 'pagador': $where[] = "pag_nome LIKE %s"; $params[] = "%$v%"; break; case 'remetente': $where[] = "remetente_nome LIKE %s"; $params[] = "%$v%"; break; case 'destinatario': $where[] = "destinatario_nome LIKE %s"; $params[] = "%$v%"; break; case 'motoboy': $where[] = "motoboy_nome LIKE %s"; $params[] = "%$v%"; break; case 'veiculo': $where[] = "veiculo = %s"; $params[] = $v; break; case 'status': $where[] = "status = %s"; $params[] = $v; break; case 'inicio': $where[] = "DATE(criado_em) >= %s"; $params[] = $v; break; case 'fim': $where[] = "DATE(criado_em) <= %s"; $params[] = $v; break; } } /* ================= EXPORTAƇƃO CSV ================= */ if (isset($_GET['export_csv'])) { header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=relatorio_os_' . date('Y-m-d_H-i') . '.csv'); $out = fopen('php://output', 'w'); fputcsv($out, [ 'Token','Status','Cliente','CPF/CNPJ','Email', 'Origem','Destino','Motoboy','Recebedor', 'Veƭculo','Valor','Data' ], ';'); $sql = "SELECT * FROM $t_os"; if ($where) $sql .= " WHERE " . implode(" AND ", $where); $sql .= " ORDER BY criado_em DESC"; $rows = $params ? $wpdb->get_results($wpdb->prepare($sql, $params), ARRAY_A) : $wpdb->get_results($sql, ARRAY_A); foreach ($rows as $r) { fputcsv($out, [ $r['token'], $r['status'], $r['pag_nome'], $r['pag_doc'], $r['pag_email'], $r['origem'], $r['destino'], $r['motoboy_nome'], $r['recebedor_nome'], $r['veiculo'], $r['preco'], $r['criado_em'], ], ';'); } exit; } /* ================= CONSULTA FINAL ================= */ global $wpdb; $t_os = $wpdb->prefix . 'mpxa_os'; $f = [ 'token' => sanitize_text_field($_GET['f_token'] ?? ''), 'cpf_cnpj' => sanitize_text_field($_GET['f_cpf_cnpj'] ?? ''), 'pagador' => sanitize_text_field($_GET['f_pagador'] ?? ''), 'remetente' => sanitize_text_field($_GET['f_remetente'] ?? ''), 'destinatario' => sanitize_text_field($_GET['f_destinatario'] ?? ''), 'motoboy' => sanitize_text_field($_GET['f_motoboy'] ?? ''), 'veiculo' => sanitize_text_field($_GET['f_veiculo'] ?? ''), 'status' => sanitize_text_field($_GET['f_status'] ?? ''), 'inicio' => sanitize_text_field($_GET['f_inicio'] ?? ''), 'fim' => sanitize_text_field($_GET['f_fim'] ?? ''), ]; $where = []; $params = []; foreach ($f as $k => $v) { if ($v === '') continue; switch ($k) { case 'token': $where[] = "token LIKE %s"; $params[] = "%$v%"; break; case 'cpf_cnpj': $where[] = "pag_doc LIKE %s"; $params[] = "%$v%"; break; case 'pagador': $where[] = "pag_nome LIKE %s"; $params[] = "%$v%"; break; case 'remetente': $where[] = "remetente_nome LIKE %s"; $params[] = "%$v%"; break; case 'destinatario': $where[] = "destinatario_nome LIKE %s"; $params[] = "%$v%"; break; case 'motoboy': $where[] = "motoboy_nome LIKE %s"; $params[] = "%$v%"; break; case 'veiculo': $where[] = "veiculo = %s"; $params[] = $v; break; case 'status': $where[] = "status = %s"; $params[] = $v; break; case 'inicio': $where[] = "DATE(criado_em) >= %s"; $params[] = $v; break; case 'fim': $where[] = "DATE(criado_em) <= %s"; $params[] = $v; break; } } $sql = "SELECT * FROM $t_os"; if ($where) { $sql .= " WHERE " . implode(" AND ", $where); } $sql .= " ORDER BY criado_em DESC LIMIT 500"; $lista = $params ? $wpdb->get_results($wpdb->prepare($sql, $params)) : $wpdb->get_results($sql);
Warning: Cannot modify header information - headers already sent by (output started at /home/u977314867/domains/mepexpress.com.br/public_html/wp-content/plugins/mep-frete-system/mep-frete-system-os.php:2530) in /home/u977314867/domains/mepexpress.com.br/public_html/wp-includes/pluggable.php on line 1450

Warning: Cannot modify header information - headers already sent by (output started at /home/u977314867/domains/mepexpress.com.br/public_html/wp-content/plugins/mep-frete-system/mep-frete-system-os.php:2530) in /home/u977314867/domains/mepexpress.com.br/public_html/wp-includes/pluggable.php on line 1453