function present($player) { $message = ''; if (count($this->errors) > 0) { foreach ($this->errors as $booboo) { $message .= $booboo . BR; } } $this->data['message'] = $message; if ($player->id != null) { $this->data['pid'] = makeTextField('hidden', '', 'id', $player->id, "", 10, 10, false); } else { $this->data['pid'] = makeTextField('hidden', '', 'id', $player->id, "", 10, 10, true); } $this->data['pFirstName'] = makeTextField('text', 'First Name', 'playerFirstName', $player->playerFirstName); $this->data['pLastName'] = makeTextField('text', 'Last Name', 'playerLastName', $player->playerLastName); $this->data['pNumber'] = makeTextField('text', 'Jersey Number', 'playerNumber', $player->playerNumber); $this->data['pPosition'] = makeTextField('text', 'Position', 'playerPosition', $player->playerPosition); //$this->data['pPhoto'] = makeTextField('text', 'Player Mugshot File Name','playerPhoto', $player->playerPhoto); $this->data['pagebody'] = 'Roster/player_edit'; if ($player->id != null) { $this->data['psubmit'] = makeSubmitButton('Save', "Click here to edit player.", 'submitButton', 'editAdd', 'btn-success', '_fields/submit'); $this->data['pdelete'] = makeSubmitButton('Delete Player', "Click here to delete player.", 'submitButton', 'delete', 'btn-success', '_fields/submit'); $this->data['pcancel'] = makeSubmitButton('Cancel', "Click here to cancel.", 'submitButton', 'cancel', 'btn-success', '_fields/submit'); } else { $this->data['psubmit'] = makeSubmitButton('Add Player', "Click here to add player.", 'submitButton', 'editAdd', 'btn-success', '_fields/submit'); $this->data['pcancel'] = makeSubmitButton('Cancel', "Click here to cancel.", 'submitButton', 'cancel', 'btn-success', '_fields/submit'); $this->data['pdelete'] = makeSubmitButton('Delete Player', "Click here to delete player.", 'submitButton', 'delete', 'btn-success', '_fields/hiddenBtn'); } $this->render(); }
function present($player) { // format any errors $message = ''; if (count($this->errors) > 0) { foreach ($this->errors as $invalid) { $message .= $invalid . ' . . . '; } } $this->data['message'] = $message; $this->data['fplayerid'] = makeTextField('Player ID', 'playerid', $player->PLAYERID, '', 10, 10); $this->data['ffirstname'] = makeTextField('First Name', 'firstname', $player->FIRSTNAME); $this->data['flastname'] = makeTextField('Last Name', 'lastname', $player->LASTNAME); $this->data['fteamcode'] = makeTextField('Team Code', 'teamcode', $player->TEAMCODE); $this->data['fplayernum'] = makeTextField('Jersey Number', 'playernum', $player->PLAYERNUM); $this->data['fposition'] = makeTextField('Position', 'position', $player->POSITION); $this->data['fimage'] = makeTextField('Photo File Name', 'image', $player->IMAGE); $this->data['finfo'] = makeTextArea('Player History', 'info', $player->INFO); $this->data['fsubmit'] = makeSubmitButton('Save', "Click here to validate the player data", 'btn-success'); $this->data['fdelete'] = makeSubmitButton('Delete', "Click here to delete the player", 'btn-success'); $this->data['fcancel'] = makeSubmitButton('Cancel', "Click here to cancel the change", "submitbutton", "cancel", 'btn-success'); $this->data['pagebody'] = 'player_edit'; $this->data['title'] = 'Player Profile Maintenance'; $this->render(); }
function makeContentForm($handler, $titleVal = "", $contentVal = "", $classExtra = "", $contentLbl = "Content", $submitLbl = "Submit", $titleLbl = "Title", $explain = "") { $CI =& get_instance(); $CI->load->helper("formfields"); $array = array("handler" => $handler, "title" => makeTextField($titleLbl, 'title', $titleVal), "content" => makeTextArea($contentLbl, 'content', $contentVal, "", 1000, 25, 5, false), "fsubmit" => makeSubmitButton($submitLbl, $explain, $classExtra)); return $CI->parser->parse('_pogfield/_content_form', $array, true); }
function makeCommentBox($comments, $commentToEdit = null, $userid = null, $admin = false) { $CI =& get_instance(); if (!function_exists('makePHPButton')) { $CI->load->helper('button_helper.php'); } $commentBox = ''; foreach ($comments as $comment) { if (($userDat = $CI->users->get($comment->poster_id)) != null) { $comment->user = '******' . $userDat->username . '">' . $userDat->username . '</a>'; } else { $comment->user = "******"; } $comment->adminContent = ""; if ($admin) { if ($commentToEdit == null || $commentToEdit != $comment->comment_id) { $comment->adminContent .= makePHPButton("/Admin/editComment/" . $comment->post_id . '/' . $comment->comment_id, "Edit", "cId", $comment->comment_id, "button floatLeft"); } else { $comment->adminContent .= '<form action="/Admin/saveComment/' . $comment->post_id . '" method="post">'; $comment->adminContent .= makeTextField('Title', 'title', $comment->title); $comment->adminContent .= makeTextArea('Comment', 'content', $comment->content, "", 1000, 25, 5, false); $comment->adminContent .= makeSubmitButton("Save", "Save", "button"); $comment->adminContent .= '</form>'; $comment->title = ""; $comment->content = ""; } $comment->adminContent .= makePHPButton("/Admin/deleteComment/" . $comment->post_id . '/' . $comment->comment_id, "Delete", "cId", $comment->comment_id, "button floatLeft"); } $commentBox .= $CI->parser->parse('_j1_comment_box', $comment, true); } return $commentBox; }
public function index() { $this->data['pagebody'] = 'createteam'; $team = $this->teams->create(); $this->data['team_name'] = makeTextField('Team Name', 'team_name', $team->name); $this->data['max_team_count'] = makeTextField('Max Number of Members', 'max_team_count', $team->max_team_count); $this->data['fsubmit'] = makeSubmitButton('Create Team', "Click here to validate the post data", 'btn-success'); $this->render(); }
public function create_post() { if (!isset($_SESSION['user_id'])) { redirect('/SignIn'); } $this->data['pagebody'] = 'createpost'; $this->setup_post_input_fields(); $this->setup_post_error_message(); $this->setup_join_error_message(); $this->data['fsubmit'] = makeSubmitButton('Add Post', "Click here to validate the post data", 'button'); $this->render(); }
function present($quote) { $message = ''; if (count($this->errors) > 0) { foreach ($this->errors as $booboo) { $message .= $booboo . BR; } } $this->data['message'] = $message; $this->data['fid'] = makeTextField('ID#', 'id', $quote->id, "Unique quote identifier, system-assigned", 10, 10, true); $this->data['fwho'] = makeTextField('Author', 'who', $quote->who); $this->data['fmug'] = makeTextField('Picture', 'mug', $quote->mug); $this->data['fwhat'] = makeTextArea('The Quote', 'what', $quote->what); $this->data['pagebody'] = 'quote_edit'; $this->data['fsubmit'] = makeSubmitButton('Process Quote', "Click here to validate the quotation data", 'btn-success'); $this->render(); }
public function index() { $this->data['pagebody'] = 'signup'; if (isset($_SESSION['signup_error'])) { $this->data['message'] = $_SESSION['signup_error']; } else { $this->data['message'] = ''; } $user = $this->restore_signup_session(); $this->data['username'] = makeTextField('Username', 'username', $user->username); $this->data['password'] = makePasswordField('Password', 'password', ''); $this->data['password2'] = makePasswordField('Password', 'password2', ''); $this->data['email'] = makeTextField('Email', 'email', $user->email); $this->data['submit'] = makeSubmitButton('Sign Up', "Click here to validate the user data", 'btn-success'); //unset sign in error unset($_SESSION['login_error']); $this->render(); }
public function index() { $this->data['pagebody'] = 'signin'; $this->load->helper('ffields'); $user = $this->users->create(); $this->data['username'] = makeTextField('Username', 'username', $user->username); $this->data['password'] = makePasswordField('Password', 'password', $user->password); $this->data['submit'] = makeSubmitButton('Sign In', "Click here to validate the user data", 'button floatLeft'); $this->data['signup'] = makeButton("/SignUp", "Sign Up", "button floatLeft"); if (isset($_SESSION['login_error']) == 'wrongcredentials') { $this->data['message'] = 'Wrong Login Information'; } else { $this->data['message'] = ''; } //unset sign up error unset($_SESSION['signup_error']); $this->render(); }
function displayPlayer($ID = null, $invalidEntry = false) { $this->session->set_userdata('editPage', '/player/displayPlayer/' . $ID); // If null, we are creating a new player if ($ID === null) { $playerTemp = $this->createPlayer(); // If displayPlayer is being recalled from validation, it is therefore invalid. } else { if ($invalidEntry) { $playerTemp = $this->parsePlayerBuffer(); // Retrieve player from database with ID } else { $playerTemp = $this->loadPlayerFromDb($ID); } } // determine if we're in edit mode if (isset($_SESSION['editMode'])) { $editMode = $this->session->userdata('editMode'); } else { $editMode = FALSE; } $message = ''; if (count($this->errors) > 0) { foreach ($this->errors as $booboo) { $message .= $booboo . "<BR>"; } } $this->data['message'] = $message; // make text fields for each key value pair foreach ($playerTemp as $key => $val) { $this->data[$key] = makeTextField($key, $key, $val, "", 40, 15, !$editMode); } // override previous foreach loop: ID and Photo are not text fields $this->data['ID'] = $playerTemp->ID; $this->data['Photo'] = $playerTemp->Photo; // Get all Codes from standings table and populate dropdown list $this->db->select('Code'); $query = $this->db->get('standings'); foreach ($query->result() as $row) { $codes[] = $row->Code; } $this->session->set_userdata('codes', $codes); $this->data['Code'] = makeComboField('Code', "Code", 24, $codes, "", 40, 15, !$editMode); $this->data['Submit'] = ""; $this->data['Cancel'] = ""; $this->data['Delete'] = ""; // if editMode is set and we're in edit mode, display CRUD controls if (isset($_SESSION['editMode']) && $this->session->userdata('editMode')) { $this->data['Submit'] = makeSubmitButton('Save', "Save", 'btn-success'); $this->data['Cancel'] = makeCancelButton('Cancel', "Cancel", 'btn-primary'); $this->data['Delete'] = makeDeleteButton('Delete', "Delete", 'btn-danger', $ID); } $this->data['pagebody'] = 'player'; $this->render(); }
/** Editing your account details **/ public function edit() { //Security redirect if (!isset($_SESSION['edit_profile_username'])) { redirect('../'); } //Loading button helper $this->load->helper('button'); //Pagebody $this->data['pagebody'] = 'account_edit'; //Getting User's info from User table $query = $this->users->get_by_username($_SESSION['edit_profile_username']); //Setting data to empty strings $this->data['form_username'] = ''; $this->data['form_email'] = ''; $this->data['form_password'] = ''; $this->data['save'] = ''; $this->data['cancel'] = ''; $this->data['form_confirm_password'] = ''; //Set the username Textbox to edit //$this->data['form_username'] = makeTextField('User Name','username',$query->username ); //Set the password Textbox to edit $this->data['form_password'] = makePasswordField('New Password', 'password', '*****'); //Set the password confirmation Textbox to edit $this->data['form_confirm_password'] = makePasswordField('Confirm New Password', 'confirm_password', '*****'); //Making the submit button $this->data['save'] = makeSubmitButton('Save', 'save_button', 'button floatLeft'); //Making the cancel button $this->data['cancel'] = '<div class="button"> ' . '<a href="../profile/' . $_SESSION['edit_profile_username'] . '">Cancel</a></div>'; $this->render(); }
function present($player) { $message = ''; if (count($this->errors) > 0) { foreach ($this->errors as $booboo) { $message .= $booboo . '<br>'; } } $this->data['message'] = $message; //make ID read-only (auto-incremented in db) $this->data['fid'] = makeTextField('ID#', 'id', $player->id, "Unique, system-assigned", 10, 10, true); $this->data['ffirstname'] = makeTextField('First Name', 'firstname', $this->session->playerFname); $this->data['flastname'] = makeTextField('Last Name', 'lastname', $this->session->playerLname); $this->data['fnumber'] = makeTextField('Jersey Number', 'number', $this->session->playerNumber); $this->data['fposition'] = makeTextField('Player Position', 'position', $player->position); $this->data['emug'] = makeTextField('mug', 'mug', $this->session->playerMug); //submit button using formfields helper $this->data['fsubmit'] = makeSubmitButton('Process Player', 'success', 'btn-success'); $this->data['pagebody'] = 'addPlayerView'; $this->data['title'] = "Add New Player"; $this->render(); }
function present($edit = false) { $player = $this->session->userdata("currplayer"); $message = ''; if (count($this->errors) > 0) { foreach ($this->errors as $booboo) { $message .= $booboo . '<BR>'; } } if ($edit) { $this->data['fedit'] = '<input type="hidden" name="edit" value="' . $player->number . '">'; $this->data['fdelete'] = '<a class="btn btn-danger" href="/playercontrol/delete/' . $player->number . '">Delete</a>'; } else { $this->data['fedit'] = ''; $this->data['fdelete'] = ''; } $this->data['message'] = $message; $this->data['fnumber'] = makeTextField('Number#', 'number', $player->number); $this->data['fname'] = makeTextField('Name', 'name', $player->name); $this->data['fposition'] = makeTextField('Position', 'position', $player->position); $this->data['fheight'] = makeTextField('Height', 'height', $player->height); $this->data['fweight'] = makeTextField('Weight', 'weight', $player->weight); $this->data['fage'] = makeTextField('Age', 'age', $player->age); $this->data['fexp'] = makeTextField('Exp', 'exp', $player->exp); $this->data['fmug'] = '<label class="btn btn-primary" for="mug">Select Mugshot' . '<input type="file" id="mug" name="mug" size="20" style="display:none;" /></label><br><br>'; $this->data['pagebody'] = 'player_edit'; $this->data['fsave'] = makeSubmitButton('Save', "Click here to validate the player data", 'btn-success'); $this->data['fcancel'] = '<a class="btn btn-primary" href="/playerroster">Cancel</a>'; $this->render(); }