remove lastcontrol timestamp

This commit is contained in:
salam committed 2026-01-27 08:21:12 +01:00
1 parent cc8ddb544b
commit 0742b6c19f
65 files changed
+132 -313

No files matched your search

+25 -25
View File
@@ -31,6 +31,8 @@ class Bet365
$sportmap = Sport::map('bapi', 1, [1, 2, 3, 5]);
$flags = [];
/**
* Bet365
*/
@@ -84,7 +86,7 @@ class Bet365
$base['sport_id'] = $event->sport_id;
$base['provider_id'] = Nuh::$options['provider_id'];
$base['bmoid'] = $event->bet365_id;
$base['flag'] = 1;
$base['flags'] = 1;
/**
* 1X2
@@ -98,6 +100,8 @@ class Bet365
$odds = array_merge($odds, $base);
$flags['odds_3ways'][] = $event->id;
$res = Odds3way::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
if (! $res) {
@@ -106,10 +110,7 @@ class Bet365
$res->h3w = $odds['h3w'];
$res->a3w = $odds['d3w'];
$res->d3w = $odds['a3w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -127,6 +128,8 @@ class Bet365
$odds = array_merge($odds, $base);
$flags['odds_dc'][] = $event->id;
$res = OddsDc::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
if (! $res) {
@@ -135,10 +138,7 @@ class Bet365
$res->dc1x = $odds['dc1x'];
$res->dc12 = $odds['dc12'];
$res->dcx2 = $odds['dcx2'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -159,6 +159,8 @@ class Bet365
$odds = array_merge($odds, $base);
$flags['odds_totals'][] = $event->id;
if ($offer['goals_over_under']['odds'][1]['name'] == '2.5') {
$odds['total'] = 2.5;
$res = OddsTotal::where('event_id', $event->id)
@@ -171,11 +173,8 @@ class Bet365
} else {
$res->over = $odds['over'];
$res->under = $odds['under'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->difference = abs(1 / $odds['over'] - 1 / $odds['under']);
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -193,6 +192,8 @@ class Bet365
$odds = array_merge($odds, $base);
$flags['odds_ggng'][] = $event->id;
$res = OddsGgng::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
if (! $res) {
@@ -200,10 +201,7 @@ class Bet365
} else {
$res->gg = $odds['gg'];
$res->ng = $odds['ng'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -222,15 +220,14 @@ class Bet365
$odds = array_merge($odds, $base);
$flags['odds_dnb'][] = $event->id;
if (! $res) {
OddsDnb::create($odds);
} else {
$res->dnb1 = $odds['dnb1'];
$res->dnb2 = $odds['dnb2'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -248,6 +245,8 @@ class Bet365
$odds = array_merge($odds, $base);
$flags['odds_3ways_ht'][] = $event->id;
$res = Odds3wayHt::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
if (! $res) {
@@ -256,10 +255,7 @@ class Bet365
$res->h3w = $odds['h3w'];
$res->d3w = $odds['d3w'];
$res->d3w = $odds['a3w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -267,5 +263,9 @@ class Bet365
}
}
}
foreach ($flags as $table => $event_ids) {
DB::table($table)->where('bookmaker_id', $bookmaker_id)->whereNotIn('event_id', $event_ids)->update(['flags' => 0]);
}
}
}
+11 -9
View File
@@ -30,7 +30,9 @@ class Odds
Notice::note('BETSAPI ODDS '.Nuh::$options['sport'], 'b');
}
$sources = [126 => 'bet365', 83 => 'pinnaclesports'];
$sources = [83 => 'pinnaclesports'];
$flags = [];
if ($single) {
$events = Event::where('id', Nuh::$options['id'])->where('betsapi_id', '>', 0)->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
@@ -84,6 +86,8 @@ class Odds
$odds = array_merge($odds, $base);
$flags['odds_3ways'][] = $event->id;
$res = Odds3way::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
if (! $res) {
@@ -92,10 +96,7 @@ class Odds
$res->h3w = $odds['h3w'];
$res->a3w = $odds['d3w'];
$res->d3w = $odds['a3w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -120,10 +121,7 @@ class Odds
$res->h3w = $odds['h3w'];
$res->a3w = $odds['d3w'];
$res->d3w = $odds['a3w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -135,5 +133,9 @@ class Odds
Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => time()]);
}
// needs check
foreach ($flags as $table => $event_ids) {
DB::table($table)->where('bookmaker_id', $bookmaker_id)->whereNotIn('event_id', $event_ids)->update(['flags' => 0]);
}
}
}
@@ -35,6 +35,8 @@ class Logifuture
Authentication::authenticate();
$flags = [];
foreach ($sportmap as $logifuture_sport_id => $sport_id) {
$matches = LogifutureData::load($logifuture_sport_id);
@@ -63,6 +65,8 @@ class Logifuture
'bookmaker_id' => Nuh::$options['bookmaker_id'],
], ['in_feed' => 1, 'bmoid' => $event['event_id'], 'startime' => $event['starttime']]);
$flags[$sport_id][] = $event['id'];
switch ($sport_id) {
case 1:
Soccer::get($event, $match);
@@ -91,5 +95,14 @@ class Logifuture
if ($event_id_collector) {
EventBookmaker::whereNotIn('event_id', $event_id_collector)->where('bookmaker_id', Nuh::$options['bookmaker_id'])->update(['in_feed' => 0]);
}
$tables = [];
$tables[1] = ['odds_3ways', 'odds_totals', 'odds_ggng', 'odds_dc', 'odds_tq'];
$tables[2] = ['odds_2ways', 'odds_2ways_s1', 'odds_3ways', 'odds_totals', 'odds_points', 'odds_points_q1', 'odds_totals_q1'];
$tables[3] = ['odds_totals', 'odds_points', 'odds_points_q1', 'odds_totals_q1'];
$tables[5] = ['odds_2ways', 'odds_2ways_s1', 'odds_totals', 'odds_points'];
foreach ($tables as $sport_id => $table) {
DB::table($table)->where('bookmaker_id', $bookmaker_id)->whereNotIn('event_id', $flags[$sport_id])->update(['flags' => 0]);
}
}
}
@@ -99,10 +99,7 @@ class Icehockey
$res->h3w = number_format($_3way['h3w'], 2);
$res->d3w = number_format($_3way['d3w'], 2);
$res->a3w = number_format($_3way['a3w'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $_3way['margin'];
$res->save();
}
@@ -122,10 +119,7 @@ class Icehockey
} else {
$res->h2w = number_format($ml['h2w'], 2);
$res->a2w = number_format($ml['a2w'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $ml['margin'];
$res->save();
}
@@ -144,10 +138,7 @@ class Icehockey
} else {
$res->h2w = number_format($ml['h2w'], 2);
$res->a2w = number_format($ml['a2w'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $mls1['margin'];
$res->save();
}
@@ -91,10 +91,7 @@ class Soccer
$res->h3w = number_format($_3way['h3w'], 2);
$res->d3w = number_format($_3way['d3w'], 2);
$res->a3w = number_format($_3way['a3w'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $_3way['margin'];
$res->save();
}
@@ -118,10 +115,7 @@ class Soccer
} else {
$res->over = number_format($_total['over'], 2);
$res->under = number_format($_total['under'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $_total['margin'];
$res->save();
}
@@ -140,10 +134,7 @@ class Soccer
} else {
$res->gg = number_format($_ggng['gg'], 2);
$res->ng = number_format($_ggng['ng'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $_ggng['margin'];
$res->save();
}
@@ -164,10 +155,7 @@ class Soccer
$res->dc1x = number_format($_dc['dc1x'], 2);
$res->dc12 = number_format($_dc['dc12'], 2);
$res->dcx2 = number_format($_dc['dcx2'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $_dc['margin'];
$res->save();
}
@@ -187,10 +175,7 @@ class Soccer
} else {
$res->htq = number_format($_tq['htq'], 2);
$res->atq = number_format($_tq['atq'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $_tq['margin'];
$res->save();
}
@@ -82,10 +82,7 @@ class Tennis
} else {
$res->h2w = number_format($ml['h2w'], 2);
$res->a2w = number_format($ml['a2w'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $ml['margin'];
$res->save();
}
@@ -104,10 +101,7 @@ class Tennis
} else {
$res->h2w = number_format($ml['h2w'], 2);
$res->a2w = number_format($ml['a2w'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = now();
$res->flags = 1;
$res->margin = $mls1['margin'];
$res->save();
}
@@ -20,6 +20,7 @@ class LogifutureStorePoints
$odds['active_spread'] = $value['active_spread'];
$odds['handicap'] = $handicap;
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
$odds['flags'] = 1;
$odds = array_merge($odds, $base);
@@ -34,12 +35,9 @@ class LogifutureStorePoints
$res->home = number_format($odds['home'], 2);
$res->away = number_format($odds['away'], 2);
$res->handicap = number_format($odds['handicap'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -19,6 +19,7 @@ class LogifutureStorePointsQ1
$odds['margin'] = (float) Margin::calculate($odds, 1);
$odds['active_spread'] = $value['active_spread'];
$odds['handicap'] = $handicap;
$odds['flags'] = 1;
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
$odds = array_merge($odds, $base);
@@ -34,12 +35,9 @@ class LogifutureStorePointsQ1
$res->home = number_format($odds['home'], 2);
$res->away = number_format($odds['away'], 2);
$res->handicap = number_format($odds['handicap'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -18,6 +18,7 @@ class LogifutureStoreTotals
$odds['under'] = $value['ele2'];
$odds['margin'] = (float) Margin::calculate($odds, 1);
$odds['active_spread'] = $value['active_spread'];
$odds['flags'] = 1;
$odds['total'] = $total;
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
@@ -34,12 +35,9 @@ class LogifutureStoreTotals
$res->over = number_format($odds['over'], 2);
$res->under = number_format($odds['under'], 2);
$res->total = number_format($odds['total'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -18,6 +18,7 @@ class LogifutureStoreTotalsQ1
$odds['under'] = $value['ele2'];
$odds['margin'] = (float) Margin::calculate($odds, 1);
$odds['active_spread'] = $value['active_spread'];
$odds['flags'] = 1;
$odds['total'] = $total;
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
@@ -34,12 +35,9 @@ class LogifutureStoreTotalsQ1
$res->over = number_format($odds['over'], 2);
$res->under = number_format($odds['under'], 2);
$res->total = number_format($odds['total'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
+4 -1
View File
@@ -69,7 +69,6 @@ class Odds
$base['provider_id'] = Nuh::$options['provider_id'];
$base['bmoid'] = preg_replace('/\D/', '', $match['i']);
$base['flag'] = 1;
$base['checked_at'] = now();
$event_id_collector[] = $event_id;
@@ -148,5 +147,9 @@ class Odds
->where('bookmaker_id', Nuh::$options['bookmaker_id'])
->update(['in_feed' => 0]);
$tables = ['odds_3ways', 'odds_dc', 'odds_ggng', 'odds_points', 'odds_points_q1', 'odds_totals', 'odds_totals_q1', 'odds_tq'];
foreach ($tables as $table) {
DB::table($table)->where('bookmaker_id', $bookmaker_id)->whereNotIn('event_id', $event_id_collector)->update(['flags' => 0]);
}
}
}
@@ -25,10 +25,6 @@ class MaglooStore1x2
$res->a3w = $odds['d3w'];
$res->d3w = $odds['a3w'];
$res->flags = 1;
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->margin = $odds['margin'];
$res->save();
}
@@ -26,10 +26,6 @@ class MaglooStoreDc
$res->dc12 = $odds['dc12'];
$res->dcx2 = $odds['dcx2'];
$res->flags = 1;
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->margin = $odds['margin'];
$res->save();
}
@@ -24,10 +24,6 @@ class MaglooStoreGgng
$res->gg = $odds['gg'];
$res->ng = $odds['ng'];
$res->flags = 1;
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->margin = $odds['margin'];
$res->save();
}
@@ -33,12 +33,8 @@ class MaglooStorePoints
$res->home = number_format($odds['home'], 2);
$res->away = number_format($odds['away'], 2);
$res->handicap = number_format($odds['handicap'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->margin = $odds['margin'];
$res->save();
}
@@ -33,12 +33,8 @@ class MaglooStorePointsQ1
$res->home = number_format($odds['home'], 2);
$res->away = number_format($odds['away'], 2);
$res->handicap = number_format($odds['handicap'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->margin = $odds['margin'];
$res->save();
}
@@ -33,12 +33,8 @@ class MaglooStoreTotals
$res->over = number_format($odds['over'], 2);
$res->under = number_format($odds['under'], 2);
$res->total = number_format($odds['total'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->margin = $odds['margin'];
$res->save();
}
@@ -33,12 +33,8 @@ class MaglooStoreTotalsQ1
$res->over = number_format($odds['over'], 2);
$res->under = number_format($odds['under'], 2);
$res->total = number_format($odds['total'], 2);
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->active_spread = $odds['active_spread'];
$res->difference = $odds['difference'];
$res->checked_at = now();
$res->margin = $odds['margin'];
$res->save();
}
@@ -24,10 +24,6 @@ class MaglooStoreTq
$res->flags = 1;
$res->htq = $odds['htq'];
$res->atq = $odds['atq'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->margin = $odds['margin'];
$res->save();
}
+1 -1
View File
@@ -289,7 +289,7 @@ class Odds
$odds['bookmaker_id'] = $bookmaker_id;
$odds['sport_id'] = $sport_id;
$odds['provider_id'] = Nuh::$options['provider_id'];
$odds['checked_at'] = now();
$odds['flags'] = 1;
foreach ($book->offer as $offer) {
@@ -22,10 +22,7 @@ class _2Way
} else {
$res->h2w = $odds['h2w'];
$res->a2w = $odds['a2w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -22,10 +22,7 @@ class _2WayS1
} else {
$res->h2w = $odds['h2w'];
$res->a2w = $odds['a2w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -24,10 +24,7 @@ class _3Way
$res->h3w = $odds['h3w'];
$res->a3w = $odds['d3w'];
$res->d3w = $odds['a3w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -24,10 +24,7 @@ class _3WayHt
$res->h3w = $odds['h3w'];
$res->d3w = $odds['d3w'];
$res->d3w = $odds['a3w'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -24,10 +24,7 @@ class _Dc
$res->dc1x = $odds['dc1x'];
$res->dc12 = $odds['dc12'];
$res->dcx2 = $odds['dcx2'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -22,10 +22,7 @@ class _Dnb
} else {
$res->dnb1 = $odds['dnb1'];
$res->dnb2 = $odds['dnb2'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -22,10 +22,7 @@ class _Ggng
} else {
$res->gg = $odds['gg'];
$res->ng = $odds['ng'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -34,10 +34,7 @@ class _Points
} else {
$res->home = $odds['home'];
$res->away = $odds['away'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -34,10 +34,7 @@ class _PointsHt
} else {
$res->home = $odds['home'];
$res->away = $odds['away'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -34,10 +34,7 @@ class _PointsQ1
} else {
$res->home = $odds['home'];
$res->away = $odds['away'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -40,10 +40,7 @@ class _Totals
} else {
$res->over = $odds['over'];
$res->under = $odds['under'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -40,10 +40,7 @@ class _TotalsHt
} else {
$res->over = $odds['over'];
$res->under = $odds['under'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -40,10 +40,7 @@ class _TotalsQ1
} else {
$res->over = $odds['over'];
$res->under = $odds['under'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -22,10 +22,7 @@ class _Tq
} else {
$res->htq = $odds['htq'];
$res->atq = $odds['atq'];
if ($res->isDirty()) {
$res->oddchange_at = now();
}
$res->checked_at = $odds['checked_at'];
$res->flags = 1;
$res->margin = $odds['margin'];
$res->save();
}
@@ -18,21 +18,38 @@ class AlarmStore
return;
}
/**
* get favorit
*/
$favorit = 100;
foreach ($oddnames as $fieldname => $oddname) {
if ($client_odds[$oddname] < $favorit) {
$favorit = $oddname;
}
}
/**
* evaluate
*/
$update_array = [];
foreach ($oddnames as $fieldname => $oddname) {
$threshold = $client_odds[$oddname] - $compare_odds[$oddname];
if ($oddname == $favorit) {
if ($threshold > $alarm_threshold[3]) {
// ROT
$update_array[$fieldname] = 3;
} elseif ($threshold > $alarm_threshold[2]) {
// ORANGE
$update_array[$fieldname] = 2;
} elseif ($threshold > $alarm_threshold[1]) {
// GRÜNE
$update_array[$fieldname] = 1;
$threshold = $client_odds[$oddname] - $compare_odds[$oddname];
if ($threshold > $alarm_threshold[3]) {
// ROT
$update_array[$fieldname] = 3;
} elseif ($threshold > $alarm_threshold[2]) {
// ORANGE
$update_array[$fieldname] = 2;
} elseif ($threshold > $alarm_threshold[1]) {
// GRÜNE
$update_array[$fieldname] = 1;
} else {
// Reset Alarm
$update_array[$fieldname] = 0;
}
} else {
// Rset Alarm
$update_array[$fieldname] = 0;
}
}