<     >
Bruce Gust - Web Development Professional!

Please accept this letter as professional reference and recommendation for Bruce Gust. I am currently the IT leader for a large global corporation that serves the power industry. It is with great pride that I offer this letter for your consideration. ... I give Bruce the highest marks in professionalism, leadership and integrity. Knowing his breadth of abilities, his dedication, and his proven success, I would hire him for nearly any position in my organization knowing he'll find a way to win regardless of the obstacles. ...click here to read the letter in full. Ray Dunaway, PMP, CWI Corporate Vice President, Operations & Technology Babcock Power - Louisville, KY
Greetings! Below you'll find my "story" as far as the code that I've written, some of the projects I've completed and the technology that I've used in various professional scenarios. I'm a nine year veteran of the USMC and an honor graduate of NCO Academy as well as a graduate of Instructional Trainers School. I've been doing PHP since 2008. I started with Procedural Programming and made my way through Object Oriented Programming and most recently into the MVC architecture in the context of frameworks such as Laravel and Symfony. JavaScript, JQuery and, most recently, Nodejs are also a part of my techical vocabulary and with those langauges also comes an ability to retrieve data using RESTful APIs and the expertise required to make those applications aesthetically engaging using Bootstrap and Photoshop. As emerging technologies have come to the surface such as Docker, OAuth and OpenAPI, I've become familiar with those as you'll see in the "timeline" below. I maintain a WordPress site and have built online shopping carts both from scratch and using frameworks such as ZenCart. The graphics that you see on the left and right represent the way in which I document my work in the way I learn different coding languages as well as the way I approach software that needs to be repaired. You'll also see sample of sites I've built and the improvements I was able to make in existing applications. By clicking on these images you'll see a depth and a quality that represents healthy apps, strong technical knowledge and a never ending pursuit of professional development. If you have any questions, you can reach me at 615.618.2059 or emailing me at bruce@brucegust.com. Thanks! Bruce Gust
Table of Contents 1998-2004 -> LifeWay Christian Resources | Corporate Trainer - Classic ASP | Flash / ActionScript 2004 - 2006 - > Independent Consultant - Classic ASP | Flash / ActionScript 2006 -2008 -> Big Shiny Planet | Creative Director - Classic ASP | Flash / ActionScript 2008 - 2017 -> Contract Developer - Procedural PHP | MSSQL | JavaScript | XCode Colgate Country Showdown - Procedural PHP | Flash / ActionScript | JavaScript | XCode Symbion Health Care | Procedural PHP | JavaScript | MSSQL Stored Procedures Verizon | PHP (Object Oriented Programming) | JavaScript | Bootstrap 200,000,000 Rows... GANT Calendar Verizon Calendar Bootstrap 2017 -> Applied Health Analytics | Software Developer - PHP (MVC Architectures), JQuery, Node, Laravel Landing Pages (JQuery API | Bootstrap) Node.js / Oauth Authentication / JWT / Fitbit Docker React Native / Angular.js Symfony / Laravel / Vue.js
1998-2004 - LifeWay Christian Resources - Classic ASP | Flash / ActionScript After having served in the USMC for nine years and then making my living as national recording artist, I came off the road and began what would be a seven year stint at LifeWay Christian Resources. It was there in the context of a my role as a Corporate Trainer, I became fascinated with the idea of building an online campus.
Using an Access database, Windows IIS, a book on Classic ASP and Flash / ActionScript, I built a framework that proved to be extremely successful in the way it both published content as well as measured engagement / retention.
2004 - 2006 - Independent Consultant - Classic ASP | Flash / ActionScript After leaving LifeWay, I owned and operated my own development shop for a while. brucegust.com specialized in small businesses and getting them up to speed with a strategic, digital presence. Initially, my services were based on a purely Classic ASP dynamic. Rather than building campuses, I was now building Shopping Carts and whatever else the client needed in order to enhance their viability and profitablity in the marketplace. One such vendor was a local trophy shop. Below is an example of a simple update script that allowed the client to edit the way in which their products were described in their online store. Classic ASP
<%@ Language=VBScript %> <% set conn = server.createobject ("adodb.connection") conn.open "brucegust" conn.execute "update bruce set Resource = '" & Replace(Request.Form("Resource"),"'","''") & "', " _ & "Link = '" & Request.Form("Link") & "', " _ & "Keywords = '" & Replace(Request.Form("Keywords"),"'","''") & "', " _ & "Comment = '" & Replace(Request.Form("Comment"),"'","''") & "' " _ & "where ID = " & Request.Form("ID") & "" set conn = nothing %> <html> <head> <title>brucegust.com DisplayPage</title> <Style type="text/css"> body {font-family:arial narrow; size: 14pt; color: white} A:link { color:#FFFF00 } A:visited { color:#FFFFFF} a:hover {color: #FFFFFF } </style> </head> <BODY BGCOLOR=#003366 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 RIGHTMARGIN=0> <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" border="0"> <tr> <td height="180" valign="top"> <table width="100%" height="180" border="0" cellpadding="0" cellspacing="0"> <tr> <td background="../Images/LinkLeft.jpg" bgcolor="#003366">   </td> </tr> </table> </td> <td valign="top" align="center" width=700> <object classid= "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" ID=roppage width=700 height=180> <embed src="Admin.swf" width=700 height=180 Loop=false Quality=high bgcolor="003366" type="application/x-shockwave-flash"> </embed> </object> </td> <td height="180" valign="top"> <table width="100%" height="180" border="0" cellpadding="0" cellspacing="0"> <tr> <td background="../Images/LinkLeft.jpg" bgcolor="#003366">   </td> </tr> </table> </td> <td>   </td> <td width=700> <table border="0" align="center"> <tr> <td> Below you'll see the entry you just edited. Confirm your changes and if everything looks good, click <A HREF="Master.asp">here</a> to return to the Main Page. <P> Thanks!</font> </td> </tr> <tr> <td>  <BR> </td> </tr> <tr> <td align="center"> <form action="Edit.asp" method="Post"> <table border="1"> <tr> <td> <b>Resource</b> </td> <td> <input type="text" size="70" value="<% response.write Request.Form("Resource") %>" name=" Resource"> </td> </tr> <tr> <td> <b>Link</b> </td> <td> <input type="text" size="70" value="<% response.write Request.Form("Link") %>" name="Link"> </td> </tr> <tr> <td> <b>Keywords</b> </td> <td> <input type="text" size="70" name="Keywords" value="<% response.write Request.Form("Keywords") %>"> </td> </tr> <tr> <td colspan="2"> <textarea name="Comments" rows=9 cols=61> <% response.write Request.Form("Comment") %></textarea> </td> </tr> <input type="hidden" value="<% response.write Request.Form("ID") %>" name="ID"> <tr> <td colspan="2" align="center"> <input type="Submit" value="Submit"> </td> </tr> </table> </td> </tr> </table> </td> <td>   </td> </tr> </table>
It's one thing to maintain a website and quite another to create it, design it and drive viewer traffic. Bruce Gust has been the creative and marketing force behind texacocountryshowdown.com. He has been employed by my company for years and I highly recommend him. Dean Unkefer - President Texaco Country Showdown Nashville, TN
2006 -2008 - Big Shiny Planet | Creative Director - Classic ASP In 2006, I teamed up with a former co-worker at LifeWay and together we put the company, "Big Shiny Planet" on the map. It was a series of studies based on the lyrics of Contemporary Christian Music artists. My official title was "Creative Director" in that I helped sell, write and market the resource. But I was also in charge of the web community which featured an online store as well as a verbose site that described each study, resource and artist. At this point, Flash was still a popular resource and I made use of many of the animated dynamics that resulted in a fun, eye catching web presence. Although the company has since been sold and the site is no longer accessible, you can click here to see a site that I developed for a firm BSP collaborated with at one point that features some of the same kind of animations that I utilized for bigshinyplanet.com. The need to move towards a different programming paradigm was becoming more and more obvious, however. Through my contacts at Big Shiny Planet, I would meet the President of Special Promotions - a company that worked in conjuction with Colgate to facilitate a national Country Music talent competition. It's at this point, I would move towards the LAMP stack and an open source dynamic. 2008 - 2014 -> Contract Developer - Procedural PHP | MSSQL | JavaScript | XCode Colgate Country Showdown - Procedural PHP | Flash / ActionScript | JavaScript | XCode I became Special Promotions, Inc Web Developer after BSP was sold. The site I inherited needed to be updated and transformed into something that better served the business strategy of "The Country Showdown." This was the primary event that SPI administered with Colgate and later Texaco as the funding behind the event. The world had yet to go mobile at this point so Flash was still a viable option. But I chose to reinvent myself as a PHP developer given the way Open Source programming was more accessible to the small business entity - specifically in the context of MySQL database as opposed to a SQL Server. Click on the screenshot to the right to see the sites I built for SPI during their tenure with Colgate. Click here to see that site that was developed for Texaco.
The code sample you see below is a an example of the Procedural approach that was common at that point. This code fed the "Contestant's Profile Page." Because it was engaged by every contestant nationwide, it bolstered the visiblity of countryshowdown.com in the context of SEO to the point where it out performed some of Colgate's own online coupons!
<?php session_start(); if (!isset ($_SESSION['sv_email'])) { header("Location:contestants_login.php");exit(); } $sv_email=$_SESSION['sv_email']; include("carter.inc"); $cxn = mysqli_connect($host,$user,$password,$database)or die ("couldn't connect to server"); $query = "select * from registration where email = '$sv_email'"; $result = mysqli_query($cxn, $query); if(!$result) {$error = mysqli_errno($cxn).': '.mysqli_error($cxn); die($error); } $row = mysqli_fetch_assoc($result);extract($row); $contestant_id = $id; $contestant_radio_id = $radio_id; $contestant_bio = $bio; $contestant_first_name = $first_name; $contestant_last_name = $last_name; $contestant_primary = $primary_instrument; $contestant_secondary = $secondary_instrument; if($primary_instrument=="Singer"){ $icon_path = "icon_singer.jpg"; } if($primary_instrument=="Guitar"){ $icon_path = "icon_aguitar.jpg"; } if($primary_instrument=="Banjo"){ $icon_path = "icon_banjo.jpg"; } if($primary_instrument=="Mandolin"){ $icon_path = "icon_mandolin.jpg"; } if($primary_instrument=="Steel Guitar"){ $icon_path = "icon_fan.jpg"; } if($primary_instrument=="Bass"){ $icon_path = "icon_eguitar.jpg"; } if($primary_instrument=="Fiddle"){ $icon_path = "icon_fiddle.jpg"; } if($primary_instrument=="Keys"){ $icon_path = "icon_keys.jpg"; } if($primary_instrument=="Harp"){ $icon_path = "icon_harp.jpg"; } if($primary_instrument=="Drums"){ $icon_path = "icon_drums.jpg"; } if($secondary_instrument==""){ $snd_icon_path = "icon_fan.jpg"; } if($secondary_instrument=="Singer"){ $snd_icon_path = "icon_singer.jpg"; } if($secondary_instrument=="Guitar"){ $snd_icon_path = "icon_aguitar.jpg"; } if($secondary_instrument=="Banjo"){ $snd_icon_path = "icon_banjo.jpg"; } if($secondary_instrument=="Mandolin"){ $snd_icon_path = "icon_mandolin.jpg"; } if($secondary_instrument=="Steel Guitar"){ $snd_icon_path = "icon_fan.jpg"; } if($secondary_instrument=="Bass"){ $snd_icon_path = "icon_eguitar.jpg"; } if($secondary_instrument=="Fiddle"){ $snd_icon_path = "icon_fiddle.jpg"; } if($secondary_instrument=="Keys"){ $snd_icon_path = "icon_keys.jpg"; } if($secondary_instrument=="Harp"){ $snd_icon_path = "icon_harp.jpg"; } if($secondary_instrument=="Drums"){ $snd_icon_path = "icon_drums.jpg"; } $views = "select * from featured where contestant_id = '$contestant_id'"; $views_query = mysqli_query($cxn, $views) or die ("Couldn't execute query."); $views_row_count = mysqli_num_rows($views_query); if($views_row_count > 0){ $views_rows = mysqli_fetch_assoc($views_query); extract($views_rows); $featured_hits = $hits; } else { $featured_hits="0"; } $queryradio = "select * from dbo_radio_stations where station_id = '$contestant_radio_id'"; $resultradio = mysqli_query($cxn, $queryradio); if(!$resultradio) { $errorradio = mysqli_errno($cxn).':'.mysqli_error($cxn); die($errorradio); } $rowradio = mysqli_fetch_assoc($resultradio); extract($rowradio); $state=$state_id; $radio_url = $url; $contact = $contact; $contact_email = $email; $contest_date = date("m/d/y", strtotime($contestdate)); $radio_phone = $phone; //I'm using this query to get my state graphic regardless if the state final and regional final have been determined yet $statequery = "select * from dbo_states where id='$state'"; $stateresult = mysqli_query($cxn, $statequery) or die ("Couldn't execute query."); $row_state_count=mysqli_num_rows($stateresult); if($row_state_count>0){ $rowstate = mysqli_fetch_assoc($stateresult); extract($rowstate); $state_abbr = $StateAbbr; $state_name = $State; $state_id = $id; } $querystate = "select * from dbo_state_contests where state_id='$state_id'"; $resultstate = mysqli_query($cxn, $querystate) or die ("Couldn't execute query."); $count_state_rows=mysqli_num_rows($resultstate); if($count_state_rows>0){ $staterow = mysqli_fetch_assoc($resultstate); extract($staterow); $state_date = date("m/d/y", strtotime($show_date)); $state_url = $url; $state=$state_id; $verbiage = "State Final will be held at $venue on $state_date. Click on the state for more information."; } else { $verbiage = "The location and date for the $state_name state final has yet to be determined. Keep checking back for updates!"; } $regionalquery = "select * from dbo_regional_contests where state='$State'"; $regionalresult = mysqli_query($cxn, $regionalquery) or die ("Couldn't execute query."); $regionalresult_count = mysqli_num_rows($regionalresult); if($regionalresult_count>0){ $regionalrow = mysqli_fetch_assoc($regionalresult); extract($regionalrow); $venuequery = "select * from dbo_regional_venues where venue_region = '$region_name'"; $venueresult = mysqli_query($cxn, $venuequery); if(!venueresult) {$error = mysqli_erno($cxn).':'. mysqli_erro($csn); die($error); } $rowCount = mysqli_num_rows($venueresult); if($rowCount > 0) { $venuerow = mysqli_fetch_assoc($venueresult); extract($venuerow); $venue_display_date = date("m/d/y", strtotime($venue_date)); $regional_message = "Your Regional Final will be held on $venue_display_date at the $venue_name. For more information, click <A HREF=\"$venue_url\" target=\"_blank\">here</a>"; } else { $regional_message = "The venue for this region has yet to be determined. Keep checking back!"; } } else { $regional_message = "The venue for this region has yet to be determined. Keep checking back!"; } ?>
ActionScript The site that I built for Colgate was a lot of fun. Flash gives you some aesthetic options that are both eye catching and dynamic. While this particular example of ActionScript isn't as involved as what was necessary for the digital quizzes that I built for the LifeWay Online Campus, it's still a good illustration of the basics:
onClipEvent(load){ //is the cursor over the movie clip previouslyOver=false; } onClipEvent(enterFrame){ currentlyOver=this.hitTest(_root._xmouse,_root._ymouse,true); //if there is a change, go to another frame if(!previouslyOver and currentlyOver){ previouslyOver=true; this.gotoAndPlay("on"); } else if (previouslyOver and !currentlyOver){ previouslyOver=false; this.gotoAndPlay("off"); } } on (release) { getURL("Search.php"); }
SPI switched sponsors and was picked up by Texaco. By now, apps were becoming popular and in an effort to stay current with the technological options that were being made available, I became familiar enough with Apple's XCode to build an app that wasn't much more than a copy of the web community as it existed, but was nonetheless another digital offering that kept both fans and contestants engaged and informed. Here's a sample of some of that code:
// // showdown_plus.m // Intro // // Created by Bruce Gust on 1/1/13. // Copyright (c) 2013 Bruce Gust. All rights reserved. // #import "showdown_plus.h" @interface showdown_plus () @end @implementation showdown_plus - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (IBAction)home_plus_button:(id)sender { [self dismissViewControllerAnimated:YES completion:nil]; } - (IBAction)plus_forward_button:(id)sender { [_showdown_plus_webview goForward]; } - (IBAction)showdown_plus_button:(id)sender { NSString *fullURL = @"http://www.countryshowdown.com/mobile/showdown_plus.php?paid=1"; NSURL *url = [NSURL URLWithString:fullURL]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [_showdown_plus_webview loadRequest:requestObj]; } - (void)viewDidLoad { [self showdown_plus_button :self]; [super viewDidLoad]; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)showdown_plus_back_button:(id)sender { [_showdown_plus_webview goBack]; } @end
Symbion Health Care | Procedural PHP | JavaScript | MSSQL Stored Procedures I left Special Promotions Inc and returned to Consulting which lead to applying for enterprise level opportunities, the first of which was Symbion Health Care. What made this opportunity distinctive was the fact that it utilized a platform that was a hybrid of PHP, T-SQL and JavaScript. It would be here that I got my first taste of writing Stored Procedures in MSSQL Studio. Here's an example: Stored Procedures
USE [BIProd] GO /****** Object: StoredProcedure [dbo].[cer_CapXTempSave] Script Date: 5/29/2014 3:26:06 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[cer_CapXTempSave] --Parms for stored procedure @capxtempid as int, @cermodelid as int, @capxid as int, @spmodelid as int, @assettypeid as int, @totalcost as int , @description as varchar(150), @shortname as varchar(150), @allocatedamount as int, @userid as int AS BEGIN declare @key as int declare @ErrorMessage as varchar(300) declare @ErrorNo as int set @ErrorMessage = '' set @ErrorNo = 0 declare @cer_itemcost int select @cer_itemcost = ISNULL(itemcost,0) from cer_Detail where cermodelid= @cermodelid declare @cer_itemshipping int select @cer_itemshipping = ISNULL(shipping,0) from cer_Detail where cermodelid= @cermodelid declare @cer_iteminstallation int select @cer_iteminstallation = ISNULL(installation,0) from cer_Detail where cermodelid = @cermodelid declare @cer_totalcost int select @cer_totalcost = @cer_itemcost + @cer_itemshipping + @cer_iteminstallation declare @capx_allocatedamount int if @allocatedamount >@cer_totalcost BEGIN select @capx_allocatedamount= @cer_totalcost END ELSE BEGIN select @capx_allocatedamount = @allocatedamount END insert into cer_CapX(cermodelid, capxid, spmodelid, assettypeid, totalcost, description, shortname,allocatedamount,updateuserid, updatedate ) values(@cermodelid, @capxid, @spmodelid, @assettypeid, @totalcost, @description, @shortname,@capx_allocatedamount, @userid, getdate ()) set @ErrorNo = @@Error if @ErrorNo <> 0 BEGIN set @key = 0 set @ErrorMessage = 'Failed to insert the record (' + cast(@ErrorNo as varchar) + '}' END select @key as ID, @ErrorMessage as ErrorMessage END
Verizon | PHP (Object Oriented Programming) | PDO | MSSQL Stored Procedures | JavaScript | Bootstrap
To Whom It May Concern: Bruce Gust has worked under my employ for over a year in the position of software development contractor. In that time, he has proven himself to be a valuable resource to the team. During his assignment he was responsible for building various web based tools and web pages with the stated purpose of increasing time efficiency for our customers. Bruce is a pleasure to work with due to his personality and general all around positive attitude. He interacted directly with internal customers and they were always pleased with the results. Bruce was a remote employee and was always easy to manage. He was responsive to emails and phone calls and I was never concerned about his output, even though we were at separate locations. He showed a willingness to learn new technologies and took coaching well. I would not hesitate to work with him again. Donald Meador Verizon Wireless 1 Allied Drive Little Rock, AR 72022
Verizon was originally a 6 month contract that turned into 18 months. It was a fully remote position and I was reponsible for building and maintaining database driven tools that used to monitor and measure efficiency of Verizon voice and data technologies. 200,000,000 Rows... One of my first tasks was to construct an online tour that queried some recently acquired Twitter data based on geographical coordinates and a range of dates. Because the database consisted of over 200,000,000 rows, some creativity had to be deployed in order to retrieve the number of rows the user was needing in response to the criteria they had submitted. The solution I came up with began by dividing the database into 365 individual tables - one table for each day of the year. The query that was triggered by the user's parameters began by identifying which tables would be needed and that would constituted the number of "laps" that would have to be completed in order for the operation to complete. You can read more about this solution which I have since used at Applied Health Analytics to solve a similar dilemma. Click here to see a mock up of the solution and feel free to peruse a portion of the code below.
//here's the button... You would also normally do a calculation here to see how many rows you've got and divide that by 10 to see how many "laps" you're going to require Click <a id="boom" data-laps="3" href="#">here</a> //here's the code that gets things moving.. $('#boom').click(function() { var laps=$(this).data('laps'); $.get("api.php?id=1&laps="+laps, function(data) { $('.centered').show(); $('#gear_text').html(data); }); //here/s the api.php page... function add($id) { //it's here where you normally have your SELECT and be limiting the number of rows you're retrieving to 10 or so $new_id=$id+1; return $new_id; } $the_id=$_GET['id']; $laps=$_GET['laps']-1; $activate=add($the_id); //add "1" to the existing id if($laps>0) { echo "<script> $(document).ready(function() { $.get('api_wait.php?new_id=$activate&laps=$laps', function(data) { //route the process to the "api_wait.php" page where the new id and the number of "laps" is embedded in the URL $('.centered').show(); $('#gear_text').html(data); }); }); </script>"; } else { echo "<script> $('.centered').show(); $('#gear_text').html('You are all set! Click <a id=\"close_print_window\" href=\"#\" style=\"font-size:9pt;\">here</a> to close this window!'); $('#close_print_window').click(function() { $('.centered').hide(); }); </script>"; } //...and here's the "api_wait.php" page. $the_id=$_GET['new_id']; $laps=$_GET['laps']; if($laps>1) { echo "Stand by! You've only got $laps more laps to go!"; } else { echo "Stand by! You've only got $laps more lap to go!"; } echo "<script> $(document).ready(function() { setTimeout(function() { $.get('api.php?id=$the_id&laps=$laps', function(data, status) { //send things back to the original api.php page and begin the process all over again $('#gear_text').html(data); }); }, 3000); }); </script>";
Up until this point, JavaScript was a coding language that I engaged only in the context of copying and pasting. With Verizon, I began using JQuery in a number of ways that went beyond pre-manufactured pieces of code. Now, I was creating my own configurations. Here's an example of the code that I used for the navbar on the South Area Portal.
<script> $(document).ready(function(){ //this is your starting point where all your slidingNavTerms are hidden and your display_hide links are displayed $(".slidingNavTerms").hide(); $(".display_hide").show(); //here's your actual function, as far as a user clicking on a link in order to see the "hidden" link beneath it $('.display_hide').click(function(){ $(this).next().slideToggle(); //$(this).html("System Performance ▲"); }); //this is the command that corresponds to all of the links on your main nav bar in that anytime the user hovers over a "primary" link, it sets all of the previously exposed links to "hidden." This way //any expanded menus don't linger. Since I've got graphic to correspond with every link, I gave each link a function. It may not be the most elegant approach, but it got the job done. $('.planning').hover(function(){ $(".slidingNavTerms").hide(); $(".display_hide").show(); }); $('.budget').hover(function(){ $(".slidingNavTerms").hide(); $(".display_hide").show(); }); $('.system_perf').hover(function(){ $(".slidingNavTerms").hide(); $(".display_hide").show(); }); $('.network_ops').hover(function(){ $(".slidingNavTerms").hide(); $(".display_hide").show(); }); $('.reference').hover(function(){ $(".slidingNavTerms").hide(); $(".display_hide").show(); }); $('.exec_reports').hover(function(){ $(".slidingNavTerms").hide(); $(".display_hide").show(); }); }); </script>
GANT Calendar Using PDO to interact with T-SQL and Stored Procedures was a needed collection of technologies in order to create a custom GANT Calendar...
It came out really well and you can read more detail about the project and the code that was used by clicking here. Below is a portion of the code that was used that shows the T-SQL in context with the PDO driver that was used to connect to the SQL Server...
//Here's a portion of the code that was used as part of the GANT Calendar project... <?php //ERROR REPORTING ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL); require_once('projectpageclass.php'); require_once('model_class.php'); $new_page= new ProjectPage; $page_title="South Area Network Development Project List"; $new_date=new DateCalc; $current_row=""; if(!isset($_GET['year'])) { $this_year=date("Y"); } else { $this_year=$_GET['year']; } $the_date=$this_year; $the_date.="-01-01"; $year_one_calc = date('c', strtotime("$the_date - 1 year")); $year_one=date("Y", strtotime($year_one_calc)); $year_two=$this_year; $year_three_calc = date('c', strtotime("$the_date + 1 year")); $year_three=date("Y", strtotime($year_three_calc)); $dayNumber = date("z") + 1; include('mssql_db_cred.php'); $mssql_pdo = new PDO("dblib:host=".$mssql_cred_data['server'].";dbname=".$mssql_cred_data['dbname'],$mssql_cred_data['user'],$mssql_cred_data['pw']); $mssql_pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); if(!$mssql_pdo) { echo "no connection"; } include("gant_header.php"); //here's the sql that gives you all of your content //this is putting the dates that are being displayed on the calendar into a code friendly format //week one is calculated based on whether or not there's a $_GET['week'] value in the URL. That's accomplished on line 89-105 on the gant_header.php $week_one_data = date('c', strtotime("$this_week - 6 weeks")); $week_one=date("m/d/Y", strtotime($week_one_data)); //echo $week_one; //week twelve comes from line 134 of the gant_header.php page $week_twelve_code_obj = date('c', strtotime("$week_twelve + 5 days")); $week_twelve_code_display_obj = date('c', strtotime("$week_twelve + 6 days")); $week_twelve=date("m/d/Y", strtotime($week_twelve_code_obj)); $query = "EXECUTE stp_Select_REPORT_DevelopeProjects_Gantt :DataDisplay_Start, :DataDisplay_End"; $stpro = $mssql_pdo->prepare($query); $stpro->bindParam(':DataDisplay_Start', $week_one, PDO::PARAM_STR); $stpro->bindParam(':DataDisplay_End', $week_twelve, PDO::PARAM_STR); // call the stored procedure $stpro->execute(); $results = $stpro->fetchALL(PDO::FETCH_ASSOC); /* $number=1; foreach($results as $row) { echo $number.') '.$row['str_ProjectName'].' | '.$row['dte_DateStarted'].'<br>'; $number=$number+1; } */ define('NCOLS', 83); $current_row = 1; $col = -1; $the_colspan=0; $body.="<tr>"; /*this is golden - this is your template, right here foreach($results as $row) { if($current_row_number<>$row['DataDisplay_Row']) { $body.="</tr><tr>"; } $body.="<td>"; $body.=$row['DataDisplay_Row']; $body.="</td>"; $current_row_number=$row['DataDisplay_Row']; } */ foreach($results as $row) { if ($current_row != $row['DataDisplay_Row']) { if ($current_row != 0) { // FINISH OFF THE ROW; while($col++ < NCOLS) { include("cell_formatting.php"); $body.=">"; $body .= ""; $body.="</td>"; } $body .= "</tr>\n<tr>"; } // MOVE OUR ROW MARKER $current_row = $row['DataDisplay_Row']; // RESET COL COUNT $col = -1; // TODO: HANDLE MISSED ROWS HERE } if($row['DataDisplay_EndCell']=="" OR $row['DataDisplay_EndCell']<0) { continue; } if($row['DataDisplay_StartCell']=="") { if($row['DataDisplay_EndCell']>83) { $the_cell=0; } else { $the_cell=$row['DataDisplay_EndCell']; } } else { $the_cell=$row['DataDisplay_StartCell']; } while($col++ < ($the_cell-1)) { include("cell_formatting.php"); $body.=">"; //$body.=""; //$body .= $col; $body.="</td>"; } //here is where you've got data //in the rare instance of a submitted_date exceeding the range of the page, you've got to handle that so the page as a whole isn't compromised if(strtotime($row['dte_DateSubmitted']) >strtotime($week_twelve)) { continue; } if($row['TotalCellSpan']>1 OR ($row['DataDisplay_EndCell']>83 AND $row['DataDisplay_StartCell']=="")) { //there are situations where have a TotalCellSpan that is greater than 0, but it belongs to an event that began before the timeframe that's being currently viewed (the DataDisplay_StartCell is 0). That being the case, your colspan will be the DataDisplay_EndCell - DataDisplay_StartCell +1) if($row['TotalCellSpan']>1 AND $row['DataDisplay_StartCell']==0) { include("cell_formatting_multiple_zero.php"); include("cell_content_multiple.php"); } else { //cell_formatting_multiple.php has a closing tag for the cell include("cell_formatting_multiple.php"); //this next section is what displays your content in the context of a conventional multi-day event include("cell_content_multiple.php"); } } else { include("cell_formatting.php"); $body.=">"; $body.="<a href=\"#\" onclick=\"javascript:void window.open('event_description.php?id="; $body.=$row['int_DEVELOPERS_Project_Id']; $body.="&project_type="; $body.=$row['str_ProjectType']; $body.="&developer="; $body.=stripslashes($row['str_Full_Name_Developer']); $body.="&submitted_by="; $body.=stripslashes($row['str_Full_Name_Submitter']); $body.="&status="; $body.=stripslashes($row['str_ProjectStatus']); $body.="&effort="; $body.=stripslashes($row['str_LevelOfEffort']); $body.="','1435862141298','width=610,height=560,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=1,left=0,top=0');return false;\" class=\"tooltip\">"; include("cell_formatting_single.php"); $body.="<span><img class=\"callout_area\" src=\"images/callout.gif\" alt=\"callout\" />"; $body.="<b>tool:</b> "; $body.=stripslashes($row['str_Tool']); $body.="<br><b>project name:</b> "; $body.=stripslashes($row['str_ProjectName']); $body.="<br><b>submitted date:</b> "; $body.=date("n/d/Y", strtotime($row['dte_DateSubmitted'])); $body.="<br><b>target UAT date: </b>"; if($row['dte_TargetCompletionDate']=="" or $row['dte_TargetCompletionDate']==" " OR is_null($row['dte_TargetCompletionDate'])) { $body.="not documented"; } else { $body.=date("n/d/Y", strtotime($row['dte_TargetCompletionDate'])); } $body.="<br><b>percentage completed:</b> "; $body.=$row['dec_PercentageCompleted']*100; $body.="%</span></a>"; //$body.=$col; $body.="</td>"; } } while($col++ < NCOLS) { include("cell_formatting.php"); $body.=">"; //$body .= ""; //$body.=$col; $body.="</td>"; } $body .= "</tr>\n"; $body.=" <!-- this last row is just for aesthetics so there's a little room at the bottom of the page. It also gurantees a certain with for all of the \"daily\" cells -->"; include("spacer_single.php"); $body.=" </table><br><br>"; $new_page->setBody($body); echo $new_page->display(); ?>
<?php class CalendarView { function calendar_specifics($page_display) { $text_style=""; $briefcase=''; foreach($page_display as $page) { if(isset($_GET['search'])&&$_GET['search']==$page['id']) { $briefcase.="<div style=\"background-color:yellow;\">"; } $briefcase.="<div class=\""; if($page['region']=="ALU") { $briefcase.="ALU"; } if($page['region']=="AREA") { $briefcase.="AREA"; } if($page['region']=="CATN") { $briefcase.="CATN"; } if($page['region']=="CTX") { $briefcase.="CTX"; } if($page['region']=="DEVICE") { $briefcase.="DEVICE"; } if($page['region']=="ERC") { $briefcase.="ERC"; } if($page['region']=="FL") { $briefcase.="FL"; } if($page['region']=="GAAL") { $briefcase.="GAAL"; } if($page['region']=="HGC") { $briefcase.="HGC"; } if($page['region']=="SCTL") { $briefcase.="SCTL"; } $briefcase.="\">"; $briefcase .="<div class=\""; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="\"> <a href=\"#\" onclick=\"javascript:void window.open('event_description.php?id="; $briefcase.=$page['id']; $briefcase.="','1435862141298','width=610,height=560,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=1,left=0,top=0');return false;\" class=\""; if($page['region']=="ALU") { $briefcase.="tooltip_date_ALU"; $text_style="ALU"; } if($page['region']=="AREA") { $briefcase.="tooltip_date_AREA"; $text_style="AREA"; } if($page['region']=="CATN") { $briefcase.="tooltip_date_CATN"; $text_style="CATN"; } if($page['region']=="CTX") { $briefcase.="tooltip_date_CTX"; $text_style="CTX"; } if($page['region']=="Device") { $briefcase.="tooltip_date_Device"; $text_style="Device"; } if($page['region']=="ERC") { $briefcase.="tooltip_date_ERC"; $text_style="ERC"; } if($page['region']=="FL") { $briefcase.="tooltip_date_FL"; $text_style="FL"; } if($page['region']=="GAAL") { $briefcase.="tooltip_date_GAAL"; $text_style="GAAL"; } if($page['region']=="HGC") { $briefcase.="tooltip_date_HGC"; $text_style="HGC"; } if($page['region']=="SCTL") { $briefcase.="tooltip_date_SCTL"; $text_style="SCTL"; } $briefcase.="\">"; $position = 35; $message = $page['short_name']; $post = substr($message,$position,1); if($post !=" ") { $length = strlen( $message ); while($post !=" " && $position < $length){ $i =1; $position = $position+$i; $post = substr($message,$position,1); } } $post = substr($message,0,$position); if(strlen($post)>35) { $briefcase.=stripslashes($post).'...'; } else { $briefcase.=stripslashes($post); } $briefcase.="<span><img class=\"callout_area\" src=\"images/callout.gif\" alt=\"callout\" /><b>"; $briefcase.=date("F, jS Y", strtotime($page['date'])); $briefcase.="</b><div style=\"float:right;\"><div class=\""; $briefcase.=$text_style; $briefcase.="\">"; $briefcase.=stripslashes($page['state']).' | '.stripslashes($page['region']); $briefcase.="</div></div><br>"; $briefcase.=stripslashes($page['description']); $briefcase.="</span> </a><br></div>"; if(isset($_GET['search'])&&$_GET['search']==$page['id']) { $briefcase.="</div>"; } $briefcase.="</div>"; } return $briefcase; } function calendar_specifics_long($page_display) { $text_style=""; foreach($page_display as $page) { $briefcase.="<tr><td>"; $briefcase.= $page['event_id']; $briefcase.="</td></tr>"; } return $briefcase; } function calendar_detail($page_display) { $briefcase=''; foreach($page_display as $page) { $briefcase .=" <div class=\""; if($page['region']=="ALU") { $briefcase.="ALU_title"; } if($page['region']=="AREA") { $briefcase.="AREA_title"; } if($page['region']=="CATN") { $briefcase.="CATN_title"; } if($page['region']=="CTX") { $briefcase.="CTX_title"; } if($page['region']=="DEVICE") { $briefcase.="DEVICE_title"; } if($page['region']=="ERC") { $briefcase.="ERC_title"; } if($page['region']=="FL") { $briefcase.="FL_title"; } if($page['region']=="GAAL") { $briefcase.="GAAL_title"; } if($page['region']=="HGC") { $briefcase.="HGC_title"; } if($page['region']=="SCTL") { $briefcase.="SCTL_title"; } $briefcase.="\"> "; $briefcase.=stripslashes($page['state']).' | '.stripslashes($page['region']); $briefcase.="<div style=\"float:right;\">"; $briefcase.=date("F, jS Y", strtotime($page['date'])); $briefcase.=" </div></div><br><span style=\"font-weight:bold; line-height:28pt; vertical-align:middle;\">short name...</span><br><div style=\"width:580px; margin:auto; min-height:50px; padding: 3px 5px 3px 5px; height:auto; border:1px solid #cccccc; border-radius:5px;\">"; $briefcase.=stripslashes($page['short_name']); $briefcase.="</div><span style=\"font-weight:bold; line-height:28pt; vertical-align:middle;\">description...</span><br><div style=\"width:580px; margin:auto; min-height:50px; padding: 3px 5px 3px 5px; height:auto; border:1px solid #cccccc; border-radius:5px;\">"; $briefcase.=stripslashes($page['description']); $briefcase.="</div>"; } return $briefcase; } function state_display($page_display) { $briefcase=""; if(!isset($_GET['month'])) { $cMonth=date("n"); } else { $cMonth = $_GET["month"]; } if(!isset($_GET['year'])) { $cYear=date("Y"); } else { $cYear = $_GET["year"]; } foreach($page_display as $page) { $briefcase.="<br><a href=\"#\" class=\"table_states\" onclick=\"return "; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="()"; $briefcase.=";\"><b>"; $briefcase.=stripslashes($page['state']); $briefcase .="</a></b>"; } $briefcase.="<br><br><a href=\"calendar.php?month="; $briefcase.=$cMonth; $briefcase.="&year="; $briefcase.=$cYear; $briefcase.="&reload=1"; $briefcase.="\" class=\"table_states\"><img src=\"images/reload.png\" border=\"0\"></a>"; return $briefcase; } function big_state_display($page_display) { $briefcase=""; foreach($page_display as $page) { $raw_month=date("m", strtotime($page['date'])); $good_month=ltrim($raw_month, '0'); $raw_year=date("Y", strtotime($page['date'])); $briefcase.="<br><a href=\"calendar.php?month="; $briefcase.=$good_month; $briefcase.="&year="; $briefcase.=$raw_year; $briefcase.="&state="; $briefcase.=stripslashes($page['state']); $briefcase.="\" class=\"table_states\"><b>"; $briefcase.=stripslashes($page['state']); $briefcase .="</a></b>"; } return $briefcase; } function javascript_commands($content, $number) { $page_display=func_get_arg(0); $the_number=(func_get_arg(1)-1); //echo $the_number; $the_count=1; $java_count=0; $java_state=""; $briefcase=""; $current_state=""; $the_state=""; $briefcase.="var queue={};\n"; if(isset($_GET['state'])&&!$_GET['state']=="") { $briefcase.="queue."; if($_GET['state']=="North Carolina") { $briefcase.="North_Carolina"; } elseif($_GET['state']=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=$_GET['state']; } $briefcase.="=true;"; } foreach($page_display as $page) { if($current_state<>$page['state']) { $briefcase.="function "; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="()\n{\n"; $briefcase.="if(Object.size(the_queue)>0)\n{\n"; $briefcase.="delete the_queue.CATN;\n"; $briefcase.="delete the_queue.CATN;\n"; $briefcase.="delete the_queue.FL;\n"; $briefcase.="delete the_queue.CTX;\n"; $briefcase.="delete the_queue.HGC;\n"; $briefcase.="delete the_queue.GAAL;\n"; $briefcase.="delete the_queue.SCTL;\n"; $briefcase.="delete the_queue.AREA;\n"; $briefcase.="delete the_queue.ALU;\n"; $briefcase.="delete the_queue.DEVICE;\n"; $briefcase.="delete the_queue.CATN_long;\n"; $briefcase.="delete the_queue.FL_long;\n"; $briefcase.="delete the_queue.CTX_long;\n"; $briefcase.="delete the_queue.HGC_long;\n"; $briefcase.="delete the_queue.GAAL_long;\n"; $briefcase.="delete the_queue.SCTL_long;\n"; $briefcase.="delete the_queue.AREA_long;\n"; $briefcase.="delete the_queue.ALU_long;\n"; $briefcase.="delete the_queue.DEVICE_long;\n"; $briefcase.="}\n"; $briefcase.="$(\".CATN,.FL,.CTX,.HGC,.GAAL,.SCTL,.AREA,.ALU,.DEVICE, .CATN_long,.FL_long,.CTX_long,.HGC_long,.GAAL_long,.SCTL_long,.AREA_long,.ALU_long,.DEVICE_long\").show();\n"; $briefcase.="queue."; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="=true;\n"; //right here you're doing a little test to ensure that you've got more than one state. Otherwise, the Javascript breaks foreach($page_display as $display) { if($java_state<>$page['state']) { $java_count=$java_count+1; } } //echo $java_count; //java_count represents the number of states you've got on this month. You'll compose only a portion of the Javascript command below if you only have one state. Otherwise, you're going to get an error if($java_count>1) { $briefcase.="$(\""; foreach($page_display as $display) { if($the_state=="") { $the_state==$page['state']; } if($the_state<>$current_state) { $briefcase.="."; if(stripslashes($display['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($display['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($display['state']); } if($the_count<$the_number) { $briefcase.=","; } else { $briefcase.="\").hide();"; } $the_count=$the_count+1; } $the_state=$display['state']; } } $briefcase.="\n\n"; $briefcase.="for( var state in queue)"; $briefcase.="\n{\n$(\".\" + state).show();\n}\n"; $briefcase.="return true;\n"; $briefcase.="}\n"; } $the_count=$count=1; $current_state=$page['state']; } return $briefcase; } function javascript_opening_act($page_display) { $briefcase=""; foreach ($page_display as $page) { $briefcase.="$('."; $briefcase.=stripslashes($page['state']); $briefcase.="').hide();\n"; } return $briefcase; } function javascript_state_id($page_display) { $briefcase=""; $briefcase.="function state_id()\n{\n"; foreach ($page_display as $page) { $briefcase.="document.getElementById(\""; $briefcase.=$page['id']; $briefcase.="\").style.display=\"none\";\ndocument.getElementById(\""; $briefcase.=stripslashes($page['state']); $briefcase.="\").style.display=\"inline\";\n\n"; } $briefcase.="}"; return $briefcase; } function search_results($page_display) { $briefcase=""; $current_event=""; foreach($page_display as $page) { $the_month=date("m", strtotime($page['date'])); $month_number= ltrim($the_month, '0'); $the_year=date("Y", strtotime($page['date'])); $briefcase.="<a href=\"calendar.php?month="; $briefcase.=$month_number; $briefcase.="&year="; $briefcase.=$the_year; $briefcase.="&search="; $briefcase.=$page['event_id']; $briefcase.="\" style=\"text-decoration:none;\">"; $briefcase.="<span class=\""; if($page['region']=="ALU") { $briefcase.="ALU"; } if($page['region']=="AREA") { $briefcase.="AREA"; } if($page['region']=="CATN") { $briefcase.="CATN"; } if($page['region']=="CTX") { $briefcase.="CTX"; } if($page['region']=="Device") { $briefcase.="Device"; } if($page['region']=="ERC") { $briefcase.="ERC"; } if($page['region']=="FL") { $briefcase.="FL"; } if($page['region']=="GAAL") { $briefcase.="GAAL"; } if($page['region']=="HGC") { $briefcase.="HGC"; } if($page['region']=="SCTL") { $briefcase.="SCTL"; } $briefcase.="\">"; $briefcase.=stripslashes($page['state']).' | '.stripslashes($page['region']).' | '; $briefcase.=date("F, jS Y", strtotime($page['date'])).' - '; $briefcase.=stripslashes($page['short_name']); $briefcase.="</span></a>"; $briefcase.="<hr>"; } return $briefcase; } public function calendar_edit_display($calendar_display) { $briefcase=""; foreach($calendar_display as $calendar) { $briefcase.=" <table class=\"page_display\" style=\"width:auto; margin:auto;\" border=\"0\"> <tr> <td> short name </td> <td> <input type=\"text\" size=\"65\" name=\"short_name\" value=\""; $briefcase.=stripslashes($calendar['short_name']); $briefcase.="\"> </td> </tr> <tr> <td style=\"width:75px;\">start date</td> <td> <input type=\"text\" size=\"65\" name=\"sdate\" id=\"start_date\" style=\"border:1px solid #000000; color:#cccccc;\" value=\""; $briefcase.=date("Y-m-d", strtotime($calendar['date'])); $briefcase.="\"></td></tr>"; if($calendar['end_date']<>"0000-00-00") { $briefcase.=" <tr> <td>end date</td> <td> <input type=\"text\" size=\"65\" name=\"edate\" id=\"end_date\" style=\"border:1px solid #000000; color:#cccccc;\" value=\""; $briefcase.=date("Y-m-d", strtotime($calendar['end_date'])); $briefcase.="\"></td></tr>"; } else { $briefcase.=" <tr> <td>end date</td> <td> <input type=\"text\" size=\"65\" name=\"edate\" id=\"end_date\" style=\"border:1px solid #000000; color:#cccccc;\" value=\"end date\"> </td> </tr>"; } $briefcase.=" <tr> <td> state </td> <td colspan=\"2\"> <select name=\"state\">"; $briefcase.="<option selected>"; $briefcase.=$calendar['state']; $briefcase.="</option>"; $briefcase.=" <option>Alabama</option> <option>Arkansas</option> <option>Florida</option> <option>Georgia</option> <option>Kentucky </option> <option>Louisiana</option> <option>Mississippi</option> <option>North Carolina</option> <option>Oklahoma</option> <option>Region</option> <option>South Carolina</option> <option>Tennessee</option> <option>Texas</option> <option>____________________________________________________</option> </select> </td> </tr> <tr> <td> <a href=\"../adm/region_map.php\" target=\"_blank\" onclick=\"return popitup('../adm/region_map.php')\">calendar</a> </td> <td colspan=\"3\"> <select name=\"region\">"; if($calendar['region']=="ALU") { $briefcase.="<option selected value=\"ALU\">Alcatel-Lucent (ALU)</option>"; } if($calendar['region']=="AREA") { $briefcase.="<option selected value=\"AREA\">Area / National</option>"; } if($calendar['region']=="CATN") { $briefcase.="<option selected value=\"CATN\">Carolinas / Tennessee</option>"; } if($calendar['region']=="CTX") { $briefcase.="<option selected value=\"CTX\">Central Texas</option>"; } if($calendar['region']=="DEVICE") { $briefcase.="<option selected value=\"DEVICE\">Device</option>"; } if($calendar['region']=="ERC") { $briefcase.="<option selected value=\"ERC\">ERC</option>"; } if($calendar['region']=="FL") { $briefcase.="<option selected value=\"FL\">Florida</option>"; } if($calendar['region']=="GAAL") { $briefcase.="<option selected value=\"GAAL\">Georgia / Alabama</option>"; } if($calendar['region']=="HGC") { $briefcase.="<option selected value=\"HGC\">Houston Gulf Coast</option>"; } if($calendar['region']=="SCTL") { $briefcase.="<option selected value=\"SCTL\">South Central</option>"; } $briefcase.=" <option value=\"ALU\">Alcatel-Lucent (ALU)</option> <option value=\"AREA\">Area /National</option> <option value=\"CATN\">Carolinas / Tennessee</option> <option value=\"CTX\">Central Texas</option> <option value=\"DEVICE\">Device</option> <option value=\"ERC\">ERC</option> <option value=\"FL\">Florida</option> <option value=\"GAAL\">Georgia / Alabama</option> <option value=\"HGC\">Houston Gulf Coast </option> <option value=\"SCTL\">South Central</option> <option>____________________________________________________</option> </select> </td> </tr> <tr> <td colspan=\"2\"> <textarea class=\"description\" name=\"description\">"; $briefcase.=stripslashes($calendar['description']); $briefcase.="</textarea> </td> </tr> </table><input type=\"hidden\" name=\"id\" value=\""; $briefcase.=$calendar['id']; $briefcase.="\"><br><br> <div style=\"text-align:center;\"><input type=\"image\" src=\"images/submit_button.png\" alt=\"Submit\" width=\"100\"></div></form>"; } return $briefcase; } function export_results($page_display) { $number=1; $briefcase=""; $current_event=""; foreach($page_display as $page) { $briefcase.="<tr><td rowspan=\"2\" style=\"border:1px solid #cccccc; text-align:center; font-size:10pt;\">"; $briefcase.=$number; $briefcase.="</td><td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=date("m/d/Y", strtotime($page['date'])); $briefcase.="</td>"; if($page['end_date']=="0000-00-00") { $briefcase.="<td style=\"border:1px solid #cccccc; font-size:10pt;\"> </td>"; } else { $briefcase.="<td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=date("m/d/Y", strtotime($page['end_date'])); $briefcase.="</td>"; } $the_month=date("m", strtotime($page['date'])); $month_number= ltrim($the_month, '0'); $the_year=date("Y", strtotime($page['date'])); $briefcase.="<td style=\"border:1px solid #cccccc; font-size:10pt;\"><a href=\"calendar.php?month="; $briefcase.=$month_number; $briefcase.="&year="; $briefcase.=$the_year; $briefcase.="&search="; $briefcase.=$page['id']; $briefcase.="\" style=\"text-decoration:none;\">"; $briefcase.="<span class=\""; if($page['region']=="ALU") { $briefcase.="ALU"; } if($page['region']=="AREA") { $briefcase.="AREA"; } if($page['region']=="CATN") { $briefcase.="CATN"; } if($page['region']=="CTX") { $briefcase.="CTX"; } if($page['region']=="Device") { $briefcase.="Device"; } if($page['region']=="ERC") { $briefcase.="ERC"; } if($page['region']=="FL") { $briefcase.="FL"; } if($page['region']=="GAAL") { $briefcase.="GAAL"; } if($page['region']=="HGC") { $briefcase.="HGC"; } if($page['region']=="SCTL") { $briefcase.="SCTL"; } $briefcase.="\" style=\"font-size:10pt;\">"; $briefcase.=stripslashes($page['short_name']); $briefcase.="</span></a></td><td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=$page['state']; $briefcase.="</td><td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=$page['region']; $briefcase.="</td></tr>"; if(!trim($page['description'])=="") { $briefcase.="<tr><td colspan=\"5\" style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=stripslashes($page['description']); $briefcase.="</td></tr>"; } $number=$number+1; } return $briefcase; } public function csv_page($page_display) { $output=""; $heading=array('#', 'start date', 'end date', 'short name', 'state', 'region', 'description'); foreach ($heading as $val) { $output .=''.$val.','; } $output .="\n"; $filename="docs/page.csv"; header('Content-type:application/csv'); header('Content-Disposition: attachment; filename='.$filename); echo $output; } } ?>
Verizon Calendar In addition to the GANT Calendar I was asked to develop, I was also asked to build an online calendar that would capture things in terms of the regions that were represented. Here's a screenshot of the finished project:
What made this particular project unique is the way in which I used PHP to echo JavaScript code in order to trigger various pop ups etc. Take a look!
<?php class CalendarView { function calendar_specifics($page_display) { $text_style=""; $briefcase=''; foreach($page_display as $page) { if(isset($_GET['search'])&&$_GET['search']==$page['id']) { $briefcase.="<div style=\"background-color:yellow;\">"; } $briefcase.="<div class=\""; if($page['region']=="ALU") { $briefcase.="ALU"; } if($page['region']=="AREA") { $briefcase.="AREA"; } if($page['region']=="CATN") { $briefcase.="CATN"; } if($page['region']=="CTX") { $briefcase.="CTX"; } if($page['region']=="DEVICE") { $briefcase.="DEVICE"; } if($page['region']=="ERC") { $briefcase.="ERC"; } if($page['region']=="FL") { $briefcase.="FL"; } if($page['region']=="GAAL") { $briefcase.="GAAL"; } if($page['region']=="HGC") { $briefcase.="HGC"; } if($page['region']=="SCTL") { $briefcase.="SCTL"; } $briefcase.="\">"; $briefcase .="<div class=\""; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="\"> <a href=\"#\" onclick=\"javascript:void window.open('event_description.php?id="; $briefcase.=$page['id']; $briefcase.="','1435862141298','width=610,height=560,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=1,left=0,top=0');return false;\" class=\""; if($page['region']=="ALU") { $briefcase.="tooltip_date_ALU"; $text_style="ALU"; } if($page['region']=="AREA") { $briefcase.="tooltip_date_AREA"; $text_style="AREA"; } if($page['region']=="CATN") { $briefcase.="tooltip_date_CATN"; $text_style="CATN"; } if($page['region']=="CTX") { $briefcase.="tooltip_date_CTX"; $text_style="CTX"; } if($page['region']=="Device") { $briefcase.="tooltip_date_Device"; $text_style="Device"; } if($page['region']=="ERC") { $briefcase.="tooltip_date_ERC"; $text_style="ERC"; } if($page['region']=="FL") { $briefcase.="tooltip_date_FL"; $text_style="FL"; } if($page['region']=="GAAL") { $briefcase.="tooltip_date_GAAL"; $text_style="GAAL"; } if($page['region']=="HGC") { $briefcase.="tooltip_date_HGC"; $text_style="HGC"; } if($page['region']=="SCTL") { $briefcase.="tooltip_date_SCTL"; $text_style="SCTL"; } $briefcase.="\">"; $position = 35; $message = $page['short_name']; $post = substr($message,$position,1); if($post !=" ") { $length = strlen( $message ); while($post !=" " && $position < $length){ $i =1; $position = $position+$i; $post = substr($message,$position,1); } } $post = substr($message,0,$position); if(strlen($post)>35) { $briefcase.=stripslashes($post).'...'; } else { $briefcase.=stripslashes($post); } $briefcase.="<span><img class=\"callout_area\" src=\"images/callout.gif\" alt=\"callout\" /><b>"; $briefcase.=date("F, jS Y", strtotime($page['date'])); $briefcase.="</b><div style=\"float:right;\"><div class=\""; $briefcase.=$text_style; $briefcase.="\">"; $briefcase.=stripslashes($page['state']).' | '.stripslashes($page['region']); $briefcase.="</div></div><br>"; $briefcase.=stripslashes($page['description']); $briefcase.="</span> </a><br></div>"; if(isset($_GET['search'])&&$_GET['search']==$page['id']) { $briefcase.="</div>"; } $briefcase.="</div>"; } return $briefcase; } function calendar_specifics_long($page_display) { $text_style=""; foreach($page_display as $page) { $briefcase.="<tr><td>"; $briefcase.= $page['event_id']; $briefcase.="</td></tr>"; } return $briefcase; } function calendar_detail($page_display) { $briefcase=''; foreach($page_display as $page) { $briefcase .=" <div class=\""; if($page['region']=="ALU") { $briefcase.="ALU_title"; } if($page['region']=="AREA") { $briefcase.="AREA_title"; } if($page['region']=="CATN") { $briefcase.="CATN_title"; } if($page['region']=="CTX") { $briefcase.="CTX_title"; } if($page['region']=="DEVICE") { $briefcase.="DEVICE_title"; } if($page['region']=="ERC") { $briefcase.="ERC_title"; } if($page['region']=="FL") { $briefcase.="FL_title"; } if($page['region']=="GAAL") { $briefcase.="GAAL_title"; } if($page['region']=="HGC") { $briefcase.="HGC_title"; } if($page['region']=="SCTL") { $briefcase.="SCTL_title"; } $briefcase.="\"> "; $briefcase.=stripslashes($page['state']).' | '.stripslashes($page['region']); $briefcase.="<div style=\"float:right;\">"; $briefcase.=date("F, jS Y", strtotime($page['date'])); $briefcase.=" </div></div><br><span style=\"font-weight:bold; line-height:28pt; vertical-align:middle;\">short name...</span><br><div style=\"width:580px; margin:auto; min-height:50px; padding: 3px 5px 3px 5px; height:auto; border:1px solid #cccccc; border-radius:5px;\">"; $briefcase.=stripslashes($page['short_name']); $briefcase.="</div><span style=\"font-weight:bold; line-height:28pt; vertical-align:middle;\">description...</span><br><div style=\"width:580px; margin:auto; min-height:50px; padding: 3px 5px 3px 5px; height:auto; border:1px solid #cccccc; border-radius:5px;\">"; $briefcase.=stripslashes($page['description']); $briefcase.="</div>"; } return $briefcase; } function state_display($page_display) { $briefcase=""; if(!isset($_GET['month'])) { $cMonth=date("n"); } else { $cMonth = $_GET["month"]; } if(!isset($_GET['year'])) { $cYear=date("Y"); } else { $cYear = $_GET["year"]; } foreach($page_display as $page) { $briefcase.="<br><a href=\"#\" class=\"table_states\" onclick=\"return "; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="()"; $briefcase.=";\"><b>"; $briefcase.=stripslashes($page['state']); $briefcase .="</a></b>"; } $briefcase.="<br><br><a href=\"calendar.php?month="; $briefcase.=$cMonth; $briefcase.="&year="; $briefcase.=$cYear; $briefcase.="&reload=1"; $briefcase.="\" class=\"table_states\"><img src=\"images/reload.png\" border=\"0\"></a>"; return $briefcase; } function big_state_display($page_display) { $briefcase=""; foreach($page_display as $page) { $raw_month=date("m", strtotime($page['date'])); $good_month=ltrim($raw_month, '0'); $raw_year=date("Y", strtotime($page['date'])); $briefcase.="<br><a href=\"calendar.php?month="; $briefcase.=$good_month; $briefcase.="&year="; $briefcase.=$raw_year; $briefcase.="&state="; $briefcase.=stripslashes($page['state']); $briefcase.="\" class=\"table_states\"><b>"; $briefcase.=stripslashes($page['state']); $briefcase .="</a></b>"; } return $briefcase; } function javascript_commands($content, $number) { $page_display=func_get_arg(0); $the_number=(func_get_arg(1)-1); //echo $the_number; $the_count=1; $java_count=0; $java_state=""; $briefcase=""; $current_state=""; $the_state=""; $briefcase.="var queue={};\n"; if(isset($_GET['state'])&&!$_GET['state']=="") { $briefcase.="queue."; if($_GET['state']=="North Carolina") { $briefcase.="North_Carolina"; } elseif($_GET['state']=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=$_GET['state']; } $briefcase.="=true;"; } foreach($page_display as $page) { if($current_state<>$page['state']) { $briefcase.="function "; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="()\n{\n"; $briefcase.="if(Object.size(the_queue)>0)\n{\n"; $briefcase.="delete the_queue.CATN;\n"; $briefcase.="delete the_queue.CATN;\n"; $briefcase.="delete the_queue.FL;\n"; $briefcase.="delete the_queue.CTX;\n"; $briefcase.="delete the_queue.HGC;\n"; $briefcase.="delete the_queue.GAAL;\n"; $briefcase.="delete the_queue.SCTL;\n"; $briefcase.="delete the_queue.AREA;\n"; $briefcase.="delete the_queue.ALU;\n"; $briefcase.="delete the_queue.DEVICE;\n"; $briefcase.="delete the_queue.CATN_long;\n"; $briefcase.="delete the_queue.FL_long;\n"; $briefcase.="delete the_queue.CTX_long;\n"; $briefcase.="delete the_queue.HGC_long;\n"; $briefcase.="delete the_queue.GAAL_long;\n"; $briefcase.="delete the_queue.SCTL_long;\n"; $briefcase.="delete the_queue.AREA_long;\n"; $briefcase.="delete the_queue.ALU_long;\n"; $briefcase.="delete the_queue.DEVICE_long;\n"; $briefcase.="}\n"; $briefcase.="$(\".CATN,.FL,.CTX,.HGC,.GAAL,.SCTL,.AREA,.ALU,.DEVICE, .CATN_long,.FL_long,.CTX_long,.HGC_long,.GAAL_long,.SCTL_long,.AREA_long,.ALU_long,.DEVICE_long\").show();\n"; $briefcase.="queue."; if(stripslashes($page['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($page['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($page['state']); } $briefcase.="=true;\n"; //right here you're doing a little test to ensure that you've got more than one state. Otherwise, the Javascript breaks foreach($page_display as $display) { if($java_state<>$page['state']) { $java_count=$java_count+1; } } //echo $java_count; //java_count represents the number of states you've got on this month. You'll compose only a portion of the Javascript command below if you only have one state. Otherwise, you're going to get an error if($java_count>1) { $briefcase.="$(\""; foreach($page_display as $display) { if($the_state=="") { $the_state==$page['state']; } if($the_state<>$current_state) { $briefcase.="."; if(stripslashes($display['state'])=="North Carolina") { $briefcase.="North_Carolina"; } elseif(stripslashes($display['state'])=="South Carolina") { $briefcase.="South_Carolina"; } else { $briefcase.=stripslashes($display['state']); } if($the_count<$the_number) { $briefcase.=","; } else { $briefcase.="\").hide();"; } $the_count=$the_count+1; } $the_state=$display['state']; } } $briefcase.="\n\n"; $briefcase.="for( var state in queue)"; $briefcase.="\n{\n$(\".\" + state).show();\n}\n"; $briefcase.="return true;\n"; $briefcase.="}\n"; } $the_count=$count=1; $current_state=$page['state']; } return $briefcase; } function javascript_opening_act($page_display) { $briefcase=""; foreach ($page_display as $page) { $briefcase.="$('."; $briefcase.=stripslashes($page['state']); $briefcase.="').hide();\n"; } return $briefcase; } function javascript_state_id($page_display) { $briefcase=""; $briefcase.="function state_id()\n{\n"; foreach ($page_display as $page) { $briefcase.="document.getElementById(\""; $briefcase.=$page['id']; $briefcase.="\").style.display=\"none\";\ndocument.getElementById(\""; $briefcase.=stripslashes($page['state']); $briefcase.="\").style.display=\"inline\";\n\n"; } $briefcase.="}"; return $briefcase; } function search_results($page_display) { $briefcase=""; $current_event=""; foreach($page_display as $page) { $the_month=date("m", strtotime($page['date'])); $month_number= ltrim($the_month, '0'); $the_year=date("Y", strtotime($page['date'])); $briefcase.="<a href=\"calendar.php?month="; $briefcase.=$month_number; $briefcase.="&year="; $briefcase.=$the_year; $briefcase.="&search="; $briefcase.=$page['event_id']; $briefcase.="\" style=\"text-decoration:none;\">"; $briefcase.="<span class=\""; if($page['region']=="ALU") { $briefcase.="ALU"; } if($page['region']=="AREA") { $briefcase.="AREA"; } if($page['region']=="CATN") { $briefcase.="CATN"; } if($page['region']=="CTX") { $briefcase.="CTX"; } if($page['region']=="Device") { $briefcase.="Device"; } if($page['region']=="ERC") { $briefcase.="ERC"; } if($page['region']=="FL") { $briefcase.="FL"; } if($page['region']=="GAAL") { $briefcase.="GAAL"; } if($page['region']=="HGC") { $briefcase.="HGC"; } if($page['region']=="SCTL") { $briefcase.="SCTL"; } $briefcase.="\">"; $briefcase.=stripslashes($page['state']).' | '.stripslashes($page['region']).' | '; $briefcase.=date("F, jS Y", strtotime($page['date'])).' - '; $briefcase.=stripslashes($page['short_name']); $briefcase.="</span></a>"; $briefcase.="<hr>"; } return $briefcase; } public function calendar_edit_display($calendar_display) { $briefcase=""; foreach($calendar_display as $calendar) { $briefcase.=" <table class=\"page_display\" style=\"width:auto; margin:auto;\" border=\"0\"> <tr> <td> short name </td> <td> <input type=\"text\" size=\"65\" name=\"short_name\" value=\""; $briefcase.=stripslashes($calendar['short_name']); $briefcase.="\"> </td> </tr> <tr> <td style=\"width:75px;\">start date</td> <td> <input type=\"text\" size=\"65\" name=\"sdate\" id=\"start_date\" style=\"border:1px solid #000000; color:#cccccc;\" value=\""; $briefcase.=date("Y-m-d", strtotime($calendar['date'])); $briefcase.="\"></td></tr>"; if($calendar['end_date']<>"0000-00-00") { $briefcase.=" <tr> <td>end date</td> <td> <input type=\"text\" size=\"65\" name=\"edate\" id=\"end_date\" style=\"border:1px solid #000000; color:#cccccc;\" value=\""; $briefcase.=date("Y-m-d", strtotime($calendar['end_date'])); $briefcase.="\"></td></tr>"; } else { $briefcase.=" <tr> <td>end date</td> <td> <input type=\"text\" size=\"65\" name=\"edate\" id=\"end_date\" style=\"border:1px solid #000000; color:#cccccc;\" value=\"end date\"> </td> </tr>"; } $briefcase.=" <tr> <td> state </td> <td colspan=\"2\"> <select name=\"state\">"; $briefcase.="<option selected>"; $briefcase.=$calendar['state']; $briefcase.="</option>"; $briefcase.=" <option>Alabama</option> <option>Arkansas</option> <option>Florida</option> <option>Georgia</option> <option>Kentucky </option> <option>Louisiana</option> <option>Mississippi</option> <option>North Carolina</option> <option>Oklahoma</option> <option>Region</option> <option>South Carolina</option> <option>Tennessee</option> <option>Texas</option> <option>____________________________________________________</option> </select> </td> </tr> <tr> <td> <a href=\"../adm/region_map.php\" target=\"_blank\" onclick=\"return popitup('../adm/region_map.php')\">calendar</a> </td> <td colspan=\"3\"> <select name=\"region\">"; if($calendar['region']=="ALU") { $briefcase.="<option selected value=\"ALU\">Alcatel-Lucent (ALU)</option>"; } if($calendar['region']=="AREA") { $briefcase.="<option selected value=\"AREA\">Area / National</option>"; } if($calendar['region']=="CATN") { $briefcase.="<option selected value=\"CATN\">Carolinas / Tennessee</option>"; } if($calendar['region']=="CTX") { $briefcase.="<option selected value=\"CTX\">Central Texas</option>"; } if($calendar['region']=="DEVICE") { $briefcase.="<option selected value=\"DEVICE\">Device</option>"; } if($calendar['region']=="ERC") { $briefcase.="<option selected value=\"ERC\">ERC</option>"; } if($calendar['region']=="FL") { $briefcase.="<option selected value=\"FL\">Florida</option>"; } if($calendar['region']=="GAAL") { $briefcase.="<option selected value=\"GAAL\">Georgia / Alabama</option>"; } if($calendar['region']=="HGC") { $briefcase.="<option selected value=\"HGC\">Houston Gulf Coast</option>"; } if($calendar['region']=="SCTL") { $briefcase.="<option selected value=\"SCTL\">South Central</option>"; } $briefcase.=" <option value=\"ALU\">Alcatel-Lucent (ALU)</option> <option value=\"AREA\">Area /National</option> <option value=\"CATN\">Carolinas / Tennessee</option> <option value=\"CTX\">Central Texas</option> <option value=\"DEVICE\">Device</option> <option value=\"ERC\">ERC</option> <option value=\"FL\">Florida</option> <option value=\"GAAL\">Georgia / Alabama</option> <option value=\"HGC\">Houston Gulf Coast </option> <option value=\"SCTL\">South Central</option> <option>____________________________________________________</option> </select> </td> </tr> <tr> <td colspan=\"2\"> <textarea class=\"description\" name=\"description\">"; $briefcase.=stripslashes($calendar['description']); $briefcase.="</textarea> </td> </tr> </table><input type=\"hidden\" name=\"id\" value=\""; $briefcase.=$calendar['id']; $briefcase.="\"><br><br> <div style=\"text-align:center;\"><input type=\"image\" src=\"images/submit_button.png\" alt=\"Submit\" width=\"100\"></div></form>"; } return $briefcase; } function export_results($page_display) { $number=1; $briefcase=""; $current_event=""; foreach($page_display as $page) { $briefcase.="<tr><td rowspan=\"2\" style=\"border:1px solid #cccccc; text-align:center; font-size:10pt;\">"; $briefcase.=$number; $briefcase.="</td><td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=date("m/d/Y", strtotime($page['date'])); $briefcase.="</td>"; if($page['end_date']=="0000-00-00") { $briefcase.="<td style=\"border:1px solid #cccccc; font-size:10pt;\"> </td>"; } else { $briefcase.="<td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=date("m/d/Y", strtotime($page['end_date'])); $briefcase.="</td>"; } $the_month=date("m", strtotime($page['date'])); $month_number= ltrim($the_month, '0'); $the_year=date("Y", strtotime($page['date'])); $briefcase.="<td style=\"border:1px solid #cccccc; font-size:10pt;\"><a href=\"calendar.php?month="; $briefcase.=$month_number; $briefcase.="&year="; $briefcase.=$the_year; $briefcase.="&search="; $briefcase.=$page['id']; $briefcase.="\" style=\"text-decoration:none;\">"; $briefcase.="<span class=\""; if($page['region']=="ALU") { $briefcase.="ALU"; } if($page['region']=="AREA") { $briefcase.="AREA"; } if($page['region']=="CATN") { $briefcase.="CATN"; } if($page['region']=="CTX") { $briefcase.="CTX"; } if($page['region']=="Device") { $briefcase.="Device"; } if($page['region']=="ERC") { $briefcase.="ERC"; } if($page['region']=="FL") { $briefcase.="FL"; } if($page['region']=="GAAL") { $briefcase.="GAAL"; } if($page['region']=="HGC") { $briefcase.="HGC"; } if($page['region']=="SCTL") { $briefcase.="SCTL"; } $briefcase.="\" style=\"font-size:10pt;\">"; $briefcase.=stripslashes($page['short_name']); $briefcase.="</span></a></td><td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=$page['state']; $briefcase.="</td><td style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=$page['region']; $briefcase.="</td></tr>"; if(!trim($page['description'])=="") { $briefcase.="<tr><td colspan=\"5\" style=\"border:1px solid #cccccc; font-size:10pt;\">"; $briefcase.=stripslashes($page['description']); $briefcase.="</td></tr>"; } $number=$number+1; } return $briefcase; } public function csv_page($page_display) { $output=""; $heading=array('#', 'start date', 'end date', 'short name', 'state', 'region', 'description'); foreach ($heading as $val) { $output .=''.$val.','; } $output .="\n"; $filename="docs/page.csv"; header('Content-type:application/csv'); header('Content-Disposition: attachment; filename='.$filename); echo $output; } } ?>
Bootstrap Verizon was also a "first" in that I had to create a mobile version of their South Area Portal. This was a site I had originally built to house and faciliate several of their digital tools. Now, it had to be reformatted in order to be better accessible for users interacting with it on a mobile device. Click here to see the end result! Here's the code for the homepage:
<!DOCTYPE html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>South Territory Field Ops</title> <link rel="shortcut icon" href="http://southareanetwork.nss.vzwnet.com/images/verizon_favicon.ico"> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="css/bootstrap-theme.min.css"> <link rel="stylesheet" href="css/sticky_footer.css"> <link rel="stylesheet" href="css/stylesheet.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script> <script src="js/bootstrap.min.js"></script> <!-- SmartMenus css --> <link href="addons/bootstrap/jquery.smartmenus.bootstrap.css" rel="stylesheet"> <!-- SmartMenus jQuery plugin --> <script type="text/javascript" src="jquery.smartmenus.js"></script> <!-- SmartMenus jQuery Bootstrap Addon --> <script type="text/javascript" src="addons/bootstrap/jquery.smartmenus.bootstrap.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="js/jquery.fittext.js"></script> <script> $(document).ready(function() { $(".footer").fitText(4, { minFontSize: '8pt', maxFontSize: '12pt' }); $(".title_text").fitText(2.5, { minFontSize: '14pt', maxFontSize: '18pt' }); }); </script> <script language="JavaScript"> <!-- Clock -- var timerID = null var timerRunning = false function stopclock(){ if(timerRunning) clearTimeout(timerID) timerRunning = false } function startclock(){ stopclock() showtime() } function showtime(){ var now = new Date() var hours = now.getHours() var minutes = now.getMinutes() var seconds = now.getSeconds() var timeValue = "" + ((hours > 12) ? hours - 12 : hours) timeValue += ((minutes < 10) ? ":0" : ":") + minutes timeValue += ((seconds < 10) ? ":0" : ":") + seconds timeValue += (hours >= 12) ? " P.M." : " A.M." document.clock.face.value = timeValue timerID = setTimeout("showtime()",1000) timerRunning = true } //--> </script></head> <body onLoad="startclock()"> <header class="navbar-inverse" role="navigation" style="border-radius: 0;"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.php"> <img id="brand-image" alt="logo" src="images/new_logo_white.png"> </a> </div><div class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li class="active"><a href="index.php">home</a></li> <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">submarkets<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Carolinas / Tennessee<span class="caret"></span></a><!--http://jsfiddle.net/chirayu45/yxkut/16/--> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> </ul> </li> <li><a href="#">Project Management<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Site Tracker</a></li> </ul> </li> <li><a href="share_list.php">File Library</a></li> <li><a href="#" target="_blank">EOC Tool</a></li> <li><a href="#" target="_blank">Data Dashboard</a></li> </ul> </li> <li><a href="#">Florida<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> </ul> </li> <li><a href="#" target="_blank">NetOpsCom</a></li> <li><a href="#" target="_blank">NetTrac</a></li> <li><a href="#" target="_blank">EOC: Disaster Recovery</a></li> </ul> </li> <li><a href="#">Georgia / Alabama<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> </ul> </li> <li><a href="#" target="_blank">Network Newsletter</a></li> </ul> </li> <li><a href="#">Houston / Gulf Coast<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> </ul> </li> </ul> </li> <li><a href="#">South Central<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> <li><a href="#" target="_blank">SC Traffic Website</a></li> </ul> </li> </ul> </li> <li><a href="#">Central Texas<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> <li><a href="#" target="_blank">CTX Data Performance</a></li> </ul> </li> </ul> </li> <li><a href="#">W/B - Virginia<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> </ul> </li> </ul> </li> <li><a href="#">Southwest<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">KPI Performance</a></li> </ul> </li> </ul> </li> </ul> </li> <li><a href="#">planning<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">RF Planning<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Report Library</a></li> </ul> </li> <li><a href="#">Innovation & Efficiency<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">I &E Sharepoint</a></li> </ul> </li> <li><a href="#">Network Implementation<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Current Projects Update</a></li> </ul> </li> <li><a href="#">Power and Ground<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Team Website</a></li> </ul> </li> <li><a href="#">Transport<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Territory Reports</a></li> </ul> </li> </ul> </li> <li><a href="#">budget reports & support<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Tools and Reporting<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Current Development Project List</a></li> <li><a href="#">New Development Project Request</a></li> <li><a href="#" target="_blank">NSS Application Summary</a></li> <li><a href="#" target="_blank">NSS Portal</a></li> <li><a href="#" target="_blank">360 Survey Tool</a></li> <li><a href="#" target="_blank">Application List</a></li> <li><a href="#" target="_blank">Usage Report</a></li> </ul> </li> <li><a href="#">Financial Planning & Analysis<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Capital Budget Tool</a></li> <li><a href="#" target="_blank">Expense Budget Tool</a></li> <li><a href="#" target="_blank">CIP Dashboard</a></li> <li><a href="#" target="_blank">Capital Review Report</a></li> </ul> </li> <li><a href="#">Inventory<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Inventory Tool</a></li> </ul> </li> <li><a href="#">Real Estate / Regulatory<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">SARE Tracker</a></li> <li><a href="#" target="_blank">Network Compliance & Regulatory</a></li> <li><a href="#" target="_blank">Small Cell Sharepoint</a></li> <li><a href="#" target="_blank">South Territory RE Processes Folder</a></li> <li><a href="#">Environmental Compliance Form</a></li> <li><a href="#" target="_blank">HQ Real Estate Sharepoint</a></li> <li><a href="#" target="_blank">Territory Newsletter</a></li> <li><a href="#" target="_blank">Real Estate Contact List</a></li> </ul> </li> <li><a href="#">Code Administration<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Team Members</a></li> <li><a href="https://cloudsites.vzbi.com/sites/codeadmin" target="_blank">File Library</a></li> <li><a href="http://txslcarxpa1v.nss.vzwnet.com/CARRIE/eng/Lerg/index.cfm" target="_blank">CARRIE</a></li> </ul> </li> </ul> </li> <li><a href="#">engineering<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Engineering<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="https://cloudsites.vzbi.com/sites/SouthEngineering">ST Engineering Sharepoint</a></li> </ul> </li> </ul> </li> <li><a href="#">system performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Territory System Performance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="https://cloudsites.vzbi.com/sites/SouthEngineering" target="_blank">ST Performance Reporting & Tools</a></li> <li><a href="https://cloudsites.vzbi.com/sites/SAMonthlyReporting/_layouts/15/start.aspx#/SitePages/Home.aspx" target="_blank">Monthly Reporting Sharepoint</a></li> <li><a href="https://cloudsites.vzbi.com/sites/SouthSystemPerformance/" target="_blank">ST Performance Sharepoint</a></li> <li><a href="http://vacusawspa1v.nss.vzwnet.com/spdashboard/index.php" target="_blank">Executive Dashboard</a></li> <li><a href="http://saportal.south.vzwcorp.com/SolutionEffectiveness/Results" target="_blank">Solution Effectiveness</a></li> </ul> </li> <li><a href="#">HQ<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Nelson Interactive VoLTE Report</a></li> <li><a href="#" target="_blank">Monthly Reporting Sharepoint</a></li> <li><a href="#">Nielsen NMP</a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Data</a></li> <li><a href="#" target="_blank">Voice</a></li> </ul> </li> <li><a href="" target="_blank">Competitive VoLTE Drives</a></li> <li><a href="#" target="_blank">System Performance Analysis & Reporting</a></li> </ul> </li> </ul> </li> <li><a href="#">network operations<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Network Operations<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Translations Website</a></li> <li><a href="#" target="_blank">Remedy Reporting</a></li> <li><a href="#" target="_blank">National EBH Dashboard</a></li> <li><a href="#" target="_blank">Small Cell Sharepoint Site</a></li> </ul> </li> </ul> </li> <li><a href="#">reference<span class="caret"></span></a> <ul class="dropdown-menu" style="subMenusMaxWidth:900px;"> <li><a href="#">Quick Links<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="# target="_blank">Award Solutions Training Calendar</a></li> <li><a href="#" target="_blank">Purchasing Card Training Policy</a></li> <li><a href="#" target="_blank">VZW Schedule of Authorizations</a></li> <li><a href="#" target="_blank">Procurement / Purchasing Policy</a></li> <li><a href="#" target="_blank">Plant Property & Equipment (Capitalization Guideline)</a></li> <li><a href="#" target="_blank">Software Accounting Guideline</a></li> <li><a href="#">Site Facility Maintenance<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Site Facility Maintenance Process</a></li> <li><a href="#" target="_blank">Site Facility Maintenance Form</a></li> </ul> </li> <li><a href="#">Disaster Recover<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Disaster Initial Cost Estimate Form</a></li> <li><a href="#" target="_blank">EPDR Financial Form</a></li> <li><a href="#" target="_blank">Disaster PCard App Form</a></li> <li><a href="#" target="_blank">Regional Disaster Cost Tracking Form</a></li> <li><a href="#" target="_blank">Emergency Equipment Tracker Form</a></li> </ul> </li> </ul> </li> <li><a href="#">Organization<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">Professional Development</a></li> <li><a href="#" target="_blank">Award Solutions Training Calendar</a></li> <li><a href="#" target="_blank">Leadership Training Audio Files</a></li> </ul> </li> <li><a href="#">Systems<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" >File Library</a></li> </ul> </li> </ul> </li> <li><a href="#">executive reports<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Financial Planning & Analysis<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#" target="_blank">CIP Dashboard</a></li> <li><a href="#" target="_blank">Pipeline Reports</a></li> <li><a href="#" target="_blank">HQ Service Performance Analysis & Reporting</a></li> <li><a href="#" target="_blank">Executive Dashboard</a></li> </ul> </li> <li><a href="update_list.php">South Territory Weekly Highlights</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div> </header> <div class="container"><br> <div class="row"> <div class="col-md-2 col-xs-12" style="height:20px; border:1px solid #8c8a8a; background-color:#cccccc; text-align:center; border-top-left-radius:5px; border-top-right-radius:5px; font-variant:small-caps;"> <a href="#" target="_blank" style="color:#000000; text-decoration:none;">Dashboard</a></div> <div class="col-md-2 col-xs-12" style="height:20px; border:1px solid #8c8a8a; background-color:#cccccc; text-align:center; border-top-left-radius:5px; border-top-right-radius:5px; font-variant:small-caps;"> <a href="#" target="_blank" style="color:#000000; text-decoration:none;">Network Tools</a></div> <div class="col-md-2 col-xs-12" style="height:20px; border:1px solid #8c8a8a; background-color:#cccccc; text-align:center; border-top-left-radius:5px; border-top-right-radius:5px; font-variant:small-caps;"> <a href="#" target="_blank" style="color:#000000; text-decoration:none;">Exec Reports</a></div> <div class="col-md-2 col-xs-12" style="height:20px; border:1px solid #8c8a8a; background-color:#cccccc; text-align:center; border-top-left-radius:5px; border-top-right-radius:5px; font-variant:small-caps;"> <a href="#" style="color:#000000; text-decoration:none;">Project Request</a></div> <div class="col-md-4 col-xs-12" id="clockwork" style="height:20px; border:1px solid #8c8a8a; background-color:#5f5d5d; text-align:center; border-top-left-radius:5px; border-top-right-radius:5px; font-size:10pt; color:#ffffff;">Tuesday - April 12th, 2016</div> </div> <div class="row"> <div class="col-md-4 col-xs-12"><img src="images/quick_links.png" class="img-responsive center-block"> <ul> <li><a href="#" target="_blank" style="color:#000000; text-decoration:none;">Purchasing Card / Travel Policy</a></li> <li><a href="#" target="_blank" style="color:#000000; text-decoration:none;">VZW Schedule of Authorizations</a></li> <li><a href="#" target="_blank" style="color:#000000; text-decoration:none;">Procurement / Purchasing Policy</a></li> <li><a href="" target="_blank" style="color:#000000; text-decoration:none;">Plant Property & Equipment (Capitalization Guideline)</a></li> <li><a href="#" target="_blank" style="color:#000000; text-decoration:none;">Software Accounting Guideline</a></li> <li>Site Facility Maintenance</li> <li>Disaster Recover</li> </ul> </div> <div class="col-md-4 col-xs-12"><img src="images/headlines.png" class="img-responsive center-block"><a href="../Photos/adage-logo[1].jpg" target="_blank"><img src="../Photos/thumbnails/adage-logo[1].jpg" width="65" border="0" style="float:left; margin:3px;"></a>A recent article in "Advertising Age" mentioned Verizon's recent partnering with a well known advertising agency...<br /><br />Verizon, the nation's largest wireless carrier, has tapped <a class="directory_entry" style="background-color: #ffffff;" title="Ad Age LookBook" href="http://adage.com/directory/wieden-kennedy/6468">Wieden & Kennedy</a> for brand work, Ad Age has learned. <p>According to people familiar with the matter, the marketer is enlisting Wieden to handle creative and strategy...<br><br><a href="../article.php?id=36">read more...</a><br><br></div> <div class="col-md-4 col-xs-12"><img src="images/reports.png" class="img-responsive center-block"> <ul class="quick_links"><li class="quick_links"><a href="#" target="_blank" style="color:#000000; text-decoration:none;">CIP Dashboard</a></li> <li class="quick_links"><a href="#" target="_blank" style="color:#000000; text-decoration:none;">Pipleline Reports</a></li> <li class="quick_links"><a href="#" target="_blank" style="color:#000000; text-decoration:none;">HQ Service Performance Analysis & Reporting</a></li> <li class="quick_links"><a href="" target="_blank" style="color:#000000; text-decoration:none;">Executive Dashboard</a></li> </ul> </div> </div> <div class="row"> <div class="col-md-6 col-xs-12"><a href="article.php?id=40"><img src="images/arpana.jpg" border="0" class="img-responsive center-block"></a></div> <div class="col-md-6 col-xs-12"><a href="../images/NewMarketMap.jpg" target="_blank"><img src="images/map.jpg" class="img-responsive center-block" border="0"></a></div> </div> </div> </div> <!-- close site_content --> <div class="footer" style="padding-top:2px;">© Verizon Wireless | South Area | All Rights Reserved | <a href="#" style="color:#ffffff; text-decoration:none;">Sign In</a> | <a href="#" style="color:#ffffff; text-decoration:none;">Contact</a></div>
2017 -> Applied Health Analytics | Software Developer - PHP (MVC Architectures), JQuery, Node, Laravel
Bruce, you're one of the most dedicated development team members and are always reliable. Your skill at methodically learning and documenting your work is impressive and the standard that all developers should hold themselves to. The client facing communcation that you have with out clients (such as WWOL) is fantastic and the fact that you're always cognizant that you're representing AHA when you do is great... ...this is a portion of my most recent review at my current employer. Click here to read the full review Nathan Hill Director, Application Development and Research Applied Health Analytics
After my contract with Verizon was concluded, I did a couple of other temporary contract jobs before I was offered a full time position with Applied Health Analytics where I am currently employed. Landing Pages (JQuery API | Bootstrap) "Landing Pages" are what an employer that's partnered with Applied Health Analytics will use as a way to inform their employees about the wellness initiatives that are available and how to access them. They're a part of AHA's storefront and involve a fairly significant amount of backend code to facilitate logging in and listing the various screening events that are particular to that employer. I was handed this project when I first started. Although it was understood that many of the users would be on a mobile device, the site itself was not mobile friendly. In addition, it was based on the "Blitz" framework for which there is very little documentation. Click here to see the "before" and click here to see the "after" version. The user will engage an API on the backend that both validates the user and then routes them according to the way their company's settings dictate. Below is a portion of that API:
<?php require_once (WEBROOT . 'lib/functions.php'); // this is the portion of the code that provides the database connection if ($_SERVER['REQUEST_METHOD'] == "POST") { // this grabs the criteria from the incoming URL and dictates the flow of the code $action = isset($_GET['p']) ? $_GET['p'] : ''; $displayLinks = isset($_GET['displayLinks']) ? $_GET['displayLinks'] : ''; $linkType = isset($_GET['linkType']) ? $_GET['linkType'] : ''; $spanishAlert = isset($_GET['spanishAlert']) ? $_GET['spanishAlert'] : ''; //die(var_dump($_POST, $_GET)); switch ($action) { case 'verify': verifyUserImproved($_POST, $displayLinks, $linkType, $spanishAlert); // this is generally the starting point where the user is getting validated and then routed to the d11 function break; case 'd11': d11($_POST); break; // there's more to the code, but this is an abbreviated example. Initially, the user has to be verified, which is the "verifyUserImproved" function } } function d11($frmData) { include ('custom_colors.php'); $frmData['ui'] = decrypt(decryptVals($frmData['ui'])[0], decryptVals($frmData['ui'])[1]); global $CN; // ONE OFF needs FIXING USED for auto populating sub-survey groups $oneOffEmpIDArray = [ 6100, 7015, 7016, 5313 ]; if($frmData['ui']=="") { $usrID=null; } else { $usrID=$frmData['ui']; } $survey = findSurvey($frmData['ei'], $usrID); $survey_guid = buildGUID(array( 'empSurveyUsername' => $survey['credUsername'], 'empSurveyPassword' => decrypt($survey['credPassIV'], $survey['credPass']), 'usrLang' => '', 'empID' => $survey['empID'], 'hID' => $survey['hID'], 'usrVerified'=>1, 'usrID' => $frmData['ui'] )); $sql = "SELECT E.empID, Ev.evEnableSignup, E.empName, X.evID, Ev.evName, C.cmpSubDomain FROM Events_X_Employers X INNER JOIN Employers E ON E.empID=X.empID INNER JOIN Events Ev ON Ev.evID=X.evID INNER JOIN Components C ON E.cmpID=C.cmpID WHERE E.empID=? AND Ev.evSignupCutoff>GETDATE() AND Ev.evtID = 2"; $stmt = $CN->prepare($sql); $stmt->execute(array( $frmData['ei'] )); $es = $stmt->fetchAll(PDO::FETCH_ASSOC); if (! empty($es)) { $out .= "<br><span style='color: {$prettyColor}; font-weight:bold; font-size:10pt;'>Step Three: Take Your Personal Health Survey</span>"; $out .= "<br><br><span style=\"color:{$prettyColor}; font-size:10pt; font-weight:normal;\">Click</span> <a href='https://www.personalhealthsurvey.net/login.php?{$survey_guid}' style=\"color: {$prettyColor}; font-weight:bold; font-size:10pt;\">here</a> <span style=\"color:#000000; font-size:10pt; font-weight:normal;\">to take your Personal Health Survey.</span></div>"; } else { $out="<script>$('#header_text').html('There are no Screening Events scheduled at this time.<br>Proceed to your Personal Health Survey.');</script>"; $out .="<div style=\"text-align:left; display:inline-block; width:100%;\"><br><b><span style='color: {$prettyColor}; font-weight:bold; font-size:10pt;'>Step Two: There are no Screening Events scheduled at this time...</span><br>"; $out .= "<br><span style='color: {$prettyColor}; font-weight:bold; font-size:10pt;'>Step Three: Take Your Personal Health Survey</span>"; $out .= "<br><br><span style=\"color:{$prettyColor}; font-size:10pt; font-weight:normal;\">Click</span> <a href='https://www.personalhealthsurvey.net/login.php?{$survey_guid}' style=\"color: {$prettyColor}; font-weight:bold; font-size:10pt;\">here</a> <span style=\"color:#000000; font-size:10pt; font-weight:normal;\">to take your Personal Health Survey.</span></div>"; } echo $out; } function verifyUserImproved(Array $params, $displayLinks, $linkType, $spanishAlert) // here's where the user is getting validated and a JQuery form dynamic is placed in a hidden div { global $CN; if (isset($params['empID'])) { // the SELECT statement is being built according to the type of parameters that are being sent by the Landing Page $params['empID'] = (int) $params['empID']; } if (isset($params['cpID'])) { $params['cpID'] = (int) $params['cpID']; } if (isset($params['empPID'])){ $params['empPID'] = (int) $params['empPID']; } include ('custom_colors.php'); // custom color page that dictates color scheme according to Employee ID $out= <<<OUT // here's the JQuery form <input type="hidden" name="usrID" id="usrID" value="{{usrID}}"> <input type="hidden" name="usrFN" id="usrFN" value="{{usrFN}}"> <input type="hidden" name="usrLN" id="usrLN" value="{{usrLN}}"> <input type="hidden" name="usrVerified" id="usrVerified" value="{{usrVerified}}"> <br><div style="display:inline-block; border:1px solid #cccccc; width:auto: height:35px; padding:10px; font-weight:bold;">{{usrFN}} {{usrLN}} | {{usrCity}} {{usrState}}, {{usrZip}}</div> <br><br> <div class="buttonWrapper"><input class="btnConfirmYes" type="button" name="verifyUseryes" id="verifyUseryes" value="Yes"></div> <div class="buttonWrapper"><input class="btnConfirmNo" type="button" name="verifyUser" id="verifyUserno" value="No"></div><br><br> </form> OUT; if (isset($params['test'])) { $testing = true; unset($params['test']); echo $out; } $where = ''; $values = []; foreach ($params as $key => $val) { // second stage of the SELECT construction if (end($params) != $val) { if ($key == 'usrSSN' || $key == 'usrEEID') { $where .= " $key LIKE ? AND "; } else { $where .= " $key = ? AND "; } } else { if ($key == 'usrSSN' || $key == 'usrEEID') { $where .= " $key LIKE ?"; } else { $where .= " $key = ?"; } } if ($key == 'usrSSN' || $key == 'usrEEID') { array_push($values, "%{$val}"); } else { array_push($values, $val); } } try { $sql = "SELECT usrID ,E.empID ,usrEEID ,usrFN ,usrLN ,usrDOB ,usrCity ,usrState ,usrZip ,usrUsername ,usrPassword FROM hraUsers U INNER JOIN Employers E on U.empID = E.empID INNER JOIN ChannelPartners CP on E.cpID = CP.cpID WHERE $where"; $stmt = $CN->prepare($sql); $stmt->execute($values); $result = $stmt->fetch(PDO::FETCH_ASSOC); } catch (PDOException $e) { echo "There was an Error verifying this user. If this continue contact the helpdesk."; } if (! empty($result)) { $replace = [ '{{usrID}}', '{{usrFN}}', '{{usrLN}}', '{{usrCity}}', '{{usrState}}', '{{usrZip}}', '{{usrVerified}}' ]; $values = [ $result['usrID'], $result['usrFN'], $result['usrLN'], $result['usrCity'], $result['usrState'], $result['usrZip'], 'true' ]; $out .= "<div id='extras' style='display: none'>"; ob_start(); if ($displayLinks == 'true') { getEventsByEmployerId($result['usrDOB'], $result['usrEEID']); } $usrID = in_array($result['empID'], $subSurveyGroupArray) ? $result['usrID'] : null; $survey = findSurvey($result['empID'], $usrID); $survey_guid = buildGUID(array( // function that builds the encrypted URL user will have access to so that they can login to Personal Health Survey 'empSurveyUsername' => $survey['credUsername'], 'empSurveyPassword' => decrypt($survey['credPassIV'], $survey['credPass']), 'usrLang' => '', 'empID' => $survey['empID'], 'hID' => $survey['hID'], 'usrVerified' => 1, 'usrID' => $result['usrID'] )); if ($linkType == 'surveyevents') { $result['usrID'] = encryptVals($result['usrID']); $out .= <<<OUT <script> $('#header_text').html('Click on the "Yes" button if the name listed below is you.<br>Otherwise, click "No."'); // portion of the Landing Page that will display text depending on how the validation process resolves $('#verifyUseryes').click(function($event){ //event.preventDefault(); $.post('api_nex.php?p=d11', {'ui':'{$result['usrID']}', 'ei':'{$result['empID']}'}, function(data){ // here's the other portion of the JQuery form dyamic where it's posting back to the same page, only now being routed to the d11 function $('#window').show(); $('#window').html(data); }); }); $('#verifyUserno').click(function(){ location.reload(); $('#step_1').show(); $('#window').hide(); }); </script> OUT; } $out = str_replace($replace, $values, $out); echo $out; } else { echo "<script>$('#header_text').html('<span style=\"color:red;\">We were unable to match the information you provided.<br>Please try again!</span><br><br>');$('#step_1').show();</script>"; // in case the user doesn't get validated } } // functions to encrypt / decrypt data function encryptVals($val) { list ($iv, $data) = encrypt($val); $explodediv = str_split($iv, 10); $explodedata = str_split($data, 10); $combined = ''; for ($i = 0; $i < count($explodedata); $i ++) { $combined .= "{$explodediv[$i]}{$explodedata[$i]}"; } return $combined; } function decryptVals($passData) { $explodereturn = str_split($passData, 20); $returnVals = []; for ($i = 0; $i < count($explodereturn); $i ++) { if ($i < 3) { $returnVals[0] .= substr($explodereturn[$i], 0, 10); $returnVals[1] .= substr($explodereturn[$i], - 10); } else if ($i == 3) { $returnVals[0] .= substr($explodereturn[$i], 0, 2); $returnVals[1] .= substr($explodereturn[$i], 2, 18); } else { $returnVals[1] .= substr($explodereturn[$i], - 20); } } return $returnVals; }
Node.js / Oauth Authentication / JWT /Fitbit Recently, a decison was made to reformat our flagship applications using the MERN stack. Part of that effort included a piece of syntax that allowed our user to login to Fitbit using our GUI. It incorporated the JWT dynamic as well as some basic Node.js. Here's a portion of that code:
this is the app.js file /* To test this puppy, just run localhost:5000/authentication/create in tandem with Postman. You'll need the fields you see in the create.js controller. The token you'll need to authenticate will show up in your console after running the code */ require("dotenv").config(); const express = require("express"); const mongoose = require("mongoose"); const bodyParser = require("body-parser"); const app = express(); const conn = process.env.CONNECTION; app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); const authRoutes = require("./routes/auth"); const createRoutes = require("./routes/create"); app.use(authRoutes); app.use(createRoutes); mongoose .connect(conn) .then(result => { app.listen(5000); }) .catch(err => { console.log(err); }); this is the auth.js file that confirms the incoming token is valid, looks at the payload and ensures the email address matches one in the database... const superPassword = process.env.SIGNATURE; const jwt = require("jsonwebtoken"); const User = require("../models/user"); exports.postAuthenticate = (req, res, next) => { jwt.verify(req.token, superPassword, (err, authData) => { res.json({ authData: authData }); if (err) { res.sendStatus(403); } else { User.findOne({ email: authData.user.email }).then(user => { if (!user) { res.json({ message: "nonauthenticated" }); } else { res.json({ message: "authenticated", user_id: user._id }); } }); } }); }; this is the create.js file that adds a user to the database for testing purposes and displays the JWT that can be used in the Postman application for testing purposes const bcrypt = require("bcryptjs"); const { validationResult } = require("express-validator/check"); const jwt = require("jsonwebtoken"); const superPassword = process.env.SIGNATURE; const User = require("../models/user"); exports.postCreate = (req, res, next) => { console.log(req.body); const first_name = req.body.first_name; const last_name = req.body.last_name; const user_name = req.body.user_name; const dob = req.body.dob; const email = req.body.email; const password = req.body.password; const errors = validationResult(req); if (!errors.isEmpty()) { res.json({ message: "form fields are not correct" }); validationErrors: errors.array(); //send the specific errors in case it's needed console.log(errors); } //incoming values are legit, now we see if the incoming user is already in the database else { User.findOne({ email: email }) //look to see if user already exists in the database .then(user => { if (user) { res.json({ message: "user already exists in database" }); } else { bcrypt .hash(password, 12) .then(hashedPassword => { const user = new User({ first_name: first_name, last_name: last_name, username: user_name, dob: dob, email: email, password: hashedPassword }); return user.save(); }) .then(result => { //the first line is commented out, although you can include it if you want to specify an expiration time // jwt.sign({ user: user }, superPassword, { expiresIn: "30s" }, (err, token) => { const tokenUser = { //user minus the encrypted password first_name: first_name, last_name: last_name, email: email, username: user_name }; jwt.sign({ user: tokenUser }, superPassword, (err, token) => { res.json({ message: "new user is successfully created", token: token //this is what you can use in a testing situation to ensure the JWT dynamic is working properly }); }); }) .catch(err => { console.log(err); res.json({ message: "something went wrong with the insert query" }); }); } }); } };
This is the Controller that I built which reached out to a user's Fitbit application and downloaded their data into a local database:
const { validationResult } = require("express-validator/check"); const mongoose = require("mongoose"); const Profile = require('./profile.model'); const ClientId = process.env.CLIENTID; const Secret = process.env.SECRET; const Callback = process.env.CALLBACK; //this is the empID you're getting from AHA const empID = 7747; //get today's date let date_ob = new Date(); // current date // adjust 0 before single digit date let date = ("0" + date_ob.getDate()).slice(-2); // current month let month = ("0" + (date_ob.getMonth() + 1)).slice(-2); // current year let year = date_ob.getFullYear(); // prints date in YYYY-MM-DD format let today = year + "-" + month + "-" + date; const FitbitApiClient = require("fitbit-node"); const client = new FitbitApiClient({ clientId: ClientId, //client_id clientSecret: Secret, //client secret apiVersion: "1.2" // 1.2 is the default }); function getCallback(req, res, next) { const yesterday_raw = new Date(new Date().setDate(new Date().getDate() - 1)); const yesterday = yesterday_raw.toISOString().slice(0, 10); client.getAccessToken(req.query.code, Callback).then(result => { var requests = [ client.get("/profile.json", result.access_token), //0 client.get("/activities/date/today.json", result.access_token), //1 //client.get("/sleep/date/" + yesterday + ".json", result.access_token), //2 client.get("/sleep/date/today.json", result.access_token), //2 //client.get("/sleep/date/2019-11-05.json", result.access_token), //2 client.get( "/foods/log/caloriesIn/date/today/1d.json", result.access_token ), //dailly intake of calories 3 client.get("/foods/log/water/date/today.json", result.access_token), // 4 this works! client.get("/activities/heart/date/today/1d.json", result.access_token), //5 client.get("/body/log/weight/goal.json", result.access_token, undefined, { "Accept-Language": "en_US" }), //6 client.get("/activities/date/" + yesterday + ".json", result.access_token) //7 ]; Promise.all(requests) .then(data => { //profile info const firstName = data[0][0].user.firstName; //0 const lastName = data[0][0].user.lastName; //0 const dateOfBirth = data[0][0].user.dateOfBirth; //0 const gender = data[0][0].user.gender; //0 //calorie goals - to be burned including BMR const calories_goal = JSON.stringify(data[1][0]["goals"].calories); //1 calorie goal const massive_total = JSON.stringify(data[1][0].summary.calories.total); //1 big calorie total const BMR = JSON.stringify(data[1][0].summary.calories.bmr); //1 - BMR const calories_burned = massive_total - BMR; //sleep const slumber = JSON.stringify( data[2][0].summary.totalMinutesAsleep / 60 ); //2 total sleep hours const sleep = JSON.stringify(Math.round(slumber * 10) / 10); const rem_sleep = data[2][0]["sleep"].length ? data[2][0]["summary"].stages.rem : 0; //minutes in deep REM sleep //nutrition const eating = JSON.stringify( data[3][0]["foods-log-caloriesIn"][0].value ); //3 const caloriesIn = eating.replace(/\"/g, ""); //water const water = JSON.stringify(data[4][0].summary.water); //heart rate const rhr = JSON.stringify( data[5][0]["activities-heart"][0].value.restingHeartRate ); //body weight goal //res.setHeader('Accept-Language', 'en_US') const startWeight = JSON.stringify(data[6][0].goal.startWeight); const targetWeight = JSON.stringify(data[6][0].goal.weight); //res.send(targetWeight); //steps const totalStepsYesterday = JSON.stringify(data[7][0].summary.steps); const totalStepsSoFar = JSON.stringify(data[1][0].summary.steps); //console.log("here's where you're putting our INSERT code"); Profile.findOne({ empID: empID, todaysDate: today }) .then(person => { if (person) { // console.log(person[0][0].empID); console.log(calories_burned); person.empID = empID; person.firstName = firstName; person.lastName = lastName; person.dateOfBirth = dateOfBirth; person.gender = gender; person.bodyStartWeight = startWeight; person.bodyTargetWeight = targetWeight; person.calorieGoal = calories_goal; person.caloriesConsumed = caloriesIn; person.caloriesBurned = calories_burned; person.waterConsumpution = water; person.BMR = BMR; person.totalHoursSlept = sleep; person.REM = rem_sleep; person.RHR = rhr; person.totalStepsYesterday = totalStepsYesterday; person.totalStepsSoFar = totalStepsSoFar; person .save() .then(result => { console.log("updated"); res.redirect("/update"); }) .catch(err => { const error = new Error(err); return next(error); }); } else { const profile = new Profile({ empID: empID, todaysDate: today, firstName: firstName, lastName: lastName, dateOfBirth: dateOfBirth, gender: gender, bodyStartWeight: startWeight, bodyTargetWeight: targetWeight, calorieGoal: calories_goal, caloriesConsumed: caloriesIn, caloriesBurned: calories_burned, waterConsumpution: water, BMR: BMR, totalHoursSlept: sleep, REM: rem_sleep, RHR: rhr, totalStepsYesterday: totalStepsYesterday, totalStepsSoFar: totalStepsSoFar }); profile .save() .then(result => { console.log("got it done"); res.redirect("/success"); }) .catch(err => { const error = new Error(err); error.httpStatusCode = 500; return next(error); }); } }) .catch(err => { const error = new Error(err); return next(error); }); }) // end of update or insert .catch(err => { const error = new Error(err); error.httpStatusCode = 500; return next(error); }); }); }; function getSuccess(req, res, next){ res.status(200).render("authorize/success", { pageTitle: "Success", path: "/success" }); }; function getUpdate(req, res, next) { res.status(200).render("authorize/update", { pageTitle: "Success", path: "/update" }); }; module.exports = { getCallback, getSuccess, getUpdate };
Docker Docker was implemented as part of the project that transferred data from a user's wearable to a local database. In addition, "containerization" is the paradigm we're using now as part of retooling a Nodejs app that my shop recently developed. Installing and running a Docker server is therefore something I'm very comfortable with. React Native / Angular.js As part of my professional development, I've taken some courses in React Native as well as Angular.js. You can see samples of that work / code by clicking on the images to the left that will connect you to the notes I took as part of those courses. The React Native Course offered a "Certificate of Completion" which you can access by clicking here. Symfony / Laravel / Vue.js Symfony While the Applied Health Analytics applications are built using the Blitz framework, being comfortable with Symfony was still considered a healthy skillset to have. So, again, as part of my professional development, I was encouraged to complete some basic Symfony training. You can access the "Certificate of Completion" by clicking here. Laravel Laravel has become a new favorite, not so much in the context of my current employer - although there are some obvious correlations given the fact that Laravel is built on top of a Symfony paradigm - but because of some independent consulting I've been doing on my own. You can click on the screenshot to the right to see a project that I'm working on now for a medical consultant based out of California. It's not completed, but you can nevertheless see evidence of an ability to incorporate custom code alongside a Bootstrap template. In addition, here are some Code Samples that facilitate some basic CRUD tasks including the routing, views and controllers.
 Administrative Suite
• Admin Routes:
Route::prefix('admin')->group(function() { Route::get('/dashboard', 'AdminController@dashboard')->name('adminDashboard'); Route::get('/users', 'AdminController@dashboard')->name('adminUsers'); Route::get('/list/page', 'PageController@index')->name('adminListPages'); Route::get('/insert/page', 'PageController@insertPage')->name('adminInsertPage'); Route::get('/show/page/{id}', 'PageController@show')->name('adminShowPage'); Route::post('/edit/page', 'PageController@edit')->name('adminEditPage'); Route::post('/create/page', 'PageController@store')->name('adminStorePage'); Route::post('/update/page', 'PageController@update')->name('adminUpdatePage'); Route::post('/delete/page/{id}', 'PageController@destroy')->name('adminDeletePage'); });
• Views This is the "insertPage.blade.php" file that allows a user to insert a new page...
@extends('../layouts.satellite') @section('content') <!-- Section: intro --> <section id="intro" class="intro"> <div class="satellite-content"> <div class="container"> <div class="row"> <div class="col-xs-12 satellite_row"> <h5>NOMAS<sup>®</sup> International Admin New Page Form</h5> <div class="row"> <div class="col-xs-12"> Hello, {{ Auth::user()->name }}! <br><br> To create a new page, simply enter your information using the fields below and click on "submit." <br><br> If you have any questions or need any assistance, contact Bruce Gust at <a href="mailto:bruce@brucegust.com">bruce@brucegust.com</a>. <br><br> Thanks! </div> </div> <div class="row"> <div class="col-xs-12"><hr></div> </div> @if($errors->any()) <div class="alert alert-danger"> <ul> @foreach($errors->all() as $error) <li>{{ $error }} </li> @endforeach </ul> </div> @endif <form method="Post" action="{{ route('adminStorePage') }}"> <div class="form-group"> <input type="hidden" value="{{csrf_token()}}" name="_token"> <div class="row"> <div class="col-xs-12"> <label for="title">Page Title</label> <input type="text" class="form-control" name="title" id="title" value="{{ old('title') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="title">Body</label> <textarea class="form-control" id="body" name="body">{{ old('body') }}</textarea> </div> </div> <div class="row"> <div class="col-xs-12" style="text-align:center;"><input type="hidden" name="user_id" value="{{Auth::user()->id}}"><br> <input type="image" name="submit" src="{{ asset('assets/img/nomas_submit.jpg') }}" style="width:150px;"> </div> </div></form> </div> </form> </div> </div> </div> </div> </section> @endsection
• Controller Here's the "PageController" that provides all of the GET and POST dynamics that allow the administrator to add, edit, list and delete all of the site's page content.
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Page; use App\Http\Requests\UpdatePageRequest; use App\Http\Requests\CreatePageRequest; //use App\Http\Resources\Page as PageResource; //for Vue.js display use View; use Redirect; class PageController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function __construct() { $this->middleware('checkRole: admin'); } public function insertPage() { return view('admin.insertPage'); } public function index() { //get pages $pages = Page::all(); //return view('admin/listPages', ['pages'=>$pages]); return view('admin/listPages', compact('pages')); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(CreatePageRequest $request) { //$page = $request->isMethod('PUT') ? Page::findOrFail($request->page_id) : new Page; //ternary IF statement determining whether or not this is a new Page or not $page = new Page; $page->id = $request->input('page_id'); $page->title=$request->input('title'); $page->body=$request->input('body'); $page->userId=$request->input('user_id'); $success='Page was successfully created!'; if($page->save()) { return View::make('/admin/displayPage') ->with('page', $page) ->with('newPage', 'Here\'s the page you just entered!'); } } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // $page=Page::findOrFail($id); return view('/admin/showPage', compact('page')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Request $request) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(UpdatePageRequest $request) { // $page=Page::findOrFail($request->page_id); $page->title=$request->input('title'); $page->body=$request->input('body'); $page->userId=$request->input('user_id'); $success='Page was successfully created!'; if($page->save()) { return View::make('/admin/displayPage') ->with('page', $page) ->with('newPage', 'Here\'s the page you just edited!'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // $page=Page::findOrFail($id); if($page->delete()) { return back(); } } }
Here's some more advanced coding examples.
 Paginated List with Sort Feature
To make this happen, you've got add a couple elements. First in your Model, you need to add the Kyslick feature: • Model
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Kyslik\ColumnSortable\Sortable; class Professional extends Model { // use Sortable; protected $fillable = ['lname']; public $sortable = ['lname', 'cert_year', 'discipline', 'country']; }
• Controller ...and then in your Controller:
public function professionals($id) { $pages = Page::findOrFail($id); $pros = Professional::sortable()->orderBy('lname', 'asc')->paginate(25); $data = [ 'pages' => $pages, 'pros'=>$pros ]; return view('pros', $data); }
 Contact Page w/ Checkboxes
This contact page features check boxes that give the user the ability to define what kind of information they're looking for. In addition, one of the options allows the user to update their profile. If they choose that option, the "comments" field is hidden and the terms of the "request" are changed. It looks like this: Here's the form (blade) itself:
<form method="Post" action="{{ route('contact_processor') }}"> <div class="row"> <div class="col-md-6 col-xs-12"> <input class="form-check-input" type="checkbox" value="license" name="myCheckboxes[]" {{ (is_array(old('myCheckboxes')) && in_array('license', old('myCheckboxes'))) ? 'checked' : '' }} > NOMAS<sup>®</sup> License Renewal </div> <div class="col-md-6 col-xs-12"> <input class="form-check-input" type="checkbox" value="training" name="myCheckboxes[]" {{ (is_array(old('myCheckboxes')) && in_array('training', old('myCheckboxes'))) ? 'checked' : '' }} > NOMAS<sup>®</sup> NOMASĀ® Training (send brochure or ask question) </div> </div> <div class="row"> <div class="col-md-6 col-xs-12"> <input class="form-check-input" type="checkbox" value="questions" name="myCheckboxes[]" {{ (is_array(old('myCheckboxes')) && in_array('questions', old('myCheckboxes'))) ? 'checked' : '' }} > NOMAS<sup>®</sup> Online Continuing Education (questions/problems) </div> <div class="col-md-6 col-xs-12"> <input class="form-check-input" type="checkbox" value="update" name="myCheckboxes[]" id="other_checkbox" {{ (is_array(old('myCheckboxes')) && in_array('update', old('myCheckboxes'))) ? 'checked' : '' }} > Update my NOMAS<sup>®</sup> Registry listing </div> </div> <div class="row"> <div class="col-xs-12"> <input class="form-check-input" type="checkbox" value="other" name="myCheckboxes[]" {{ (is_array(old('myCheckboxes')) && in_array('other', old('myCheckboxes'))) ? 'checked' : '' }} > Other </div> </div> <hr style="border-top:1px solid #7a7979;"> <br> <div class="form-group"> @if($errors->any()) <div class="alert alert-danger"> <ul> @foreach($errors->all() as $error) <li>{{ $error }} </li> @endforeach </ul> </div> @endif <input type="hidden" value="{{csrf_token()}}" name="_token"> <div class="row"> <div class="col-xs-12"> <label for="name">Name</label> <input type="text" class="form-control" name="name" id="name" value="{{ old('name') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">email</label> <input type="text" class="form-control" name="email" id="email" value="{{ old('email') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">Occupation</label> <input type="text" class="form-control" name="occupation" id="occupation" value="{{ old('occupation') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">Address 1</label> <input type="text" class="form-control" name="address_1" id="address_1" value="{{ old('address_1') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">Address 2</label> <input type="text" class="form-control" name="address_2" id="address_2" value="{{ old('address_2') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">City</label> <input type="text" class="form-control" name="city" id="city" value="{{ old('city') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">State</label> <input type="text" class="form-control" name="state" id="state" value="{{ old('state') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">Country</label> <input type="text" class="form-control" name="country" id="country" value="{{ old('state') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">Postal Code</label> <input type="text" class="form-control" name="postal_code" id="postal_code" value="{{ old('postal_code') }}"> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="name">Phone</label> <input type="text" class="form-control" name="phone" id="phone" value="{{ old('phone') }}"> </div> </div> <div id="comment_section"> <div class="row"> <div class="col-xs-12"> <label for="comments">Comments</label> <textarea class="form-control" name="comments" id="comments">{{ old('comments') }}</textarea> </div> </div> </div> <div class="row"> <div class="col-xs-12" style="text-align:center;"> <input type="image" name="submit" src="{{ asset('assets/img/nomas_submit.jpg') }}" style="width:150px;"> </div> </div> </div> </form> <script> $(document).ready(function() { $('#other_checkbox').click(function() { if($(this).prop("checked")==true) { $('#comment_section').toggle(); } else { $('#comment_section').toggle(); } }); }); </script>
rather than each checkbox being distinguished by a different name, in this instance, it will be their value that will serve as the unique identifier each checkbox has the same name. The result will be an array and it's that "collection" that will be evaluated to ensure that at least one check box was "checked" if the "other_checkbox," which is the checkbox a user will check if they want to update their profile information, is checked, the "comment" field will be hidden This is the Controller...
public function contact_processor(ContactRequest $request) { $data = $request->validated(); $info=request(); if( in_array("update", $request->myCheckboxes) ) { $the_user = Auth::user()->id; $user=User::findOrFail($the_user); $user->name=$request->input('name'); $user->email=$request->input('email'); if($user->save()) { >return view('contact_update_confirm', compact('info')); } } else { Mail::to('bruce@brucegust.com')->send(new ContactInfoRequest($data)); return view('contact_update_confirm', compact('info')); } }
the first thing to notice is the fact that you've got a "request," which looks like this:
<?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class ContactRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $rules = [ 'name'=> 'required', 'email' => 'required', 'occupation' => 'required', 'address_1' => 'required', 'city' => 'required', 'state' => 'required', 'postal_code' => 'required', 'country' => 'required', 'phone' => 'required',
a
'myCheckboxes' => 'required' ];
b
if($this->myCheckboxes && ! in_array("update", $this->myCheckboxes)) { $rules['comments'] = 'required'; } return $rules; } public function messages() { return [ 'name.required' => 'your name is required!', 'email.required' => 'your email is required!', 'address_1.required' => 'the first line of your address is required', 'city.required' => 'your city is required!', 'state.required' => 'your state is required!', 'postal_code.required' => 'your postal code is required!', 'country.required' => 'your country is required!', 'phone.required' => 'your phone number is required!', 'comments.required' => 'don\'t forget to put something in the comment section!', 'myCheckboxes.required' => 'be sure to put a checkmark in at least one of the check boxes' ]; } }
a
make sure at least one of the "myCheckboxes" is checked
b
only if the "update" checkbox is not checked do you check for "comments" if the "update" checkbox has been checked, then update the profile of the user that's logged in we're going to send the administrator an email. That's going to look like this:
<?php namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; class ContactInfoRequest extends Mailable { use Queueable, SerializesModels; public $data; /** * Create a new message instance. * * @return void */ public function __construct($data) { //
a
$this->data=$data; } /** * Build the message. * * @return $this */ public function build() {
b
return $this->markdown('emails.contact_info_request'); } }
a
grab the incoming data
b
send out the incoming data to the "contact_info_request" view. From there it will go out as an email let the user know their request for information has been sent with the "contact_update_confirm" blade
 Vue.js
Vue.js has become an icon within Laravel. While a conventional approach to CRUD tasks is still more than appropriate, the "SPA" dynamic can be very useful. Here are some examples of Vue.js being deployed in the context of a basic administrative suite:
Here's the "app.js" file that goes along with what you see above:
/** * First we will load all of this project's JavaScript dependencies which * includes Vue and other libraries. It is a great starting point when * building robust, powerful web applications using Vue and Laravel. */ require('./bootstrap'); window.Vue = require('vue'); /** * The following block of code may be used to automatically register your * Vue components. It will recursively scan this directory for the Vue * components and automatically register them with their "basename". * * Eg. ./components/ExampleComponent.vue -> */ // const files = require.context('./', true, /\.vue$/i) // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)) Vue.component('navbar', require('./components/Navbar.vue').default); Vue.component('articles', require('./components/Articles.vue').default); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ const app = new Vue({ el: '#app', });
For more code and commentary, please visit the notes that go along with this project at http://brucegust.com/adm/laravel#nomas.
<     >