Commit 6ec6e6bb by cam

removed last remaining envoy references and added image to login page

parent cd6b2e67
...@@ -7,7 +7,7 @@ uses ...@@ -7,7 +7,7 @@ uses
XData.Web.Client; XData.Web.Client;
const const
TOKEN_NAME = 'WEBENVOYCALLS_TOKEN'; TOKEN_NAME = 'KG_ORDERS_WEB_TOKEN';
type type
TOnLoginSuccess = reference to procedure; TOnLoginSuccess = reference to procedure;
......
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Users</h1> <h1 class="page-header pt-3" id="view.edituser.title" style="font-size: 24px;">Users</h1>
<div class="container mt-4"> <div class="container mt-4">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8">
......
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Calls</h1> <h1 class="page-header pt-3" id="view.items.title" style="font-size: 24px;">Items</h1>
<div class="container mt-4"> <div class="container mt-4">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8">
......
// Displays calls and their associated recordings in the grid. Allows the user // Displays items in the grid. Allows the user
// to sort the entries, filter their search, and search for a specific person. // to sort the entries, filter their search, and search for a specific person.
// Authors: // Authors:
// Cameron Hayes // Cameron Hayes
...@@ -35,7 +35,6 @@ type ...@@ -35,7 +35,6 @@ type
procedure GeneratePagination(TotalPages: Integer); procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string; function GenerateSearchOptions(): string;
[async] procedure Search(searchOptions: string); [async] procedure Search(searchOptions: string);
[async] procedure GetCalls(searchOptions: string);
[async] procedure GetItems(searchOptions: string); [async] procedure GetItems(searchOptions: string);
[async] procedure getUser(); [async] procedure getUser();
[async] procedure AddItem(itemOptions: string); [async] procedure AddItem(itemOptions: string);
...@@ -340,58 +339,8 @@ begin ...@@ -340,58 +339,8 @@ begin
end; end;
end; end;
procedure TFViewItems.GetCalls(searchOptions: string);
// Retrieves list of calls from the server that meet the criteria searchOptions
// searchOptions: information about how to generate the SQL statement based on
// user input.
var
xdcResponse: TXDataClientResponse;
callList : TJSObject;
i: integer;
data: TJSArray;
call: TJSObject;
callListLength: integer;
begin
{if PageNumber > 0 then
begin
asm
startSpinner();
end;
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCalls',
[searchOptions]));
callList := TJSObject(xdcResponse.Result);
data := TJSArray(callList['data']);
callListLength := integer(callList['count']);
ClearTable();
asm
setTimeout(endSpinner, 2000);
end;
for i := 0 to data.Length - 1 do
begin
call := TJSObject(data[i]);
AddRowToTable(string(call['toNumber']), string(call['fromNumber']), string(call['dateCreated']),
string(call['duration']), string(call['transcription']), string(call['mediaUrl']));
end;
TotalPages := (callListLength + PageSize - 1) div PageSize;
if (PageNumber * PageSize) < callListLength then
begin
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(PageNumber * PageSize) +
' of ' + IntToStr(callListLength);
end
else
begin
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) +
' - ' + IntToStr(callListLength) +
' of ' + IntToStr(callListLength);
end;
GeneratePagination(TotalPages);
end; }
end;
procedure TFViewItems.btnApplyClick(Sender: TObject); procedure TFViewItems.btnApplyClick(Sender: TObject);
// Button that effectively functions as a GetCalls() button // Button that effectively functions as a GetItems() button
var var
itemOptions: string; itemOptions: string;
begin begin
...@@ -451,7 +400,7 @@ begin ...@@ -451,7 +400,7 @@ begin
end; end;
procedure TFViewItems.btnSearchClick(Sender: TObject); procedure TFViewItems.btnSearchClick(Sender: TObject);
// calls Search method // item Search method
begin begin
//Search(edtSearch.Text); //Search(edtSearch.Text);
end; end;
...@@ -466,7 +415,7 @@ begin ...@@ -466,7 +415,7 @@ begin
end; end;
function TFViewItems.GenerateSearchOptions(): string; function TFViewItems.GenerateSearchOptions(): string;
// Generates searchOptions for get calls. // Generates searchOptions for GetItems.
var var
searchOptions: string; searchOptions: string;
begin begin
......
<nav class="navbar navbar-light bg-light login-navbar"> <nav class="navbar navbar-light bg-light login-navbar">
<div class="container-fluid"> <div class="container-fluid">
<a class="navbar-brand" href="#">Envoy Calls</a> <a class="navbar-brand" href="#">Koehler-Gibson Orders</a>
</div> </div>
</nav> </nav>
<div class="container mt-5"> <div class="container mt-5">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-auto">
<img id="kgpicture"style="width: 250px; height: 250px;">
</div>
<div class="col-md-6 col-lg-4"> <div class="col-md-6 col-lg-4">
<div class="card login-card"> <div class="card login-card">
<div class="card-header"> <div class="card-header">
......
...@@ -6,7 +6,7 @@ uses ...@@ -6,7 +6,7 @@ uses
System.SysUtils, System.Classes, Web, WEBLib.Graphics, WEBLib.Controls, WEBLib.Forms, WEBLib.Dialogs, System.SysUtils, System.Classes, Web, WEBLib.Graphics, WEBLib.Controls, WEBLib.Forms, WEBLib.Dialogs,
Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls, WEBLib.JSON, Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls, WEBLib.JSON,
JS, XData.Web.Connection, WEBLib.ExtCtrls, JS, XData.Web.Connection, WEBLib.ExtCtrls,
App.Types, ConnectionModule, XData.Web.Client; App.Types, ConnectionModule, XData.Web.Client, Vcl.Imaging.pngimage;
type type
TFViewLogin = class(TWebForm) TFViewLogin = class(TWebForm)
...@@ -18,6 +18,7 @@ type ...@@ -18,6 +18,7 @@ type
lblMessage: TWebLabel; lblMessage: TWebLabel;
btnCloseNotification: TWebButton; btnCloseNotification: TWebButton;
XDataWebClient: TXDataWebClient; XDataWebClient: TXDataWebClient;
WebImageControl1: TWebImageControl;
procedure btnLoginClick(Sender: TObject); procedure btnLoginClick(Sender: TObject);
procedure btnCloseNotificationClick(Sender: TObject); procedure btnCloseNotificationClick(Sender: TObject);
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
......
...@@ -59,7 +59,7 @@ object FViewMain: TFViewMain ...@@ -59,7 +59,7 @@ object FViewMain: TFViewMain
Transparent = False Transparent = False
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblCallsList: TWebLinkLabel object lblItemsList: TWebLinkLabel
Left = 560 Left = 560
Top = 69 Top = 69
Width = 29 Width = 29
...@@ -68,7 +68,7 @@ object FViewMain: TFViewMain ...@@ -68,7 +68,7 @@ object FViewMain: TFViewMain
ElementFont = efCSS ElementFont = efCSS
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = lblCallsListClick OnClick = lblItemsListClick
Caption = 'Items' Caption = 'Items'
end end
object lblUsers: TWebLinkLabel object lblUsers: TWebLinkLabel
......
<div id="wrapper"> <div id="wrapper">
<nav class="navbar navbar-expand navbar-light bg-light" style="margin-bottom: 0px;"> <nav class="navbar navbar-expand navbar-light bg-light" style="margin-bottom: 0px;">
<div class="container-fluid"> <div class="container-fluid">
<a id="view.main.apptitle" class="navbar-brand" href="index.html">Envoy Calls</a> <a id="view.main.apptitle" class="navbar-brand" href="index.html">Koehler-Gibson Orders</a>
<div class="collapse navbar-collapse show" id="navbarNavDropdown"> <div class="collapse navbar-collapse show" id="navbarNavDropdown">
<ul class="navbar-nav ms-auto"> <ul class="navbar-nav ms-auto">
<li class="nav-item dropdown"> <li class="nav-item dropdown">
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
<a class="dropdown-item" id="dropdown.menu.userprofile" href="#"><i class="fa fa-user fa-fw"></i><span> User Profile</span></a> <a class="dropdown-item" id="dropdown.menu.userprofile" href="#"><i class="fa fa-user fa-fw"></i><span> User Profile</span></a>
</li> </li>
<li> <li>
<a class="dropdown-item" id="lblorders" href="#"><i class="fa fa-home fa-fw"></i><span> Orders</span></a> <a class="dropdown-item" id="lblorders" href="#"><i class="fa fa-tags fa-fw"></i><span> Orders</span></a>
</li> </li>
<li> <li>
<a class="dropdown-item" id="dropdown.menu.itemlist" href="#"><i class="fa fa-phone fa-fw"></i><span> Items</span></a> <a class="dropdown-item" id="dropdown.menu.itemlist" href="#"><i class="fa fa-cubes fa-fw"></i><span> Items</span></a>
</li> </li>
<li> <li>
<a class="dropdown-item" id="dropdown.menu.users" href="#"><i class="fas fa-address-book fa-fw"></i><span> Users</span></abbr></a> <a class="dropdown-item" id="dropdown.menu.users" href="#"><i class="fas fa-address-book fa-fw"></i><span> Users</span></abbr></a>
......
...@@ -19,7 +19,7 @@ type ...@@ -19,7 +19,7 @@ type
lblAppTitle: TWebLabel; lblAppTitle: TWebLabel;
WebMemo1: TWebMemo; WebMemo1: TWebMemo;
XDataWebClient: TXDataWebClient; XDataWebClient: TXDataWebClient;
lblCallsList: TWebLinkLabel; lblItemsList: TWebLinkLabel;
lblUsers: TWebLinkLabel; lblUsers: TWebLinkLabel;
lblorders: TWebLabel; lblorders: TWebLabel;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
...@@ -27,7 +27,7 @@ type ...@@ -27,7 +27,7 @@ type
procedure wllblUserProfileClick(Sender: TObject); procedure wllblUserProfileClick(Sender: TObject);
procedure wllblLogoutClick(Sender: TObject); procedure wllblLogoutClick(Sender: TObject);
procedure lblHomeClick(Sender: TObject); procedure lblHomeClick(Sender: TObject);
procedure lblCallsListClick(Sender: TObject); procedure lblItemsListClick(Sender: TObject);
procedure lblUsersClick(Sender: TObject); procedure lblUsersClick(Sender: TObject);
procedure lblordersClick(Sender: TObject); procedure lblordersClick(Sender: TObject);
private private
...@@ -100,7 +100,7 @@ begin ...@@ -100,7 +100,7 @@ begin
ShowForm(TFViewUsers); ShowForm(TFViewUsers);
end; end;
procedure TFViewMain.lblCallsListClick(Sender: TObject); procedure TFViewMain.lblItemsListClick(Sender: TObject);
begin begin
ShowForm(TFViewItems); ShowForm(TFViewItems);
end; end;
......
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Orders</h1> <h1 class="page-header pt-3" id="view.orders.title" style="font-size: 24px;">Orders</h1>
<div class="container mt-4"> <div class="container mt-4">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8">
......
// Displays calls and their associated recordings in the grid. Allows the user // Displays orders in the grid. Allows the user
// to sort the entries, filter their search, and search for a specific person. // to sort the entries, filter their search, and search for a specific person.
// Authors: // Authors:
// Cameron Hayes // Cameron Hayes
...@@ -49,7 +49,7 @@ type ...@@ -49,7 +49,7 @@ type
procedure GeneratePagination(TotalPages: Integer); procedure GeneratePagination(TotalPages: Integer);
function GenerateSearchOptions(): string; function GenerateSearchOptions(): string;
[async] procedure Search(searchOptions: string); [async] procedure Search(searchOptions: string);
[async] procedure GetCalls(searchOptions: string); [async] procedure GetOrders(searchOptions: string);
[async] procedure getUser(); [async] procedure getUser();
var var
PageNumber: integer; PageNumber: integer;
...@@ -84,7 +84,7 @@ begin ...@@ -84,7 +84,7 @@ begin
PageNumber := 1; PageNumber := 1;
TotalPages := 1; // Initial total pages TotalPages := 1; // Initial total pages
wcbPageSize.Text := '10'; wcbPageSize.Text := '10';
getCalls(GenerateSearchOptions()); getOrders(GenerateSearchOptions());
end; end;
procedure TFViewOrders.getUser(); procedure TFViewOrders.getUser();
...@@ -285,7 +285,7 @@ begin ...@@ -285,7 +285,7 @@ begin
if PageNumber > 1 then if PageNumber > 1 then
begin begin
Dec(PageNumber); Dec(PageNumber);
GetCalls(GenerateSearchOptions()); GetOrders(GenerateSearchOptions());
end; end;
end); end);
PageItem.appendChild(PageLink); PageItem.appendChild(PageLink);
...@@ -325,7 +325,7 @@ begin ...@@ -325,7 +325,7 @@ begin
begin begin
PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText); PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText);
PageNumber := PageNum; PageNumber := PageNum;
GetCalls(GenerateSearchOptions()); GetOrders(GenerateSearchOptions());
end); end);
PageItem.appendChild(PageLink); PageItem.appendChild(PageLink);
PaginationElement.appendChild(PageItem); PaginationElement.appendChild(PageItem);
...@@ -364,7 +364,7 @@ begin ...@@ -364,7 +364,7 @@ begin
begin begin
PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText); PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText);
PageNumber := PageNum; PageNumber := PageNum;
GetCalls(GenerateSearchOptions()); GetOrders(GenerateSearchOptions());
end); end);
PageItem.appendChild(PageLink); PageItem.appendChild(PageLink);
PaginationElement.appendChild(PageItem); PaginationElement.appendChild(PageItem);
...@@ -401,7 +401,7 @@ begin ...@@ -401,7 +401,7 @@ begin
begin begin
PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText); PageNum := StrToInt((Event.currentTarget as TJSHTMLElement).innerText);
PageNumber := PageNum; PageNumber := PageNum;
GetCalls(generateSearchOptions()); GetOrders(generateSearchOptions());
end); end);
end; end;
PageItem.appendChild(PageLink); PageItem.appendChild(PageLink);
...@@ -421,7 +421,7 @@ begin ...@@ -421,7 +421,7 @@ begin
if PageNumber < TotalPages then if PageNumber < TotalPages then
begin begin
Inc(PageNumber); Inc(PageNumber);
GetCalls(GenerateSearchOptions()); GetOrders(GenerateSearchOptions());
end; end;
end); end);
PageItem.appendChild(PageLink); PageItem.appendChild(PageLink);
...@@ -430,8 +430,8 @@ begin ...@@ -430,8 +430,8 @@ begin
end; end;
procedure TFViewOrders.GetCalls(searchOptions: string); procedure TFViewOrders.GetOrders(searchOptions: string);
// Retrieves list of calls from the server that meet the criteria searchOptions // Retrieves list of orders from the server that meet the criteria searchOptions
// searchOptions: information about how to generate the SQL statement based on // searchOptions: information about how to generate the SQL statement based on
// user input. // user input.
var var
...@@ -487,7 +487,7 @@ begin ...@@ -487,7 +487,7 @@ begin
end; end;
procedure TFViewOrders.btnApplyClick(Sender: TObject); procedure TFViewOrders.btnApplyClick(Sender: TObject);
// Button that effectively functions as a GetCalls() button // Button that effectively functions as a GetOrders() button
var var
searchOptions: string; searchOptions: string;
begin begin
...@@ -497,7 +497,7 @@ begin ...@@ -497,7 +497,7 @@ begin
searchOptions := '&pagenumber=' + IntToStr(PageNumber) + searchOptions := '&pagenumber=' + IntToStr(PageNumber) +
'&pagesize=' + IntToStr(PageSize) + '&pagesize=' + IntToStr(PageSize) +
'&orderby=' + OrderBy; '&orderby=' + OrderBy;
GetCalls(searchOptions); GetOrders(searchOptions);
end; end;
procedure TFViewOrders.Search(searchOptions: string); procedure TFViewOrders.Search(searchOptions: string);
...@@ -531,7 +531,7 @@ begin ...@@ -531,7 +531,7 @@ begin
end; end;
procedure TFViewOrders.btnSearchClick(Sender: TObject); procedure TFViewOrders.btnSearchClick(Sender: TObject);
// calls Search method // orders Search method
begin begin
Search(edtSearch.Text); Search(edtSearch.Text);
end; end;
...@@ -546,7 +546,7 @@ begin ...@@ -546,7 +546,7 @@ begin
end; end;
function TFViewOrders.GenerateSearchOptions(): string; function TFViewOrders.GenerateSearchOptions(): string;
// Generates searchOptions for get calls. // Generates searchOptions for GetOrders.
var var
searchOptions: string; searchOptions: string;
begin begin
......
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Users</h1> <h1 class="page-header pt-3" id="view.users.title" style="font-size: 24px;">Users</h1>
<div class="container mt-4 px-0"> <div class="container mt-4 px-0">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12 col-md-8"> <div class="col-12 col-md-8">
......
...@@ -20,34 +20,6 @@ const ...@@ -20,34 +20,6 @@ const
API_MODEL = 'Api'; API_MODEL = 'Api';
type type
TCallItem = class
// Class of the info we want from the database from a specific call.
// callSid: SID of the call, 34 digit string.
// fromNumber: Who the phone call was from. (xxx) xxx-xxxx
// toNumber: Who the phone call was to. (xxx) xxx-xxxx
// dateCreated: Date the phone call was created. mm/dd/yyyy hh:nn:ss am/pm
// mediaURL: Link to the recording audio
// duration: Length of the entire call and recording.
// transcription: Transcription of the recording. Not always present due to
// the call being answerered or caller did not leave a message.
public
callSid: string;
fromNumber: string;
toNumber: string;
dateCreated: string;
mediaUrl: string;
duration: string;
transcription: string;
end;
// List of call items
// count: Total amount of records that fit the SQL query
// data: List of retrieved calls
TCallList = class
public
count: integer;
data: TList<TCallItem>;
end;
TUserItem = class TUserItem = class
public public
...@@ -114,8 +86,7 @@ type ...@@ -114,8 +86,7 @@ type
[ServiceContract] [ServiceContract]
ILookupService = interface(IInvokable) ILookupService = interface(IInvokable)
['{F24E1468-5279-401F-A877-CD48B44F4416}'] ['{F24E1468-5279-401F-A877-CD48B44F4416}']
[HttpGet] function GetCalls(searchOptions: string): TCallList; [HttpGet] function Search(phoneNum: string): TOrderList;
[HttpGet] function Search(phoneNum: string): TCallList;
[HttpGet] function GetUsers(searchOptions: string): TUserList; [HttpGet] function GetUsers(searchOptions: string): TUserList;
[HttpGet] function GetItems(searchOptions: string): TItemList; [HttpGet] function GetItems(searchOptions: string): TItemList;
[HttpGet] function GetOrders(searchOptions: string): TOrderList; [HttpGet] function GetOrders(searchOptions: string): TOrderList;
......
unit Main; unit Main;
//Main form of the program. This program gets calls/recordings/transcriptions from
//twilio and stores them in a database. From there it is able to be accessed by the client.
//Has access to every visual form for debugging purposes.
//Authors: //Authors:
//Elias Sarraf //Elias Sarraf
//Mac ... //Mac ...
......
...@@ -156,6 +156,6 @@ begin ...@@ -156,6 +156,6 @@ begin
Application.MainFormOnTaskbar := True; Application.MainFormOnTaskbar := True;
Application.CreateForm(TFMain, FMain); Application.CreateForm(TFMain, FMain);
Logger.AddAppender(TMemoLogAppender.Create( 5, FMain.memoinfo )); Logger.AddAppender(TMemoLogAppender.Create( 5, FMain.memoinfo ));
Logger.AddAppender(TFileLogAppender.Create( 5, 'envoyCallsServer' )); Logger.AddAppender(TFileLogAppender.Create( 5, 'kgOrdersServer' ));
Application.Run; Application.Run;
end. end.
[Options] [Options]
LogFileNum=92 LogFileNum=98
UpdateTimerLength=0 UpdateTimerLength=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment