fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.09s 54664KB
stdin
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>VIỆT HÀNH TRÌNH</title>
<style>
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #07100d; color: #eee; }
.top { background: linear-gradient(135deg, #071b14, #163d2b); padding: 20px; border-bottom: 2px solid #d7ad35; }
.wrap { width: min(1400px, 94%); margin: auto; }
.top h1 { margin: 0; color: #f4ca45; }
.top p { margin: 7px 0 0; color: #ddd; }
.panel { background: #0e1714; border: 1px solid #8e6a21; border-radius: 12px; margin: 18px 0; padding: 18px; box-shadow: 0 8px 24px #0008; }
h2 { color: #f2c43d; margin-top: 0; }
.hidden { display: none !important; }
input, button, select { font: inherit; padding: 11px; border-radius: 8px; border: 1px solid #8e6a21; }
input, select { background: #050908; color: #fff; }
button { background: #d9ad32; color: #16120a; font-weight: 700; cursor: pointer; margin: 3px; }
button:hover { filter: brightness(1.08); }
button.danger { background: #b52b2b; color: #fff; }
button.secondary { background: #254c3a; color: #fff; }
.loginbox { max-width: 520px; margin: 70px auto; }
.field { margin: 10px 0; }
.field label { display: block; margin-bottom: 5px; color: #e8d27e; }
.field input { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msg { margin-top: 10px; font-weight: 700; color: #ffd34f; }
.ok { color: #5ee28a; }
.err { color: #ff7373; }
.tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.table { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 10px; border-bottom: 1px solid #29352f; text-align: left; vertical-align: middle; }
th { background: #17251f; color: #f1cc57; }
.status-active { color: #63e68f; font-weight: 700; }
.status-off { color: #ff7474; font-weight: 700; }
.small { font-size: 13px; color: #aaa; }
.modal { position: fixed; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modalbox { width: min(520px, 100%); background: #101916; border: 1px solid #d3aa32; border-radius: 12px; padding: 20px; }
.dangerText { color: #ff7777; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* === GIAO DIỆN PANEL VIỆT HÀNH TRÌNH === */
.hero-panel {
    background: linear-gradient(135deg, #0a1a12, #1a3a28);
    border: 2px solid #d4aa32;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 0 30px rgba(212, 170, 50, 0.25);
}
.hero-title {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 3px 3px 6px #000;
    margin: 0 0 10px;
}
.hero-subtitle {
    font-size: 18px;
    color: #fff8dc;
    font-style: italic;
    margin-bottom: 25px;
}
.login-gmail-box {
    background: linear-gradient(to right, #ffd700, #ffb300);
    color: #000;
    font-size: 24px;
    font-weight: bold;
    padding: 18px;
    border-radius: 12px;
    border: 3px solid #b8860b;
    box-shadow: 0 0 15px #ffd700;
    margin: 20px auto;
    max-width: 700px;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.feature-card {
    background: rgba(20, 35, 28, 0.8);
    border: 1px solid #8e6a21;
    border-radius: 10px;
    padding: 18px;
}
.feature-card h3 {
    color: #ffd700;
    margin: 0 0 12px;
    font-size: 16px;
    border-bottom: 1px solid #3a4a3f;
    padding-bottom: 8px;
}
.feature-item {
    color: #ddd;
    padding: 5px 0 5px 22px;
    position: relative;
    font-size: 14px;
}
.feature-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #32cd32;
    font-weight: bold;
}
.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
.big-btn {
    padding: 15px 10px;
    background: linear-gradient(to bottom, #ffd700, #ffb300);
    color: #000;
    font-weight: bold;
    border-radius: 8px;
    border: 2px solid #b8860b;
    cursor: pointer;
    transition: 0.2s;
}
.big-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}
.culture-bar {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    background: rgba(25, 40, 32, 0.7);
    border: 1px solid #8e6a21;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}
.culture-item {
    color: #ffd700;
    padding: 8px 12px;
    text-align: center;
    font-size: 14px;
}
.footer-info {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    color: #ffd700;
    border-top: 1px solid #2a3a30;
}
.email-hl {
    color: #ff8c00;
    font-weight: bold;
}

@media (max-width: 700px) {
    .grid { grid-template-columns: 1fr; }
    .loginbox { margin: 25px auto; }
    .hero-title { font-size: 32px; }
    .btn-grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<header class="top">
  <div class="wrap">
    <h1>VIỆT HÀNH TRÌNH</h1>
    <p>LỢI ÍCH CHO TÔI - GIÀU CÓ LÀ CỦA BẠN</p>
  </div>
</header>
<main class="wrap">

  <!-- === GIAO DIỆN CHÍNH VIỆT HÀNH TRÌNH === -->
  <section class="hero-panel"
    <h2 class="hero-title">VIỆT HÀNH TRÌNH</h2>
    <p class="hero-subtitle">Kết nối mọi miền — Trọn vẹn giá trị Việt</p>
    
 <button class="big-btn" onclick="location.href='https://accounts.google.com/o/oauth2/v2/auth?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&scope=profile email'">ĐĂNG KÝ/ĐĂNG NHẬP GMAIL</button>
<div class="feature-grid">
      <div class="feature-card">
        <h3>✅ UY TÍN — AN TOÀN — TIỀN LỢI</h3>
        <div class="feature-item">Tài xế kinh nghiệm - Phục vụ tận tâm</div>
        <div class="feature-item">Giá cả minh bạch - Không phát sinh</div>
        <div class="feature-item">Hỗ trợ 24/7 - Mọi lúc mọi nơi</div>
        <div class="feature-item">Bảo mật thông tin - Tuyệt đối tin cậy</div>
      </div>

      <div class="feature-card">
        <h3>🚗 HÀNH TRÌNH AN TOÀN — VẠN ĐẶM BÌNH AN</h3>
        <div class="feature-item">Tài xế chuyên nghiệp</div>
        <div class="feature-item">Xe chất lượng cao</div>
        <div class="feature-item">Giá minh bạch</div>
        <div class="feature-item">Hỗ trợ 24/7</div>
      </div>

      <div class="feature-card">
        <div class="btn-grid">
          <button class="big-btn">ĐẶT XE GHÉP CHUYẾN</button>
          <button class="big-btn">MUA SẮM SẢN PHẨM</button>
          <button class="big-btn">BẢNG GIÁ XE GHÉP</button>
          <button class="big-btn">ĐẶT PHÒNG</button>
        </div>
      </div>
    </div>

    <div class="culture-bar" style="justify-content: space-between; padding: 15px 20px; margin-top:15px;">
      <div class="culture-item">🚗 ĐẶT XE NHANH CHÓNG<br><small>Chỉ vài thao tác</small></div>
      <div class="culture-item">💰 GIÁ TỐT MỖI NGÀY<br><small>Tiết kiệm chi phí</small></div>
      <div class="culture-item">📋 TÀI XẾ CHUYÊN NGHIỆP<br><small>Kinh nghiệm & thân thiện</small></div>
      <div class="culture-item">🛎️ HỖ TRỢ 24/7<br><small>Luôn sẵn sàng</small></div>
      <div class="culture-item">💻 CÔNG NGHỆ HIỆN ĐẠI<br><small>Kết nối thông minh</small></div>
    </div>

    <div class="footer-info">
      <p>Gửi góp ý và chia sẻ về: <span class="email-hl">viethanhtrinh3mien@gmail.com</span> &nbsp;|&nbsp; <button class="big-btn">HỢP ĐỒNG ĐỐI TÁC</button><button class="big-btn">ĐĂNG KÝ TÀI XẾ</button><button class="big-btn">ĐỐI TÁC THƯƠNG MẠI</button></p>
      <p style="margin-top:10px; font-size:13px; color:#daa520;">© 2026 VIỆT HÀNH TRÌNH — KẾT NỐI MỌI MIỀN — TRỌN VEN GIÁ TRỊ VIỆT — LỢI ÍCH CHO TÔI LÀM GIÀU CHO BẠN | Phiên bản V3.0</p>
    </div>
  </section>

  <!-- === KHỐI ĐĂNG NHẬP QUẢN TRỊ === -->
  <section id="login" class="panel loginbox">
    <h2>🔐 ĐĂNG NHẬP QUẢN TRỊ HỆ THỐNG</h2>
    <div class="field">
      <label for="adminEmail">Email Admin</label>
      <input id="adminEmail" type="email" autocomplete="username"
             value="viethanhtrinh3mien@gmail.com">
    </div>
    <div class="field">
      <label for="adminPassword">Mật khẩu Admin</label>
      <input id="adminPassword" type="password" autocomplete="current-password">
    </div>
    <div class="actions">
      <button type="button" onclick="login()">ĐĂNG NHẬP QUẢN TRỊ</button>
      <button type="button" class="secondary" onclick="showForgot()">QUÊN MẬT KHẨU</button>
    </div>
    <div id="loginMsg" class="msg"></div>
  </section>

  <!-- === KHỐI QUẢN LÝ SAU ĐĂNG NHẬP === -->
  <section id="app" class="hidden">
    <div class="panel">
      <div class="actions">
        <strong id="adminInfo"></strong>
        <button type="button" onclick="loadUsers()">👥 TÀI KHOẢN</button>
        <button type="button" onclick="loadVehiclePartners()">🚗 ĐỐI TÁC XE</button>
        <button type="button" onclick="loadCommercialPartners()">🏪 ĐỐI TÁC THƯƠNG MẠI</button>
        <button type="button" class="danger" onclick="logout()">ĐĂNG XUẤT</button>
      </div>
    </div>
    <div id="content" class="panel">
      <h2>👥 QUẢN LÝ TÀI KHOẢN</h2>
    </div>
  </section>

</main>

<!-- === KHỐI QUÊN MẬT KHẨU === -->
<div id="forgotModal" class="modal hidden">
  <div class="modalbox">
    <h2>QUÊN MẬT KHẨU ADMIN</h2>
    <div class="field">
      <label for="forgotEmail">Email Admin</label>
      <input id="forgotEmail" type="email">
    </div>
    <div class="field">
      <label for="recoveryCode">Mã khôi phục</label>
      <input id="recoveryCode" type="text">
    </div>
    <div class="field">
      <label for="newAdminPassword">Mật khẩu mới</label>
      <input id="newAdminPassword" type="password">
    </div>
    <div class="actions">
      <button type="button" onclick="forgotPassword()">ĐẶT LẠI MẬT KHẨU</button>
      <button type="button" class="secondary" onclick="hideForgot()">ĐÓNG</button>
    </div>
    <div id="forgotMsg" class="msg"></div>
  </div>
</div>

<script type="module">
import { initializeApp } from "https://w...content-available-to-author-only...c.com/firebasejs/12.17.1/firebase-app.js";
import {
  getAuth,
  signInWithEmailAndPassword,
  sendPasswordResetEmail,
  signOut,
  onAuthStateChanged
} from "https://w...content-available-to-author-only...c.com/firebasejs/12.17.1/firebase-auth.js";

const firebaseConfig = {
  apiKey: "AIzaSyBCyoFpsvzxvRrPIbLMchNHFoDJOqh3Sg",
  authDomain: "viet-hanh-trinh.firebaseapp.com",
  projectId: "viet-hanh-trinh",
  storageBucket: "viet-hanh-trinh.firebasestorage.app",
  messagingSenderId: "508781821117",
  appId: "1:508781821117:web:bc7d03add8c3e49ff1cbd4",
  measurementId: "G-VJTS0SX4LS"
};

const appFirebase = initializeApp(firebaseConfig);
const auth = getAuth(appFirebase);
const ADMIN_EMAIL = "viethanhtrinh@gmail.com";
const $ = id => document.getElementById(id);
const esc = s => String(s ?? '').replace(/[&<>"']/g, c => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));

function setMsg(id, text, ok=false){
  const el=$(id); if(!el) return;
  el.textContent=text; el.className='msg '+(ok?'ok':'err');
}

function showApp(user){
  $('login').classList.add('hidden');
  $('app').classList.remove('hidden');
  $('adminInfo').textContent=`Đang đăng nhập: ${user.email} — Firebase Authentication`;
  renderAdminHome();
}

function renderAdminHome(){
  $('content').innerHTML=`
    <h2>👥 QUẢN TRỊ HỆ THỐNG VIỆT HÀNH TRÌNH</h2>
    <p class="small">✅ Đăng nhập Admin đã được xác thực bằng Firebase Authentication.</p>
    <div class="panel" style="margin:12px 0 0;padding:14px;background:rgba(20,35,28,0.5);">
      <b>🚗 ĐỐI TÁC XE / CHỦ XE</b><br>
      Quản lý hồ sơ tài xế, trạng thái hoạt động và AUTO MATCH.
    </div>
    <div class="panel" style="margin:12px 0 0;padding:14px;background:rgba(20,35,28,0.5);">
      <b>🏪 ĐỐI TÁC THƯƠNG MẠI</b><br>
      Quản lý hồ sơ đối tác thương mại và trạng thái phê duyệt.
    </div>
    <p class="small" style="margin-top:14px;">Các chức năng quản trị dữ liệu sẽ kết nối API khi backend tương ứng đã được triển khai.</p>`;
}

window.login = async function(){
  const email=$('adminEmail').value.trim().toLowerCase();
  const password=$('adminPassword').value;
  if(!email || !password){ setMsg('loginMsg','❌ Nhập email và mật khẩu Admin.'); return; }
  if(email!==ADMIN_EMAIL){ setMsg('loginMsg','❌ Tài khoản này không có quyền Admin.'); return; }
  setMsg('loginMsg','🔐 Đang xác thực Firebase...',true);
  try{
    const cred=await signInWithEmailAndPassword(auth,email,password);
    if(cred.user.email?.toLowerCase()!==ADMIN_EMAIL){
      await signOut(auth);
      throw new Error('Tài khoản này không có quyền Admin.');
    }
    showApp(cred.user);
  }catch(e){
    console.error(e);
    let msg='Đăng nhập không thành công.';
    if(e.code==='auth/invalid-credential' || e.code==='auth/wrong-password') msg='Email hoặc mật khẩu Admin không đúng.';
    else if(e.code==='auth/user-not-found') msg='Chưa có tài khoản Admin này trong Firebase.';
    else if(e.code==='auth/too-many-requests') msg='Quá nhiều lần thử. Vui lòng thử lại sau.';
    else if(e.message) msg=e.message;
    setMsg('loginMsg','❌ '+msg);
  }
};

window.logout = async function(){
  try{ await signOut(auth); } finally { location.reload(); }
};

window.showForgot = function(){
  $('forgotEmail').value=$('adminEmail').value.trim() || ADMIN_EMAIL;
  $('forgotModal').classList.remove('hidden');
  $('forgotMsg').textContent='';
};

window.hideForgot = function(){
  $('forgotModal').classList.add('hidden');
  $('forgotMsg').textContent='';
};

window.forgotPassword = async function(){
  const email=$('forgotEmail').value.trim().toLowerCase();
  if(!email){setMsg('forgotMsg','❌ Nhập email Admin.');return;}
  if(email!==ADMIN_EMAIL){setMsg('forgotMsg','❌ Chỉ được khôi phục tài khoản Admin.');return;}
  try{
    await sendPasswordResetEmail(auth,email);
    setMsg('forgotMsg','✅ Đã gửi email khôi phục mật khẩu Admin.',true);
  }catch(e){
    console.error(e);
    setMsg('forgotMsg','❌ Không gửi được email: '+(e.message||'Lỗi Firebase.'));
  }
};

window.loadUsers = function(){ renderAdminHome(); };
window.loadVehiclePartners = function(){
  $('content').innerHTML='<h2>🚗 QUẢN LÝ ĐỐI TÁC XE / CHỦ XE</h2><p class="small">✅ Đăng nhập thành công. API quản trị đối tác xe đang được xây dựng.</p>';
};
window.loadCommercialPartners = function(){
  $('content').innerHTML='<h2>🏪 QUẢN LÝ ĐỐI TÁC THƯƠNG MẠI</h2><p class="small">✅ Đăng nhập thành công. API quản trị đối tác thương mại đang được xây dựng.</p>';
};

onAuthStateChanged(auth,user=>{
  if(user && user.email?.toLowerCase()===ADMIN_EMAIL) showApp(user);
  else if(user) signOut(auth);
});
</script>



</body>
</html>
stdout
Standard output is empty