if (preg_match("/^([0-9A-Z]*)\\-([0-9A-Z]*)\$/i", str_replace(" ", "", $Value), $Tmp)) { for ($i = intval($Tmp[1]); $i <= intval($Tmp[2]); $i++) { $Frames = array_merge($Frames, PrepareTxFrame($i, 'SW?')); // versione fw $Frames = array_merge($Frames, PrepareTxFrame($i, 'READAB')); // AB $Frames = array_merge($Frames, PrepareTxFrame($i, 'READCD')); // CD $HhtRequested[] = $i; } } else { $Frames = array_merge($Frames, PrepareTxFrame(intval($Value), 'SW?')); // versione fw $Frames = array_merge($Frames, PrepareTxFrame(intval($Value), 'READAB')); // AB $Frames = array_merge($Frames, PrepareTxFrame(intval($Value), 'READCD')); // CD $HhtRequested[] = $Value; } } } /*foreach($Frames as $value) echo OutText($value); exit();*/ if (count($Frames) > 0) { $ResponseFromHHT = false; $Results = SendHTT(HhtParam($_REQUEST['x_Hht']), $Frames); if (count($Results) > 0) { $ResponseFromHHT = true; foreach ($Results as $frame) { $HhtAnswered[$frame['Target']][] = $frame;
$DataSource = $_FILES["Fw"]["tmp_name"]; break; case UPLOAD_ERR_NO_FILE: unset($_REQUEST["Fw"]); break; default: unset($_REQUEST["Fw"]); } } if ($DataSource != "") { $fwp = fopen($DataSource, "r"); if ($fwp) { //"mF69a-7Ji1Z&pjU3" $Frames = PrepareTxFrame($HttNumber, "qW4Gl56fR3HJ80+s"); $Updated = SendHTT(HhtParam($_REQUEST['x_Hht']), $Frames); sleep(4); $Frames = array(); while (!feof($fwp)) { $buffer = fgets($fwp, 4096); $buffer = str_replace(chr(10), '', $buffer); $buffer = str_replace(chr(13), '', $buffer); $Frames = array_merge($Frames, PrepareTxFrame($HttNumber, $buffer)); } fclose($fwp); echo "<pre>\n"; $Updated = SendHTT(HhtParam($_REQUEST['x_Hht']), $Frames, false, 5000); echo "</pre>\n"; } } } include 'Common/Templates/tail.php';
$Data = Alpha . $ModeMapping[$Mode]; // a seconda del $Mode aggiungo o no i flags switch ($Mode) { case 2: case 3: for ($numFlag = 0; $numFlag < count($Flags); $numFlag++) { $Data .= $Flags[$numFlag]; } break; } /*print '<pre>'; print_r($Dests); print($Data); print '</pre>';exit;*/ // preparo i pacchetti $Frames = PrepareTxFrame($Dests, $Data); // Risposte /*foreach($Frames as $value) echo OutText($value); //exit();*/ $ResponseFromHHT = false; $Updated = SendHTT(HhtParam($_REQUEST['x_Hht']), $Frames, false, 3); //print_r($Updated); // se non era un broadcast verifico chi ha risposto ok if ($Dests != 0) { /*print '<pre>'; print_r($Updated); print '</pre>';*/ if (!is_null($Updated)) { $ResponseFromHHT = true; }
while ($MyRow = safe_fetch($Rs)) { if ($TargetNo != $MyRow->TargetNo) { if ($TargetNo != 'xx') { //print 'finito<br>'; $Frames = array_merge($Frames, PrepareTxFrame(intval($TargetNo), $Data)); } $Data = ''; } $Data .= Alpha . $LettersCode[$MyRow->TargetLetter] . substr(iconv('UTF-8', 'ASCII//TRANSLIT', $MyRow->Ath), 0, 13) . substr(iconv('UTF-8', 'ASCII//TRANSLIT', $MyRow->CountryCode), 0, 3); //print intval($MyRow->TargetNo) . ' - ' . $Data . '<br/>'; //print $Data.'<br>'; $TargetNo = $MyRow->TargetNo; } } // ultimo ciclo $Frames = array_merge($Frames, PrepareTxFrame(intval($TargetNo), $Data)); //print 'finito<br>'; /*print '<pre>'; print_r($Frames); print '</pre>';exit;*/ /*foreach($Frames as $value) echo OutText($value); //exit();*/ if (count($Frames) > 0) { $ResponseFromHHT = false; $Results = SendHTT(HhtParam($_REQUEST['x_Hht']), $Frames, false, 0.5); if (!is_null($Results)) { $ResponseFromHHT = true; } if (count($Results) != 0) { foreach ($Results as $v) {
// preparo i destinatari $Dests = array_values($HTTs); sort($Dests); // per essere sicuro che se c'è lo zero allora sarà all'inizio if (array_search(0, $HTTs) !== false) { array_shift($Dests); } /*print '<pre>'; print_r($Dests); print '</pre>'; exit;*/ $Frames = array(); if ($Command == 'OK') { $Frames = PrepareTxFrame($Dests, ""); } else { $Frames = PrepareTxFrame($Dests, "sTORE"); } // Risposte $Results = array(); if (count($Frames) > 0) { $ResponseFromHHT = false; $Results = SendHTT(HhtParam($_REQUEST['x_Hht']), $Frames, true); if (!is_null($Results)) { $ResponseFromHHT = true; } //print '<pre>';print_r($Results);print'</pre>';exit(); if (count($Results) != 0) { foreach ($Results as $v) { //Carico il vettore HTTOK if ($v["TargetNo"] != -1) { $HTTOK[] = $v["TargetNo"];
if (isset($_REQUEST['chkSponsor']) && $_REQUEST['chkSponsor'] == 1) { if (isset($_REQUEST['txtSponsor1']) && isset($_REQUEST['txtSponsor2'])) { $Sponsor1 = str_pad($_REQUEST['txtSponsor1'], 21, ' ', STR_PAD_RIGHT); $Sponsor2 = str_pad($_REQUEST['txtSponsor2'], 21, ' ', STR_PAD_RIGHT); $Data = Alpha . $InfosMapping['Sponsor'] . $Sponsor1 . $Sponsor2; $Frames = array_merge($Frames, PrepareTxFrame($Dests, $Data)); } } if (isset($_REQUEST['chkSendSequence']) && $_REQUEST['chkSendSequence'] == 1) { if (intval($FirstArr) > 0 && intval($LastArr) > 0 && intval($Volee) > 0 && array_key_exists($ScoreStart, $ScoreStartMapping) && intval($StoreTimeout) > 0) { // scrivo i parametri nel DB $Query = "UPDATE " . "HhtSetup " . "SET " . "HsDistance=" . StrSafe_DB($Dist) . ", " . "HsSequence=" . StrSafe_DB($FirstArr . $LastArr . $Volee . $ScoreStart . $StoreTimeout) . " " . "WHERE " . "HsTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND " . "HsId=" . StrSafe_DB($_REQUEST['x_Hht']); $Rs = safe_w_sql($Query); $Data = Alpha . $InfosMapping['Sequence'] . $FirstArr . $LastArr . $Volee . $Phase . $ScoreStartMapping[$ScoreStart] . $StoreTimeout; //già paddato $Frames = array_merge($Frames, PrepareTxFrame($Dests, $Data)); } } /*foreach($Frames as $value) echo count($Frames) . OutText($value); exit();*/ // Risposte $Results = array(); if (count($Frames) > 0) { $ResponseFromHHT = false; $Results = SendHTT(HhtParam($_REQUEST['x_Hht']), $Frames); if (!is_null($Results)) { $ResponseFromHHT = true; } //print '<pre>';print_r($Results);print'</pre>';exit(); if (count($Results) != 0) {