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 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 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 setup_post_input_fields() { /* Restore previous session */ $post = $this->restore_post_session($this->posts->create()); $team = $this->restore_team_session($this->teams->create()); $this->data['title'] = makeTextField('Title *', 'title', $post->title); $this->data['content'] = $this->data['content'] = makeTextArea('Content*', 'content', $post->content, "", 1000, 25, 5, false); $this->data['team_name'] = makeTextField('Team Name *', 'team_name', $team->team_name); $this->data['max_team_count'] = makeTextField('Max Team Members *', 'max_team_count', $team->max_team_count); }
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(); }
function writeContent() { global $aStates, $isPost, $sFirstName, $sLastName, $sEmail, $nPhone, $sAddress, $sAddress2, $sCity, $sState, $nZip, $sComments, $bSent; if ($bSent) { echo '<p>Thank you for contacting us.</p>'; } else { addField(makeInput('First Name', 'con_firstname', $sFirstName), true); addField(makeInput('Last Name', 'con_lastname', $sLastName), true); addField(makeEmail('Email Address', 'con_email', $sEmail), true); addField(makeInput('Telephone', 'con_phone', $nPhone, 'size="13"')); addField(makeInput('Address', 'con_address', $sAddress, 'size="30"')); addField(makeInput('Address 2', 'con_address2', $sAddress2, 'size="30"')); addField(makeInput('City', 'con_city', $sCity)); addField(makeSelect('State', 'con_state', $aStates, $sState)); addField(makeInput('Zip', 'con_zip', $nZip, 'size="10" maxlength="5"')); addField(makeTextArea('Message', 'con_comments', $sComments, 'rows="5" cols="60"')); addField(makeSubmit('Send', 'send') . ' ' . makeCancel('Cancel', 'cancel')); writeDataForm('/contact.php', 'contact'); } }
<? $sensors = $driver->listSensors(); $counter = 0; $colNames = array('SerialNumber', 'name','description','color','Range Alarm','Min','Max','Max Change Alarm','Max Change Amount','Max Change Inteval (seconds)','Delete Metadata'); echo makeTableHeader($colNames); while(list($sensor, $data) = each($sensors)) { //echo "$sensor"; echo "<TR>"; echo "<TD bgcolor='#EEEEEE'>$sensor</TD>"; echo makeHiddenField("SerialNumber$counter", $sensor); echo '<TD>'.makeInputField("name$counter", $data['name']).'</TD>'; //echo '<TD>'.makeInputField("description$counter", $data['description'], 40).'</TD>'; echo '<TD>'.makeTextArea("description$counter", $data['description']).'</TD>'; echo '<TD bgcolor='.$data['color'].'>*'.makeInputField("color$counter", $data['color']).'</TD>'; echo '<TD>'.makeCheckBox("alarm$counter", $data['alarm']).'</TD>'; echo '<TD>'.makeInputField("min$counter", $data['min'],5).'</TD>'; echo '<TD>'.makeInputField("max$counter", $data['max'],5).'</TD>'; echo '<TD>'.makeCheckBox("maxchange_alarm$counter", $data['maxchange_alarm']).'</TD>'; echo '<TD>'.makeInputField("maxchange$counter", $data['maxchange'], 5).'</TD>'; echo '<TD>'.makeInputField("maxchange_interval$counter", $data['maxchange_interval'], 6).'</TD>'; echo '<TD>'.makeDelete($sensor).'</TD>'; echo '</TR>'; $counter++; } ?> </TABLE>