コード例 #1
0
 /**
  * Upload attachment for SDA
  * @param int $id
  * @return mixed
  */
 public function actionUploadsda($id)
 {
     $id = (int) $id;
     $model1 = new SdaAttachments();
     if ($model1->load(Yii::$app->request->post())) {
         //If request is post
         $model1->path = UploadedFile::getInstances($model1, 'path');
         foreach ($model1->path as $files) {
             if ($files->saveAs('uploads/' . $files->baseName . '.' . $files->extension)) {
                 $model1->congress_id = $id;
                 $filesize = $files->size;
                 $filetype = $files->extension;
                 $path = "uploads/" . $files->name;
                 $cong = Sda::find()->where(['id' => $id])->one();
                 $congressid = $cong['congress_id'];
                 Yii::$app->db->createCommand("insert into sda_attachments(sda_id,path,congress_id,size,type)values('{$id}','{$path}','{$congressid}','{$filesize}','{$filetype}')")->execute();
             }
         }
         return $this->redirect(array("sda/update", 'id' => $id));
     }
 }
コード例 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSda()
 {
     return $this->hasOne(Sda::className(), ['id' => 'sda_id']);
 }
コード例 #3
0
 public function attributes()
 {
     // add related fields to searchable attributes
     return array_merge(parent::attributes(), ['sda_types.sda_name']);
 }
コード例 #4
0
 /**
  * Advanced search in iPAd
  * @return mixed
  */
 public function actionSdasearch()
 {
     $connection = Yii::$app->db;
     if (Yii::$app->request->post()) {
         $value = \Yii::$app->request->post();
         $formData['title'] = $value['title'];
         $formData['date'] = $value['date'];
         $formData['authors'] = $value['authors'];
         $formData['session_id'] = $value['session_id'];
         $formData['poster_board_no'] = $value['poster_board_no'];
         $formData['session'] = $value['session'];
         $formData['abstract_id'] = $value['abstract_id'];
         $formData['abstract'] = $value['abstract'];
         $formData['presenter'] = $value['presenter'];
         $formData['sda_type'] = $value['sda_type'];
         $formData['presentation_no'] = $value['presentation_no'];
         $formData['team'] = $value['team'];
         $formData['congress_id'] = $value['congress'];
         $formData['product'] = $value['product'];
         //User id can be used for searching for data on the basis of user's id
         $formData['user_id'] = (int) isset($value['user_id']) ? $value['user_id'] : false;
         $finalvalue = array();
         $sql = "SELECT sda.* FROM sda ";
         if ($formData['user_id'] > 0) {
             $user = User::findOne(['id' => $formData['user_id']]);
             if ($user) {
                 $sql .= " INNER JOIN sda_schedules on sda_schedules.sda_id = sda.id and sda_schedules.attendee_id = " . $user->attendee_id;
             } else {
                 echo "Incorrect method";
             }
         }
         $sql .= " INNER JOIN products on products.id = sda.product";
         $sql .= " WHERE 1 ";
         $sql .= " AND sda.is_active = 1 ";
         $sql .= isset($formData['title']) && !empty($formData['title']) ? " AND sda.title LIKE '%" . $formData['title'] . "%'" : '';
         $sql .= isset($formData['date']) && !empty($formData['date']) ? " AND sda.date='" . $formData['date'] . "'" : '';
         $sql .= isset($formData['authors']) && !empty($formData['authors']) ? " AND sda.authors LIKE '%" . $formData['authors'] . "%'" : '';
         $sql .= isset($formData['session_id']) && !empty($formData['session_id']) ? " AND sda.session_id='" . $formData['session_id'] . "'" : '';
         $sql .= isset($formData['poster_board_no']) && !empty($formData['poster_board_no']) ? " AND sda.poster_board_no='" . $formData['poster_board_no'] . "'" : '';
         $sql .= isset($formData['session']) && !empty($formData['session']) ? " AND sda.session LIKE '%" . $formData['session'] . "%'" : '';
         $sql .= isset($formData['abstract_id']) && !empty($formData['abstract_id']) ? " AND sda.abstract_id='" . $formData['abstract_id'] . "'" : '';
         $sql .= isset($formData['abstract']) && !empty($formData['abstract']) ? " AND sda.abstract LIKE '%" . $formData['abstract'] . "%'" : '';
         $sql .= isset($formData['presenter']) && !empty($formData['presenter']) ? " AND sda.presenter LIKE '%" . $formData['presenter'] . "%'" : '';
         if ($sdaTypeRow = \backend\models\SdaTypes::find()->where(['sda_name' => $formData['sda_type']])->one()) {
             $sql .= isset($formData['sda_type']) && !empty($formData['sda_type']) ? " AND sda_type_id='" . $sdaTypeRow->id . "'" : '';
         }
         $sql .= isset($formData['product']) && !empty($formData['product']) ? " AND products.name='" . $formData['product'] . "'" : '';
         $sql .= isset($formData['presentation_no']) && !empty($formData['presentation_no']) ? " AND sda.presentation_no='" . $formData['presentation_no'] . "'" : '';
         $sql .= isset($formData['team']) && !empty($formData['team']) ? " AND sda.team LIKE '%" . $formData['team'] . "%'" : '';
         $sql .= isset($formData['congress_id']) && !empty($formData['congress_id']) ? " AND sda.congress_id='" . $formData['congress_id'] . "'" : '';
         $sql .= " order by date asc,session_start_time asc";
         $model = Sda::findBySql($sql)->all();
         if (!empty($model)) {
             foreach ($model as $key => $value) {
                 $modelsda = $connection->createCommand("SELECT DISTINCT ms.attendee_id,a.Name as Name, a.title as title, f.Name AS Funame, c.Group_name AS Cost_Center, a.phone as phone, a.speciality as speciality,'sdaattendee' as type\n                                                            FROM  sda_schedules ms\n                                                            INNER JOIN amgen_contact_list a ON ms.attendee_id = a.id\n                                                            LEFT JOIN functions f ON f.ID = a.function_id LEFT JOIN cost_center c ON c.id = a.group_id\n                                                            WHERE ms.sda_id = {$value->id}");
                 $attendee = $modelsda->queryAll();
                 $finalvalue[] = array('id' => $value['id'], 'congress' => CongressDetails::findOne($value['congress_id'])->name, 'product' => $value['product'] ? Products::findOne($value['product'])->name : null, 'title' => $value['title'], 'abstract_id' => $value['abstract_id'], 'priority' => SdaPriority::findOne($value['priority'])->priority_name, 'abstract' => $value['abstract'], 'date' => $value['date'], 'start_time' => date("g:i a", strtotime($value['session_start_time'])), 'end_time' => date("g:i a", strtotime($value['session_end_time'])), 'session_start_time' => !empty($value['session_start_time']) ? date("g:i a", strtotime($value['session_start_time'])) : "", 'session_end_time' => !empty($value['session_end_time']) ? date("g:i a", strtotime($value['session_end_time'])) : "", 'presentation_start_time' => !empty($value['presentation_start_time']) ? date("g:i a", strtotime($value['presentation_start_time'])) : "", 'presentation_end_time' => !empty($value['presentation_end_time']) ? date("g:i a", strtotime($value['presentation_end_time'])) : "", 'presenter' => $value['presenter'], 'sda_type' => \backend\models\SdaTypes::findOne($value['sda_type_id'])->sda_name, 'location' => $value['location'], 'session_id' => $value['session_id'], 'session' => $value['session'], 'authors' => $value['authors'], 'company' => \backend\models\CompanyDetails::findOne($value['company_id'])->name, 'team' => $value['team'], 'linktoposter' => $value['link_to_poster'], 'posterboadnno' => $value['poster_board_no'], 'presentation_no' => $value['presentation_no'], 'attendee' => $attendee, 'type' => 'SDA', 'category' => $value['category']);
             }
         }
         return $finalvalue;
     } else {
         echo "Incorrect method";
     }
 }
