$shell = array();
         $shell[] = 'cd ' . SP_OTTODE_PATH . 'jms';
         $shell[] = './produce-styles.sh';
         $output = shell_exec(implode("\n", $shell));
         $files = @scandir(SP_OTTODE_UPLOAD_PATH);
     }
     $success = count($files) <= 2;
 }
 if ($success) {
     if (!$trigger_jms_manually) {
         logProcess('JMS Upload Success', '- ', false);
     }
     $upload_id = $class_ju->newUpload($jng_sp_id, 'CAT', $xml_files[count($xml_files) - 1], $session_userinfo['username']);
     //save products with images files included in upload
     if (count($upload_image_log) > 0) {
         $class_ju->addUploadType($upload_id, 'MEDIA', $zip_filename);
         foreach ($upload_image_log as $jcid) {
             $class_ju->addUploadImage($upload_id, $jcid);
         }
     }
     //save products with changing active status
     foreach ($active_log as $status => $jccol) {
         foreach ($jccol as $jcid) {
             $class_ju->addUploadProducts($upload_id, $jcid, $status);
         }
     }
     //SAVE DELETED TO DB AND SEND EAN INFO TO PETER
     //Prevent error caused by multiple eans in array
     if (count($deleted_eans) > 0) {
         $deleted_eans = array_unique($deleted_eans);
         foreach ($deleted_eans as $ean) {
     //BACKUP XML FILE
     $shell = array();
     $shell[] = 'cd ' . SP_NECKERMANNAT_UPLOAD_PATH;
     $shell[] = 'zip ' . SP_NECKERMANNAT_PATH . 'cat-backup/' . $xml_filename . '.zip ' . $xml_filename;
     $output = shell_exec(implode("\n", $shell));
     $file = fopen(SP_NECKERMANNAT_UPLOAD_PATH . $xml_filename_marker, 'w');
     fclose($file);
     $upload_id = $class_ju->newUpload($jng_sp_id, 'CAT', $xml_filename, $session_userinfo['username']);
     $content = '<h3 class="green">CAT XML File is uploaded successfully</h3>';
     if (count($upload_image_log) > 0 && $create_image_zip) {
         $zipper->create_archive();
         $success = rename($zip_file, $zip_final);
         if ($success) {
             $file = fopen($zip_marker, 'w');
             fclose($file);
             $class_ju->addUploadType($upload_id, 'MEDIA', $zip_filename);
             foreach ($upload_image_log as $jcid) {
                 $class_ju->addUploadImage($upload_id, $jcid);
             }
             $content .= '<h3 class="green">Media (Image) File is uploaded successfuly</h3>';
         } else {
             $content .= '<h3 class="red">Can not create the Media file, please contact administrator.</h3>';
         }
     }
 } else {
     $content = '<h3 class="red">Can not save CAT XML File to server, please contact administrator.</h3>';
     if (count($upload_image_log) > 0 && $create_image_zip) {
         $content .= '<h3 class="red">Media (Image) File upload is aborted due to this failure.</h3>';
     }
 }
 if (isset($temp_images)) {