Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 17th, 2014  |  syntax: PHP  |  size: 6.27 KB  |  views: 2,622  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ...
  2. if ($var[0]->voorgerecht != 0 && $var[0]->nagerecht != 0) {
  3.     if ($var[0]->hoofdgerecht == $var[0]->nagerecht && $var[0]->voorgerecht == $var[0]->hoofdgerecht) {
  4.         if ($res2['voorgerecht_status'] == "PENDING") {
  5.             $this->Module->logger->logInfo("Sending mail...");
  6.             $gerechten = array(1,2,3);
  7.             $renewed_data['gerechten'] = $gerechten;
  8.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  9.         }
  10.  
  11.     } elseif ($var[0]->voorgerecht == $var[0]->hoofdgerecht) {
  12.         if ($res2['voorgerecht_status'] == "PENDING") {
  13.             $this->Module->logger->logInfo("Sending mail...");
  14.             $gerechten = array(1,2);
  15.             $renewed_data['gerechten'] = $gerechten;
  16.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  17.         }
  18.  
  19.         unset($gerechten);
  20.         if ($res2['nagerecht_status'] == "PENDING") {
  21.             $this->Module->logger->logInfo("Sending mail...");
  22.             $gerechten = array(3);
  23.             unset($renewed_data['gerechten']);
  24.             $renewed_data['gerechten'] = $gerechten;
  25.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  26.         }
  27.  
  28.     } elseif ($var[0]->hoofdgerecht == $var[0]->nagerecht) {
  29.         if ($res2['voorgerecht_status'] == "PENDING") {
  30.             $this->Module->logger->logInfo("Sending mail...");
  31.             $gerechten = array(1);
  32.             $renewed_data['gerechten'] = $gerechten;
  33.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  34.         }
  35.  
  36.         unset($gerechten);
  37.         if ($res2['hoofdgerecht_status'] == "PENDING") {
  38.             $this->Module->logger->logInfo("Sending mail...");
  39.             $gerechten = array(2,3);
  40.             unset($renewed_data['gerechten']);
  41.             $renewed_data['gerechten'] = $gerechten;
  42.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  43.         }
  44.  
  45.     } elseif ($var[0]->voorgerecht == $var[0]->nagerecht) {
  46.         if ($res2['hoofdgerecht_status'] == "PENDING") {
  47.             $this->Module->logger->logInfo("Sending mail...");
  48.             $gerechten = array(2);
  49.             $renewed_data['gerechten'] = $gerechten;
  50.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  51.         }
  52.  
  53.         unset($gerechten);
  54.         if ($res2['voorgerecht_status'] == "PENDING") {
  55.             $this->Module->logger->logInfo("Sending mail...");
  56.             $gerechten = array(1,3);
  57.             unset($renewed_data['gerechten']);
  58.             $renewed_data['gerechten'] = $gerechten;
  59.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  60.         }
  61.  
  62.     } else {
  63.         if ($res2['voorgerecht_status'] == "PENDING") {
  64.             $this->Module->logger->logInfo("Sending mail...");
  65.             $gerechten = array(1);
  66.             $renewed_data['gerechten'] = $gerechten;
  67.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  68.         }
  69.  
  70.         unset($gerechten);
  71.         if ($res2['hoofdgerecht_status'] == "PENDING") {
  72.             $this->Module->logger->logInfo("Sending mail...");
  73.             $gerechten = array(2);
  74.             unset($renewed_data['gerechten']);
  75.             $renewed_data['gerechten'] = $gerechten;
  76.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  77.         }
  78.  
  79.         unset($gerechten);
  80.         if ($res2['nagerecht_status'] == "PENDING") {
  81.             $this->Module->logger->logInfo("Sending mail...");
  82.             $gerechten = array(3);
  83.             unset($renewed_data['gerechten']);
  84.             $renewed_data['gerechten'] = $gerechten;
  85.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  86.         }
  87.  
  88.     }
  89.  
  90. } elseif ($var[0]->nagerecht == 0) {
  91.     if ($var[0]->voorgerecht == $var[0]->hoofdgerecht) {
  92.         if ($res2['voorgerecht_status'] == "PENDING") {
  93.             $this->Module->logger->logInfo("Sending mail...");
  94.             $gerechten = array(1,2);
  95.             $renewed_data['gerechten'] = $gerechten;
  96.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  97.         }
  98.  
  99.     } else {
  100.         if ($res2['voorgerecht_status'] == "PENDING") {
  101.             $this->Module->logger->logInfo("Sending mail...");
  102.             $gerechten = array(1);
  103.             $renewed_data['gerechten'] = $gerechten;
  104.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  105.         }
  106.  
  107.         unset($gerechten);
  108.         if ($res2['hoofdgerecht_status'] == "PENDING") {
  109.             $this->Module->logger->logInfo("Sending mail...");
  110.             $gerechten = array(2);
  111.             unset($renewed_data['gerechten']);
  112.             $renewed_data['gerechten'] = $gerechten;
  113.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  114.         }
  115.     }
  116.  
  117. } elseif ($var[0]->voogerecht == 0) {
  118. // Check if same restaurant
  119.     if ($var[0]->hoofdgerecht == $var[0]->nagerecht) {
  120.         if ($res2['hoofdgerecht_status'] == "PENDING") {
  121.             $this->Module->logger->logInfo("Sending mail...");
  122.             $gerechten = array(2,3);
  123.             $renewed_data['gerechten'] = $gerechten;
  124.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  125.         }
  126.  
  127.     } else {
  128.         if ($res2['hoofdgerecht_status'] == "PENDING") {
  129.             $this->Module->logger->logInfo("Sending mail...");
  130.             $gerechten = array(2);
  131.             $renewed_data['gerechten'] = $gerechten;
  132.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  133.         }
  134.  
  135.         unset($gerechten);
  136.         if ($res2['nagerecht_status'] == "PENDING") {
  137.             $this->Module->logger->logInfo("Sending mail...");
  138.             $gerechten = array(3);
  139.             unset($renewed_data['gerechten']);
  140.             $renewed_data['gerechten'] = $gerechten;
  141.             $this->Mailer->newMail("RESTAURANT_ORDER_REMINDER", $renewed_data, $var[1][$i]['Email']);
  142.         }
  143.     }
  144. }
  145. ...
clone this paste RAW Paste Data