$performance=$_POST["performance"]; $comments=$_POST["comments"]; $idTeam=$_POST["idteam"]; $english=$_POST["english"]; $calledSupervisor=$_POST["supervisor"]; $accion=$_POST["accion"]; $cantidad=$_POST["cantidad"]; $razon=$_POST["razonptscall"]; $comments=str_replace("\n","<br>",$comments); $comments=str_replace("\r","",$comments); if(isset($cantidad) && $cantidad!=0 && $cantidad!=" "){ // graba los datos y retorna el valor del ultimo id introducido en la tabla $idpunts=$ff->grabardatos("INSERT INTO puntos(id_puntos,cantidad,fecha,razon,id_usuario,id_accion) VALUES (Null,'$cantidad','$fecha','$razon','$idAgent','$accion')"); } else{$idpunts=0;} $sql=" INSERT INTO qa_calls (id,idAgent,idAdmin,fecha,shift,customerName,polite,performance,english,calledSupervisor,comments,idTeam,id_puntos) VALUES (Null,'$idAgent','$idAdmin','$fecha','$shift','$customerName','$polite','$performance','$english','$calledSupervisor','$comments','$idTeam','$idpunts') "; //$ff->grabardatos($sql); if($ff->grabardatos($sql)){$ff->escribir_archivo("qa/calls/".$idAgent.".txt","w",$idAgent);} include_once("vercalls.php"); break;
echo"</div>"; break; case "grabarchats": $idAgent=$_POST["idagent"];$idAdmin=$_POST["idAdmin"];$fecha=$_POST["fecha"];$shift=$_POST["shift"]; $customerName=$_POST["customer"];$emailAddress=$_POST["email"];$waitTime=$_POST["wait"];$comments=$_POST["comment"]; $idTeam=$_POST["idteam"];$duration=$_POST["duration"]; $sql=" INSERT INTO qa_chats(id,idAgent,idAdmin,fecha,shift,customerName,emailAddress,waitTime,comments,idTeam,duration) VALUES (Null,'$idAgent','$idAdmin','$fecha','$shift','$customerName','$emailAddress','$waitTime','$comments','$idTeam','$duration') "; if($f->grabardatos($sql)){ $f->redireccionar("","_qa.php?tipo=$tipo&usuario=$usuario&transaccion=chats"); } break; case "mails": $plantilla=$f->leer_plantilla("qamails.html"); $idadmin=$f->id_usuario($usuario); $optionsteam=$f->qaconsultas("SELECT id_team AS id, team AS nombre FROM teams","options"); $optionsagent=$f->qaconsultas("SELECT id_usuario AS id, nombre AS nombre FROM usuario WHERE estado='1' AND id_tipo_usuario='3'","options"); $plantilla=str_replace("{url}","_qa.php?tipo=$tipo&usuario=$usuario&transaccion=grabarmails",$plantilla); $plantilla=str_replace("{fecha}",$f->fechadehoy(),$plantilla); $plantilla=str_replace("{optionsteam}",$optionsteam,$plantilla); $plantilla=str_replace("{optionsagent}",$optionsagent,$plantilla); $plantilla=str_replace("{idadmin}",$idadmin,$plantilla);
$answerGiven=str_replace("\n","<br>",$answerGiven); $answerGiven=str_replace("\r","",$answerGiven); $correctAnswer=str_replace("\n","<br>",$correctAnswer); $correctAnswer=str_replace("\r","",$correctAnswer); $sql=" INSERT INTO qa_emails(id,idAgent,idAdmin,fecha,shift,customerName,email,comments,answerGiven,correctAnswer,team) VALUES (Null,'$idAgent','$idAdmin','$fecha','$shift','$customerName','$emailAddress','$comments','$answerGiven','$correctAnswer','$idTeam') "; $ff->grabardatos($sql); include_once("vermails.php"); break; case "delete": $id=$_POST["iddelete"]; $ff->grabardatos("DELETE FROM qa_emails WHERE id='$id'"); include_once("vermails.php"); break; case "showform_edit": $id=$_POST["idmodify"]; $plantilla=$ff->leer_plantilla("qamails_edit.html"); $consulta="AS campo FROM qa_emails WHERE id='$id'"; $idAgent=$ff->qaconsultas("SELECT idAgent $consulta","uncampo");
$duration=$_POST["duration"]; $accion=$_POST["accion"]; $cantidad=$_POST["cantidad"]; $razon=$_POST["razonptschat"]; $comments=str_replace("\n","<br>",$comments); $comments=str_replace("\r","",$comments); $comments=str_replace("&"," and ",$comments); if(isset($cantidad) && $cantidad!=0 && $cantidad!=" "){ // graba los datos y retorna el valor del ultimo id introducido en la tabla $idpunts=$ff->grabardatos("INSERT INTO puntos(id_puntos,cantidad,fecha,razon,id_usuario,id_accion) VALUES (Null,'$cantidad','$fecha','$razon','$idAgent','$accion')"); } else{$idpunts=0;} $sql=" INSERT INTO qa_chats(id,idAgent,idAdmin,fecha,shift,customerName,emailAddress,waitTime,comments,idTeam,duration,id_puntos) VALUES (Null,'$idAgent','$idAdmin','$fecha','$shift','$customerName','$emailAddress','$waitTime','$comments','$idTeam','$duration','$idpunts')"; if($ff->grabardatos($sql)){$ff->escribir_archivo("qa/chats/".$idAgent.".txt","w",$idAgent);} include_once("verchats.php"); break;