public function commentCampaign() { $idCampaign = Input::get('id_campaign'); $valueComment = Input::get('comment'); $arrComment = commentCampaign(); if ($valueComment == -1) { $comment = Input::get('orther-comment'); } else { $comment = $arrComment[$valueComment]; } $dataUpdate = ["campaign_id" => $idCampaign, "comment" => $comment]; $item = CampaignCommentBaseModel::create($dataUpdate); if ($item) { return 1; } else { return 0; } }
<button type="button" class="close" data-dismiss="modal"> <span aria-hidden="true">×</span> <span class="sr-only">Close</span> </button> <h4 class="modal-title" id="myModalLabel">{{trans('backend::publisher/text.comment')}}</h4> </div> <div class="modal-body"> <h3>{{trans('backend::publisher/text.what_do_you_think')}}</h3> <div class="row"> <div class="col-sm-12"> {{Form::open(['id'=>'form-comment','role'=>'form'])}} <div class="form-group" id="cm-campaign"> <input type="hidden" name="id_campaign" id="id_campaign" value=""> <?php $arrComment = commentCampaign(); ?> @foreach($arrComment as $key=>$value) <input type="radio" name="comment" value="{{$key}}"> {{$value}} <br> @endforeach <textarea name="orther-comment" style="display:none;" id="orther-comment" cols="30" class="form-control" rows="5"></textarea> </div> {{Form::close()}} </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" id="btn-submit-comment" data-dismiss="modal">{{trans('backend::publisher/text.send')}}</button> </div> </div> </div>