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 writeContent() { global $results; ?> <h2>User Management</h2> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <table class="grid"> <thead> <tr> <th></td> <th>Name</th> <th>Email</th> <th>Address</th> <th>Phone</th> <th>Admin</th> </tr> </thead> <tbody> <?php while ($rs = mysql_fetch_array($results, MYSQL_ASSOC)) { ?> <tr<?php echo !$rs['use_active'] ? ' class="inactive"' : ''; ?> > <td><?php echo makeCheckbox('', $rs['use_id']); ?> </td> <td><a href="user-edit.php?id=<?php echo $rs['use_id']; ?> " alt="<?php echo $rs['use_image_path']; ?> " rel="tooltip"><?php echo $rs['use_name']; ?> </a></td> <td><?php echo '<a href="mailto:' . $rs['use_email'] . '">' . $rs['use_email'] . '</a>'; ?> </td> <td><?php echo $rs['use_address'] . ' ' . $rs['use_address2'] . '<br />' . $rs['use_city'] . ' ' . $rs['use_state'] . ' ' . $rs['use_zip']; ?> </td> <td><?php echo formatPhone($rs['use_phone']); ?> </td> <td><?php echo $rs['use_admin'] ? 'Yes' : 'No'; ?> </td> </tr> <?php } ?> </tbody> </table> <?php echo makeButton('Add User', 'add') . ' ' . makeSubmit('Delete User(s)', 'delete') . ' ' . makeButton('Download Data', 'csv'); ?> </form> <?php }
<div class = "col-sm-8"> <h1><center>Spencer L. Gray</center></h1> </div> <div class = "col-sm-2" align="right"> 847-899-3118<br/>slg94@pitt.edu </div> </div> </div> <div align="center"> <?php //this section creates the buttons under the header container that was just created $linksToDisplays = array("Home" => "Home", "Education" => "Education", "Employment" => "Employment", "CommunityService" => "Community Service", "AwardsAndHonors" => "Awards & Honors", "Contact" => "Contact Me"); foreach ($linksToDisplays as $link => $displayName) { makeButton($link, $displayName); } //simple function to create a button given a link to the desired page and text to be displayed by the button function makeButton($link, $displayName) { echo "<a href=\"{$link}.php\"><button type=\"button\" class=\"btn btn-primary btn-head\">{$displayName}</button></a>\n"; } ?> </div> <!-- Closes the button container --> </div> <!--Closes the entire header container --> </html>
public function showPost($currPost) { //Set up the base pagebody $this->data['pagebody'] = 'show_post'; //Load helpers $this->load->helper('commentbox'); $this->load->helper('button'); $this->load->helper('ffields'); //initialize information of the current post $allComments = $this->comments->some('post_id', $currPost); $currPostInfo = $this->posts->get_full($currPost); $this->data['currPost'] = $currPost; //initialize information about logged in user $isAdmin = isset($_SESSION['admin']) ? $_SESSION['admin'] : false; $currUser = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null; $commentToEdit = isset($_SESSION['commentToEdit']) ? $_SESSION['commentToEdit'] : null; //TEAMLIST $curTeamID = $currPostInfo->team_id; //get tareget team_Id //get all team members from target team $team_members = $this->team_members->some('team_id', $curTeamID); //team members $teams_users_members = $this->team_members->get_team_member_details($curTeamID); /*foreach ($team_members as $team_member) { $userID = $team_member->user_id; $user = $this->users->get($userID); $userName = $user->username; array_push($usernames, $user); }*/ foreach ($teams_users_members as $team_member) { $team_member->post_id = $currPostInfo->post_id; } //team members $this->data['teamlistview'] = $teams_users_members; //Load the various view fragments if ($isAdmin || $currUser === $currPostInfo->poster_id) { $currPostInfo->title = $this->createEditField("/Admin/editPostTitle/" . $currPostInfo->post_id, "Title", "title", $currPostInfo->title, "makeTextField"); $currPostInfo->content = $this->createEditField("/Admin/editPostDesc/" . $currPostInfo->post_id, "Description", "content", $currPostInfo->content, "makeTextArea"); $currPostInfo->max_team_count = $this->createEditField("/Admin/editPostMembersNum/" . $currPostInfo->post_id, "Max Number of Team Members:", "mtc", $currPostInfo->max_team_count, "makeTextField"); //team members $this->data['teamlist'] = $this->parser->parse('_teamlistedit', $this->data, true); } else { //team members $this->data['teamlist'] = $this->parser->parse('_teamlist', $this->data, true); } // Check if join possible print_r($currPostInfo->team_count); print_r($currPostInfo->max_team_count); if ($currPostInfo->team_count >= $currPostInfo->max_team_count) { $currPostInfo->isFull = 'hidden'; } else { $currPostInfo->isFull = ''; } if (isset($_SESSION['user_id'])) { $record = $this->team_members->get_record('team_id', $currPostInfo->team_id); if ($record->user_id == $_SESSION['user_id']) { $currPostInfo->hasJoined = 'hidden'; } } //Fill the current post info $this->data['postInfo'] = $this->parser->parse('_justone', $currPostInfo, true); //Fill the form data for the comment box $this->data['newCommentForm'] = $currUser != null ? makeContentForm("/Post/postComment/" . $currPostInfo->post_id, "", "", "button", "Comment", "Add Comment") : makeButton("/SignIn", "Sign In", "button center"); //Fill up the comments in the current post $this->data['commentsBox'] = makeCommentBox($allComments, $commentToEdit, $currUser, $isAdmin); $this->render(); }
//$szErrorNotice .=$_SERVER['HTTP_HOST'] } } } /* ============================================================================ * Determine the output filename to display * ========================================================================= */ if (isset($_FORM["txtDLFilename"]) && strlen(trim($_FORM["txtDLFilename"])) > 0) { $szDLFilename = $_FORM["txtDLFilename"]; } else { $szDLFilename = "Dibujos_usuario"; } /* ============================================================================ * Make close button * ========================================================================= */ $szCloseButton = makeButton('CloseWindow', '', 'ExtractROIData', "icons/icon_cancel.png", $oMLT->get('common', 'Cancel', 'Cancel'), "Cierra el Diálogo", array('width' => 75)); function tar($aszSource, $szDestination) { // include file include COMMON . "/tar/tar.php"; // specify filename for output file $tar = new Archive_Tar($szDestination); // build archive if (!$tar->create($aszSource)) { return false; } else { return true; } } function gZip($szSource, $szDestination) {
makeButton('action', 'Update', 'submit', $form); //DELETE makeButton('action', 'Delete', 'submit', $form); } else { //blank form //ADD makeButton('action', 'Add', 'submit', $form); } } } else { //we have taken no action yet, so either we are EDITing or ADDing // !isset($_POST['action'] return; ////show form before submiting, awaiting ACTION if (isset($_POST['rdn'])) { //editing, rdn would specify the ID of the record //UPDATE makeButton('action', 'Update', 'submit', $form); //DELETE makeButton('action', 'Delete', 'submit', $form); } else { //blank form //ADD makeButton('action', 'Add', 'submit', $form); } } //return the form echo $form->returnHtml(); ?> </body> </html>
function writeContent() { global $results; ?> <h2>Visitor Submissions</h2> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <table class="grid"> <thead> <tr> <th title="Check All Messages"><?php echo makeCheckbox('', 'all'); ?> </td> <th>Name</th> <th>Email</th> <th>Address</th> <th>Phone</th> <th>Comments</th> <th>Date</th> </tr> </thead> <tbody> <?php while ($rs = mysql_fetch_array($results, MYSQL_ASSOC)) { ?> <tr> <td><?php echo makeCheckbox('', $rs['con_id']); ?> </td> <td><?php echo $rs['con_firstname'] . ' ' . $rs['con_lastname']; ?> </td> <td><?php echo '<a href="mailto:' . $rs['con_email'] . '">' . $rs['con_email'] . '</a>'; ?> </td> <td><?php echo $rs['con_address'] . ' ' . $rs['con_address2'] . '<br />' . $rs['con_city'] . ' ' . $rs['con_state'] . ' ' . $rs['con_zip']; ?> </td> <td><?php echo formatPhone($rs['con_phone']); ?> </td> <td><?php echo $rs['con_comments']; ?> </td> <td><?php echo formatDate($rs['con_date'], false); ?> </td> </tr> <?php } ?> </tbody> </table> <?php echo makeSubmit('Delete Message(s)', 'delete'); echo makeButton('Download Data', 'csv'); ?> </form> <?php }