コード例 #5
0
<?php

use yii\helpers\Html;
use backend\models\Sda;
use backend\models\CongressDetails;
use backend\models\FeedbackComments;
$spaceString = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
$this->title = 'SDA Feedback';
$this->params['breadcrumbs'][] = $this->title;
//getting congress id for back functinility
$getfid = $_REQUEST['id'];
$userid = Sda::find()->where(['id' => $getfid])->one();
$congid = $userid['congress_id'];
$congress = CongressDetails::findOne($congid);
if ($congress) {
    $this->params['blueTitle'] = 'Congress Schedule:' . $congress->name;
} else {
    $this->params['blueTitle'] = 'Congress Schedule';
}
$array_elements = array();
$takeaway_summary = array();
$question_ans = array();
$ol_feedback = array();
$audiences_size = '';
$debrief = '';
$questions_anss = '';
$session = '';
$takeawaysd = '';
$images = "";
$allimages = '';
$userdetails = [];
コード例 #6
0
/* @var $model backend\models\SdaFeedback */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="sda-feedback-form">

    <?php 
$form = ActiveForm::begin();
?>
    <?php 
$congress_ids = \backend\models\CongressDetails::find()->all();
$listData = ArrayHelper::map($congress_ids, 'id', 'name');
echo $form->field($model, 'congress_id')->dropDownList($listData, ['prompt' => 'Select...']);
?>
    <?php 
$sda_ids = \backend\models\Sda::find()->all();
$listDatas = ArrayHelper::map($sda_ids, 'id', 'title');
echo $form->field($model, 'sda_id')->dropDownList($listDatas, ['prompt' => 'Select...']);
?>
    <?php 
$listData = ArrayHelper::map($sda_ids, 'session_id', 'session_id');
echo $form->field($model, 'session_id')->dropDownList($listData, ['prompt' => 'Select...']);
?>
  
    <?php 
echo $form->field($model, 'audience_size')->textInput();
?>
    <?php 
echo $form->field($model, 'additional_data')->textInput(['maxlength' => true]);
?>
    <?php 
コード例 #7
0
 /**
  * Finds the Sda model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Sda the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Sda::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }