davidjmorin

Convert this to better scripting?

Dec 2nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.72 KB | None | 0 0
  1. foreach ($result as $data) {
  2.  
  3.  
  4.       ////// Trending Data ///////
  5.       $trendingStore  = round($data["total_gp"] / $dom * $daysinmonth, 2);
  6.       $trending       = round($data["GP"] / $dom * $daysinmonth, 2);
  7.       $trendingStore2 = round($data2["total_gp"] / $dom * $daysinmonth, 2);
  8.       $trendingStore5 = round($data5["total_gp"] / $dom * $daysinmonth, 2);
  9.       $trendingStore6 = round($data6["total_gp"] / $dom * $daysinmonth, 2);
  10.       $trendingStore7 = round($data7["total_gp"] / $dom * $daysinmonth, 2);
  11.       $trendingStore8 = round($data8["total_gp"] / $dom * $daysinmonth, 2);
  12.       $trendingStore9 = round($data9["total_gp"] / $dom * $daysinmonth, 2);
  13.  
  14.       if (strpos($_SERVER['HTTP_HOST'], 'rockland') !== false) {
  15.  
  16.         $name           = $data["tmppercent"] > "1" ? ' style="color: red;"' : '';
  17.         $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  18.         $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  19.         $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  20.         $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  21.         $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  22.         $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  23.         $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  24.         $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  25.         $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  26.         $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  27.         $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  28.  
  29.  
  30.       } elseif (strpos($_SERVER['HTTP_HOST'], 'thomaston') !== false) {
  31.         $name           = $data["tmppercent"] > "1" ? ' style="color: red;"' : '';
  32.         $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  33.         $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  34.         $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  35.         $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  36.         $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  37.         $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  38.         $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  39.         $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  40.         $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  41.         $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  42.         $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  43.  
  44.       } elseif (strpos($_SERVER['HTTP_HOST'], 'lisbonfalls') !== false) {
  45.         $name           = $data["tmppercent"] > "1" ? ' style="color: red;"' : '';
  46.         $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  47.         $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  48.         $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  49.         $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  50.         $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  51.         $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  52.         $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  53.         $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  54.         $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  55.         $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  56.         $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  57.  
  58.       } elseif (strpos($_SERVER['HTTP_HOST'], 'nashua') !== false) {
  59.         $name           = $data["tmppercent"] > "1" ? ' style="color: red;"' : '';
  60.         $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  61.         $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  62.         $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  63.         $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  64.         $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  65.         $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  66.         $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  67.         $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  68.         $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  69.         $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  70.         $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  71.  
  72.       } elseif (strpos($_SERVER['HTTP_HOST'], 'boylston') !== false) {
  73.         $name           = $data["tmppercent"] > "1" ? ' style="color: red;"' : '';
  74.         $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  75.         $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  76.         $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  77.         $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  78.         $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  79.         $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  80.         $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  81.         $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  82.         $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  83.         $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  84.         $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  85.  
  86.       } elseif (strpos($_SERVER['HTTP_HOST'], 'broadway') !== false) {
  87.         $name           = $data["tmppercent"] > "1" ? ' style="color: red;"' : '';
  88.         $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  89.         $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  90.         $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  91.         $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  92.         $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  93.         $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  94.         $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  95.         $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  96.         $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  97.         $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  98.         $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  99.  
  100.       } elseif (strpos($_SERVER['HTTP_HOST'], 'hampstead') !== false) {
  101.         $name           = $data["tmppercent"] > "1" ? ' style="color: red;"' : '';
  102.         $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  103.         $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  104.         $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  105.         $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  106.         $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  107.         $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  108.         $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  109.         $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  110.         $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  111.         $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  112.         $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  113.  
  114.       } else {
  115.  
  116.           $tmpstyle       = $data["tmppercent"] < "75" ? ' style="color: red;"' : '';
  117.           $pullthrough    = $data["pullthroughpercent"] <= "22" ? ' style="color: red;"' : '';
  118.           $bundlestyle    = $data["bundlepercent"] <= "49.9999" ? ' style="color: red;"' : '';
  119.           $gp_smartstyle  = $data["gp_smart2"] <= "350" ? ' style="color: red;"' : '';
  120.           $hum            = $data["HUM_Devices"] <= "0" ? ' style="color: red;"' : '';
  121.           $accgp          = $data["accessorygp"] <= "120" ? ' style="color: red;"' : '';
  122.           $jetpack        = $data["jetpack"] <= "1" ? ' style="color: red;"' : '';
  123.           $tmpstyleStore1      = $data["Textbox106"] <= "75" ? ' style="color: red;"' : '';
  124.           $pullthroughStore1   = $data["Textbox90"] <= "22" ? ' style="color: red;"' : '';
  125.           $bundlestyleStore1   = $data["Textbox74"] <= "50" ? ' style="color: red;"' : '';
  126.           $gp_smartstyleStore1 = $data["gp_smart"] <= "$350" ? ' style="color: red;"' : '';
  127.           $humStore1           = $data["HUM_Devices3"] <= "1" ? ' style="color: red;"' : '';
  128.           $accgpStore1         = $data["Textbox66"] <= "$120" ? ' style="color: red;"' : '';
  129.       }
Advertisement
Add Comment
Please, Sign In to add comment