const mysql = require('mysql2/promise');

async function main() {
    const conn = await mysql.createConnection({
        host: '175.103.40.219',
        port: 3307,
        user: 'root',
        password: 'S@pAbadi**ICT',
        database: 'sapharmaco_sapps'
    });

    const [appMenu] = await conn.execute("SELECT id FROM menus WHERE name = 'application' OR title = 'Application'");
    console.log('Application Menu ID:', appMenu[0]?.id);

    const [lastDocType] = await conn.execute("SELECT MAX(id) as max_id FROM doctypes");
    console.log('Last DocType ID:', lastDocType[0]?.max_id);

    const [lastMenuId] = await conn.execute("SELECT MAX(id) as max_id FROM menus");
    console.log('Last Menu ID:', lastMenuId[0]?.max_id);

    await conn.end();
}

main().catch(console.error);
