];
     $icon = '<span class="fa fa-plus fa-lg"> Reply Discusion</span>';
     $label = $icon . ' ' . $title;
     $url = Url::toRoute(['/widget/berita/join-comment','KD_BERITA'=>$model->KD_BERITA]);
     $content = Html::a($label,$url, $options);
     return $content;
 }

 if($model->STATUS == 0)
 {
   $btnreply = "";
 }else{
   $btnreply = berita_reply($model);
 } */
/* array commentar */
$query = Commentberita::find()->where(['KD_BERITA' => $model->KD_BERITA])->asArray()->all();
$body = [];
foreach ($query as $key => $value) {
    # code...
    $foto = $value['EMP_IMG'];
    if ($foto == '') {
        $profile = '/upload/hrd/Employee/default.jpg';
    } else {
        $profile = '/upload/hrd/Employee/' . $foto . '';
    }
    $body[] = ['body' => "<class='box-body'><class='direct-chat-info clearfix'><div class='direct-chat-text'>" . $value['CHAT'] . "</div></div></div>", 'img' => $profile, 'imgOptions' => ['width' => "64px", 'height' => "64px", 'class' => 'img-circle'], 'srcOptions' => ['style' => ['class' => 'direct-chat-img', 'background-color' => 'rgba(0, 95, 218, 0.3)', 'width' => "70px", 'height' => "70px", 'padding-top' => '3px', 'padding-left' => '3px']]];
}
$bodyHead = $this->render('_view_detailberita_headline', ['model' => $model]);
$viewBt = Html::mediaList([['heading' => "<div ><div class='direct-chat-text'>" . $model->JUDUL . "</div></div", 'body' => $bodyHead, 'imgOptions' => ['width' => "84px", 'height' => "84px", 'class' => 'img-circle'], 'srcOptions' => ['style' => ['background-color' => 'rgba(0, 95, 218, 0.3)', 'width' => "90px", 'height' => "90px", 'padding-top' => '3px', 'padding-left' => '3px']], 'img' => $foto_profile, 'items' => $body]]);
/* $viewBt1=Html::panel([
        'heading' => '<div></div>',
Esempio n. 2
0
 /** author :wawan
  * Creates a new Commentberita model.
  * If creation is successful,update bt0001notify type equal 1 and the browser will be redirected to the 'detail-berita' page.
  * @param string $KD_BERITA
  * @return mixed
  */
 public function actionJoinComment($KD_BERITA)
 {
     $model = new Commentberita();
     /* componen user */
     $profile = Yii::$app->getUserOpt->profile_user()->emp;
     $emp_img = $profile->EMP_IMG;
     $emp_img_base64 = $profile->IMG_BASE64;
     /* foto profile */
     if ($emp_img_base64 == '') {
         $emp_img_base64 = "default.jpg";
         $foto_profile = Html::img(Yii::getAlias('@web') . '/upload/hrd/Employee/default.jpg', ['width' => '130', 'height' => '130', 'align' => 'center', 'class' => 'img-thumbnail']);
     } else {
         $emp_img_base64 = $profile->IMG_BASE64;
         $foto_profile = Html::img('data:image/jpg;base64,' . $emp_img_base64, ['width' => '130', 'height' => '130', 'align' => 'center', 'class' => 'img-thumbnail']);
     }
     /* proses save */
     if ($model->load(Yii::$app->request->post())) {
         $model->KD_BERITA = $KD_BERITA;
         $model->EMP_IMG = $emp_img_base64;
         //componen
         $model->ID_USER = Yii::$app->user->identity->EMP_ID;
         $model->CREATED_AT = date('Y-m-d H:i:s');
         $model->CREATED_BY = Yii::$app->user->identity->EMP_ID;
         if ($model->save()) {
             //   $condition = ['and',
             //   ['ID_USER'=>$profile->EMP_ID],
             //   ['KD_BERITA'=> $model->KD_BERITA],
             //   ['TYPE'=> 0],
             // ];
             // $update_image = BeritaImage::updateAll(['CREATED_AT' => $model->CREATED_AT],$condition);
             /* update read or unread  notifikasion */
             $notifupdateread = BeritaNotify::updateAll(['TYPE' => 1], ['KD_BERITA' => $model->KD_BERITA]);
         }
         return $this->redirect(['detail-berita', 'KD_BERITA' => $model->KD_BERITA]);
     } else {
         return $this->renderAjax('commentar', ['model' => $model, 'emp_img' => $emp_img, 'foto_profile' => $foto_profile, 'KD_BERITA' => $KD_BERITA]);
     }
 }
Esempio n. 3
0
    for ($a = 0; $a < 2; $a++) {
        $items1[] = ['src' => '/upload/barang/df.jpg', 'imageOptions' => ['width' => "150px"]];
    }
} else {
    foreach ($attach_file as $key => $value) {
        # code...
        $items1[] = ['src' => 'data:image/pdf;base64,' . $value['ATTACH64'], 'imageOptions' => ['width' => "120px", 'height' => "120px", 'class' => 'img-rounded']];
    }
}
# code...
$itemHeaderAttach = Gallery::widget(['id' => 'headergalery', 'items' => $items1, 'showControls' => true]);
?>

 <?php 
/* array commentar */
$query = Commentberita::find()->with('profile')->where(['KD_BERITA' => $model->KD_BERITA])->orderBy(['CREATED_AT' => SORT_DESC])->all();
//$body = [];
$body1 = [];
$x = 0;
foreach ($query as $key => $value) {
    $emp_ID = $value->profile->EMP_ID;
    //   $condition = ['and',
    //   // ['ID_USER'=>$emp_ID],
    //   ['KD_BERITA'=> $model->KD_BERITA],
    //   // ['TYPE'=> 0],
    //   // ['CREATED_AT'=> $value->CREATED_AT],
    // ];
    // $attach_image = BeritaImage::find()->where($condition)->All();
    $attach_image = BeritaImage::find()->where(['KD_BERITA' => $model->KD_BERITA, 'ID_USER' => $emp_ID])->All();
    if ($value->EMP_IMG == "default.jpg") {
        $profile = '/upload/hrd/Employee/default.jpg';