/** Get the list of all attachments */
 public function actionAllattachment()
 {
     if (Yii::$app->request->post()) {
         $value = \Yii::$app->request->post();
         $congress = $value['congress'];
         $sda_id = isset($value['sda_id']) && $value['sda_id'] > 0 ? $value['sda_id'] : "";
         if ($congress) {
             if ($sda_id > 0) {
                 $records_sda = \backend\models\SdaAttachments::find()->where(['congress_id' => $congress, 'sda_id' => $sda_id, 'sda_feedback_id' => null])->all();
             } else {
                 $records_sda = \backend\models\SdaAttachments::find()->where(['congress_id' => $congress])->all();
             }
             $records_meeting = \backend\models\MeetingAttachments::find()->where(['congress_id' => $_POST['congress']])->all();
             $return = [];
             $data = [];
             foreach ($records_sda as $row) {
                 $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'https://';
                 $host = $_SERVER['HTTP_HOST'];
                 $congressname = CongressDetails::findOne($row['congress_id'])->name;
                 unset($row['sda_feedback_id']);
                 unset($row['session_id']);
                 $row = $row->toArray();
                 $filename = explode("/", $row['path']);
                 $filenames = end(explode(".", $filename[1]));
                 $data['filename'] = str_replace($filenames, "", $filename[1]);
                 $data['filename'] = str_replace(".", "", $filename[1]);
                 $data['filetype'] = $filenames;
                 $data['path'] = $protocol . $host . "/rest/backend/web/" . $row['path'];
                 $data['exits'] = file_exists($_SERVER['DOCUMENT_ROOT'] . '/rest/backend/web/' . $row['path']);
                 $return['sda'][] = $data;
             }
             $data2 = [];
             foreach ($records_meeting as $row) {
                 $protocol = stripos($_SERVER['SERVER_PROTOCOL'], 'https') === true ? 'https://' : 'https://';
                 $host = $_SERVER['HTTP_HOST'];
                 $row = $row->toArray();
                 $type = \backend\models\MeetingTypes::findOne($row['meeting_type_id']);
                 $congressname = CongressDetails::findOne($row['congress_id'])->name;
                 unset($row['meeting_type_id']);
                 $filename = explode("/", $row['path']);
                 $filenames = end(explode(".", $filename[1]));
                 $data2['filename'] = str_replace($filenames, "", $filename[1]);
                 $data2['filename'] = str_replace(".", "", $filename[1]);
                 $data2['filetype'] = $filenames;
                 $data2['path'] = $protocol . $host . "/rest/backend/web/" . $row['path'];
                 $data2['exits'] = file_exists($_SERVER['DOCUMENT_ROOT'] . '/rest/backend/web/' . $row['path']);
                 $return['meeting'][] = $data2;
             }
             return $return;
         } else {
             return "parameter missing";
         }
     } else {
         return 'invalid method';
     }
 }
$debrief = '';
$questions_anss = '';
$session = '';
$takeawaysd = '';
$images = "";
$allimages = '';
$userdetails = [];
$username = '';
$summaries = "";
$questies = "";
$sdaTitle = '';
if ($model) {
    foreach ($model as $models) {
        $summary = json_decode($models->takeaway_summary, true);
        $ques = json_decode($models->questions_ans, true);
        $sda_attachements = \backend\models\SdaAttachments::find()->where(['sda_feedback_id' => $models->id])->orderBy(['id' => SORT_DESC])->all();
        if ($models->user_id > 0) {
            $userdetails = \backend\models\User::findOne(['id' => $models->user_id]);
            if ($userdetails) {
                $username = $userdetails->first_name . " " . $userdetails->last_name;
            }
        }
        $commentmodel = new FeedbackComments();
        $commentdata = $commentmodel::find(1)->where(array('feedback_id' => $models->id))->orderBy(['id' => SORT_DESC])->all();
        foreach ($commentdata as $commentdata) {
            if ($commentdata->feedback_type == "takeaway_summary") {
                $summaries .= '<p class="bg-success">' . $username . $spaceString . date("M d,Y", strtotime($commentdata->createdOn)) . "/" . date("h:i a", strtotime($commentdata->createdOn)) . "{$spaceString}" . $commentdata->comment . "</p>";
            } else {
                $questies .= '<p class="bg-success">' . $username . $spaceString . date("M d,Y", strtotime($commentdata->createdOn)) . "/" . date("h:i a", strtotime($commentdata->createdOn)) . "{$spaceString}" . $commentdata->comment . " </p>";
            }
        }