Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function index()
- {
- $this->load->view('view_frontend');
- echo "
- <table class='table table-condensed table-hover table-striped table-responsive'>
- <tr>
- <th class='col-xs-12 col-sm-12 col-md-7'>title</th>
- <th class='col-xs-12 col-sm-6 col-md-2'>Handling</th>
- </tr>";
- $query = $this->db->get('ci_pages');
- echo "
- <br>
- <br>
- <br>
- <br>
- <br>
- <br>";
- foreach ($query->result() as $row)
- {
- echo"
- <tr>
- <td class='col-xs-12 col-sm-12 col-md-7'>{$row->page_title}</td>
- <td class='col-xs-12 col-sm-6 col-md-2'>
- <a class='btn btn-info btn-xs' href=''>Rediger</a>
- ";
- echo "<button class='btn btn-danger btn-xs' data-toggle='modal' data-target='#myModal-{}'>
- Slet
- </button>";
- }
- echo"
- <form method='post'>
- <strong>Titel:</strong> <br />
- <input type='text' class='form-control' placeholder='Titel' name='formCreatePageTitle' /><br />
- <strong>Slug:</strong> <br />
- <input type='text' class='form-control' placeholder='Slug' name='formCreatePageSlug' /><br />
- <input type='submit' name='formCreatPage' value='create page' class='btn btn-success'>
- </form>";
- if($this->input->post('formCreatPage')){
- if($this->form_validation->run()){
- $data = array(
- 'page_title' => $this->input->post('formCreatePageTitle'),
- 'page_slug' => $this->input->post('formCreatePageSlug')
- );
- if($this->db->insert('ci_pages', $data)){
- echo "det virkede";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement