fork(2) download
  1. <script language="JavaScript" type="text/JavaScript">
  2. <!--
  3. function MM_displayStatusMsg(msgStr) { //v1.0
  4. status=msgStr;
  5. document.MM_returnValue = true;
  6. }
  7. //-->
  8.  
  9. function checarAnuncio() {
  10. var http=false;
  11. var http = getHTTPObject();
  12.  
  13. if (!enProceso && http) {
  14. http.open("POST", "../consulta.php",true);
  15. http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  16.  
  17. enProceso = true;
  18. http.send("accion=anuncio");
  19. http.onreadystatechange = function()
  20. {
  21. if (http.readyState == 4) {
  22. if (http.status == 200) {
  23. if (http.responseText.indexOf('invalid') == -1) {
  24. // Armamos un array, usando la coma para separar elementos
  25. results = http.responseText.split(",");
  26. if(results[0]!="")
  27. alert(results[0]);
  28. enProceso = false;
  29. }
  30. }
  31. }
  32. }
  33. }
  34. delete http;
  35. enProceso = false;
  36. window.setTimeout("checarAnuncio();", 10000);
  37. }
  38.  
  39. // ################################################################################
  40. // FUNCIONES PARTICULARES
  41. // ################################################################################
  42. var CronoID = null;
  43. var decimas, segundos, minutos;
  44. function iniciarTiempo(){
  45. decimas = 0
  46. segundos = 0
  47. minutos = 0
  48. document.getElementById('time_call').innerHTML = "00:00";
  49. calcularTiempo();
  50. }
  51. function calcularTiempo(){
  52. //incrementa el crono
  53. // decimas++
  54. // if ( decimas > 9 ) {
  55. // decimas = 0
  56. segundos++
  57. if ( segundos > 59 ) {
  58. segundos = 0
  59. minutos++
  60. if ( minutos > 99 ) {
  61. clearTimeout(CronoID);
  62. }
  63. }
  64. // }
  65.  
  66. //configura la salida
  67. var ValorCrono = "";
  68. ValorCrono = (minutos < 10) ? "0" + minutos : minutos;
  69. ValorCrono += (segundos < 10) ? ":0" + segundos : ":" + segundos;
  70. // ValorCrono += ":" + decimas;
  71.  
  72. document.getElementById('time_call').innerHTML = ValorCrono;
  73.  
  74. time_total=segundos+(minutos*60);
  75. if(time_total>300){
  76. if(time_total % 2){
  77. colorFondo("#FFFF00");
  78. }else{
  79. colorFondo('#0000FF');
  80. }
  81. }
  82. CronoID = setTimeout("calcularTiempo()", 1000);
  83. }
  84.  
  85. function Terminar(){
  86. window.location.href='../index.php?salir=OK';
  87. }
  88.  
  89. function checarValores(){
  90. checarAnuncio();
  91. cambiarEstatus(1);
  92. }
  93. <? if($_SESSION["permiso"] == 2 ){ ?>
  94. window.onload = checarValores;
  95. <? } ?>
  96.  
  97. </script>
  98. <? if($_SESSION["permiso"] == 4 ){ ?>
  99. <a href="callcenter.php">CallCenter</a>
  100. <a href="visitas.php">Visitas</a>
  101. <? } ?>
  102. <? if( $_SESSION["permiso"]==9 || $_SESSION["permiso"]==3 || $_SESSION["permiso"]==6 ){ ?>
  103. <a href="../direccion/index.php" onMouseOver="MM_displayStatusMsg('Direccion');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('');return document.MM_returnValue">Direccion</a>
  104. <? }elseif($_SESSION["permiso"]==2){ ?>
  105. <select name="estatus" style="font-size:8px;" onChange="cambiarEstatus(this.value)">
  106. <option value="1" <? if($_SESSION["estatus"]==1) echo("selected"); ?>>DISPONIBLE</option>
  107. <option value="2" <? if($_SESSION["estatus"]==2) echo("selected"); ?>>PERSONAL</option>
  108. <option value="3" <? if($_SESSION["estatus"]==3) echo("selected"); ?>>BREAK</option>
  109. <option value="4" <? if($_SESSION["estatus"]==4) echo("selected"); ?>>JUNTA</option>
  110. <option value="5" <? if($_SESSION["estatus"]==5) echo("selected"); ?>>PAGO</option>
  111. <option value="6" <? if($_SESSION["estatus"]==6) echo("selected"); ?>>CAPACITACION</option>
  112. <option value="7" <? if($_SESSION["estatus"]==7) echo("selected"); ?>>SUPERVISION</option>
  113. </select>
  114. <? } ?>
  115. <div class="cronometro" id="time_call">&nbsp;</div>
  116. <div style="height: 200px; position: relative;">&nbsp;</div>
  117. <? if($_SESSION["permiso"] == 2 ){ ?>
  118. <a href="./tiempos_asesor_ok.php">Mis tiempos</a>
  119. <a href="#" onMouseOver="MM_displayStatusMsg('Limpiar Formulario');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('');return document.MM_returnValue" onClick="document.frmCartera.submit();" style="height:20px;">Limpiar</a>
  120. <? } ?>
  121. <div style="height: 155px; position: relative;">&nbsp;</div>
  122. <a href="#" onMouseOver="MM_displayStatusMsg('Salir');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('');return document.MM_returnValue" onClick="Terminar();">Salir</a>
  123.  
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
//-->

