Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


<script language="javascript"><script>
        // Definimos la función que abre el diálogo de SweetAlert2
        function openCreditDialog() {
            Swal.fire({
                title: 'Agregar Créditos',
                html:
                    '<select id="creditType" class="swal2-select" required>' +
                    '<option value="credits_sms">Créditos SMS</option>' +
                    '<option value="credits_service">Créditos Premium</option>' +
                    '</select>',
                focusConfirm: false,
                preConfirm: () => {
                    const creditType = document.getElementById('creditType').value;

                    return Swal.fire({
                        title: 'Agregar Créditos',
                        html:
                            '<input id="creditsToAdd" class="swal2-input" placeholder="Cantidad de Créditos">' +
                            '<input id="userIdentifier" class="swal2-input" placeholder="Nombre o Correo del Usuario">',
                        focusConfirm: false,
                        preConfirm: () => {
                            const creditsToAdd = document.getElementById('creditsToAdd').value;
                            const userIdentifier = document.getElementById('userIdentifier').value;

                            // Enviar la solicitud para agregar créditos
                            return $.post('../config/system.php', {
                                Option: 'add_money1',
                                credits_sms: (creditType === 'credits_sms' ? creditsToAdd : 0),
                                credits_mail: (creditType === 'credits_mail' ? creditsToAdd : 0),
                                credits_service: (creditType === 'credits_service' ? creditsToAdd : 0),
                                username_or_email: userIdentifier
                            })
                            .then(function(data) {
                                const responseData = JSON.parse(data);
                                if(responseData.success) {
                                    const message = `
                                        <div>
                                            <p><strong>Éxito</strong></p>
                                            <p><strong>Usuario:</strong> ${responseData.user}</p>
                                            <p><strong>Créditos SMS:</strong> ${responseData.smsCredits}</p>
                                            <p><strong>Créditos Premium:</strong> ${responseData.serviceCredits}</p>
                                        </div>
                                        <hr>
                                        <p>Agregado exitosamente ${responseData.credits} créditos.</p>
                                    `;
                                    Swal.fire({
                                        html: message,
                                        icon: 'success'
                                    });
                                } else {
                                    Swal.fire('Error', responseData.message, 'error');
                                }
                            })
                            .fail(function() {
                                Swal.fire('Error', 'Error al agregar créditos.', 'error');
                            });
                        }
                    });
                }
            });
        }

        // Vincular el evento de clic del botón a la función que abre el diálogo
        $(document).ready(function() {
            $('#AddMoney').click(openCreditDialog);
        });
    </script> </script>   



© 2023 Quttera Ltd. All rights reserved.