function db_optimize() { global $WORKING, $STATIC; trigger_error(sprintf(__('%d. try for database optimize...', 'backwpup'), $WORKING['DB_OPTIMIZE']['STEP_TRY']), E_USER_NOTICE); if (!isset($WORKING['DB_OPTIMIZE']['DONETABLE']) or !is_array($WORKING['DB_OPTIMIZE']['DONETABLE'])) { $WORKING['DB_OPTIMIZE']['DONETABLE'] = array(); } mysql_update(); //to backup $tabelstobackup = array(); $result = mysql_query("SHOW TABLES FROM `" . $STATIC['WP']['DB_NAME'] . "`"); //get table status if (!$result) { trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`;"), E_USER_ERROR); } while ($data = mysql_fetch_row($result)) { if (!in_array($data[0], $STATIC['JOB']['dbexclude'])) { $tabelstobackup[] = $data[0]; } } //Set num of todos $WORKING['STEPTODO'] = count($tabelstobackup); if (count($tabelstobackup) > 0) { maintenance_mode(true); foreach ($tabelstobackup as $table) { if (in_array($table, $WORKING['DB_OPTIMIZE']['DONETABLE'])) { continue; } $result = mysql_query('OPTIMIZE TABLE `' . $table . '`'); if (!$result) { trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "OPTIMIZE TABLE `" . $table . "`"), E_USER_ERROR); continue; } $optimize = mysql_fetch_assoc($result); $WORKING['DB_OPTIMIZE']['DONETABLE'][] = $table; $WORKING['STEPDONE'] = count($WORKING['DB_OPTIMIZE']['DONETABLE']); if ($optimize['Msg_type'] == 'error') { trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s', 'backwpup'), $table, $optimize['Msg_text']), E_USER_ERROR); } elseif ($optimize['Msg_type'] == 'warning') { trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s', 'backwpup'), $table, $optimize['Msg_text']), E_USER_WARNING); } else { trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s', 'backwpup'), $table, $optimize['Msg_text']), E_USER_NOTICE); } } trigger_error(__('Database optimize done!', 'backwpup'), E_USER_NOTICE); maintenance_mode(false); } else { trigger_error(__('No tables to optimize', 'backwpup'), E_USER_WARNING); } $WORKING['STEPSDONE'][] = 'DB_OPTIMIZE'; //set done }
function update_option($option = 'backwpup_jobs', $data) { global $WORKING, $STATIC; mysql_update(); $serdata = mysql_real_escape_string(serialize($data)); $query = "UPDATE " . $STATIC['WP']['OPTIONS_TABLE'] . " SET option_value= '" . $serdata . "' WHERE option_name='" . trim($option) . "' LIMIT 1"; $res = mysql_query($query); if (!$res) { trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), $query), E_USER_ERROR); return false; } return true; }
protected function verifyUser($args) { if ($args['msisdn'] == '' || $args['number'] == '') { return array('error' => 1, 'message' => 'Mandatory field missing'); } $verifyEmailQry = "select ver_number from register where email = '" . $args['msisdn'] . "@mobifyi.com'"; $verifyEmailRes = mysql_query($verifyEmailQry, $this->db->conn); $verifyRow = mysql_fetch_assoc($verifyEmailRes); if ($verifyRow['ver_number'] == $args['number']) { $updateVerificationNumberQry = "update ver_number = '' where msisdn = '" . $args['msisdn'] . "'"; mysql_update($updateVerificationNumberQry, $this->db->conn); return array('error' => 0, 'message' => 'Verified Successfully'); } else { return array('error' => 1, 'message' => 'Verification failed'); } }
function cron_logErrorsOnDieOrExit() { if (!@$GLOBALS['CRON_JOB_LOG_NUM']) { return; } $summary = t("Returned errors"); $output = ob_get_clean(); $runtime = sprintf("%0.2f", microtime(true) - $GLOBALS['CRON_JOB_START']); // update job log entry mysql_update('_cron_log', $GLOBALS['CRON_JOB_LOG_NUM'], null, array('summary' => $summary, 'output' => $output, 'runtime' => $runtime)); // send email $secondsAgo = time() - $GLOBALS['SETTINGS']['bgtasks_lastEmail']; if ($secondsAgo >= 60 * 60) { // don't email more than once an hour // get email placeholders $cronLog = mysql_get('_cron_log', $GLOBALS['CRON_JOB_LOG_NUM']); $placeholders = array('bgtask.date' => $cronLog['createdDate'], 'bgtask.activity' => $cronLog['activity'], 'bgtask.summary' => nl2br(htmlencode($cronLog['summary'])), 'bgtask.completed' => $cronLog['completed'], 'bgtask.function' => $cronLog['function'], 'bgtask.output' => nl2br(htmlencode($cronLog['output'])), 'bgtask.runtime' => $cronLog['runtime'], 'bgtask.function' => $cronLog['function'], 'bgtasks.logsUrl' => realUrl("?menu=_cron_log", $GLOBALS['SETTINGS']['adminUrl']), 'bgtasks.settingsUrl' => realUrl("?menu=admin&action=general#background-tasks", $GLOBALS['SETTINGS']['adminUrl'])); // send message $errors = sendMessage(emailTemplate_loadFromDB(array('template_id' => 'CMS-BGTASK-ERROR', 'placeholders' => $placeholders))); if ($errors) { die("Mail Error: {$errors}"); } // update last emailed time $GLOBALS['SETTINGS']['bgtasks_lastEmail'] = time(); saveSettings(); } }
<?php include "../../includes/sessionAdmin.php"; include "../../includes/conexion.php"; include "../../includes/mysql_util.php"; $matricula = $_POST["matricula"]; $nombres = $_POST["nombres"]; $APaterno = $_POST["APaterno"]; $AMaterno = $_POST["AMaterno"]; $FechaNacimiento = $_POST["FechaNacimiento"]; $CURP = $_POST["CURP"]; $Enfermedades = $_POST["Enfermedades"]; $Alergias = $_POST["Alergias"]; $Telefono = $_POST["Telefono"]; $Email = $_POST["Email"]; $estudios = $_POST["estudios"]; $result = mysql_update("maestro", array('m_nombre' => $nombres, 'm_apellidopaterno' => $APaterno, 'm_apellidomaterno' => $AMaterno, 'm_fechanac' => $FechaNacimiento, 'm_curp' => $CURP, 'm_enfermedades' => $Enfermedades, 'm_alergias' => $Alergias, 'm_numlocal' => $Telefono, 'm_email' => $Email, 'm_estudios' => $estudios), $matricula); if (mysql_affected_rows() > 0) { $alertMsg = "Maestro actualizado satisfactoriamente"; } elseif (!$result) { $alertMsg = "Algo salio mal: " . mysql_error(); } else { $alertMsg = "No encontramos ningun maestro con la matricula m{$matricula} o no hubo cambios en la informacion"; } echo "<script language=\"javascript\">\n\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\twindow.location.href = \"../../vistas/menus/menuAdmin.php\"\n\t\t\t</script>";
$password = sha1($newpass); } else { // TFS 0.3/4 if (config('salt') === true) { $saltdata = mysql_select_single("SELECT `salt` FROM `accounts` WHERE `email`='{$email}' LIMIT 1;"); if ($saltdata !== false) { $salt .= $saltdata['salt']; } } $password = sha1($salt . $newpass); } $user = mysql_select_single("SELECT `p`.`id` AS `player_id`, `a`.`name`, `a`.`id` AS `account_id` FROM `players` `p` INNER JOIN `accounts` `a` ON `p`.`account_id` = `a`.`id` WHERE `p`.`name` = '{$character}' AND `a`.`email` = '{$email}' AND `a`.`name` = '{$username}' LIMIT 1;"); if ($user !== false) { // Found user // Give him the new password mysql_update("UPDATE `accounts` SET `password`='{$password}' WHERE `id`='" . $user['account_id'] . "' LIMIT 1;"); // Send him a mail with the new password $mailer = new Mail($config['mailserver']); $title = "{$_SERVER['HTTP_HOST']}: Your new password"; $body = "<h1>Account Recovery</h1>"; $body .= "<p>Your new password is: <b>{$newpass}</b><br>"; $body .= "We recommend you to login and change it before you continue playing. <br>"; $body .= "Enjoy your stay at " . $config['mailserver']['fromName'] . ". <br>"; $body .= "<hr>I am an automatic no-reply e-mail. Any emails sent back to me will be ignored.</p>"; $mailer->sendMail($email, $title, $body, $user['name']); ?> <h1>Account Found!</h1> <p>We have sent your new password to <b><?php echo $email; ?> </b>.</p>
/** * If config is set to store local version of file, store it */ if ($store_local) { // Split text/html; charset=UTF-8 $type_info = explode("; ", $page_data['type']); // Only store 'text/html' files // TO DO enable range of file types to save if ($type_info[0] == 'text/html') { $data['html'] = $page_data['html']; } } /** * Store data */ mysql_update('urls', $data, array('ID' => $id)); /** * If in debug mode, close the <ul> we opened above */ if (isset($_GET['debug'])) { echo "</ul>"; } } //End foreach URL } //End While uncrawled URLs /** * If we're done, let the user know the good news */ if (sizeof($urls) == 0) { echo "<p>No URLs to crawl!</p>";
require_once 'engine/init.php'; include 'layout/overall/header.php'; protect_page(); admin_only($user_data); // Declare as int $view = isset($_GET['view']) && (int) $_GET['view'] > 0 ? (int) $_GET['view'] : false; if ($view !== false) { if (!empty($_POST['reply_text'])) { sanitize($_POST['reply_text']); // Save ticket reply on database $query = array('tid' => $view, 'username' => getValue($_POST['username']), 'message' => getValue($_POST['reply_text']), 'created' => time()); $fields = '`' . implode('`, `', array_keys($query)) . '`'; $data = '\'' . implode('\', \'', $query) . '\''; mysql_insert("INSERT INTO `znote_tickets_replies` ({$fields}) VALUES ({$data})"); mysql_update("UPDATE `znote_tickets` SET `status`='Staff-Reply' WHERE `id`='{$view}' LIMIT 1;"); } $ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='{$view}' LIMIT 1;"); ?> <h1>View Ticket #<?php echo $ticketData['id']; ?> </h1> <table class="znoteTable ThreadTable table table-striped"> <tr class="yellow"> <th> <?php echo getClock($ticketData['creation'], true); ?> - Created by: <?php
$bidend = time() + $config['houseConfig']['auctionPeriod']; mysql_update("UPDATE `houses` SET `highest_bidder`='" . $player['id'] . "', `bid`='{$bid_amount}', `last_bid`='{$lastbid}', `bid_end`='{$bidend}' WHERE `id`='" . $house['id'] . "' LIMIT 1;"); $house = mysql_select_single("SELECT `id`, `owner`, `paid`, `name`, `rent`, `town_id`, `size`, `beds`, `bid`, `bid_end`, `last_bid`, `highest_bidder` FROM `houses` WHERE `id`='" . $house['id'] . "';"); } echo "<b><font color='green'>You have the highest bid on this house!</font></b>"; } else { echo "<b><font color='red'>You need to place a bid that is higher or equal to {$minbid}gp.</font></b>"; } } else { // Check if current bid is higher than last_bid if ($bid_amount > $house['last_bid']) { // Should only apply to external players, allowing a player to up his pledge without // being forced to pay his full previous bid. if ($house['highest_bidder'] != $player['id']) { $lastbid = $bid_amount + 1; mysql_update("UPDATE `houses` SET `last_bid`='{$lastbid}' WHERE `id`='" . $house['id'] . "' LIMIT 1;"); $house = mysql_select_single("SELECT `id`, `owner`, `paid`, `name`, `rent`, `town_id`, `size`, `beds`, `bid`, `bid_end`, `last_bid`, `highest_bidder` FROM `houses` WHERE `id`='" . $house['id'] . "';"); echo "<b><font color='orange'>Unfortunately your bid was not higher than previous bidder.</font></b>"; } else { echo "<b><font color='orange'>You already have a higher pledge on this house.</font></b>"; } } else { echo "<b><font color='red'>Too low bid amount, someone else has a higher bid active.</font></b>"; } } } else { echo "<b><font color='red'>You don't have enough money to bid this high.</font></b>"; } } else { echo "<b><font color='red'>Your character is to low level, must be higher level than ", $config['houseConfig']['levelToBuyHouse'] - 1, " to buy a house.</font></b>"; }
<?php include "../../includes/sessionAdmin.php"; include "../../includes/conexion.php"; include "../../includes/mysql_util.php"; $matricula = $_POST["matricula"]; $descripcion = $_POST["descripcion"]; $result = mysql_update("periodo", $conexion, array('per_desc' => $descripcion), $matricula); if (!$result) { $alertMsg = "Algo salio mal: " . mysqli_error($conexion); } else { $alertMsg = "Periodo actualizado satisfactoriamente"; } echo "<script language=\"javascript\">\n\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\twindow.history.go(-2);\n\t\t\t</script>";
function _errorlog_sendEmailAlert() { if (!$GLOBALS['SETTINGS']['advanced']['phpEmailErrors']) { return; } // once run function once per page-view static $alreadySent = false; if ($alreadySent) { return; } $alreadySent = true; // check if email sent in last hour $sentInLastHour = mysql_count('_error_log', " `dateLogged` > (NOW() - INTERVAL 1 HOUR) AND email_sent = 1"); // send hourly alert if (!$sentInLastHour) { // send email $secondsAgo = time() - $GLOBALS['SETTINGS']['bgtasks_lastEmail']; if ($secondsAgo >= 60 * 60) { // don't email more than once an hour // get date format if ($GLOBALS['SETTINGS']['dateFormat'] == 'dmy') { $dateFormat = "jS M, Y - h:i:s A"; } elseif ($GLOBALS['SETTINGS']['dateFormat'] == 'mdy') { $dateFormat = "M jS, Y - h:i:s A"; } else { $dateFormat = "M jS, Y - h:i:s A"; } // load latest error list $latestErrors = mysql_select('_error_log', "`dateLogged` > (NOW() - INTERVAL 1 HOUR) ORDER BY `dateLogged` DESC LIMIT 25"); $latestErrorsList = ''; foreach ($latestErrors as $thisError) { $latestErrorsList .= date($dateFormat, strtotime($thisError['dateLogged'])) . "\n"; $latestErrorsList .= $thisError['error'] . "\n"; $latestErrorsList .= $thisError['filepath'] . " (line " . $thisError['line_num'] . ")\n"; $latestErrorsList .= $thisError['url'] . "\n\n"; } // set email_sent flag for ALL records mysql_update('_error_log', null, 'TRUE', array('email_sent' => 1)); // send email message $placeholders = array('error.hostname' => parse_url($GLOBALS['SETTINGS']['adminUrl'], PHP_URL_HOST), 'error.latestErrorsList' => nl2br(htmlencode($latestErrorsList)), 'error.errorLogUrl' => realUrl("?menu=_error_log", $GLOBALS['SETTINGS']['adminUrl'])); $errors = sendMessage(emailTemplate_loadFromDB(array('template_id' => 'CMS-ERRORLOG-ALERT', 'placeholders' => $placeholders))); // log/display email sending errors if ($errors) { trigger_error("Unable to send error notification email from " . __FUNCTION__ . ": {$errors}", E_USER_NOTICE); die(__FUNCTION__ . ": {$errors}"); } } } }
/** * verify account * * @param mixed $email * @param mixed $code */ function verify_account($email, $code, $data = array()) { global $conn; $rs = mysql_query('select * from crx_demo_users where email="' . mysql_real_escape_string($email) . '" and activation_code="' . mysql_real_escape_string($code) . '"', $conn); if (mysql_num_rows($rs)) { $update = array('verify' => '1'); if (is_array($data) && count($data)) { $update = array_merge($update, $data); } mysql_update('crx_demo_users', $update, 'email="' . mysql_real_escape_string($email) . '"'); return true; } return false; }
function db_dump() { global $WORKING, $STATIC; trigger_error(sprintf(__('%d. try for database dump...', 'backwpup'), $WORKING['DB_DUMP']['STEP_TRY']), E_USER_NOTICE); if (!isset($WORKING['DB_DUMP']['DONETABLE']) or !is_array($WORKING['DB_DUMP']['DONETABLE'])) { $WORKING['DB_DUMP']['DONETABLE'] = array(); } mysql_update(); //to backup $tabelstobackup = array(); $result = mysql_query("SHOW TABLES FROM `" . $STATIC['WP']['DB_NAME'] . "`"); //get table status if (!$result) { trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`;"), E_USER_ERROR); } while ($data = mysql_fetch_row($result)) { if (!in_array($data[0], $STATIC['JOB']['dbexclude'])) { $tabelstobackup[] = $data[0]; } } $WORKING['STEPTODO'] = count($tabelstobackup); //Set maintenance maintenance_mode(true); if (count($tabelstobackup) > 0) { $result = mysql_query("SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`"); //get table status if (!$result) { trigger_error(sprintf(__('Database error %1$s for query %2$s', 'backwpup'), mysql_error(), "SHOW TABLE STATUS FROM `" . $STATIC['WP']['DB_NAME'] . "`;"), E_USER_ERROR); } while ($data = mysql_fetch_assoc($result)) { $status[$data['Name']] = $data; } if ($file = fopen($STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql', 'wb')) { fwrite($file, "-- ---------------------------------------------------------\n"); fwrite($file, "-- Dump with BackWPup ver.: " . $STATIC['BACKWPUP']['VERSION'] . "\n"); fwrite($file, "-- Plugin for WordPress " . $STATIC['WP']['VERSION'] . " by Daniel Huesken\n"); fwrite($file, "-- http://backwpup.com/\n"); fwrite($file, "-- Blog Name: " . $STATIC['WP']['BLOGNAME'] . "\n"); fwrite($file, "-- Blog URL: " . $STATIC['WP']['SITEURL'] . "\n"); fwrite($file, "-- Blog ABSPATH: " . $STATIC['WP']['ABSPATH'] . "\n"); fwrite($file, "-- Table Prefix: " . $STATIC['WP']['TABLE_PREFIX'] . "\n"); fwrite($file, "-- Database Name: " . $STATIC['WP']['DB_NAME'] . "\n"); fwrite($file, "-- Dump on: " . date('Y-m-d H:i.s', time() + $STATIC['WP']['TIMEDIFF']) . "\n"); fwrite($file, "-- ---------------------------------------------------------\n\n"); //for better import with mysql client fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n"); fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n"); fwrite($file, "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n"); fwrite($file, "/*!40101 SET NAMES '" . mysql_client_encoding() . "' */;\n"); fwrite($file, "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n"); fwrite($file, "/*!40103 SET TIME_ZONE='" . mysql_result(mysql_query("SELECT @@time_zone"), 0) . "' */;\n"); fwrite($file, "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n"); fwrite($file, "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n"); fwrite($file, "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n"); fwrite($file, "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n\n"); //make table dumps foreach ($tabelstobackup as $table) { if (in_array($table, $WORKING['DB_DUMP']['DONETABLE'])) { continue; } _db_dump_table($table, $status[$table], $file); $WORKING['DB_DUMP']['DONETABLE'][] = $table; $WORKING['STEPDONE'] = count($WORKING['DB_DUMP']['DONETABLE']); } //for better import with mysql client fwrite($file, "\n"); fwrite($file, "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\n"); fwrite($file, "/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n"); fwrite($file, "/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n"); fwrite($file, "/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n"); fwrite($file, "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"); fwrite($file, "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"); fwrite($file, "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); fwrite($file, "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n"); fclose($file); trigger_error(__('Database dump done!', 'backwpup'), E_USER_NOTICE); } else { trigger_error(__('Can not create database dump!', 'backwpup'), E_USER_ERROR); } } else { trigger_error(__('No tables to dump', 'backwpup'), E_USER_WARNING); } //add database file to backupfiles if (is_readable($STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql')) { $filestat = stat($STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql'); trigger_error(sprintf(__('Add database dump "%1$s" with %2$s to backup file list', 'backwpup'), $STATIC['WP']['DB_NAME'] . '.sql', formatbytes($filestat['size'])), E_USER_NOTICE); $WORKING['ALLFILESIZE'] += $filestat['size']; add_file(array(array('FILE' => $STATIC['TEMPDIR'] . $STATIC['WP']['DB_NAME'] . '.sql', 'OUTFILE' => $STATIC['WP']['DB_NAME'] . '.sql', 'SIZE' => $filestat['size'], 'ATIME' => $filestat['atime'], 'MTIME' => $filestat['mtime'], 'CTIME' => $filestat['ctime'], 'UID' => $filestat['uid'], 'GID' => $filestat['gid'], 'MODE' => $filestat['mode']))); } //Back from maintenance maintenance_mode(false); $WORKING['STEPSDONE'][] = 'DB_DUMP'; //set done }
<?php session_start(); include 'functions.php'; $code = $_REQUEST['code']; //sub $subcode = $_REQUEST['subCode']; //subcode $sender = $_REQUEST['mobile']; $servNum = $_REQUEST['serviceNumber']; //service number $mess = $_REQUEST['info']; //message //generate code $code = RandomString(10); if (count(select_sql('select * from crx_demo_users where phone="' . $sender . '"'))) { //update mysql_update('crx_demo_users', array('verify' => '1', 'activation_code' => $code), 'phone="' . $sender . '"'); } else { //add new demo //add user to crx_demo_users table $id = mysql_insert('crx_demo_users', array('phone' => $sender, 'verify' => '1', 'activation_code' => $code)); //add advertising data to crx_ads mysql_insert('crx_ads', array('user' => $id)); } //0 là sms dạng text $resp = "0|Your Code:" . $code . ' Login URL: http://app-ads.hoangweb.com/ksn-crx/admin.php'; echo $resp;
} if (isset($_POST['bajaGrupoCursos'])) { $bajaGrupoCursos = 1; $_SESSION['bajaGrupoCursos'] = 1; } else { $bajaGrupoCursos = 0; $_SESSION['bajaGrupoCursos'] = 0; } if (isset($_POST['cambioGrupoCursos'])) { $cambioGrupoCursoselds = 1; $_SESSION['cambioGrupoCursos'] = 1; } else { $cambioGrupoCursoselds = 0; $_SESSION['cambioGrupoCursos'] = 0; } if (isset($_POST['verReportes'])) { $verReportes = 1; $_SESSION['verReportes'] = 1; } else { $verReportes = 0; $_SESSION['verReportes'] = 0; } $result = mysql_update("permiso", $conexion, array('p_aAdmin' => $altaAdmin, 'p_bAdmin' => $bajaAdmin, 'p_cAdmin' => $cambioAdmin, 'p_aMaestro' => $altaMaestro, 'p_bMaestro' => $bajaMaestro, 'p_cMaestro' => $cambioMaestro, 'p_aAlumno' => $altaAlumno, 'p_bAlumno' => $bajaAlumno, 'p_cAlumno' => $cambioAlumno, 'p_aPeriodo' => $altaPeriodo, 'p_bPeriodo' => $bajaPeriodo, 'p_cPeriodo' => $cambioPeriodo, 'p_aGruposCursos' => $altaGrupoCursos, 'p_bGruposCursos' => $bajaGrupoCursos, 'p_cGruposCursos' => $cambioGrupoCursoselds, 'p_verReportes' => $verReportes), $id_permiso); if (mysqli_affected_rows($conexion) > 0) { $alertMsg = "Permiso actualizado satisfactoriamente"; } elseif (!$result) { $alertMsg = "Algo salio mal: " . mysql_error(); } else { $alertMsg = "No encontramos ningun Permiso con el id {$id_permiso} o no hubo cambios en la informacion"; } echo "<script>\t\n\t\t\talert(\"{$alertMsg}\");\t\t\n\t\t\twindow.location.href = \"../../vistas/menus/menuABCAdmins.php\"\n\t\t\t</script>";
require '../engine/database/connect.php'; ?> <h1>Gesior and Modern shop points to Znote AAC shop points</h1> <p>Convert donation/shop points from previous Gesior/Modern installation to Znote AAC:</p> <?php $accounts = mysql_select_multi("SELECT `id`, `premium_points` FROM `accounts` WHERE `premium_points`>'0';"); $accountids = array(); foreach ($accounts as $acc) { $accountids[] = $acc['id']; } $accidlist = join(',', $accountids); if ($accounts !== false) { echo "<p>Detected: " . count($accounts) . " accounts who have points in old system.</p>"; } else { die("<h1>All accounts already converted. :)</h1>"); } $znote_accounts = mysql_select_multi("SELECT `account_id`, `points` FROM `znote_accounts` WHERE `account_id` IN ({$accidlist});"); if (count($accounts) !== count($znote_accounts)) { die("<h1><font color='red'>Failed to syncronize accounts. You need to convert all accounts to Znote AAC first!</font></h1>"); } // Order old accounts by id. $idaccounts = array(); foreach ($accounts as $acc) { $idaccounts[$acc['id']] = $acc['premium_points']; } foreach ($znote_accounts as $acc) { mysql_update("UPDATE `znote_accounts` SET `points`='" . ($acc['points'] + $idaccounts[$acc['account_id']]) . "' WHERE `account_id`='" . $acc['account_id'] . "' LIMIT 1;"); } mysql_update("UPDATE `accounts` SET `premium_points`='0';"); echo "<h1><font color='green'>Successfully converted all points!</font></h1>";
function znote_visitor_set_data($visitor_data) { $exist = false; $ip = ip2long(getIP()); foreach ((array) $visitor_data as $row) { if ($ip == $row['ip']) { $exist = true; $value = $row['value']; } } if ($exist && isset($value)) { // Update the value $value++; mysql_update("UPDATE `znote_visitors` SET `value` = '{$value}' WHERE `ip` = '{$ip}'"); } else { // Insert new row mysql_insert("INSERT INTO `znote_visitors` (`ip`, `value`) VALUES ('{$ip}', '1')"); } }
$SueldoPadre = $_POST["SueldoPadre"]; $NombreMadre = $_POST["NombreMadre"]; $OcupacionMadre = $_POST["OcupacionMadre"]; $EmpresaMadre = $_POST["EmpresaMadre"]; $SueldoMadre = $_POST["SueldoMadre"]; $OtrosEstudios = $_POST["OtrosEstudios"]; $SuspendidoEstudios = $_POST["SuspendidoEstudios"]; $MateriasReprobadas = $_POST["MateriasReprobadas"]; $ApoyoEconomico = $_POST["ApoyoEconomico"]; $EnteroEscuela = $_POST["EnteroEscuela"]; $PorqueEstudiarCR = $_POST["PorqueEstudiarCR"]; $PorqueEstudiarEnfermeria = $_POST["PorqueEstudiarEnfermeria"]; $OtrasCarrerasPosibles = $_POST["OtrasCarrerasPosibles"]; $RegistroCeneval = $_POST["RegistroCeneval"]; $RegistroEscuela = $_POST["RegistroEscuela"]; $ExamenPsicometrico = $_POST["ExamenPsicometrico"]; $Entrevisto = $_POST["Entrevisto"]; $CelularPadre = $_POST["celularPadre"]; $CelularMadre = $_POST["celularMadre"]; $Estatus = $_POST["Estatus"]; $id_carrera = $_POST["carrera"]; $id_nivelEscolar = $_POST["nivel"]; $result = mysql_update("alumno", $conexion, array('a_nombre' => $nombres, 'a_apellidpaterno' => $APaterno, 'a_apellidomaterno' => $AMaterno, 'a_fechanac' => $FechaNacimiento, 'a_lugarnac' => $LugarNacimiento, 'a_nacionalidad' => $Nacionalidad, 'a_sexo' => $Sexo, 'a_estadocivil' => $EstadoCivil, 'a_gposanguineo' => $GrupoSanguineo, 'a_rh' => $RH, 'a_curp' => $CURP, 'a_servmedico' => $ServicioMedico, 'a_trabajo' => $ActualmenteLaborando, 'a_enfermedades' => $Enfermedades, 'a_alergias' => $Alergias, 'a_debilidadmotriz' => $DebilidadMotriz, 'a_domicilio' => $Direccion, 'a_cp' => $CP, 'a_colonia' => $Colonia, 'a_municipio' => $Municipio, 'a_numlocal' => $Telefono, 'a_email' => $Email, 'a_nompapa' => $NombrePadre, 'a_ocupacionpapa' => $OcupacionPadre, 'a_empresapapa' => $EmpresaPadre, 'a_sueldopapa' => $SueldoPadre, 'a_nommama' => $NombreMadre, 'a_ocupacionmama' => $OcupacionMadre, 'a_empresamama' => $EmpresaMadre, 'a_sueldomama' => $SueldoMadre, 'a_otrosestudios' => $OtrosEstudios, 'a_suspencionestudios' => $SuspendidoEstudios, 'a_matreprobadas' => $MateriasReprobadas, 'a_aval' => $ApoyoEconomico, 'a_promocionesc' => $EnteroEscuela, 'a_objcruzroja' => $PorqueEstudiarCR, 'a_objenfermeria' => $PorqueEstudiarEnfermeria, 'a_otracarrera' => $OtrasCarrerasPosibles, 'a_ceneval' => $RegistroCeneval, 'a_regescuela' => $RegistroEscuela, 'a_psicometrico' => $ExamenPsicometrico, 'a_entrevista' => $Entrevisto, 'a_celPadre' => $CelularPadre, 'a_celMadre' => $CelularMadre, 'a_estatus' => $Estatus, 'id_carrera' => $id_carrera, 'id_nivelEscolar' => $id_nivelEscolar), $matricula); if (mysqli_affected_rows($conexion) > 0) { $alertMsg = "Alumno actualizado satisfactoriamente"; } elseif (!$result) { $alertMsg = "Algo salio mal: " . mysqli_error($conexion); } else { $alertMsg = "No encontramos ningun alumno con la matricula a{$matricula} o no hubo cambios en la informacion"; } echo "<script language=\"javascript\">\n\t\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\t\twindow.location.href = \"../../vistas/menus/menuABCAlumnos.php\"\n\t\t\t\t</script>";
$m_gposanguineo = $_POST["m_gposanguineo"]; $m_rh = $_POST["m_rh"]; $m_curp = $_POST["m_curp"]; $m_servmedico = $_POST["m_servmedico"]; $m_trabajo = $_POST["m_trabajo"]; $m_enfermedades = $_POST["m_enfermedades"]; $m_alergias = $_POST["m_alergias"]; $m_debilidadmotriz = $_POST["m_debilidadmotriz"]; $m_domicilio = $_POST["m_domicilio"]; $m_numext = $_POST["m_numext"]; $m_numint = $_POST["m_numint"]; $m_cp = $_POST["m_cp"]; $m_colonia = $_POST["m_colonia"]; $m_municipio = $_POST["m_municipio"]; $m_numlocal = $_POST["m_numlocal"]; $m_numcelular = $_POST["m_numcelular"]; $m_escolaridad = $_POST["m_escolaridad"]; $m_otrosestudios = $_POST["m_otrosestudios"]; $m_email = $_POST["m_email"]; //$m_fecharegistro = $_POST["m_fecharegistro"]; //$m_estudios = $_POST["m_estudios"]; $m_estatus = 1; $result = mysql_update("maestro", $conexion, array('m_nombre' => $m_nombre, 'm_apellidopaterno' => $m_apellidopaterno, 'm_apellidomaterno' => $m_apellidomaterno, 'm_fechanac' => $m_fechanac, 'm_edad' => $m_edad, 'm_lugarnac' => $m_lugarnac, 'm_nacionalidad' => $m_nacionalidad, 'm_sexo' => $m_sexo, 'm_estadocivil' => $m_estadocivil, 'm_gposanguineo' => $m_gposanguineo, 'm_rh' => $m_rh, 'm_curp' => $m_curp, 'm_servmedico' => $m_servmedico, 'm_trabajo' => $m_trabajo, 'm_enfermedades' => $m_enfermedades, 'm_alergias' => $m_alergias, 'm_debilidadmotriz' => $m_debilidadmotriz, 'm_domicilio' => $m_domicilio, 'm_numext' => $m_numext, 'm_numint' => $m_numint, 'm_cp' => $m_cp, 'm_colonia' => $m_colonia, 'm_municipio' => $m_municipio, 'm_numlocal' => $m_numlocal, 'm_numcelular' => $m_numcelular, 'm_escolaridad' => $m_escolaridad, 'm_otrosestudios' => $m_otrosestudios, 'm_email' => $m_email, 'm_fecharegistro' => date("Y-m-d"), 'm_estudios' => $m_escolaridad, 'm_estatus' => $m_estatus), $matricula); if (mysqli_affected_rows($conexion) > 0) { $alertMsg = "Maestro actualizado satisfactoriamente"; } elseif (!$result) { $alertMsg = "Algo salio mal: " . mysqli_error($conexion); } else { $alertMsg = "No encontramos ningun maestro con la matricula a{$matricula} o no hubo cambios en la informacion"; } echo "<script language=\"javascript\">\n\t\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\t\twindow.location.href = \"../../vistas/menus/menuABCMaestros.php\"\n\t\t\t\t</script>";
<p>We have sent you an email with an activation link to your submitted email address.</p> <p>If you can't find the email within 5 minutes, check your junk/trash inbox as it may be mislocated there.</p> <?php } else { echo 'Congratulations! Your account has been created. You may now login to create a character.'; } } elseif (isset($_GET['authenticate']) && empty($_GET['authenticate'])) { // Authenticate user, fetch user id and activation key $auid = isset($_GET['u']) && (int) $_GET['u'] > 0 ? (int) $_GET['u'] : false; $akey = isset($_GET['k']) && (int) $_GET['k'] > 0 ? (int) $_GET['k'] : false; // Find a match $user = mysql_select_single("SELECT `id` FROM `znote_accounts` WHERE `account_id`='{$auid}' AND `activekey`='{$akey}' AND `active`='0' LIMIT 1;"); if ($user !== false) { $user = $user['id']; // Enable the account to login mysql_update("UPDATE `znote_accounts` SET `active`='1' WHERE `id`='{$user}' LIMIT 1;"); echo '<h1>Congratulations!</h1> <p>Your account has been created. You may now login to create a character.</p>'; } else { echo '<h1>Authentication failed</h1> <p>Either the activation link is wrong, or your account is already activated.</p>'; } } else { if (empty($_POST) === false && empty($errors) === true) { if ($config['log_ip']) { znote_visitor_insert_detailed_data(1); } //Register $register_data = array('name' => $_POST['username'], 'password' => $_POST['password'], 'email' => $_POST['email'], 'ip' => ip2long(getIP()), 'created' => time()); user_create_account($register_data, $config['mailserver']); if (!$config['mailserver']['debug']) { header('Location: register.php?success'); }
$cache = new Cache('engine/cache/changelog'); $cache->setContent(mysql_select_multi("SELECT `id`, `text`, `time`, `report_id`, `status` FROM `znote_changelog` ORDER BY `id` DESC;")); $cache->save(); } } // If we should give user price if ($price > 0) { $account = mysql_select_single("SELECT `a`.`id`, `a`.`email` FROM `accounts` AS `a` \n INNER JOIN `players` AS `p` ON `p`.`account_id` = `a`.`id`\n WHERE `p`.`name` = '{$playerName}' LIMIT 1;"); if ($account !== false) { // transaction log mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '{$reportId}', 'report@admin." . $user_data['name'] . " to " . $account['email'] . "', '" . $account['id'] . "', '0', '" . $price . "')"); // Process payment $data = mysql_select_single("SELECT `points` AS `old_points` FROM `znote_accounts` WHERE `account_id`='" . $account['id'] . "';"); // Give points to user $new_points = $data['old_points'] + $price; mysql_update("UPDATE `znote_accounts` SET `points`='{$new_points}' WHERE `account_id`='" . $account['id'] . "'"); // Remind GM that he sent points to character echo "<font color='green' size='5'>" . $playerName . " has been granted " . $price . " points for his reports.</font>"; } } // GET logic (Edit report data and specify how many [if any] points to give to user) } elseif (!empty($_GET)) { // Fetch GET data $action = getValue($_GET['action']); $playerName = getValue($_GET['name']); $reportId = getValue($_GET['id']); // Fetch the report we intend to modify foreach ($reports as $sid => $sa) { foreach ($sa as $rid => $ra) { if ($rid == $reportId) { $report = $reports[$sid][$reportId];
<?php include "../../includes/sessionAdmin.php"; include "../../includes/conexion.php"; include "../../includes/mysql_util.php"; $matricula = $_POST["matricula"]; $nombres = $_POST["nombres"]; $APaterno = $_POST["APaterno"]; $AMaterno = $_POST["AMaterno"]; $FechaNacimiento = $_POST["FechaNacimiento"]; $CURP = $_POST["CURP"]; $Enfermedades = $_POST["Enfermedades"]; $Alergias = $_POST["Alergias"]; $Telefono = $_POST["Telefono"]; $Email = $_POST["Email"]; $result = mysql_update("administrador", array('d_nombre' => $nombres, 'd_apellidopaterno' => $APaterno, 'd_apellidomaterno' => $AMaterno, 'd_fechanac' => $FechaNacimiento, 'd_curp' => $CURP, 'd_enfermedades' => $Enfermedades, 'd_alergias' => $Alergias, 'd_numlocal' => $Telefono, 'd_email' => $Email), $matricula); if (mysql_affected_rows() > 0) { $alertMsg = "Administrador actualizado satisfactoriamente"; } elseif (!$result) { $alertMsg = "Algo salio mal: " . mysql_error(); } else { $alertMsg = "No encontramos ningun Administrador con la matricula d{$matricula} o no hubo cambios en la informacion"; } echo "<script language=\"javascript\">\n\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\twindow.location.href = \"../../vistas/menus/menuAdmin.php\"\n\t\t\t</script>";
} else { $action = 0; } // POST delete if (isset($_POST['delete'])) { $delete = isset($_POST['delete']) ? (int) $_POST['delete'] : 0; if ($delete && $action == 1) { mysql_delete("DELETE FROM `znote_changelog` WHERE `id`='{$delete}' LIMIT 1;"); echo "<h2>Changelog message deleted!</h2>"; $updateCache = true; } } else { if ($status) { // POST update if ($changelogId > 0) { mysql_update("UPDATE `znote_changelog` SET `text`='{$changelogText}' WHERE `id`='{$changelogId}' LIMIT 1;"); echo "<h2>Changelog message updated!</h2>"; $updateCache = true; } else { // POST create $time = time(); mysql_insert("INSERT INTO `znote_changelog` (`text`, `time`, `report_id`, `status`) VALUES ('{$changelogText}', '{$time}', '0', '35');"); echo "<h2>Changelog message created!</h2>"; $updateCache = true; } } } if ($action === 2) { $old = mysql_select_single("SELECT `text` FROM `znote_changelog` WHERE `id`='{$changelogId}' LIMIT 1;"); } // HTML to create or update
// If empty post } // Display whatever output we figure out to add if (empty($errors) === false) { echo '<font color="red"><b>'; echo output_errors($errors); echo '</b></font>'; } // end ?> <h1>Admin Page.</h1> <p> <?php $basic = user_znote_data('version', 'installed', 'cached'); if ($basic['version'] !== $version) { mysql_update("UPDATE `znote` SET `version`='{$version}';"); $basic = user_znote_data('version', 'installed', 'cached'); } echo "Running Znote AAC Version: " . $basic['version'] . ".<br>"; echo "Last cached on: " . getClock($basic['cached'], true) . ".<br>"; ?> </p> <ul> <li> <b>Permanently Delete/erase character from database:</b> <form type="submit" action="" method="post"> <input type="text" name="del_name" placeholder="Character name..."> </form> </li> <li> <b>Ban/violate :3 character and/or his account:</b>
$WORKING['PID'] = getmypid(); // execute function on job shutdown register_shutdown_function('job_shutdown'); if (function_exists('pcntl_signal')) { pcntl_signal(SIGTERM, 'job_shutdown'); } //try to disable safe mode @ini_set('safe_mode', '0'); // Now user abrot allowed @ini_set('ignore_user_abort', '0'); //disable user abort ignore_user_abort(true); //update running file update_working_file(true); //mysql connect mysql_update(); //Load needed files foreach ($WORKING['STEPS'] as $step) { $stepfile = strtolower($step) . '.php'; if ($step != 'JOB_END') { if (is_file(BACKWPUP_JOBRUN_FOLDER . $stepfile)) { require_once BACKWPUP_JOBRUN_FOLDER . $stepfile; } else { trigger_error(sprintf(__('Can not find job step file: %s', 'backwpup'), $stepfile), E_USER_ERROR); } } } // Working step by step foreach ($WORKING['STEPS'] as $step) { //display some info massages bevor fist step if (count($WORKING['STEPSDONE']) == 0) {
if (!empty($_POST['reply_text'])) { sanitize($_POST['reply_text']); // Save ticket reply on database $query = array('tid' => $view, 'username' => getValue($_POST['username']), 'message' => getValue($_POST['reply_text']), 'created' => time()); $fields = '`' . implode('`, `', array_keys($query)) . '`'; $data = '\'' . implode('\', \'', $query) . '\''; mysql_insert("INSERT INTO `znote_tickets_replies` ({$fields}) VALUES ({$data})"); mysql_update("UPDATE `znote_tickets` SET `status`='Staff-Reply' WHERE `id`='{$view}' LIMIT 1;"); } else { if (!empty($_POST['admin_ticket_close'])) { $ticketId = (int) $_POST['admin_ticket_id']; mysql_update("UPDATE `znote_tickets` SET `status` = 'CLOSED' WHERE `id` ='{$ticketId}' LIMIT 1;"); } else { if (!empty($_POST['admin_ticket_open'])) { $ticketId = (int) $_POST['admin_ticket_id']; mysql_update("UPDATE `znote_tickets` SET `status` = 'Open' WHERE `id` ='{$ticketId}' LIMIT 1;"); } else { if (!empty($_POST['admin_ticket_delete'])) { $ticketId = (int) $_POST['admin_ticket_id']; mysql_delete("DELETE FROM `znote_tickets` WHERE `id`='{$ticketId}' LIMIT 1;"); header("Location: admin_helpdesk.php"); } } } } $ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='{$view}' LIMIT 1;"); ?> <h1>View Ticket #<?php echo $ticketData['id']; ?> </h1>
function resetPassword() { global $CURRENT_USER, $SETTINGS; $GLOBALS['sentEmail'] = false; // error checking if (!@$_REQUEST['userNum']) { die("No 'userNum' value specified!"); } if (!@$_REQUEST['resetCode']) { die("No 'resetCode' value specified!"); } if (!_isValidPasswordResetCode(@$_REQUEST['userNum'], @$_REQUEST['resetCode'])) { alert(t("Password reset code has expired or is not valid. Try resetting your password again.")); showInterface('forgotPassword.php', false); } // load user global $user; $user = mysql_get(accountsTable(), (int) @$_REQUEST['userNum']); // Lookup username or email if (@$_REQUEST['submitForm']) { security_dieUnlessPostForm(); security_dieOnInvalidCsrfToken(); disableInDemoMode('', 'resetPassword.php'); // error checking $textErrors = getNewPasswordErrors(@$_REQUEST['password'], @$_REQUEST['password:again'], $user['username']); // v2.52 if ($textErrors) { alert(nl2br(htmlencode($textErrors))); showInterface('resetPassword.php'); exit; } // update password $newPassword = getPasswordDigest($_REQUEST['password']); mysql_update(accountsTable(), $user['num'], null, array('password' => $newPassword)); // show login alert(t('Password updated!')); $_REQUEST = array(); showInterface('login.php', false); exit; } // showInterface('resetPassword.php'); exit; }
} if ($config['TFSVersion'] == 'TFS_02' || $config['salt'] === false) { $password = user_data($old_id, 'password'); $p_pass = $password['password']; } // Verify lenght of password is less than 28 characters (most likely a plain password) if (strlen($p_pass) < 28 && $old_id > 1) { // encrypt it with sha1 if ($config['TFSVersion'] == 'TFS_02' || $config['salt'] === false) { $p_pass = sha1($p_pass); } if ($config['TFSVersion'] == 'TFS_03' && $config['salt'] === true) { $p_pass = sha1($password['salt'] . $p_pass); } // Update their password so they are sha1 encrypted mysql_update("UPDATE `accounts` SET `password`='{$p_pass}' WHERE `id`='{$old}';"); $updated_pass += 1; } } } // validate players if ($all_account !== false) { $time = time(); foreach ($all_account as $all) { $chars = user_character_list_player_id($all); if ($chars !== false) { // since char list is not false, we found a character list // Lets loop through the character list foreach ($chars as $c) { // Is character not compatible yet? if (user_character_is_compatible($c) == 0) {
require 'config.php'; require 'engine/database/connect.php'; // check that the request comes from PayGol server if (!in_array($_SERVER['REMOTE_ADDR'], array('109.70.3.48', '109.70.3.146', '109.70.3.58'))) { header("HTTP/1.0 403 Forbidden"); die("Error: Unknown IP"); } // get the variables from PayGol system $message_id = $_GET['message_id']; $service_id = $_GET['service_id']; $shortcode = $_GET['shortcode']; $keyword = $_GET['keyword']; $message = $_GET['message']; $sender = $_GET['sender']; $operator = $_GET['operator']; $country = $_GET['country']; $custom = $_GET['custom']; $points = $_GET['points']; $price = $_GET['price']; $currency = $_GET['currency']; $paygol = $config['paygol']; $new_points = $paygol['points']; // Update logs: mysql_insert("INSERT INTO `znote_paygol` VALUES ('', '{$custom}', '{$price}', '{$new_points}', '{$message_id}', '{$service_id}', '{$shortcode}', '{$keyword}', '{$message}', '{$sender}', '{$operator}', '{$country}', '{$currency}')"); // Fetch points $account = mysql_select_single("SELECT `points` FROM `znote_accounts` WHERE `account_id`='{$custom}';"); // Calculate new points $new_points = $account['points'] + $new_points; // Update new points mysql_update("UPDATE `znote_accounts` SET `points`='{$new_points}' WHERE `account_id`='{$custom}'");
<?php include "../../includes/sessionAdmin.php"; include "../../includes/conexion.php"; include "../../includes/mysql_util.php"; $matricula = $_POST["matricula"]; $gru_nombre = $_POST["grupo"]; $result = mysql_update("grupo", $conexion, array('gru_nombre' => $gru_nombre), $matricula); if (!$result) { $alertMsg = "Algo salio mal: " . mysqli_error($conexion); } else { $alertMsg = "Grupo editado satisfactoriamente"; } echo "<script language=\"javascript\">\n\t\t\t\talert(\"{$alertMsg}\");\n\t\t\t\twindow.history.go(-2);\n\t\t\t</script>";