$db = JFactory::getDbo();
$user = JFactory::getUser();
$uname = strtoupper($user->get(‘username’));
// tablas de logs
$usertable = «logs»;
$desafio = «logs_desafio»;
//$fechatable = «afecha»;
// password
$uploadpassword = «acracbpuntoorg»;
$dir_articulo = ‘/index.php?option=com_content&view=article&id=1389’;
//$dir_articulo=’/acracb/index.php/acracb-prueba2′;
$dir_imagenes_corto = ‘/images/’;
$dir_imagenes = $dir_imagenes_corto . ‘bancomu/’;
if (!isset($_POST[«acracb_form_admin_subir_logs_desafio_accion»])) {$accion = «»;} else { $accion = $db->escape($_POST[«acracb_form_admin_subir_logs_desafio_accion»]);}
if (!isset($_POST[«pref»])) {$pref = «»;} else { $pref = $db->escape($_POST[«pref»]);}
if (!isset($_POST[«Actividad»])) {$Actividad = «»;} else { $Actividad = $db->escape($_POST[«Actividad»]);}
//if (!isset($_POST[«act»])) { $act=»»; } else {$act=$db->escape($_POST[«act»]);}
//if (!isset($_POST[«act2″])) { $act2=»»; } else {$act2=$db->escape($_POST[«act2»]);}
if (!isset($_POST[«ref»])) {$ref = «»;} else { $ref = $db->escape($_POST[«ref»]);}
if (!isset($_POST[«dia»])) {$dia = «»;} else { $dia = $db->escape($_POST[«dia»]);}
if (!isset($_POST[«mes»])) {$mes = «»;} else { $mes = $db->escape($_POST[«mes»]);}
if (!isset($_POST[«ano»])) {$ano = «»;} else { $ano = $db->escape($_POST[«ano»]);}
if (!isset($_POST[«operador»])) {$operador = «»;} else { $operador = $db->escape($_POST[«operador»]);}
if (!isset($_POST[«otro_operador»])) {$otro_operador = «»;} else { $otro_operador = $db->escape($_POST[«otro_operador»]);}
if (!isset($_POST[«password»])) {$password = «»;} else { $password = $db->escape($_POST[«password»]);}
if (!isset($_POST[«tipo_diploma»])) {$tipo_diploma = «»;} else { $tipo_diploma = $db->escape($_POST[«tipo_diploma»]);}
if (!isset($_POST[«punto_ref_nueva»])) {$punto_ref_nueva = «»;} else { $punto_ref_nueva = $db->escape($_POST[«punto_ref_nueva»]);}
$accion = trim($accion);
$Pref = trim($Pref);
$Actividad = trim($Actividad);
//$act=trim($act);
//$act2=trim($act2);
$ref = trim($ref);
$dia = trim($dia);
$mes = trim($mes);
$ano = trim($ano);
$operador = trim($operador);
$otro_operador = trim($otro_operador);
$password = trim($password);
$tipo_diploma = trim($tipo_diploma);
$punto_ref_nueva = trim($punto_ref_nueva);
$Pref = str_replace(‘%’, », $Pref);
$Actividad = str_replace(‘%’, », $Actividad);
//$act=str_replace(‘%’,», $act);
//$act2=str_replace(‘%’,», $act2);
$ref = str_replace(‘%’, », $ref);
$dia = str_replace(‘%’, », $dia);
$mes = str_replace(‘%’, », $mes);
$ano = str_replace(‘%’, », $ano);
$operador = str_replace(‘%’, », $operador);
$otro_operador = str_replace(‘%’, », $otro_operador);
$password = str_replace(‘%’, », $password);
$tipo_diploma = str_replace(‘%’, », $tipo_diploma);
$punto_ref_nueva = str_replace(‘%’, », $punto_ref_nueva);
list($Actividad_temp, $act, $act2) = explode(«/», $Actividad);
$Actividad = $Actividad_temp;
if (isset($act)) {$act = «/$act»;} else {}
if (isset($act2)) {$act2 = «/$act2»;} else {}
$valid_file = 0;
$duplicateQSO = 0;
$qso_count = 0;
$errorQSO = 0;
if (!isset($_FILES[‘Filename’])) {
$browser_name = «»;
$temp_name = «»;
$filesize = «»;
} else {
$browser_name = $_FILES[‘Filename’][‘name’];
$temp_name = $_FILES[‘Filename’][‘tmp_name’];
$filesize = $_FILES[‘Filename’][‘size’];
}
?>
<?php
/*funcionaes auxiliares*/
function validar_fichero($file)
{
$string = «»;
$valid_file = 2;
$desc_error = «»;
$encontrado_call = 0;
$log = 0;
$log_html = 0;
while ($string = fgets($file, 1024)) {
$string = utf8_encode(strtoupper($string));
//$string = strtoupper ($string);
if ($log_html == 1) {echo «html1-> » . htmlentities($string) . «<br>»;}
if (stristr($string, «<EOH>») || stristr($string, «<CALL») || stristr($string, «<BAND») || stristr($string, «<FREQ») || stristr($string, «<MODE»)) {![]()
if (stristr($string, «<CALL»)) {![]()
$encontrado_call = $encontrado_call + 1;![]()
if ($log == 1) {echo «log01-> » . $encontrado_call . «<br>»;}![]()
} elseif (stristr($string, «<EOH>»)) {![]()
$encontrado_call = 0;![]()
if ($log == 1) {echo «log02-> » . $encontrado_call . «<br>»;}![]()
}
![]()
$EOR = 0;![]()
if ($log_html == 1) {echo «html2-> » . htmlentities($string) . «<br>»;}![]()
// inicializamos el array![]()
$qso_data = array(‘MyCallsign’ => », ‘Date’ => », ‘Time’ => », ‘Callsign’ => », ‘Band’ => », ‘Frequency’ => », ‘Mode’ => », ‘RSTS’ => », ‘RSTR’ => »);
![]()
while (!$EOR) {![]()
readADIFQSO($string, $qso_data);![]()
/*buscamos el final de cada registro del ADIF*/![]()
if (stristr($string, «<EOR>»)) {![]()
![]()
$EOR = 1;![]()
![]()
if (strlen(trim($qso_data[‘Callsign’])) <= 0) {![]()
![]()
$valid_file = 0;![]()
![]()
$desc_error = «CALL NO ENCONTRADO»;![]()
![]()
if ($log == 1) {echo «log03-> » . $desc_error . «<br>»;}![]()
![]()
} else {![]()
![]()
if ($valid_file != 0) {![]()
![]()
![]()
$valid_file = 1;![]()
![]()
}![]()
![]()
}![]()
![]()
if ($encontrado_call > 1) {![]()
![]()
$valid_file = 0;![]()
![]()
$desc_error = «1. FALTA EOR (» . $encontrado_call . «)»;![]()
![]()
if ($log == 1) {echo «log04-> » . $desc_error . «<br>»;}![]()
![]()
}![]()
![]()
$encontrado_call = 0;![]()
![]()
if ($log == 1) {echo «log05-> » . $encontrado_call . «<br>»;}![]()
} else {![]()
![]()
$string = fgets($file, 1024);![]()
![]()
if (stristr($string, «<CALL»)) {![]()
![]()
$encontrado_call = $encontrado_call + 1;![]()
![]()
if ($log == 1) {echo «log06-> » . $encontrado_call . «<br>»;}![]()
![]()
}![]()
![]()
if (stristr($string, «<EOH>»)) {![]()
![]()
// inicializamos el array![]()
![]()
$qso_data = array(‘MyCallsign’ => », ‘Date’ => », ‘Time’ => », ‘Callsign’ => », ‘Band’ => », ‘Frequency’ => », ‘Mode’ => », ‘RSTS’ => », ‘RSTR’ => »);![]()
![]()
$encontrado_call = 0;![]()
![]()
if ($log == 1) {echo «log07-> » . $encontrado_call . «<br>»;}![]()
![]()
}![]()
![]()
if ($log_html == 1) {echo «html3-> » . htmlentities($string) . «<br>»;}![]()
}![]()
}
}
}
if ($valid_file != 0) {$valid_file = 1;}
if ($log == 1) {if ($valid_file == 0) {echo «log08-> » . $desc_error . «<br>»;}}
return $valid_file;
}
function readADIFQSO($string, &$qso_data)
{
$string = utf8_encode(strtoupper($string));
//$string = strtoupper($string);
// Read Date
if ($s = stristr($string, «<QSO_DATE»)) {
$values = sscanf($s, «<QSO_DATE:%d>%s «, $length, $qso_data[‘Date’]);
$qso_data[‘Date’] = substr($qso_data[‘Date’], 0, $length);
if ($values != 2) {![]()
sscanf($s, «<QSO_DATE:%d:%c>%s «, $length, $dummy, $qso_data[‘Date’]);
}
}
// Read Time
if ($s = stristr($string, «<TIME_ON»)) {
$values = sscanf($s, «<TIME_ON:%d>%s «, $length, $qso_data[‘Time’]);
$qso_data[‘Time’] = substr($qso_data[‘Time’], 0, $length);
if ($values != 2) {![]()
sscanf($s, «<TIME_ON:%d:%c>%s «, $length, $dummy, $qso_data[‘Time’]);
}
if (strlen($qso_data[‘Time’]) > «4») {![]()
$qso_data[‘Time’] = substr($qso_data[‘Time’], 0, 4);
}
}
// Read Callsign
if ($s = stristr($string, «<CALL»)) {
//$values = sscanf ($s, «<CALL:%d>%s «, $length,$qso_data[‘Callsign’]);
//para que tenga en cuenta los espacios
$values = sscanf($s, «<CALL:%d>%[^\n]», $length, $qso_data[‘Callsign’]);
$qso_data[‘Callsign’] = explode(«<«, $qso_data[‘Callsign’]);
$qso_data[‘Callsign’] = $qso_data[‘Callsign’][0];
if ($values != 2) {![]()
sscanf($s, «<CALL:%d:%c>%s «, $length, $dummy, $qso_data[‘Callsign’]);
}
}
// Read Band
if ($s = stristr($string, «<BAND»)) {
$values = sscanf($s, «<BAND:%d>%s «, $length, $qso_data[‘Band’]);
$qso_data[‘Band’] = substr($qso_data[‘Band’], 0, $length);
if ($values != 2) {![]()
sscanf($s, «<BAND:%d:%c>%s «, $length, $dummy, $qso_data[‘Band’]);
}
if (($pos = strpos($qso_data[‘Band’], ‘M’)) != null) {![]()
$qso_data[‘Band’][$pos] = ‘ ‘;
}
$qso_data[‘Band’] = trim($qso_data[‘Band’]);
}
// Read Frequency
if ($s = stristr($string, «<FREQ»)) {
$values = sscanf($s, «<FREQ:%d>%s «, $length, $qso_data[‘Frequency’]);
$qso_data[‘Frequency’] = substr($qso_data[‘Frequency’], 0, $length);
}
// Read Mode
if ($s = stristr($string, «<MODE»)) {
$values = sscanf($s, «<MODE:%d>%s «, $length, $qso_data[‘Mode’]);
$qso_data[‘Mode’] = substr($qso_data[‘Mode’], 0, $length);
if ($values != 2) {![]()
sscanf($s, «<MODE:%d:%c>%s «, $length, $dummy, $qso_data[‘Mode’]);
}
switch ($qso_data[‘Mode’]) {![]()
case «USB»:![]()
case «LSB»:![]()
$qso_data[‘Mode’] = «SSB»;
}
}
}
// Function to read an ADIF file and insert each QSO into the database
function processADIFFile($file, &$qso_count, &$duplicateQSO, &$errorQSO, $usertable, $pref, $Actividad, $act, $act2, $ref, $dia, $mes, $ano, $operador, $otro_operador, &$duplicados, &$insertados, $tipo_diploma)
{
$string = «»;
while ($string = fgets($file, 1024)) {
$string = utf8_encode(strtoupper($string));
//$string = strtoupper($string);
if (stristr($string, «<EOH>») || stristr($string, «<CALL») || stristr($string, «<BAND») || stristr($string, «<FREQ») || stristr($string, «<MODE»)) {![]()
$EOR = 0;![]()
// inicializamos el array![]()
$qso_data = array(‘MyCallsign’ => », ‘Date’ => », ‘Time’ => », ‘Callsign’ => », ‘Band’ => », ‘Frequency’ => », ‘Mode’ => », ‘RSTS’ => », ‘RSTR’ => »);![]()
while (!$EOR) {![]()
readADIFQSO($string, $qso_data);![]()
/*buscamos el final de cada registro del ADIF*/![]()
if (stristr($string, «<EOR>»)) {![]()
![]()
$EOR = 1;![]()
![]()
/*ahora ya hemos leido el registro entero que puede![]()
![]()
tener varias lineas hasta encontrar el <EOR>*/![]()
![]()
if (strlen(trim($qso_data[‘Band’])) <= 0) {![]()
![]()
if (strlen(trim($qso_data[‘Frequency’])) > 0) {![]()
![]()
![]()
$qso_data[‘Frequency’] = substr($qso_data[‘Frequency’], 0, -2);![]()
![]()
![]()
$frecuencia_temp = strval(str_replace(array(‘,’, ‘.’), array(», »), trim($qso_data[‘Frequency’])));![]()
![]()
![]()
$frecuencia_valor = «»;![]()
![]()
![]()
if ($frecuencia_temp >= 1830 and $frecuencia_temp <= 1850) {$frecuencia_valor = «160»;}![]()
![]()
![]()
if ($frecuencia_temp >= 3500 and $frecuencia_temp <= 3800) {$frecuencia_valor = «80»;}![]()
![]()
![]()
if ($frecuencia_temp >= 7000 and $frecuencia_temp <= 7200) {$frecuencia_valor = «40»;}![]()
![]()
![]()
if ($frecuencia_temp >= 10100 and $frecuencia_temp <= 10150) {$frecuencia_valor = «30»;}![]()
![]()
![]()
if ($frecuencia_temp >= 14000 and $frecuencia_temp <= 14350) {$frecuencia_valor = «20»;}![]()
![]()
![]()
if ($frecuencia_temp >= 18068 and $frecuencia_temp <= 18168) {$frecuencia_valor = «17»;}![]()
![]()
![]()
if ($frecuencia_temp >= 21000 and $frecuencia_temp <= 21450) {$frecuencia_valor = «15»;}![]()
![]()
![]()
if ($frecuencia_temp >= 24890 and $frecuencia_temp <= 24990) {$frecuencia_valor = «12»;}![]()
![]()
![]()
if ($frecuencia_temp >= 28000 and $frecuencia_temp <= 29700) {$frecuencia_valor = «10»;}![]()
![]()
![]()
if ($frecuencia_temp >= 50000 and $frecuencia_temp <= 52000) {$frecuencia_valor = «6»;}![]()
![]()
![]()
if (strlen($frecuencia_valor) > 0) {![]()
![]()
![]()
$qso_data[‘Band’] = $frecuencia_valor;![]()
![]()
![]()
} else {![]()
![]()
![]()
$qso_data[‘Band’] = ’40’;![]()
![]()
![]()
}![]()
![]()
} else {![]()
![]()
![]()
$qso_data[‘Band’] = ’40’;![]()
![]()
}![]()
![]()
}![]()
![]()
/*la fecha tiene el formato añonmesdia -> 20170929*/![]()
![]()
// la fecha la obtenemos edl formulario no del adi![]()
![]()
/*$dia = substr($qso_data[‘Date’], -2);![]()
![]()
$mes = substr($qso_data[‘Date’], -4, -2);![]()
![]()
$ano = substr($qso_data[‘Date’], 0, -4);*/
![]()
![]()
$qso_data[‘Callsign’] = trim($qso_data[‘Callsign’]);![]()
![]()
$qso_data[‘Band’] = trim($qso_data[‘Band’]);![]()
![]()
$qso_data[‘Mode’] = trim($qso_data[‘Mode’]);
![]()
![]()
if (strlen(trim($qso_data[‘Mode’])) <= 0) {$qso_data[‘Mode’] = ‘SSB’;}![]()
![]()
/*![]()
![]()
comprobamos que:![]()
![]()
– concat(pref,Actividad,act,act2) like concat(‘$pref’,’$Actividad’,’$act’,’$act2′)![]()
![]()
– Qrz like $qso_data[‘Callsign’]![]()
![]()
– ref like ‘$ref’![]()
![]()
– concat(dia,’/’,mes,’/’,ano) like concat(‘$dia’,’/’,’$mes’,’/’,’$ano’)![]()
![]()
– banda like $qso_data[‘Band’]![]()
![]()
– modo like $qso_data[‘Mode’]![]()
![]()
*/![]()
![]()
$sql = «SELECT count(*) FROM $usertable ![]()
![]()
where concat(pref,Actividad,act,act2) like concat(‘$pref’,’$Actividad’,’$act’,’$act2′) ![]()
![]()
and Qrz like ‘» . $qso_data[‘Callsign’] . «‘ ![]()
![]()
and ref like ‘$ref’ ![]()
![]()
and concat(dia,’/’,mes,’/’,ano) like concat(‘$dia’,’/’,’$mes’,’/’,’$ano’) ![]()
![]()
and banda like ‘» . $qso_data[‘Band’] . «‘ and modo like ‘» . $qso_data[‘Mode’] . «‘ ![]()
![]()
and tipo_diploma='» . $tipo_diploma . «‘ ;»;![]()
![]()
$db = JFactory::getDbo();![]()
![]()
$db->setQuery($sql);![]()
![]()
$total = $db->loadResult();
![]()
![]()
if ($total <= 0 and strlen($Actividad) > 0 and strlen($qso_data[‘Callsign’]) > 0 and strlen($ref) > 0 and strlen($qso_data[‘Band’]) > 0 and strlen($qso_data[‘Mode’]) > 0 and strlen($dia) > 0 and strlen($mes) > 0 and strlen($ano) > 0) {
![]()
![]()
$sql = «INSERT INTO $usertable (pref,Actividad,act,act2,Qrz,ref,banda,modo,dia,mes,ano,operador,otro_operador,tipo_diploma) values (‘» . $pref . «‘,'» . $Actividad . «‘,'» . $act . «‘,'» . $act2 . «‘,'» . $qso_data[‘Callsign’] . «‘,'» . $ref . «‘,'» . $qso_data[‘Band’] . «‘,'» . $qso_data[‘Mode’] . «‘,'» . $dia . «‘,'» . $mes . «‘,'» . $ano . «‘,'» . $operador . «‘,'» . $otro_operador . «‘,'» . $tipo_diploma . «‘)»;![]()
![]()
$db = JFactory::getDbo();![]()
![]()
$db->setQuery($sql);![]()
![]()
$result = $db->execute();
![]()
![]()
if ($result) {![]()
![]()
![]()
$qso_count++;![]()
![]()
![]()
$insertados[$qso_count][‘actividad’] = trim($pref . $Actividad . $act . $act2);![]()
![]()
![]()
$insertados[$qso_count][‘qrz’] = trim($qso_data[‘Callsign’]);![]()
![]()
![]()
$insertados[$qso_count][‘fecha’] = trim($dia . ‘/’ . $mes . ‘/’ . $ano);![]()
![]()
![]()
$insertados[$qso_count][‘banda’] = trim($qso_data[‘Band’]);![]()
![]()
![]()
$insertados[$qso_count][‘modo’] = trim($qso_data[‘Mode’]);![]()
![]()
} else {![]()
![]()
![]()
$errorQSO++;![]()
![]()
}![]()
![]()
} else {![]()
![]()
$duplicateQSO++;![]()
![]()
$duplicados[$duplicateQSO][‘actividad’] = trim($pref . $Actividad . $act . $act2);![]()
![]()
$duplicados[$duplicateQSO][‘qrz’] = trim($qso_data[‘Callsign’]);![]()
![]()
$duplicados[$duplicateQSO][‘fecha’] = trim($dia . ‘/’ . $mes . ‘/’ . $ano);![]()
![]()
$duplicados[$duplicateQSO][‘banda’] = trim($qso_data[‘Band’]);![]()
![]()
$duplicados[$duplicateQSO][‘modo’] = trim($qso_data[‘Mode’]);![]()
![]()
}
![]()
![]()
/*si no hemos encontrado el EOR seguimos*/![]()
} else {![]()
![]()
$string = fgets($file, 1024);![]()
![]()
$string = utf8_encode(strtoupper($string));![]()
![]()
//$string = strtoupper($string);![]()
![]()
if (stristr($string, «<EOH>»)) {![]()
![]()
// inicializamos el array![]()
![]()
$qso_data = array(‘MyCallsign’ => », ‘Date’ => », ‘Time’ => », ‘Callsign’ => », ‘Band’ => », ‘Frequency’ => », ‘Mode’ => », ‘RSTS’ => », ‘RSTR’ => »);![]()
![]()
}![]()
}![]()
}
}
}
}
?>
<script language=»javascript» type=»text/javascript»>
function accion(tipo)
{
document.getElementById(«acracb_form_admin_subir_logs_desafio_accion»).value = tipo;
document.getElementById(«acracb_form_admin_subir_logs_desafio»).submit();
}
function inicializar()
{
document.getElementById(«acracb_form_admin_subir_logs_desafio_accion»).value = «»;
document.getElementById(«acracb_form_admin_subir_logs_desafio»).submit();
}
</script>
<?php
if (strlen($accion) <= 0) {
?>
<div style=’margin-left:30px;’>
<h3 class=»titulo_anunciar_actividad»> SUBIDA LOGS acracb </h3>
<p align=left>
<font size=2>
<br>
Analizemos esta actividad EA7/IK9XXX/P/QRP :
<ul>
<li><b>Prefijo</b> es EA7/</li>
<li><b>Actividad</b> es IK9XXX</li>
<li><b>Act</b> es /P</li>
<li><b>Act2</b> es /QRP</li>
</ul>
Solamente es aceptado el formato ADIF, los campos que seran necesarios son:
<ul>
<li><b>QSO_DATE</b> tipo 20140413 donde 2014 es el año 04 el mes y 13 el día</li>
<li><b>MODE</b> por defecto SSB</li>
<li><b>CALL</b> el Qrz de la actividad</li>
<li><b>BAND</b> por defecto 40</li>
<li>
<b>FREQ</b> si no existe <b>BAND</b> se tendrá en cuenta <b>FREQ</b> según la tabla de equivalencias siguiente:
<table border=0 width=45%>
<tr>
<td width=15%> </td>
<td width=15%> </td>
<td width=15%> </td>
</tr>
<tr>
<td width=15%>FREQ ENTRE</td>
<td width=15%>FREQ HASTA</td>
<td width=15%>BAND EQUIVALENTE</td>
</tr>
<tr>
<td>1830</td>
<td>1850</td>
<td>160</td>
</tr>
<tr>
<td>3500</td>
<td>3800</td>
<td>80</td>
</tr>
<tr>
<td>7000</td>
<td>7200</td>
<td>40</td>
</tr>
<tr>
<td>10100</td>
<td>10150</td>
<td>30</td>
</tr>
<tr>
<td>14000</td>
<td>14350</td>
<td>20</td>
</tr>
<tr>
<td>18068</td>
<td>18168</td>
<td>17</td>
</tr>
<tr>
<td>21000</td>
<td>21450</td>
<td>15</td>
</tr>
<tr>
<td>24890</td>
<td>24990</td>
<td>12</td>
</tr>
<tr>
<td>28000</td>
<td>29700</td>
<td>10</td>
</tr>
<tr>
<td>50000</td>
<td>52000</td>
<td>6</td>
</tr>
</table>
</li>
<li>SI no existe ni <b>BAND</b> ni <b>FREQ</b> por defecto será <b>BAND</b> 40</li>
</ul>
Comentaremos algunas consideraciones que se tendrán en cuenta con el fichero ADIF:
<ul>
<li>Los registros duplicados que se detecten no se tendrán en cuenta.</li>
<li>
La estructura del fichero ADIF será válida SI contiene la siguiente información:
<ul>
<li>0, 1 o más lineas con cualquiera información, como comentarios, lineas en blanco, ect…</li>
<li>a continuación debe existir EOH</li>
<li>a continuación puede existir 0, 1 o más lineas con cualquiera información, como comentarios, lineas en blanco, ect…</li>
<li>una vez encontrado EOH por cada logs será necesario las etiquetas QSO_DATE, CALL , BAND (FREQ), MODE y EOR</li>
</ul>
</li>
</ul>
Los campos con el <span style=»color:red»><b>*</b></span> son datos obligatorios que son necesario rellenar.
</font>
</p>
<center>
<p align=center>
<form name=»acracb_form_admin_subir_logs_desafio» id=»acracb_form_admin_subir_logs_desafio» action=»<?php echo $dir_articulo; ?>» method=post enctype=»multipart/form-data»>
<input size=25 type=hidden id=»acracb_form_admin_subir_logs_desafio_accion» name=»acracb_form_admin_subir_logs_desafio_accion» value=»<?php echo $accion; ?>»>
<table border=»0″ width=»65%» align=center>
<tr>
<td width=»15%» align=left><b>Diploma ACRACB</b> <span style=»color:red»><b>*</b></span></td>
<td width=»50%» align=left>
<select name=»tipo_diploma»>
<option value=»»>Seleccione un diploma</option>
<?php
$sql = «SELECT codigo,descripcion FROM acracb_lista_diplomas where funcion=’3′ order by codigo desc»;
$db->setQuery($sql);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
$codigo = $row->codigo;
$descripcion = $row->descripcion;
echo ‘<option value=»‘ . $codigo . ‘»>’ . $descripcion . ‘</option>’;
}
?>
</select>
</td>
</tr>
<hr>
<tr>
<td width=»15%» align=left><b>Prefijo</b></td>
<td width=»50%» align=left><input type=»text» name=»pref» size=»3″ maxlength=»3″> Tipo EA1 a EA9 <b><u>SOLO EN CASO DE Estaciones NO-EA</u></b></td>
</tr>
<tr>
<td width=»15%» align=left><b>Actividad</b> <span style=»color:red»><b>*</b></span></td>
<td width=»50%» align=left><input type=»text» name=»Actividad» size=»10″ maxlength=»15″ value=»»> Tipo IK9XXX /P /QRP</td>
</tr>
<!–<tr>
<td width=»15%» align=left><b>Act</b></td>
<td width=»50%» align=left><input type=»text» name=»act» size=»5″ maxlength=»5″> Tipo /P</td>
</tr>
<tr style=»display:none»>
<td width=»15%» align=left><b>Act 2</b></td>
<td width=»50%» align=left><input type=»text» name=»act2″ size=»5″ maxlength=»5″> Tipo /QRP</td>
</tr>–>
<tr>
<td width=»15%» align=left><b>Referencia</b> <span style=»color:red»><b>*</b></span></td>
<td width=»50%» align=left><input size=»10″ maxlength=»15″ name=»ref» type=»text» value=»»> Tipo CSE-001</td>
</tr>
<tr>
<td width=»15%» align=left><b>Fecha</b> <span style=»color:red»><b>*</b></span></td>
<td width=»50%» align=left>
<select name=»dia»>
<option value=»»>Dia</option>
<option value=»01″ selected >01</option>
<option value=»02″>02</option>
<option value=»03″>03</option>
<option value=»04″>04</option>
<option value=»05″>05</option>
<option value=»06″>06</option>
<option value=»07″>07</option>
<option value=»08″>08</option>
<option value=»09″>09</option>
<option value=»10″>10</option>
<option value=»11″>11</option>
<option value=»12″>12</option>
<option value=»13″>13</option>
<option value=»14″>14</option>
<option value=»15″>15</option>
<option value=»16″>16</option>
<option value=»17″>17</option>
<option value=»18″>18</option>
<option value=»19″>19</option>
<option value=»20″>20</option>
<option value=»21″>21</option>
<option value=»22″>22</option>
<option value=»23″>23</option>
<option value=»24″>24</option>
<option value=»25″>25</option>
<option value=»26″>26</option>
<option value=»27″>27</option>
<option value=»28″>28</option>
<option value=»29″>29</option>
<option value=»30″>30</option>
<option value=»31″>31</option>
</select>
<select name=»mes»>
<option value=»»>Mes</option>
<option value=»01″ selected>01</option>
<option value=»02″>02</option>
<option value=»03″>03</option>
<option value=»04″>04</option>
<option value=»05″>05</option>
<option value=»06″>06</option>
<option value=»07″>07</option>
<option value=»08″>08</option>
<option value=»09″>09</option>
<option value=»10″>10</option>
<option value=»11″>11</option>
<option value=»12″>12</option></select>
<select name=»ano»>
<option value=»»>Año</option>
<?php
$sql = ‘SELECT min(ano) FROM logs’;
$db->setQuery($sql);
$anio_inicio = $db->loadResult();
$sql = ‘SELECT max(ano) ano_max FROM logs’;
$db->setQuery($sql);
$anio_max = $db->loadResult();
$ano_actual = date(«Y»);
$mes_actual = date(«m»);
$dia_actual = date(«d»);
if (strlen($anio_inicio) <= 0) {
$anio_inicio = $ano_actual;
$anio_max = $ano_actual;
}
if ($mes_actual >= 12) {$anio_max = $ano_actual + 1;}
$indice_array = 1;
for ($var_ano = $anio_inicio; $var_ano <= $anio_max; $var_ano++) {
echo ‘<option value=»‘ . $var_ano . ‘» selected>’ . $var_ano . ‘</option>’;
$array_ano[$indice_array] = $var_ano;
$indice_array++;
}
if (in_array($ano_actual, $array_ano) == false) {
echo ‘<option value=»‘ . $ano_actual . ‘» selected>’ . $ano_actual . ‘</option>’;
}
?>
</select>
</td>
</tr>
<tr>
<td width=»15%» align=left><b>Puntos Ref Nueva</b> <span style=»color:red»><b>*</b></span></td>
<td width=»50%» align=left><input size=»10″ maxlength=»10″ name=»punto_ref_nueva» type=»text»><span style=»color:red»> </span></td>
</tr>
<tr>
<td width=»15%» align=left><b>Fichero ADIF</b> <span style=»color:red»><b>*</b></span></td>
<td width=»50%» align=left><input type=»file» name=»Filename» id=»Filename» size=»15″></td>
</tr>
<tr style=»display:none»>
<td width=»15%» align=left><b>Operador</b> </td>
<td width=»50%» align=left><input size=»10″ maxlength=»10″ name=»operador» type=»text»><span style=»color:red»> </span></td>
</tr>
<tr style=»display:none»>
<td width=»15%» align=left><b>Otros Operadores</b></td>
<td width=»50%» align=left><input size=»10″ maxlength=»50″ name=»otro_operador» type=»text»> EA5RK1,EA5RK2,EA5RK3</td>
</tr>
<tr>
<td width=»15%» align=left><b>Password</b> <span style=»color:red»><b>*</b></span></td>
<td width=»50%» align=left><input type=»text» name=»password» id=»password» size=»15″></td>
</tr>
</table>
<br>
<table border=»0″ width=»60%» align=center>
<tr>
<td align=center>
<input type=»button» name=»upload» value=»SUBIR LOG» onclick=»accion(‘paso01’);»>
</td>
</tr>
</table>
</form>
</p>
</center>
</div>
<?php
} elseif ($accion == «paso01») {
?>
<div style=’margin-left:30px;’>
<h3 class=»titulo_anunciar_actividad»> SUBIDA LOGS acracb </h3>
<p align=left>
<font size=2>
<br>
<form name=»acracb_form_admin_subir_logs_desafio» id=»acracb_form_admin_subir_logs_desafio» action=»<?php echo $dir_articulo; ?>» method=post enctype=»multipart/form-data»>
<input size=25 type=hidden id=»acracb_form_admin_subir_logs_desafio_accion» name=»acracb_form_admin_subir_logs_desafio_accion» value=»<?php echo $accion; ?>»>
</form>
<?php
/*nos aseguramos que ha intentado subir un archvivo*/
if (strlen($temp_name) > 0 && strlen($browser_name) > 0) {
/*nos aseguramos que el fichero se ha subido*/
if (is_uploaded_file($temp_name)) {![]()
/*los datos introducidos por el usuario son validos*/![]()
if (($Actividad != «») && ($ref != «») && ($dia != «») && ($mes != «») && ($ano != «») && ($tipo_diploma != «»)) {![]()
/*el dato de la fecha es correcta*/![]()
if ((is_numeric($dia)) && (is_numeric($mes)) && (is_numeric($ano))) {![]()
![]()
/*el password es correcto*/![]()
![]()
if (strlen($password) > 0 and $password == $uploadpassword) {![]()
![]()
/*el fichero subido se puede abrir para manipularlo*/![]()
![]()
if (($file1 = fopen($temp_name, «r»)) and ($file2 = fopen($temp_name, «r»))) {![]()
![]()
![]()
$valid_file = validar_fichero($file1);![]()
![]()
![]()
//$valid_file=1;![]()
![]()
![]()
$duplicateQSO = 0;![]()
![]()
![]()
$qso_count = 0;![]()
![]()
![]()
$errorQSO = 0;![]()
![]()
![]()
$insertados = array(0 => array(‘actividad’ => », ‘qrz’ => », ‘fecha’ => », ‘banda’ => », ‘modo’ => »));![]()
![]()
![]()
$duplicados = array(0 => array(‘actividad’ => », ‘qrz’ => », ‘fecha’ => », ‘banda’ => », ‘modo’ => »));![]()
![]()
![]()
$lista_puntos = array(‘ref_nueva’ => intval($punto_ref_nueva), ‘banda20’ => 0, ‘banda40’ => 0, ‘banda80’ => 0, ‘modossb’ => 0, ‘modocw’ => 0, ‘mododg’ => 0, ‘provincia’ => 0, ‘comunicados’ => 0, ‘indicativo_asociacion’ => 0);
![]()
![]()
![]()
if ($valid_file) {![]()
![]()
![]()
/*primero eliminamos todo de una actividad*/![]()
![]()
![]()
$sql = «DELETE FROM $usertable WHERE concat(pref,Actividad,act,act2) = concat(‘$pref’,’$Actividad’,’$act’,’$act2′)![]()
![]()
![]()
and ref=’$ref’ and concat(dia,’/’,mes,’/’,ano) = concat(‘$dia’,’/’,’$mes’,’/’,’$ano’) and tipo_diploma=’$tipo_diploma'»;![]()
![]()
![]()
$db = JFactory::getDbo();![]()
![]()
![]()
$db->setQuery($sql);![]()
![]()
![]()
$result = $db->execute();![]()
![]()
![]()
processADIFFile($file2, $qso_count, $duplicateQSO, $errorQSO, $usertable, $pref, $Actividad, $act, $act2, $ref, $dia, $mes, $ano, $operador, $otro_operador, $duplicados, $insertados, $tipo_diploma);![]()
![]()
![]()
}![]()
![]()
![]()
if (!$valid_file) {![]()
![]()
![]()
?>![]()
![]()
![]()
<font size=3>![]()
![]()
![]()
<p align=left>![]()
![]()
![]()
<b>Se ha encontrado un error en el archivo: <?php echo $browser_name; ?></b>![]()
![]()
![]()
<br><br>Ningún QSO cargado<br><br>![]()
![]()
![]()
<a href=’javascript:inicializar();’>Volver</a>![]()
![]()
![]()
</p>![]()
![]()
![]()
</font>![]()
![]()
![]()
<?php
} else {![]()
![]()
![]()
$puntos_ref_nueva = $punto_ref_nueva;![]()
![]()
![]()
$puntos_banda_20 = 0;![]()
![]()
![]()
$puntos_banda_40 = 0;![]()
![]()
![]()
$puntos_banda_80 = 0;![]()
![]()
![]()
$puntos_modo_ssb = 0;![]()
![]()
![]()
$puntos_modo_cw = 0;![]()
![]()
![]()
$puntos_modo_dg = 0;![]()
![]()
![]()
![]()
![]()
![]()
![]()
$puntos_porcentaje = 0;![]()
![]()
![]()
$puntos_total_exp = 0;
![]()
![]()
![]()
$puntos_provincia = 0;![]()
![]()
![]()
list($ref1, $ref2) = explode(«-«, $ref); ![]()
![]()
![]()
$sql = «SELECT count(distinct(ref)) FROM $usertable where ![]()
![]()
![]()
tipo_diploma=’$tipo_diploma’ ![]()
![]()
![]()
AND ref like ‘$ref1-%’ ![]()
![]()
![]()
and concat(pref,Actividad,act,act2) = concat(‘$pref’,’$Actividad’,’$act’,’$act2′)»;![]()
![]()
![]()
$db = JFactory::getDbo();![]()
![]()
![]()
$db->setQuery($sql);![]()
![]()
![]()
if ($db->loadResult() <= 1) {![]()
![]()
![]()
![]()
$puntos_provincia = 10;![]()
![]()
![]()
}
![]()
![]()
![]()
$puntos_indicativo = 0;![]()
![]()
![]()
if (strtoupper($Actividad) == ‘EA5RKB’) {![]()
![]()
![]()
![]()
$puntos_indicativo = 10;![]()
![]()
![]()
}
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘banda’] == ’20’) {![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
}![]()
![]()
![]()
if ($contador >= 15) {![]()
![]()
![]()
![]()
$puntos_banda_20 = 2;![]()
![]()
![]()
}
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘banda’] == ’40’) {![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
}![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_banda_40 = 2;![]()
![]()
![]()
}
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘banda’] == ’80’) {![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
}![]()
![]()
![]()
if ($contador >= 15) {![]()
![]()
![]()
![]()
$puntos_banda_80 = 2;![]()
![]()
![]()
}
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if (in_array(strtoupper(trim($insertados[$i][‘modo’])), array(‘CW’))) {![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
}![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_modo_cw = 2;![]()
![]()
![]()
}
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if (in_array(strtoupper(trim($insertados[$i][‘modo’])), array(‘SSB’, ‘FM’))) {![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
}![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_modo_ssb = 2;![]()
![]()
![]()
}
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if (!in_array(strtoupper(trim($insertados[$i][‘modo’])), array(‘CW’, ‘SSB’, ‘FM’))) {![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
}![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_modo_dg = 2;![]()
![]()
![]()
}
![]()
![]()
![]()
if ($qso_count > 100) {![]()
![]()
![]()
![]()
$puntos_porcentaje = round($qso_count * 0.10);![]()
![]()
![]()
}
![]()
![]()
![]()
/*if (($puntos_banda_20 + $puntos_banda_40 + $puntos_banda_80 + $puntos_modo_ssb + $puntos_modo_cw + $puntos_modo_dg) >= 6) {![]()
![]()
![]()
![]()
$puntos_total_exp = 6;![]()
![]()
![]()
} else {![]()
![]()
![]()
![]()
$puntos_total_exp = $puntos_banda_20 + $puntos_banda_40 + $puntos_banda_80 + $puntos_modo_ssb + $puntos_modo_cw + $puntos_modo_dg;![]()
![]()
![]()
}*/![]()
![]()
![]()
$puntos_total_exp = $puntos_banda_20 + $puntos_banda_40 + $puntos_banda_80 + $puntos_modo_ssb + $puntos_modo_cw + $puntos_modo_dg;![]()
![]()
![]()
$puntos_total_exp = $puntos_total_exp + $puntos_ref_nueva + $puntos_provincia;![]()
![]()
![]()
$puntos_total_exp = $puntos_total_exp * $puntos_porcentaje;
![]()
![]()
![]()
echo «<br><center><font size=3><b>Resumen de puntos detectados en la actividad EXPEDICIONARIOS</b></font></center>»;![]()
![]()
![]()
?>![]()
![]()
![]()
<br>![]()
![]()
![]()
<center>![]()
![]()
![]()
<table border=»0″ cellpadding=»0″ cellspacing=»0″ width=»90%» class=’tabla_acracb’>![]()
![]()
![]()
<tr class=’tr_cab_acracb’>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Ref nueva</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Banda 20</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Banda 40</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Banda 80</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Modo SSB</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Modo CW</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Modo DG</b></td>![]()
![]()
![]()
![]()
<td width=»20%» align=»center»><b>P. Provincia Activ</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. QSO Realizados</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>Total</b></td>![]()
![]()
![]()
</tr>![]()
![]()
![]()
<tr class=’tr_par_acracb’>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_ref_nueva; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_banda_20; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_banda_40; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_banda_80; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_modo_ssb; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_modo_cw; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_modo_dg; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_provincia; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_porcentaje; ?></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $puntos_total_exp; ?></td>![]()
![]()
![]()
</tr>![]()
![]()
![]()
</table>![]()
![]()
![]()
</center>![]()
![]()
![]()
<?php
![]()
![]()
![]()
$revisados = array();![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
$existe = false;![]()
![]()
![]()
![]()
foreach ($revisados as $key => $item) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘qrz’] == $item[‘qrz’]) {![]()
![]()
![]()
![]()
![]()
$existe = true;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
if (!$existe) {![]()
![]()
![]()
![]()
array_push($revisados, array(‘qrz’ => $insertados[$i][‘qrz’], ‘banda_20’ => 0, ‘banda_40’ => 0, ‘banda_80’ => 0, ‘modo_cw’ => 0, ‘modo_ssb’ => 0, ‘modo_dg’ => 0, ‘provincia’ => 0, ‘indicativo’ => 0));![]()
![]()
![]()
![]()
}![]()
![]()
![]()
}
![]()
![]()
![]()
if (count($revisados) > 0) {![]()
![]()
![]()
![]()
//insertamos tablas desafio![]()
![]()
![]()
![]()
/*primero eliminamos todo de una actividad*/![]()
![]()
![]()
![]()
$sql = «DELETE FROM $desafio WHERE concat(pref,Actividad,act,act2) = concat(‘$pref’,’$Actividad’,’$act’,’$act2′) and ref=’$ref’ and concat(dia,’/’,mes,’/’,ano) like concat(‘$dia’,’/’,’$mes’,’/’,’$ano’) and tipo_diploma=’$tipo_diploma'»;![]()
![]()
![]()
![]()
$db = JFactory::getDbo();![]()
![]()
![]()
![]()
$db->setQuery($sql);![]()
![]()
![]()
![]()
$result = $db->execute();
![]()
![]()
![]()
![]()
//insertamos expedicionario con tipo = 0 y qrz = »![]()
![]()
![]()
![]()
$sql = «INSERT INTO $desafio (pref,Actividad,act,act2,Qrz,ref,banda,modo,dia,mes,ano,operador,otro_operador,tipo_diploma,puntos,tipo,![]()
![]()
![]()
![]()
provincia,ref_nueva,banda_20,banda_40,banda_80,modo_ssb,modo_cw,modo_dg) ![]()
![]()
![]()
![]()
values (‘» . $pref . «‘,'» . $Actividad . «‘,'» . $act . «‘,'» . $act2 . «‘,'» . » . «‘,'» . $ref . «‘,'» . » . «‘,'» . » . «‘,'» . $dia . «‘,'» . $mes . «‘,'» . $ano . «‘,'» . $operador . «‘,'» . $otro_operador . «‘,'» . $tipo_diploma . «‘,» . $puntos_total_exp . «,0,![]()
![]()
![]()
![]()
$puntos_provincia,$puntos_ref_nueva,$puntos_banda_20,$puntos_banda_40,$puntos_banda_80,$puntos_modo_ssb,$puntos_modo_cw,$puntos_modo_dg![]()
![]()
![]()
![]()
)»;![]()
![]()
![]()
![]()
$db = JFactory::getDbo();![]()
![]()
![]()
![]()
$db->setQuery($sql);![]()
![]()
![]()
![]()
$result = $db->execute();![]()
![]()
![]()
}
![]()
![]()
![]()
foreach ($revisados as $key => $item) {![]()
![]()
![]()
![]()
$qrz = $item[‘qrz’];
![]()
![]()
![]()
![]()
$puntos_banda_20 = 0;![]()
![]()
![]()
![]()
$puntos_banda_40 = 0;![]()
![]()
![]()
![]()
$puntos_banda_80 = 0;![]()
![]()
![]()
![]()
$puntos_modo_ssb = 0;![]()
![]()
![]()
![]()
$puntos_modo_cw = 0;![]()
![]()
![]()
![]()
$puntos_modo_dg = 0; ![]()
![]()
![]()
![]()
$puntos_total = 0;
![]()
![]()
![]()
![]()
$puntos_provincia = 0;![]()
![]()
![]()
![]()
list($ref1, $ref2) = explode(«-«, $ref); ![]()
![]()
![]()
![]()
$sql = «SELECT count(distinct(ref)) FROM $usertable where ![]()
![]()
![]()
![]()
tipo_diploma=’$tipo_diploma’ ![]()
![]()
![]()
![]()
AND ref like ‘$ref1-%’ ![]()
![]()
![]()
![]()
and qrz = ‘$qrz'»;
![]()
![]()
![]()
![]()
$db = JFactory::getDbo();![]()
![]()
![]()
![]()
$db->setQuery($sql);![]()
![]()
![]()
![]()
if ($db->loadResult() <= 1) {![]()
![]()
![]()
![]()
$puntos_provincia = 10;![]()
![]()
![]()
![]()
}
![]()
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘qrz’] == $qrz) {![]()
![]()
![]()
![]()
![]()
if ($insertados[$i][‘banda’] == ’20’) {![]()
![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_banda_20 = 2;![]()
![]()
![]()
![]()
}
![]()
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘qrz’] == $qrz) {![]()
![]()
![]()
![]()
![]()
if ($insertados[$i][‘banda’] == ’40’) {![]()
![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_banda_40 = 2;![]()
![]()
![]()
![]()
}
![]()
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘qrz’] == $qrz) {![]()
![]()
![]()
![]()
![]()
if ($insertados[$i][‘banda’] == ’80’) {![]()
![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_banda_80 = 2;![]()
![]()
![]()
![]()
}
![]()
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘qrz’] == $qrz) {![]()
![]()
![]()
![]()
![]()
if (in_array(strtoupper(trim($insertados[$i][‘modo’])), array(‘CW’))) {![]()
![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_modo_cw = 2;![]()
![]()
![]()
![]()
}
![]()
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘qrz’] == $qrz) {![]()
![]()
![]()
![]()
![]()
if (in_array(strtoupper(trim($insertados[$i][‘modo’])), array(‘SSB’, ‘FM’))) {![]()
![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_modo_ssb = 2;![]()
![]()
![]()
![]()
}
![]()
![]()
![]()
![]()
$contador = 0;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
if ($insertados[$i][‘qrz’] == $qrz) {![]()
![]()
![]()
![]()
![]()
if (!in_array(strtoupper(trim($insertados[$i][‘modo’])), array(‘CW’, ‘SSB’, ‘FM’))) {![]()
![]()
![]()
![]()
![]()
$contador++;![]()
![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
if ($contador > 0) {![]()
![]()
![]()
![]()
$puntos_modo_dg = 2;![]()
![]()
![]()
![]()
}
![]()
![]()
![]()
![]()
/*if (($puntos_banda_20 + $puntos_banda_40 + $puntos_banda_80 + $puntos_modo_ssb + $puntos_modo_cw + $puntos_modo_dg) >= 6) {![]()
![]()
![]()
![]()
$puntos_total = 6;![]()
![]()
![]()
![]()
} else {![]()
![]()
![]()
![]()
$puntos_total = $puntos_banda_20 + $puntos_banda_40 + $puntos_banda_80 + $puntos_modo_ssb + $puntos_modo_cw + $puntos_modo_dg;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
$puntos_total = $puntos_total + $puntos_indicativo + $puntos_provincia;*/
![]()
![]()
![]()
![]()
$puntos_total = $puntos_banda_20 + $puntos_banda_40 + $puntos_banda_80 + $puntos_modo_ssb + $puntos_modo_cw + $puntos_modo_dg + $puntos_indicativo + $puntos_provincia;
![]()
![]()
![]()
![]()
$item[‘puntos’] = $puntos_total;![]()
![]()
![]()
![]()
$item[‘banda_20’] = $puntos_banda_20;![]()
![]()
![]()
![]()
$item[‘banda_40’] = $puntos_banda_40;![]()
![]()
![]()
![]()
$item[‘banda_80’] = $puntos_banda_80;![]()
![]()
![]()
![]()
$item[‘modo_cw’] = $puntos_modo_cw;![]()
![]()
![]()
![]()
$item[‘modo_ssb’] = $puntos_modo_ssb;![]()
![]()
![]()
![]()
$item[‘modo_dg’] = $puntos_modo_dg;![]()
![]()
![]()
![]()
$item[‘provincia’] = $puntos_provincia;![]()
![]()
![]()
![]()
$item[‘indicativo’] = $puntos_indicativo;![]()
![]()
![]()
![]()
$revisados[$key] = $item;![]()
![]()
![]()
}
![]()
![]()
![]()
echo «<br><center><font size=3><b>Resumen de puntos detectados en la actividad PARTICIPANTES</b></font></center>»;![]()
![]()
![]()
?>![]()
![]()
![]()
<br>![]()
![]()
![]()
<center>![]()
![]()
![]()
<table border=»0″ cellpadding=»0″ cellspacing=»0″ width=»90%» class=’tabla_acracb’>![]()
![]()
![]()
<tr class=’tr_cab_acracb’>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>Qrz</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Banda 20</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Banda 40</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Banda 80</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Modo SSB</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Modo CW</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. Modo DG</b></td>![]()
![]()
![]()
![]()
<td width=»20%» align=»center»><b>P. Provincia Activ</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>P. EA5RKB</b></td>![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><b>Total</b></td>![]()
![]()
![]()
</tr>![]()
![]()
![]()
<?php![]()
![]()
![]()
$tr_impar = ‘tr_impar_acracb’;![]()
![]()
![]()
$tr_par = ‘tr_par_acracb’;![]()
![]()
![]()
foreach ($revisados as $i => $item) {![]()
![]()
![]()
![]()
$tr_class = ($i % 2) ? $tr_impar : $tr_par;![]()
![]()
![]()
![]()
?>![]()
![]()
![]()
![]()
<tr class='<?php echo $tr_class; ?>’>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘qrz’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘banda_20’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘banda_40’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘banda_80’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘modo_ssb’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘modo_cw’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘modo_dg’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘provincia’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘indicativo’]; ?></td>![]()
![]()
![]()
![]()
![]()
<td width=»10%» align=»center»><?php echo $item[‘puntos’]; ?></td>![]()
![]()
![]()
![]()
</tr>![]()
![]()
![]()
![]()
<?php![]()
![]()
![]()
}
![]()
![]()
![]()
if (count($revisados) > 0) {![]()
![]()
![]()
![]()
//insertamos los participantes con tipo = 1 y qrz del participante![]()
![]()
![]()
![]()
foreach ($revisados as $i => $item) {![]()
![]()
![]()
![]()
$sql = «INSERT INTO $desafio (pref,Actividad,act,act2,Qrz,ref,banda,modo,dia,mes,ano,operador,otro_operador,tipo_diploma,puntos,tipo,![]()
![]()
![]()
![]()
indicativo,provincia,ref_nueva,banda_20,banda_40,banda_80,modo_ssb,modo_cw,modo_dg)![]()
![]()
![]()
![]()
values (‘» . $pref . «‘,'» . $Actividad . «‘,'» . $act . «‘,'» . $act2 . «‘,'» . $item[‘qrz’] . «‘,'» . $ref . «‘,'» . » . «‘,'» . » . «‘,'» . $dia . «‘,'» . $mes . «‘,'» . $ano . «‘,'» . $operador . «‘,'» . $otro_operador . «‘,'» . $tipo_diploma . «‘,» . $item[‘puntos’] . «,1,» .![]()
![]()
![]()
![]()
$item[‘indicativo’].»,».$item[‘provincia’].»,».$puntos_ref_nueva.»,».$item[‘banda_20’].»,».$item[‘banda_40’].»,».$item[‘banda_80’].»,».$item[‘modo_ssb’].»,».$item[‘modo_cw’].»,».$item[‘modo_dg’].»![]()
![]()
![]()
![]()
)»;![]()
![]()
![]()
![]()
$db = JFactory::getDbo();![]()
![]()
![]()
![]()
$db->setQuery($sql);![]()
![]()
![]()
![]()
$result = $db->execute();![]()
![]()
![]()
![]()
} ![]()
![]()
![]()
}![]()
![]()
![]()
?>![]()
![]()
![]()
</table>![]()
![]()
![]()
</center>![]()
![]()
![]()
<?php![]()
![]()
![]()
echo «<br><hr><br>»;![]()
![]()
![]()
echo «<br><center><font size=3><b>$errorQSO errores</b> encontrados.</font></center>»;![]()
![]()
![]()
echo «<br><center><font size=3><b>$duplicateQSO QSOs</b> QSOs duplicados que no se han tenido en cuenta.</font></center>»;![]()
![]()
![]()
if ($duplicateQSO > 0) {![]()
![]()
![]()
![]()
?>![]()
![]()
![]()
<br>![]()
![]()
![]()
<center>![]()
![]()
![]()
<table border=»0″ cellpadding=»0″ cellspacing=»0″ width=»45%» class=’tabla_acracb’>![]()
![]()
![]()
<tr class=’tr_cab_acracb’>![]()
![]()
![]()
<td width=»10%» align=»center»><b>Actividad</b></td>![]()
![]()
![]()
<td width=»15%» align=»center»><b>Qrz</b></td>![]()
![]()
![]()
<td width=»10%» align=»center»><b>Fecha</b></td>![]()
![]()
![]()
<td width=»10%» align=»center»><b>Banda/Modo</b></td>![]()
![]()
![]()
</tr>![]()
![]()
![]()
<?php
$tr_impar = ‘tr_impar_acracb’;![]()
![]()
![]()
![]()
$tr_par = ‘tr_par_acracb’;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $duplicateQSO; $i++) {![]()
![]()
![]()
![]()
$tr_class = ($i % 2) ? $tr_impar : $tr_par;![]()
![]()
![]()
![]()
echo «<tr class='» . $tr_class . «‘>![]()
![]()
![]()
<td width=10% align=left><b>» . $duplicados[$i][‘actividad’] . «</b></td>![]()
![]()
![]()
<td width=15% align=left><b>» . $duplicados[$i][‘qrz’] . «</b></td>![]()
![]()
![]()
<td width=10% align=left><b>» . $duplicados[$i][‘fecha’] . «</b></td>![]()
![]()
![]()
<td width=10% align=left><b>» . $duplicados[$i][‘banda’] . » – » . $duplicados[$i][‘modo’] . «</b></td>![]()
![]()
![]()
</tr>»;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
?>![]()
![]()
![]()
</table>![]()
![]()
![]()
</center>![]()
![]()
![]()
<?php
}![]()
![]()
![]()
echo «<br><center><font size=3><b>$qso_count QSOs</b> subidos a la base de datos en la Referencia:<b> $ref</b></font></center>»;![]()
![]()
![]()
if ($qso_count > 0) {![]()
![]()
![]()
![]()
?>![]()
![]()
![]()
<br>![]()
![]()
![]()
<center>![]()
![]()
![]()
<table border=»0″ cellpadding=»0″ cellspacing=»0″ width=»45%» class=’tabla_acracb’>![]()
![]()
![]()
<tr class=’tr_cab_acracb’>![]()
![]()
![]()
<td width=»10%» align=»center»><b>Actividad</b></td>![]()
![]()
![]()
<td width=»15%» align=»center»><b>Qrz</b></td>![]()
![]()
![]()
<td width=»10%» align=»center»><b>Fecha</b></td>![]()
![]()
![]()
<td width=»10%» align=»center»><b>Banda/Modo</b></td>![]()
![]()
![]()
</tr>![]()
![]()
![]()
<?php
$tr_impar = ‘tr_impar_acracb’;![]()
![]()
![]()
![]()
$tr_par = ‘tr_par_acracb’;![]()
![]()
![]()
![]()
for ($i = 1; $i <= $qso_count; $i++) {![]()
![]()
![]()
![]()
$tr_class = ($i % 2) ? $tr_impar : $tr_par;![]()
![]()
![]()
![]()
echo «<tr class='» . $tr_class . «‘>![]()
![]()
![]()
<td width=10% align=left><b>» . $insertados[$i][‘actividad’] . «</b></td>![]()
![]()
![]()
<td width=15% align=left><b>» . $insertados[$i][‘qrz’] . «</b></td>![]()
![]()
![]()
<td width=10% align=left><b>» . $insertados[$i][‘fecha’] . «</b></td>![]()
![]()
![]()
<td width=10% align=left><b>» . $insertados[$i][‘banda’] . » – » . $insertados[$i][‘modo’] . «</b></td>![]()
![]()
![]()
</tr>»;![]()
![]()
![]()
![]()
}![]()
![]()
![]()
![]()
?>![]()
![]()
![]()
</table>![]()
![]()
![]()
</center>![]()
![]()
![]()
<?php
}
![]()
![]()
![]()
?>![]()
![]()
<font size=3>![]()
![]()
<p align=left>![]()
![]()
<br>![]()
![]()
<center><a href=’javascript:inicializar();’>Volver Subir logs</a></center>![]()
![]()
</p>![]()
![]()
</font>![]()
![]()
<?php
}![]()
![]()
} else {![]()
![]()
![]()
?>![]()
<font size=3>![]()
<p align=left>![]()
<b>Error al abrir el fichero ADIF</b><br><br>![]()
<a href=’javascript:inicializar();’>Volver</a>![]()
</p>![]()
</font>![]()
<?php
}![]()
![]()
} else {![]()
![]()
?>![]()
<font size=3>![]()
<p align=left>![]()
<b>El Password que has introducido no es valido.<br>Por favor vuelve a intentarlo!</b><br><br>![]()
<a href=’javascript:inicializar();’>Volver</a>![]()
</p>![]()
</font>![]()
<?php
}![]()
} else {![]()
![]()
?>
<font size=3>
<p align=left>
<b>Fecha incorrecta.</b><br><br>
<a href=’javascript:inicializar();’>Volver</a>
</p>
</font>
<?php
}![]()
} else {![]()
?>
<font size=3>
<p align=left>
<b>Hay que completar todos los campos necesarios</b><br><br>
<a href=’javascript:inicializar();’>Volver</a>
</p>
</font>
<?php
}
} else {![]()
?>
<font size=3>
<p align=left>
<b>Error al subir el fichero ADIF</b><br><br>
<a href=’javascript:inicializar();’>Volver</a>
</p>
</font>
<?php
}
} else {
?>
<font size=3>
<p align=left>
<b>Error al subir el fichero ADIF</b><br><br>
<a href=’javascript:inicializar();’>Volver</a>
</p>
</font>
<?php
}
?>
</font>
</p>
</div>
<?php
}
?>
