google_forms/application/views/form_preview.php

53 lines
2.5 KiB
PHP
Raw Normal View History

2024-07-16 12:29:59 +00:00
<div class="container">
<div class="form-header">
2024-07-17 12:21:51 +00:00
<h2><?php echo $form->title; ?></h2>
<h4><?php echo $form->description; ?></h4>
2024-07-16 12:29:59 +00:00
</div>
2024-07-19 10:46:18 +00:00
<?php foreach ($questions as $question): ?>
<div class="form-section">
2024-07-16 12:29:59 +00:00
<div class="question-section">
<input type="text" class="form-control question-label" value="<?php echo $question->text; ?>" disabled>
2024-07-19 10:46:18 +00:00
</div>
<?php if ($question->type == 'multiple-choice'): ?>
<div class="options-container">
2024-07-16 12:29:59 +00:00
<?php foreach ($question->options as $option): ?>
<div class="option">
2024-07-19 10:46:18 +00:00
<input type="radio" name="option-<?php echo $question->id; ?>" disabled>
2024-07-16 12:29:59 +00:00
<label><?php echo $option->option_text; ?></label>
</div>
<?php endforeach; ?>
2024-07-19 10:46:18 +00:00
</div>
<?php elseif ($question->type == 'checkbox'): ?>
<div class="options-container">
2024-07-16 12:29:59 +00:00
<?php foreach ($question->options as $option): ?>
<div class="option">
2024-07-19 10:46:18 +00:00
<input type="checkbox" name="option-<?php echo $question->id; ?>" disabled>
2024-07-16 12:29:59 +00:00
<label><?php echo $option->option_text; ?></label>
</div>
<?php endforeach; ?>
2024-07-19 10:46:18 +00:00
</div>
<?php elseif ($question->type == 'short-answer'): ?>
<div class="options-container">
<input type="text" class="form-control" placeholder="Short answer text" disabled>
</div>
<?php elseif ($question->type == 'paragraph'): ?>
<div class="options-container">
<textarea class="form-control" placeholder="Paragraph text" disabled></textarea>
</div>
<?php elseif ($question->type == 'dropdown'): ?>
<div class="options-container">
<select class="form-control" disabled>
2024-07-16 12:29:59 +00:00
<?php foreach ($question->options as $option): ?>
<option><?php echo $option->option_text; ?></option>
<?php endforeach; ?>
</select>
2024-07-19 10:46:18 +00:00
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
2024-07-17 12:21:51 +00:00
2024-07-19 10:46:18 +00:00
<a href="<?php echo base_url('Publish_controller/publish_form/'.$form->id); ?>" class="btn btn-success" style="margin-top: 20px; position: relative; left: 240px;">Publish</a>
2024-07-16 12:29:59 +00:00
</div>
2024-07-19 10:46:18 +00:00