Example #1
0
 public static function importFile($file, $add)
 {
     $error = 0;
     $biobank_id = $file->metadata['biobank_id'];
     $file_imported_id = $file->_id;
     $bytes = CommonTools::toCsv($file);
     $error = CommonTools::analyzeCsv($bytes, $biobank_id, $file_imported_id, $add);
     if ($error == 0) {
         Yii::app()->user->setFlash('success', Yii::app()->user->getFlash('success') . '<br>All samples where successfully imported');
     } else {
         Yii::app()->user->setFlash('notice', Yii::app()->user->getFlash('success') . "<br>{$error} elements were not correctly imported. Please ask admin for more details");
         Yii::app()->user->setFlash('success', null);
     }
 }