echo $model_SurveyResulte->sr_id;
?>
" >
            <input type="hidden" id="SurveyResulte-image"

            class="form-control " name="SurveyResulte[image]" value="<?php 
echo $model_SurveyResulte->image;
?>
">

            <div class="help-block"></div>
        </div>
		<div id="image-wrap">
            <?php 
if (isset($model_SurveyResulte->image) && !empty($model_SurveyResulte->image)) {
    echo '<img src="', $image = SurveyResulte::getImageUrl($model_SurveyResulte), '"/>';
}
?>
        </div>
        <br/>
        <div class="btn_bg btn-2" style="padding:0;" >
            <?php 
$prv_url = Yii::$app->urlManager->createUrl(['survey/step4_2_question', 'id' => $model->id]);
$model->tax == 2 ? $prv_url = Yii::$app->urlManager->createUrl(['survey/step4_3', 'id' => $model->id]) : '';
$model->tax == 1 ? $prv_url = Yii::$app->urlManager->createUrl(['survey/step1_3', 'id' => $model->id]) : '';
$model->tax == 3 ? $prv_url = Yii::$app->urlManager->createUrl(['survey/step4_2_question', 'id' => $model->id]) : '';
?>
			<a  style=""
			href="<?php 
echo $prv_url;
?>
 /**
  * 检测发布
  */
 public function checkPublish($question_all, $model, $result_all)
 {
     $message = '';
     isset($question_all['questions'][0]) ? null : ($question_all['questions'] = []);
     if ($model->tax > 1) {
         !isset($question_all['questions'][0]) ? $message = '至少包含一个问题,' : null;
     }
     isset($question_all['options'][0]) ? null : ($question_all['options'] = []);
     isset($result_all[0]) ? null : ($result_all = []);
     $replace_prefix = '<b class="replace_word" style="color: blue;">';
     $replace_self = false;
     $replace_suffix = '</b>';
     $replace = true;
     $all_count = 0;
     // 敏感词数量
     $all_count_empty = 0;
     // 未填写项
     $all_question_empty = 0;
     // 空问题数量
     $all_question_option_empty = 0;
     // 空选项数量
     ZCommonFun::replace_filter_words($model->title, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
     $all_count += $replace_count;
     ZCommonFun::replace_filter_words($model->intro, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
     $all_count += $replace_count;
     empty($model->title) ? $all_count_empty++ : null;
     empty($model->intro) ? $all_count_empty++ : null;
     // 问题
     $index = 0;
     foreach ($question_all['questions'] as $key => $question) {
         $index++;
         $label = $question->label;
         $replace_count = 0;
         $label = ZCommonFun::replace_filter_words($label, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
         $all_count += $replace_count;
         $error = !empty($label) ? '' : '问题不能为空';
         $error ? $all_count_empty++ : null;
         isset($question_all['options'][$key]) ? null : ($question_all['options'][$key] = []);
         if (count($question_all['options'][$key]) < 1) {
             $all_count_empty++;
         }
         foreach ($question_all['options'][$key] as $key2 => $question_option) {
             $option_label = $question_option->option_label;
             $option_label = ZCommonFun::replace_filter_words($option_label, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
             $all_count += $replace_count;
             $error_option_label = !empty($option_label) ? '' : '选项不能为空';
             $error_option_label ? $all_count_empty++ : null;
             $speparator = $question_option->skip_question > 0 || $question_option->skip_resulte > 0 ? '——' : '';
             $skip_text = '';
             $question_option->skip_question > 0 ? $skip_text = "转{$question_option->skip_question}题" : '';
             $question_option->skip_resulte > 0 ? $skip_text = "转{$question_option->skip_question}结果" : '';
             $score_text = '';
             if ($model->tax == 2) {
                 $score_text = '—(' . $question_option->option_score . '分)';
             }
         }
     }
     $index = 0;
     !isset($result_all[0]) ? $message .= '至少包含一个测试结果' : '';
     foreach ($result_all as $key => $result) {
         $index++;
         $name = $result->name;
         $name = ZCommonFun::replace_filter_words($name, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
         $all_count += $replace_count;
         $error_name = !empty($name) ? '' : '姓名之前不能为空';
         $error_name ? $all_count_empty++ : null;
         $value = $result->value;
         $value = ZCommonFun::replace_filter_words($value, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
         $all_count += $replace_count;
         $error_value = !empty($value) ? '' : '姓名之后不能为空';
         $error_value ? $all_count_empty++ : null;
         $intro = $result->intro;
         $intro = ZCommonFun::replace_filter_words($intro, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
         $all_count += $replace_count;
         $error_intro = !empty($intro) ? '' : '结果详情不能为空';
         $error_intro ? $all_count_empty++ : null;
         $image = $result->image;
         $error_image = !empty($image) ? '' : '图片不能为空';
         $error_image ? $all_count_empty++ : null;
         $image = SurveyResulte::getImageUrl($result);
         $score_text = '';
         if ($model->tax == 2) {
             $score_text = '' . $result->score_min . '分~~' . $result->score_max . '分';
         }
     }
     return [$all_count, $all_count_empty, 'message' => $message];
 }
Beispiel #3
0
				<div id="panel3" class="panel-body js_result trueresult">
					<hr  style="display: none;">
					<div id="test_content">
						<div class="progre">
							<span class="value"  style="display: none;"><span class="current">我的测试结果</span></span>
							<p>
							<?php 
echo $model_SurveyResulte->name;
echo $model_AnswerUser->answer_name ? '<span class="answer-name">' . $model_AnswerUser->answer_name . '</span>' : '';
echo $model_SurveyResulte->value;
?>
				            </p>
				            <div>
            			    <?php 
if (isset($model_SurveyResulte->image) && !empty($model_SurveyResulte->image)) {
    echo '<img style="width: 100%;" src="', $image = SurveyResulte::getImageUrl($model_SurveyResulte), '"/>';
}
?>
            				</div>
            				
						</div>

					</div>
					
					<dl>
						<dt>详细分析:</dt>
						<dd style="" id="details">
							<p></p>
							<p>
    							<?php 
echo $model_SurveyResulte->intro;
Beispiel #4
0
$index = 0;
foreach ($result_all as $key => $result) {
    $index++;
    $row_change_result_url = Yii::$app->urlManager->createUrl(['survey/step4_2', 'id' => $model->id, 'page' => $index]);
    $name = $result->name;
    $name = ZCommonFun::replace_filter_words($name, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
    $error_name = !empty($name) ? '' : '姓名之前不能为空';
    $value = $result->value;
    $value = ZCommonFun::replace_filter_words($value, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
    $error_value = !empty($value) ? '' : '姓名之后不能为空';
    $intro = $result->intro;
    $intro = ZCommonFun::replace_filter_words($intro, $replace_prefix, $replace_self, $replace_suffix, $replace, $replace_count);
    $error_intro = !empty($intro) ? '' : '结果详情不能为空';
    $image = $result->image;
    $error_image = !empty($image) ? '' : '图片不能为空';
    $image = SurveyResulte::getImageUrl($result);
    $score_text = '';
    if ($model->tax == 2) {
        $score_text = '' . $result->score_min . '分~~' . $result->score_max . '分';
    }
    ?>
                 <section class="layout">
                    <section data-bcless="lighten">
                        <h2><?php 
    echo '结果', $index;
    ?>
</h2>
                        <a class="change-btn" href="<?php 
    echo $row_change_result_url;
    ?>
" >修改此结果</a>