google_forms/application/views/publish_view.php

152 lines
4.7 KiB
PHP
Raw Normal View History

2024-07-26 12:41:46 +00:00
<style>
/* CSS styles */
.title-column {
color: darkblue;
/* Dark blue color for title */
}
.draft-row {
background-color: #f0f0f0;
/* Light grey background for draft status */
}
.switch {
position: relative;
display: inline-block;
width: 34px;
height: 20px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 14px;
width: 14px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .4s;
}
input:checked+.slider {
background-color: #673AB7;
}
input:checked+.slider:before {
transform: translateX(14px);
}
/* Rounded sliders */
.slider.round {
border-radius: 20px;
}
.slider.round:before {
border-radius: 50%;
}
.switch {
position: relative;
display: inline-block;
}
.switch .tooltip {
visibility: hidden;
width: 70px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 5px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: 125%;
/* Position above the switch */
left: 290%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}
.switch:hover .tooltip {
visibility: visible;
opacity: 1;
}
2024-07-23 12:54:27 +00:00
</style>
2024-07-16 12:29:59 +00:00
<div class="container">
<div class="row">
2024-07-19 12:30:57 +00:00
<div class="col-md-12 mt-4">
2024-07-16 12:29:59 +00:00
<div class="card">
<div class="card-header">
<?php if ($this->session->flashdata('status')): ?>
<div class="alert alert-success">
<?= $this->session->flashdata('status'); ?>
</div>
<?php endif; ?>
<h3>
Published Forms
</h3>
</div>
<div class="card-body">
<!-- here your table will occur -->
<table id="basetable1" class="table table-bordered">
<thead>
<tr>
2024-07-23 12:54:27 +00:00
<th>Responses</th>
2024-07-16 12:29:59 +00:00
<th>Title</th>
2024-07-23 12:54:27 +00:00
<th>Response Link</th>
2024-07-24 13:12:00 +00:00
<th>Status</th>
2024-07-23 12:54:27 +00:00
<th>Preview</th>
2024-07-16 12:29:59 +00:00
</tr>
</thead>
<tbody>
2024-07-26 12:41:46 +00:00
<?php $serialNumber = 1;
foreach ($forms as $row): ?>
2024-07-16 12:29:59 +00:00
<tr>
2024-07-26 12:41:46 +00:00
<td><?php echo $serialNumber++; ?></td>
<td class="title-column">
2024-07-23 12:54:27 +00:00
<?php echo $row->title; ?>
</td>
2024-07-16 12:29:59 +00:00
<td>
2024-07-26 12:41:46 +00:00
<a href="<?php echo $row->response_link; ?>"
target="_blank"><?php echo $row->response_link; ?></a>
2024-07-16 12:29:59 +00:00
</td>
<td>
2024-07-26 12:41:46 +00:00
<label class="switch">
<input type="checkbox" class="toggle-switch"
data-form-id="<?php echo $row->id; ?>" <?php echo $row->is_responsive ? 'checked' : ''; ?>>
<span class="slider round"></span>
<span
class="tooltip"><?php echo $row->is_responsive ? 'Active' : 'Disabled'; ?>
</span>
</label>
2024-07-16 12:29:59 +00:00
</td>
2024-07-26 12:41:46 +00:00
2024-07-16 12:29:59 +00:00
<td>
2024-07-26 12:41:46 +00:00
<a href="<?php echo base_url('form_preview/' . $row->id); ?>">
<i class="fas fa-eye"></i> <!-- Eye icon -->
</a>
</td>
2024-07-16 12:29:59 +00:00
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
2024-07-26 12:41:46 +00:00
</div>