$paramPausa[0],'id_pausa' => $_SESSION["SetListaMotivo"]]); if($res['status'] == 'success'){ $jsStartup[] = "alert('Sucesso! Agente foi adicionado em Pausa!')"; } else { $jsStartup[] = sprintf("alert('Erro! %s')", utf8_decode($res['message'])); } } } else { $cmd = sprintf("window.opener.PausaDac('%s', 0);", $paramPausa[2]); } //if(IsAdmin ()) echo $cmd . " mot " . $_SESSION["SetListaMotivo"]; $jsStartup[] = $cmd; $jsStartup[] = "window.close()"; } else { $paramPausa = array(); $paramPausa[0] = isset($_GET['pausaAgente']) ? $_GET['pausaAgente'] : '0000'; $paramPausa[1] = isset($_GET['ramal']) ? $_GET['ramal'] : '0000'; $paramPausa[2] = $_GET['dac']; $paramPausa[3] = isset($_GET['tipoPausa']) ? $_GET['tipoPausa'] : 'agt'; $paramPausa[4] = $_GET['status']; $_SESSION["paramPausa"] = $paramPausa; } $msgSis = ""; $_SESSION[AGT_PAUSA_MOTIVO] = GetMotivoDef($dbcon); $smarty->assign('menuAgente', ""); $smarty->assign('value', $valueBt); $smarty->assign('motivoPausa', GetMotivo($dbcon, $_SESSION[AGT_PAUSA_MOTIVO])); $smarty->assign('msgSis', $msgSis); GetTemplate($smarty, $nomeTpl); function request($url, $post = []) { $ch = curl_init(); $isPost = $post ? 1 : 0; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, $isPost); if ($isPost) { curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post)); } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $head = curl_exec($ch); curl_close($ch); return json_decode($head, true); } ?>