PHP File Manager
Editing File: Clubs.php
<?php class Clubs extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('teams'); } function show_page($head_data = array(), $view, $view_data = array()) { $this->load->view('header', $head_data); $this->load->view($view, $view_data); $this->load->view('footer'); } function index() { $teams = $this->teams->get(); $this->show_page(array('page_title' => 'Teams'), 'teams/index', array('teams' => $teams)); } function create() { if ($this->input->post()) { $team_id = $this->teams->save($this->input->post()); if ($team_id) { redirect(site_url(array('teams', 'edit', $team_id))); } } $this->show_page(array('page_title' => 'New team'), 'teams/edit'); } function edit($team_id) { if ($this->input->post()) { $team_id = $this->teams->save($this->input->post()); if ($team_id) { redirect(site_url(array('teams', 'edit', $team_id))); } } $team = $this->teams->get($team_id); $this->show_page(array('page_title' => 'Edit team - ' . $team->name), 'teams/edit', array('team' => $team)); } function delete($team_id) { $this->teams->delete($team_id); redirect(site_url('teams')); } }
Cancel