if ($o['type'] == 'SP') {
             $email_subject .= ' über ' . $sp_tograb[$o['jng_sp_id']];
         }
         $from_email_name = FROM_EMAIL_NAME;
         $from_email_address = FROM_EMAIL_ADDRESS;
         $sent = tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address);
         if ($sent) {
             $cron_result[] = "{$to_name} ({$to_email_address}) - {$oid}";
             tep_mail(EMAIL_NAME_SERVICE, EMAIL_ADDRESS_SERVICE, $email_subject, $email_text, $from_email_name, $from_email_address);
             $sent_to = array();
             $sent_to[] = $to_email_address;
             $sent_to[] = EMAIL_ADDRESS_SERVICE;
             if ($o['type'] == 'JG') {
                 $items = $class_o->retrieveProducts($o['orders_id']);
                 foreach ($items as $i) {
                     $class_o->delayInfoSent($i['orders_products_id'], $timestamp, 'auto-sent', $sent_to);
                 }
             } elseif ($o['type'] == 'SP') {
                 $items = $class_jo->retrieveItems($o['orders_id']);
                 foreach ($items as $i) {
                     $class_jo->delayInfoSent($i['jng_sp_orders_items_id'], $timestamp, 'auto-sent', $sent_to);
                 }
             }
         }
     }
 }
 $mt_finish = microtime();
 list($old_usec, $old_sec) = explode(' ', $mt_start);
 list($new_usec, $new_sec) = explode(' ', $mt_finish);
 $old_mt = (double) $old_usec + (double) $old_sec;
 $new_mt = (double) $new_usec + (double) $new_sec;
         $to_name = $order['customers_name'];
         $to_email_address = $order['customers_email_address'];
         $product_id = $item['products_model'];
         $product_name = $item['products_name'];
         $delay = '3 Tage';
         include DIR_WS_EMAILS . $languages[2]['path'] . '/jng-item-delay.php';
         $from_email_name = FROM_EMAIL_NAME;
         $from_email_address = FROM_EMAIL_ADDRESS;
         $sent = tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address);
         if ($sent) {
             $sent_to = array();
             $sent_to[] = $to_email_address;
             tep_mail(EMAIL_NAME_SERVICE, EMAIL_ADDRESS_SERVICE, $email_subject, $email_text, $from_email_name, $from_email_address);
             $sent_to[] = EMAIL_ADDRESS_SERVICE;
             $sent_time = date('Y-m-d H:i:s');
             $class_o->delayInfoSent($opid, $sent_time, $session_userinfo['username'], $sent_to);
             //$result = 'Delay Info is successfully sent.';
             $result = $opid . ",green";
         } else {
             //$result = 'Failed sending email, please try again later.';
             $result = $opid . ",red";
         }
     }
     echo utf8_encode($result);
     exit;
 } elseif ($_POST['me_action'] == 'CANCELORDER') {
     $opid = tep_db_prepare_input($_POST['op_id']);
     $old_status = tep_db_prepare_input($_POST['old_status']);
     $new_status = $class_o->doCancelOrders($opid, $old_status, $session_userinfo['username']);
     $result = array();
     $result['op_id'] = $opid;