HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/awaldron/www/archive/teampay/application/controllers/create_team.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Create_team extends CI_Controller
{
	function __construct()
	{
		parent::__construct();

		$this->load->helper('url');
		$this->load->library('tank_auth');
	}

	function index()
	{
		// Initialize page variables 
		$data = $this->tank_auth->auth_init( true, '');
		
		$data['page_title'] = "Create New Team";
		$data['icon_title'] = "fa-plus-circle";
		$data['navon'] = "new_team";
		
		$this->load->view('_header', $data);
		$this->load->view('v_newteam', $data);
		$this->load->view('_footer', $data);

	}
	
	function add() {
		// Initialize page variables 
		$data = $this->tank_auth->auth_init( true, '');

		$post = $this->input->post();
		
		// Form Validation 
		$this->form_validation->set_rules('team_name', 'Team Name', 'trim|required|xss_clean');
		$this->form_validation->set_rules('sport_id', 'Sport', 'trim|required|xss_clean');
		$this->form_validation->set_rules('team_fee', 'Team Fee', 'trim|required|xss_clean|is_numeric');
		$this->form_validation->set_rules('team_fees_due', 'Team Fees Due', 'trim|required|xss_clean');

		if ($this->form_validation->run()) {								// validation ok
			
			// Format data
			$post['team_fees_due'] = datetime( strtotime($post['team_fees_due']) );
			$post['team_fee'] = preg_replace("/[^0-9\.]/","", $post['team_fee']); 
			$post['team_fee'] = number_format( $post['team_fee'], 2 );
		
			$team_id = $this->teampay_model->create_team( $post, $data['user_id'] );
			
			redirect('/my_teams/team/'.$team_id);
			
		} else {
			$data['navon'] = 'my_teams';
			$data['page_title'] = 'New Team Error';
			$data['icon_title'] = 'fa-plus-circle';
			$data['message'] = array('Oops, something went wrong with your new team. You probably didn\'t fill out a required field. Click the back button and give it another shot.');
			$this->load->view('_header.php', $data);
			$this->load->view('auth/general_message', $data);
			$this->load->view('_footer.php', $data);
		}

	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */