Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php session_name("setcall-dialer"); session_start(); include_once "connectDb.php"; d..

Decoded Output download

<?php 
session_name("setcall-dialer"); 
session_start(); 
include_once "connectDb.php"; 
date_default_timezone_set("Europe/Istanbul"); 
if (!function_exists("json_encode")) { 
	include_once "JSON.php"; 
} 
$db = new connectDb(); 
$con = $db->connect(); 
$lang = $_SESSION["language"]; 
$dato = isset($_GET["dato"]) ? $_GET["dato"] : "start_process"; 
if ($dato == "start_process") { 
	$query = "select * from grabar where id=1"; 
	$result = $db->select($con, $query, "ajax_refresh_datos"); 
	$row = mysqli_fetch_array($result); 
	$prehab1 = $row["prehab1"]; 
	$prehab2 = $row["prehab2"]; 
	$prehab3 = $row["prehab3"]; 
	$prehab4 = $row["prehab4"]; 
	$prehab5 = $row["prehab5"]; 
	$prehab6 = $row["prehab6"]; 
	$prehab7 = $row["prehab7"]; 
	$saludohab = $row["saludohab"]; 
	$despedida = $row["despedida"]; 
} 
if ($dato == "estado") { 
	$query = "select count(*) as tot from `call`"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$totReg = $row["tot"]; 
	$query = "select count(*) as tot from `call` where estado<>''"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$procesadas = $row["tot"]; 
	$query = "select count(*) as tot from `call` where estado='OK'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$cont = $row["tot"]; 
	$query = "select count(*) as tot from `call` where estado='NC'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$noCont = $row["tot"]; 
	$query = "select count(*) as tot from `call` where estado=''"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$pend = $row["tot"]; 
	$query = "select count(*) as tot from `call` where estado='error'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$error = $row["tot"]; 
	$query = "select est_ivr from `config` where id=1"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$est_ivr = $row["est_ivr"]; 
	$date_start = $row["date_start"]; 
	$date_start_hab = $row["date_start_hab"]; 
	$query = "select port_call from `port_call` where id=1"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$port_call = $row["port_call"]; 
	$jsondata = array(); 
	$jsondata["totalreg"] = $totReg; 
	$jsondata["procesadas"] = $procesadas; 
	$jsondata["contestada"] = $cont; 
	$jsondata["nocont"] = $noCont; 
	$jsondata["pendiente"] = $pend; 
	$jsondata["error"] = $error; 
	if ($date_start_hab == 1) { 
		$jsondata["date_start"] = $date_start; 
	} 
	$jsondata["est_ivr"] = $est_ivr; 
	$jsondata["port_call"] = $port_call; 
	if (function_exists("json_encode")) { 
		echo json_encode($jsondata); 
	} else { 
		$json = new Services_JSON(); 
		echo $json->encode($jsondata); 
	} 
} 
if ($dato == "preguntas") { 
	$query = "select count(*) as tot from `call`"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$torReg = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta1<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p1 = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta2<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p2 = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta3<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p3 = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta4<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p4 = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta5<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p5 = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta6<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p6 = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta7<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p7 = $row["tot"]; 
	$query = "select count(*) as tot from `call` where pregunta8<>'' and pregunta1<>'-1'"; 
	$result = $db->select($con, $query); 
	$row = mysqli_fetch_array($result); 
	$p8 = $row["tot"]; 
	$jsondata = array(); 
	$jsondata["totalreg"] = $torReg; 
	$jsondata["p1"] = $p1; 
	$jsondata["p2"] = $p2; 
	$jsondata["p3"] = $p3; 
	$jsondata["p4"] = $p4; 
	$jsondata["p5"] = $p5; 
	$jsondata["p6"] = $p6; 
	$jsondata["p7"] = $p7; 
	$jsondata["p8"] = $p8; 
	if (function_exists("json_encode")) { 
		echo json_encode($jsondata, JSON_FORCE_OBJECT); 
	} else { 
		$json = new Services_JSON(); 
		echo $json->encode($jsondata); 
	} 
} 
if ($dato == "borrar") { 
	$falla = true; 
	$query = "truncate table `call`"; 
	$result = mysqli_query($con, $query); 
	if ($result) { 
		$query = "truncate table `ringback`"; 
		$result = mysqli_query($con, $query); 
		if ($result) { 
			$falla = false; 
		} 
	} 
	if ($falla) { 
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>
		  <strong>Error no se borro registros!</strong> " . mysqli_error($con) . "  
		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
			<span aria-hidden='true'>&times;</span>
		  </button>
		</div>"; 
	} else { 
		$infoRecDel = $lang == "es" ? "Registros borrados!" : "All records delete!"; 
		$infodbVacia = $lang == "es" ? " La base de datos esta vacia." : " Database empty."; 
		echo "<div class='alert alert-danger alert-dismissible fade show' role='alert'>
		  <strong>{$infoRecDel}</strong>{$infodbVacia}
		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
			<span aria-hidden='true'>&times;</span>
		  </button>
		</div>"; 
	} 
} 
if ($dato == "todos_volver") { 
	$query = "update `call` set puerta='',llamadas='',estado='',flag='',hora_call='',fecha_call='',play_mensaje='',play_tiempo='',
			 hangup='',recordfile='',pregunta1='',pregunta2='',pregunta3='',pregunta4='',pregunta5='',pregunta6='',pregunta7='',pregunta8=''"; 
	$result = mysqli_query($con, $query); 
	if (!$result) { 
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>
		  <strong>Error no se actualizo registros!</strong> " . mysqli_error($con) . "
		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
			<span aria-hidden='true'>&times;</span>
		  </button>
		</div>"; 
	} else { 
		$infoRecUp = $lang == "es" ? "Todos los registros actualizados!" : "All records updated!"; 
		$infoRecAll = $lang == "es" ? " Todos los registros." : " All records."; 
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>
		  <strong>{$infoRecUp}</strong>{$infoRecAll}
		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
			<span aria-hidden='true'>&times;</span>
		  </button>
		</div>"; 
	} 
} 
if ($dato == "nocontesta_volver") { 
	$query = "update `call` set puerta='',llamadas='',estado='',flag='',hora_call='',fecha_call='',play_mensaje='',play_tiempo='',
			 hangup='',recordfile='',pregunta1='',pregunta2='',pregunta3='',pregunta4='',pregunta5='',pregunta6='',pregunta7='',pregunta8=''
			 where estado='NC' or estado='OC' or estado='error'"; 
	$result = mysqli_query($con, $query); 
	if (!$result) { 
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>
		  <strong>Error no se actualizo registros!</strong> " . mysqli_error($con) . "
		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
			<span aria-hidden='true'>&times;</span>
		  </button>
		</div>"; 
	} else { 
		$infoRecUpNo = $lang == "es" ? "Registros Actualizados!" : "Records Update!."; 
		$infoRecNoCon = $lang == "es" ? " Registros que no contestaron." : " Records that did not answer."; 
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>
		  <strong>{$infoRecUpNo}</strong>{$infoRecNoCon}
		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
			<span aria-hidden='true'>&times;</span>
		  </button>
		</div>"; 
	} 
} 
if ($dato == "import_contador") { 
	 
	$dato2 = $_GET["dato2"]; 
	sleep(0.5); 
	echo $dato2; 
} 
if ($dato == "llamar") { 
	$dato2 = $_GET["dato2"]; 
	date_default_timezone_set("Europe/Istanbul"); 
	if ($dato2 == "start") { 
		$idcall = date("YmdHis"); 
		$query = "update config set est_ivr=1,idcall='{$idcall}'"; 
		$db->select($con, $query, "ajax_refresh_datos"); 
		$query = "update ipnet_ivr.port_call set port_call=0 where id=1"; 
		$db->select($con, $query, "ajax_refresh_datos"); 
		$fecha_start_work = date("Y-m-d H:i:s"); 
		$start_who = $_SESSION["user"]; 
		$ipLog = getenv("REMOTE_ADDR"); 
		$queryStart = "insert into `ipnet_ivr`.`work` (id,fecha_start,start_who) values ('{$idcall}','{$fecha_start_work}','{$ipLog}-{$start_who}') "; 
		$db->select($con, $queryStart, "ajax_refresh_datos"); 
		$resp = "startok"; 
	} elseif ($dato2 == "stop") { 
		$queryC = "select * from config where id=1"; 
		$resultC = $db->select($con, $queryC, "ajax_refresh_datos"); 
		$rowC = mysqli_fetch_array($resultC); 
		$idcallWork = $rowC["idcall"]; 
		$stop_who = $_SESSION["user"]; 
		$ipLog = getenv("REMOTE_ADDR"); 
		$fecha_end_work = date("Y-m-d H:i:s"); 
		$queryW = "SELECT 
				SUM(CASE WHEN estado='OK' THEN 1 ELSE 0 END ) 'OK',
				SUM(CASE WHEN estado='OC' THEN 1 ELSE 0 END ) 'OC',
				SUM(CASE WHEN estado='NC' THEN 1 ELSE 0 END ) 'NC',
				SUM(CASE WHEN estado='error' THEN 1 ELSE 0 END ) 'ER'
				FROM `call`"; 
		$resultW = $db->select($con, $queryW, "ajax_refresh_datos"); 
		$rowW = mysqli_fetch_array($resultW); 
		$ok = $rowW["OK"] == null ? "0" : $rowW["OK"]; 
		$nc = $rowW["NC"] == null ? "0" : $rowW["NC"]; 
		$oc = $rowW["OC"] == null ? "0" : $rowW["OC"]; 
		$error = $rowW["ER"] == null ? "0" : $rowW["ER"]; 
		$query = "update `ipnet_ivr`.`work` set fecha_end='{$fecha_end_work}',stop_who='{$ipLog}-{$stop_who}',nc={$nc},oc={$oc},ok={$ok},err={$error} where id='{$idcallWork}'"; 
		$db->select($con, $query, "ajax_refresh_datos"); 
		$query = "update config set est_ivr=0"; 
		$resp = "stopok"; 
		$db->select($con, $query, "ajax_refresh_datos"); 
		sleep(1); 
		$db->select($con, "update `port_call` set port_call=0 where id=1 ", "ajax_refresh_datos"); 
	} 
	echo $resp; 
} 
if ($dato == "datatable") { 
	$id = $_GET["dato2"]; 
	$view = $_GET["dato3"]; 
	$query = "update fields set view={$view}  where id={$id}"; 
	$db->select($con, $query, "ajax_refresh_datos"); 
} 
if ($dato == "playwavsurfer") { 
	$audio = $_GET["dato2"]; 
	$audioRandom = $audio . "_" . date("Ymdhis") . rand(142, 3784); 
	if (PHP_OS == "WINNT") { 
		$copia = "copy /y saludos\{$audio} saludos\{$audioRandom}.wav"; 
	} else { 
		$copia = "cp saludos/{$audio} saludos/{$audioRandom}.wav"; 
	} 
	exec($copia); 
	echo $audioRandom . ".wav"; 
} 
if ($dato == "testemail") { 
	exec("php -q /var/www/html/ipnetivr/email_send_report.php test"); 
} 
if ($dato == "enc_digito_menu") { 
	$enc_digito_menu = ""; 
	$texto = $_GET["dato3"]; 
	$mensaje = $_GET["dato4"]; 
	$pretext = "pretext" . $mensaje; 
	if ($mensaje == "20") { 
		$enc_digito_menu = $_GET["dato2"]; 
		$query = "update `grabar` set saludotext = '{$texto}' , enc_digito_menu={$enc_digito_menu}"; 
	} else { 
		if ($mensaje == "21") { 
			$query = "update `grabar` set despedidatext = '{$texto}'"; 
		} else { 
			 
			$query = "update `grabar` set {$pretext} = '{$texto}' "; 
		} 
	} 
	$db->select($con, $query, "ajax_refresh_datos"); 
} 
mysqli_close($con); ?>

Did this file decode correctly?

Original Code

<?php
session_name("setcall-dialer");
session_start();
include_once "connectDb.php";
date_default_timezone_set("Europe/Istanbul");
if (!function_exists("json_encode")) {
	include_once "JSON.php";
}
$db = new connectDb();
$con = $db->connect();
$lang = $_SESSION["language"];
$dato = isset($_GET["dato"]) ? $_GET["dato"] : "start_process";
if ($dato == "start_process") {
	$query = "select * from grabar where id=1";
	$result = $db->select($con, $query, "ajax_refresh_datos");
	$row = mysqli_fetch_array($result);
	$prehab1 = $row["prehab1"];
	$prehab2 = $row["prehab2"];
	$prehab3 = $row["prehab3"];
	$prehab4 = $row["prehab4"];
	$prehab5 = $row["prehab5"];
	$prehab6 = $row["prehab6"];
	$prehab7 = $row["prehab7"];
	$saludohab = $row["saludohab"];
	$despedida = $row["despedida"];
}
if ($dato == "estado") {
	$query = "select count(*) as tot from `call`";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$totReg = $row["tot"];
	$query = "select count(*) as tot from `call` where estado<>''";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$procesadas = $row["tot"];
	$query = "select count(*) as tot from `call` where estado='OK'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$cont = $row["tot"];
	$query = "select count(*) as tot from `call` where estado='NC'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$noCont = $row["tot"];
	$query = "select count(*) as tot from `call` where estado=''";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$pend = $row["tot"];
	$query = "select count(*) as tot from `call` where estado='error'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$error = $row["tot"];
	$query = "select est_ivr from `config` where id=1";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$est_ivr = $row["est_ivr"];
	$date_start = $row["date_start"];
	$date_start_hab = $row["date_start_hab"];
	$query = "select port_call from `port_call` where id=1";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$port_call = $row["port_call"];
	$jsondata = array();
	$jsondata["totalreg"] = $totReg;
	$jsondata["procesadas"] = $procesadas;
	$jsondata["contestada"] = $cont;
	$jsondata["nocont"] = $noCont;
	$jsondata["pendiente"] = $pend;
	$jsondata["error"] = $error;
	if ($date_start_hab == 1) {
		$jsondata["date_start"] = $date_start;
	}
	$jsondata["est_ivr"] = $est_ivr;
	$jsondata["port_call"] = $port_call;
	if (function_exists("json_encode")) {
		echo json_encode($jsondata);
	} else {
		$json = new Services_JSON();
		echo $json->encode($jsondata);
	}
}
if ($dato == "preguntas") {
	$query = "select count(*) as tot from `call`";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$torReg = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta1<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p1 = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta2<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p2 = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta3<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p3 = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta4<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p4 = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta5<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p5 = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta6<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p6 = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta7<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p7 = $row["tot"];
	$query = "select count(*) as tot from `call` where pregunta8<>'' and pregunta1<>'-1'";
	$result = $db->select($con, $query);
	$row = mysqli_fetch_array($result);
	$p8 = $row["tot"];
	$jsondata = array();
	$jsondata["totalreg"] = $torReg;
	$jsondata["p1"] = $p1;
	$jsondata["p2"] = $p2;
	$jsondata["p3"] = $p3;
	$jsondata["p4"] = $p4;
	$jsondata["p5"] = $p5;
	$jsondata["p6"] = $p6;
	$jsondata["p7"] = $p7;
	$jsondata["p8"] = $p8;
	if (function_exists("json_encode")) {
		echo json_encode($jsondata, JSON_FORCE_OBJECT);
	} else {
		$json = new Services_JSON();
		echo $json->encode($jsondata);
	}
}
if ($dato == "borrar") {
	$falla = true;
	$query = "truncate table `call`";
	$result = mysqli_query($con, $query);
	if ($result) {
		$query = "truncate table `ringback`";
		$result = mysqli_query($con, $query);
		if ($result) {
			$falla = false;
		}
	}
	if ($falla) {
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>\n		  <strong>Error no se borro registros!</strong> " . mysqli_error($con) . "  \n		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n			<span aria-hidden='true'>&times;</span>\n		  </button>\n		</div>";
	} else {
		$infoRecDel = $lang == "es" ? "Registros borrados!" : "All records delete!";
		$infodbVacia = $lang == "es" ? " La base de datos esta vacia." : " Database empty.";
		echo "<div class='alert alert-danger alert-dismissible fade show' role='alert'>\n		  <strong>{$infoRecDel}</strong>{$infodbVacia}\n		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n			<span aria-hidden='true'>&times;</span>\n		  </button>\n		</div>";
	}
}
if ($dato == "todos_volver") {
	$query = "update `call` set puerta='',llamadas='',estado='',flag='',hora_call='',fecha_call='',play_mensaje='',play_tiempo='',\n			 hangup='',recordfile='',pregunta1='',pregunta2='',pregunta3='',pregunta4='',pregunta5='',pregunta6='',pregunta7='',pregunta8=''";
	$result = mysqli_query($con, $query);
	if (!$result) {
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>\n		  <strong>Error no se actualizo registros!</strong> " . mysqli_error($con) . "\n		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n			<span aria-hidden='true'>&times;</span>\n		  </button>\n		</div>";
	} else {
		$infoRecUp = $lang == "es" ? "Todos los registros actualizados!" : "All records updated!";
		$infoRecAll = $lang == "es" ? " Todos los registros." : " All records.";
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>\n		  <strong>{$infoRecUp}</strong>{$infoRecAll}\n		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n			<span aria-hidden='true'>&times;</span>\n		  </button>\n		</div>";
	}
}
if ($dato == "nocontesta_volver") {
	$query = "update `call` set puerta='',llamadas='',estado='',flag='',hora_call='',fecha_call='',play_mensaje='',play_tiempo='',\n			 hangup='',recordfile='',pregunta1='',pregunta2='',pregunta3='',pregunta4='',pregunta5='',pregunta6='',pregunta7='',pregunta8=''\n			 where estado='NC' or estado='OC' or estado='error'";
	$result = mysqli_query($con, $query);
	if (!$result) {
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>\n		  <strong>Error no se actualizo registros!</strong> " . mysqli_error($con) . "\n		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n			<span aria-hidden='true'>&times;</span>\n		  </button>\n		</div>";
	} else {
		$infoRecUpNo = $lang == "es" ? "Registros Actualizados!" : "Records Update!.";
		$infoRecNoCon = $lang == "es" ? " Registros que no contestaron." : " Records that did not answer.";
		echo "<div class='alert alert-warning alert-dismissible fade show' role='alert'>\n		  <strong>{$infoRecUpNo}</strong>{$infoRecNoCon}\n		  <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n			<span aria-hidden='true'>&times;</span>\n		  </button>\n		</div>";
	}
}
if ($dato == "import_contador") {
	
	$dato2 = $_GET["dato2"];
	sleep(0.5);
	echo $dato2;
}
if ($dato == "llamar") {
	$dato2 = $_GET["dato2"];
	date_default_timezone_set("Europe/Istanbul");
	if ($dato2 == "start") {
		$idcall = date("YmdHis");
		$query = "update config set est_ivr=1,idcall='{$idcall}'";
		$db->select($con, $query, "ajax_refresh_datos");
		$query = "update ipnet_ivr.port_call set port_call=0 where id=1";
		$db->select($con, $query, "ajax_refresh_datos");
		$fecha_start_work = date("Y-m-d H:i:s");
		$start_who = $_SESSION["user"];
		$ipLog = getenv("REMOTE_ADDR");
		$queryStart = "insert into `ipnet_ivr`.`work` (id,fecha_start,start_who) values ('{$idcall}','{$fecha_start_work}','{$ipLog}-{$start_who}') ";
		$db->select($con, $queryStart, "ajax_refresh_datos");
		$resp = "startok";
	} elseif ($dato2 == "stop") {
		$queryC = "select * from config where id=1";
		$resultC = $db->select($con, $queryC, "ajax_refresh_datos");
		$rowC = mysqli_fetch_array($resultC);
		$idcallWork = $rowC["idcall"];
		$stop_who = $_SESSION["user"];
		$ipLog = getenv("REMOTE_ADDR");
		$fecha_end_work = date("Y-m-d H:i:s");
		$queryW = "SELECT \n				SUM(CASE WHEN estado='OK' THEN 1 ELSE 0 END ) 'OK',\n				SUM(CASE WHEN estado='OC' THEN 1 ELSE 0 END ) 'OC',\n				SUM(CASE WHEN estado='NC' THEN 1 ELSE 0 END ) 'NC',\n				SUM(CASE WHEN estado='error' THEN 1 ELSE 0 END ) 'ER'\n				FROM `call`";
		$resultW = $db->select($con, $queryW, "ajax_refresh_datos");
		$rowW = mysqli_fetch_array($resultW);
		$ok = $rowW["OK"] == null ? "0" : $rowW["OK"];
		$nc = $rowW["NC"] == null ? "0" : $rowW["NC"];
		$oc = $rowW["OC"] == null ? "0" : $rowW["OC"];
		$error = $rowW["ER"] == null ? "0" : $rowW["ER"];
		$query = "update `ipnet_ivr`.`work` set fecha_end='{$fecha_end_work}',stop_who='{$ipLog}-{$stop_who}',nc={$nc},oc={$oc},ok={$ok},err={$error} where id='{$idcallWork}'";
		$db->select($con, $query, "ajax_refresh_datos");
		$query = "update config set est_ivr=0";
		$resp = "stopok";
		$db->select($con, $query, "ajax_refresh_datos");
		sleep(1);
		$db->select($con, "update `port_call` set port_call=0 where id=1 ", "ajax_refresh_datos");
	}
	echo $resp;
}
if ($dato == "datatable") {
	$id = $_GET["dato2"];
	$view = $_GET["dato3"];
	$query = "update fields set view={$view}  where id={$id}";
	$db->select($con, $query, "ajax_refresh_datos");
}
if ($dato == "playwavsurfer") {
	$audio = $_GET["dato2"];
	$audioRandom = $audio . "_" . date("Ymdhis") . rand(142, 3784);
	if (PHP_OS == "WINNT") {
		$copia = "copy /y saludos\\{$audio} saludos\\{$audioRandom}.wav";
	} else {
		$copia = "cp saludos/{$audio} saludos/{$audioRandom}.wav";
	}
	exec($copia);
	echo $audioRandom . ".wav";
}
if ($dato == "testemail") {
	exec("php -q /var/www/html/ipnetivr/email_send_report.php test");
}
if ($dato == "enc_digito_menu") {
	$enc_digito_menu = "";
	$texto = $_GET["dato3"];
	$mensaje = $_GET["dato4"];
	$pretext = "pretext" . $mensaje;
	if ($mensaje == "20") {
		$enc_digito_menu = $_GET["dato2"];
		$query = "update `grabar` set saludotext = '{$texto}' , enc_digito_menu={$enc_digito_menu}";
	} else {
		if ($mensaje == "21") {
			$query = "update `grabar` set despedidatext = '{$texto}'";
		} else {
			
			$query = "update `grabar` set {$pretext} = '{$texto}' ";
		}
	}
	$db->select($con, $query, "ajax_refresh_datos");
}
mysqli_close($con);

Function Calls

session_name 1

Variables

None

Stats

MD5 468cd75cc9b919e910b37478c27e2085
Eval Count 0
Decode Time 168 ms