function checarAnuncio() {
	var http=false;
	var http = getHTTPObject();
		
    if (!enProceso && http) {
 		http.open("POST", "../consulta.php",true);
		http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
		enProceso = true;
		http.send("accion=anuncio");
		http.onreadystatechange = function()
			{
				if (http.readyState == 4) { 
					if (http.status == 200) { 
						if (http.responseText.indexOf('invalid') == -1) {
							// Armamos un array, usando la coma para separar elementos
							results = http.responseText.split(","); 
							if(results[0]!="")
								alert(results[0]);
							enProceso = false;
						}
					}
				}
			}
    }
	delete http;
	enProceso = false;
	window.setTimeout("checarAnuncio();", 10000);
}

// ################################################################################
// FUNCIONES PARTICULARES
// ################################################################################
	var CronoID = null;
	var decimas, segundos, minutos;
	function iniciarTiempo(){
		decimas = 0
		segundos = 0
		minutos = 0
		document.getElementById('time_call').innerHTML = "00:00";
		calcularTiempo();
	}
	function calcularTiempo(){
		//incrementa el crono
//		decimas++
//		if ( decimas > 9 ) {
//			decimas = 0
			segundos++
			if ( segundos > 59 ) {
				segundos = 0
				minutos++
				if ( minutos > 99 ) {
					clearTimeout(CronoID);
				}
			}
//		}
	
		//configura la salida
		var ValorCrono = "";
		ValorCrono = (minutos < 10) ? "0" + minutos : minutos;
		ValorCrono += (segundos < 10) ? ":0" + segundos : ":" + segundos;
//		ValorCrono += ":" + decimas;

		document.getElementById('time_call').innerHTML = ValorCrono;
		
		time_total=segundos+(minutos*60);
		if(time_total>300){
			if(time_total % 2){
				colorFondo("#FFFF00");
			}else{
				colorFondo('#0000FF');
			}
		}
		CronoID = setTimeout("calcularTiempo()", 1000);
	}

	function Terminar(){
		window.location.href='../index.php?salir=OK';
	}

	function checarValores(){
		checarAnuncio();
		cambiarEstatus(1);
	}
	
</script>
<div class="cronometro" id="time_call">&nbsp;</div>
<div style="height: 200px; position: relative;">&nbsp;</div>
<div style="height: 155px; position: relative;">&nbsp;</div>
<a href="#" onMouseOver="MM_displayStatusMsg('Salir');return document.MM_returnValue" onMouseOut="MM_displayStatusMsg('');return document.MM_returnValue" onClick="Terminar();">Salir</a>