Commit 8d360d08 by Mac Stephens

Merge branch 'cam'

parents 63620b75 c515903d
......@@ -7,7 +7,7 @@ uses
XData.Web.Client;
const
TOKEN_NAME = 'WEBENVOYCALLS_TOKEN';
TOKEN_NAME = 'KG_ORDERS_WEB_TOKEN';
type
TOnLoginSuccess = reference to procedure;
......
......@@ -5,30 +5,6 @@
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<form class="form-inline">
<div class="col-sm py-2">
<label class='pe-2'style="font-weight: 700;">Location:</label>
<select class="custom-select" id="wcblocation" style="font-size: 1.00rem;"></select>
</div>
<div class="row">
<div class="col-sm-6">
<label class='pe-2'style="font-weight: 700;">Phone Number:</label>
<input class="form-control input-sm" id="edtsearch">
</div>
</div>
</form>
<form class="form-inline">
<div class="row">
<div class="col-sm-6">
<label style="font-weight: 700;">Start Date:</label>
<input class="form-control input-sm" id="dtpstartdate" type="date">
</div>
<div class="col-sm-6">
<label class= 'pe-2'style="font-weight: 700;">End Date:</label>
<input class="form-control input-sm" id="dtpenddate" type="date">
</div>
</div>
</form>
<form class="form-inline">
<div class= "row">
<div class="col-sm-5">
<label class="py-2" style="font-weight: 700;">Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries</label>
......@@ -42,16 +18,25 @@
</div>
</div>
</form>
</div>
<table class="table table-responsive table-striped table-bordered" id="tblPhoneGrid">
<thead class="thead-dark">
<tr>
<th scope="col">Phone Number</th>
<th scope="col">Caller</th>
<th scope="col">Time</th>
<th scope="col">Duration</th>
<th scope="col">Transcript</th>
<th scope="col">Listen</th>
<th scope="col">Order ID</th>
<th scope="col">Company Name</th>
<th scope="col">Job Name</th>
<th scope="col">Order Date</th>
<th scope="col">Proof Due</th>
<th scope="col">Proof Date</th>
<th scope="col">Art Due</th>
<th scope="col">Art Done</th>
<th scope="col">Mount Due</th>
<th scope="col">Mount Done</th>
<th scope="col">Ship Due</th>
<th scope="col">Ship Done</th>
<th scope="col">Price</th>
<th scope="col">Quickbooks Reference Number</th>
<th scope="col">Colors</th>
</tr>
</thead>
<tbody>
......@@ -68,7 +53,6 @@
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="audioModal" tabindex="-1" aria-labelledby="audioModalLabel" aria-hidden="true">
<div class="modal-dialog">
......
......@@ -2,17 +2,6 @@ object FViewEditUser: TFViewEditUser
Width = 640
Height = 480
OnShow = WebFormCreate
object WebLabel1: TWebLabel
Left = 8
Top = 125
Width = 73
Height = 15
Caption = 'Make Admin?'
Color = clBtnFace
ElementID = 'lblAdmin'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel2: TWebLabel
Left = 16
Top = 8
......@@ -35,19 +24,19 @@ object FViewEditUser: TFViewEditUser
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel4: TWebLabel
Left = 6
Top = 62
Width = 84
object lblQB: TWebLabel
Left = 256
Top = 65
Width = 80
Height = 15
Caption = 'Phone Number:'
Caption = 'Quickbooks ID:'
Color = clBtnFace
ElementID = 'lblphone'
ElementID = 'lblQB'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebLabel5: TWebLabel
Left = 256
Left = 284
Top = 8
Width = 56
Height = 15
......@@ -69,8 +58,8 @@ object FViewEditUser: TFViewEditUser
WidthPercent = 100.000000000000000000
end
object WebLabel7: TWebLabel
Left = 252
Top = 69
Left = 35
Top = 62
Width = 32
Height = 15
Caption = 'Email:'
......@@ -80,8 +69,8 @@ object FViewEditUser: TFViewEditUser
WidthPercent = 100.000000000000000000
end
object lblactive: TWebLabel
Left = 291
Top = 125
Left = 45
Top = 163
Width = 38
Height = 15
Caption = 'Active?'
......@@ -90,23 +79,33 @@ object FViewEditUser: TFViewEditUser
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object lblLocation: TWebLabel
object lblRights: TWebLabel
Left = 3
Top = 96
Width = 87
Width = 74
Height = 15
Caption = 'Default Location'
ElementID = 'lbllocation'
Caption = 'System Rights'
ElementID = 'lblrights'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtPhoneNumber: TWebEdit
Left = 96
Top = 62
Width = 121
Height = 22
ChildOrder = 7
ElementID = 'edtphonenumber'
object lblAccess: TWebLabel
Left = 272
Top = 96
Width = 66
Height = 15
Caption = 'Access Type:'
ElementID = 'lblaccess'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object lblPerspective: TWebLabel
Left = 3
Top = 132
Width = 77
Height = 15
Caption = 'Perspective ID:'
ElementID = 'lblperspective'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
......@@ -121,7 +120,7 @@ object FViewEditUser: TFViewEditUser
WidthPercent = 100.000000000000000000
end
object edtEmail: TWebEdit
Left = 348
Left = 96
Top = 62
Width = 121
Height = 22
......@@ -140,26 +139,9 @@ object FViewEditUser: TFViewEditUser
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object cbAdmin: TWebCheckBox
Left = 96
Top = 124
Width = 107
Height = 20
Caption = 'Make Admin?'
ChildOrder = 12
ElementID = 'cbadminuser'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
HeightPercent = 100.000000000000000000
ParentFont = False
WidthPercent = 100.000000000000000000
end
object btnConfirm: TWebButton
Left = 96
Top = 170
Top = 200
Width = 96
Height = 25
Caption = 'Confirm'
......@@ -197,8 +179,8 @@ object FViewEditUser: TFViewEditUser
WidthPercent = 100.000000000000000000
end
object btnCancel: TWebButton
Left = 237
Top = 170
Left = 221
Top = 200
Width = 96
Height = 25
Caption = 'Cancel'
......@@ -234,7 +216,7 @@ object FViewEditUser: TFViewEditUser
Height = 33
ElementID = 'view.login.message'
ChildOrder = 17
TabOrder = 10
TabOrder = 8
object lblMessage: TWebLabel
Left = 16
Top = 11
......@@ -257,14 +239,14 @@ object FViewEditUser: TFViewEditUser
OnClick = btnCloseNotificationClick
end
end
object cbActive: TWebCheckBox
Left = 346
Top = 124
object cbStatus: TWebCheckBox
Left = 96
Top = 162
Width = 107
Height = 20
Caption = 'Active?'
ChildOrder = 12
ElementID = 'cbactive'
ElementID = 'cbstatus'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
......@@ -274,47 +256,63 @@ object FViewEditUser: TFViewEditUser
ParentFont = False
WidthPercent = 100.000000000000000000
end
object wcbLocation: TWebLookupComboBox
Left = 96
Top = 96
Width = 145
object edtQB: TWebEdit
Left = 348
Top = 62
Width = 121
Height = 22
ElementID = 'wcblocation'
ElementFont = efCSS
ChildOrder = 7
ElementID = 'edtQB'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
LookupValues = <
item
DisplayText = 'All'
end
item
Value = '(716) 681-8820'
DisplayText = 'Galleria'
end
item
Value = '(716) 297-4654'
DisplayText = 'NF Outlet'
object edtRights: TWebEdit
Left = 96
Top = 93
Width = 121
Height = 22
ChildOrder = 19
ElementID = 'edtrights'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
item
Value = '(585) 445-8911'
DisplayText = 'Rochester'
object cbAccess: TWebComboBox
Left = 352
Top = 90
Width = 145
Height = 23
ElementID = 'cbaccess'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'PLATE'
'MOUNT'
'SHIP'
'ART'
'ALL'
'ACTIVE')
end
item
Value = '(315) 565-4138'
DisplayText = 'Syracuse'
end>
object edtPerspective: TWebEdit
Left = 96
Top = 129
Width = 121
Height = 22
ChildOrder = 23
ElementID = 'edtperspective'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 462
Top = 164
Left = 556
Top = 416
end
object WebTimer1: TWebTimer
Enabled = False
Interval = 500
OnTimer = WebTimer1Timer
Left = 236
Top = 194
Left = 430
Top = 382
end
end
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Users</h1>
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
......@@ -39,30 +38,37 @@
<form class="form-inline">
<div class="row">
<div class="col-sm">
<label class='pe-2' style="font-weight: 700;font-size: 15px;" id="lblphone">Phone Number:</label>
<input id="edtphonenumber" class= "form-control input-sm" width='50%'/>
<label class='pe-2' style="font-weight: 700;font-size: 15px;" id="lblemail">Email Address:</label>
<input id="edtemail" class= "form-control input-sm" width='50%'/>
</div>
<div class="col-sm">
<label class= 'pe-2' style="font-weight: 700;font-size: 15px"id="lblemail">Email Address:</label>
<input class="form-control input-sm" id="edtemail">
<label class= 'pe-2' style="font-weight: 700;font-size: 15px"id="lblQB">Quickbook ID:</label>
<input class="form-control input-sm" id="edtQB">
</div>
</div>
</form>
<div class="row">
<div class="col-sm">
<label class= 'pe-2' style="font-weight: 700;font-size: 15px"id="lbllocation">Location:</label>
<select class="custom-select-large" id="wcblocation" style="font-size: 1.00rem;"></select>
<label class='pe-2' style="font-weight: 700;font-size: 15px;" id="lblrights">System Rights:</label>
<input id="edtrights" class= "form-control input-sm" width='50%'/>
</div>
<div class="col-sm-6">
<label class='pe-2' style="font-weight: 700;font-size: 15px;" id="lblperspective">Perspective ID:</label>
<input id="edtperspective" class= "form-control input-sm" width='50%'/>
</div>
</div>
<div class="row">
<div class="col-sm py-3">
<label class= 'pe-2' style="font-weight: 700;font-size: 15px"id="lblaccess">Access Type:</label>
<select class="custom-select-large" id="cbaccess" style="font-size: 1.00rem;"></select>
</div>
</div>
<div class="row">
<div class="col-sm">
<form class='form-inline'>
<div class="col-sm">
<div class="form-cells"><input type="checkbox" id="cbadminuser"></div>
<div class="form-cells ps-1 py-2"><label style="font-weight: 700;font-size: 15px" id="lblAdmin">Make Admin?</label></div>
</div>
<div class="col-sm">
<div class="form-cells"><input type="checkbox" id="cbactive"></div>
<div class="form-cells"><input type="checkbox" id="cbstatus"></div>
<div class="form-cells ps-1 py-2"><label style="font-weight: 700;font-size: 15px" id="lblactive">Active></label></div>
</div>
</form>
......
......@@ -12,18 +12,15 @@ uses
type
TFViewEditUser = class(TWebForm)
WebLabel1: TWebLabel;
WebLabel2: TWebLabel;
WebLabel3: TWebLabel;
WebLabel4: TWebLabel;
lblQB: TWebLabel;
WebLabel5: TWebLabel;
WebLabel6: TWebLabel;
WebLabel7: TWebLabel;
edtPhoneNumber: TWebEdit;
edtConfirmPassword: TWebEdit;
edtEmail: TWebEdit;
edtPassword: TWebEdit;
cbAdmin: TWebCheckBox;
btnConfirm: TWebButton;
edtFullname: TWebEdit;
edtUsername: TWebEdit;
......@@ -35,9 +32,14 @@ type
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
lblactive: TWebLabel;
cbActive: TWebCheckBox;
lblLocation: TWebLabel;
wcbLocation: TWebLookupComboBox;
cbStatus: TWebCheckBox;
lblRights: TWebLabel;
edtQB: TWebEdit;
edtRights: TWebEdit;
lblAccess: TWebLabel;
cbAccess: TWebComboBox;
lblPerspective: TWebLabel;
edtPerspective: TWebEdit;
procedure WebFormCreate(Sender: TObject);
procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
......@@ -49,12 +51,14 @@ type
FMessage: string;
Mode: string;
Username: string;
Password: string;
FullName: string;
Phone: string;
Status: string;
Email: string;
Location: string;
Admin: boolean;
Active: boolean;
Access: string;
Rights: string;
Perspective: string;
QB: string;
[async] procedure EditUser();
[async] function AddUser(): string;
procedure HideNotification();
......@@ -62,7 +66,8 @@ type
public
{ Public declarations }
Info: string;
class function CreateForm(AElementID, Mode, Username, FullName, Phone, Email, Location: string; Admin, Active: boolean): TWebForm;
class function CreateForm(AElementID, Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string): TWebForm;
end;
var
......@@ -108,13 +113,16 @@ var
xdcResponse: TXDataClientResponse;
responseString: TJSObject;
begin
userInfo := '&username=' + string(edtUsername.Text).ToLower +
'&password=' + edtPassword.Text +
userInfo := '&username=' + edtUsername.Text +
'&fullname=' + edtFullName.Text +
'&phonenumber=' + edtPhoneNumber.Text +
'&password=' + edtPassword.Text +
'&status=' + BoolToStr(cbStatus.Checked) +
'&email=' + edtEmail.Text +
'&admin=' + BoolToStr(cbAdmin.Checked) +
'&location=' + wcbLocation.Value;
'&access=' + cbAccess.Text +
'&newuser=' + edtUsername.Text +
'&rights=' + edtRights.Text +
'&perspective=' + edtPerspective.Text +
'&QB=' + edtQB.Text;
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.AddUser',
[userInfo]));
......@@ -146,13 +154,14 @@ begin
editOptions := 'username=' + Username +
'&fullname=' + edtFullName.Text +
'&phonenumber=' + edtPhoneNumber.Text +
'&password=' + edtPassword.Text +
'&status=' + BoolToStr(cbStatus.Checked) +
'&email=' + edtEmail.Text +
'&admin=' + BoolToStr(cbAdmin.Checked) +
'&access=' + cbAccess.Text +
'&newuser=' + edtUsername.Text +
'&password=' + edtPassword.Text +
'&active=' + BoolToStr(cbActive.Checked) +
'&location=' + wcbLocation.DisplayText;
'&rights=' + edtRights.Text +
'&perspective=' + edtPerspective.Text +
'&QB=' + edtQB.Text;
console.log(editOptions);
......@@ -163,18 +172,20 @@ begin
end;
class function TFViewEditUser.CreateForm(AElementID, Mode, Username, FullName, Phone, Email, Location: string; Admin, Active: boolean): TWebForm;
class function TFViewEditUser.CreateForm(AElementID, Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string): TWebForm;
// Autofills known information about a user on create
procedure AfterCreate(AForm: TObject);
begin
TFViewEditUser(AForm).Mode := Mode;
TFViewEditUser(AForm).Username := Username;
TFViewEditUser(AForm).FullName := FullName;
TFViewEditUser(AForm).Phone := Phone;
TFViewEditUser(AForm).Email:= Email;
TFViewEditUser(AForm).Location:= Location;
TFViewEditUser(AForm).Admin := Admin;
TFViewEditUser(AForm).Active := Active;
TFViewEditUser(AForm).FullName := Name;
TFViewEditUser(AForm).Status := Status;
TFViewEditUser(AForm).Email := Email;
TFViewEditUser(AForm).Access := Access;
TFViewEditUser(AForm).Rights := Rights;
TFViewEditUser(AForm).Perspective := Perspective;
TFViewEditUser(AForm).QB := QB;
end;
{$R *.dfm}
......@@ -197,14 +208,14 @@ begin
begin
edtPassword.Text := 'hidden';
edtConfirmPassword.Text := 'hidden';
end
else
cbAdmin.Enabled := False;
wcbLocation.DisplayText := Location;
edtPhoneNumber.Text := Phone;
end;
edtEmail.Text := Email;
cbAdmin.checked := Admin;
cbActive.Checked := Active;
cbAccess.Text := Access;
edtRights.Text := Rights;
edtQB.Text := QB;
if Status = 'ACTIVE' then
cbStatus.checked := true;
edtPerspective.Text := Perspective
end;
procedure TFViewEditUser.WebTimer1Timer(Sender: TObject);
......@@ -229,7 +240,7 @@ var
charIndex: integer;
phoneNum: string;
begin
checkString := edtFullName.Text + edtUsername.Text + edtPassword.Text
{ checkString := edtFullName.Text + edtUsername.Text + edtPassword.Text
+ edtConfirmPassword.Text + edtPhoneNumber.Text + edtEmail.Text;
if string(edtFullName.Text).IsEmpty then
begin
......@@ -331,7 +342,7 @@ begin
ShowNotification('Passwords must be between 6-20 characters!');
exit;
end;
}
asm
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false });
......
object FViewCalls: TFViewCalls
object FViewItems: TFViewItems
Width = 676
Height = 480
CSSLibrary = cssBootstrap
......@@ -22,37 +22,6 @@ object FViewCalls: TFViewCalls
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object wcbLocation: TWebLookupComboBox
Left = 154
Top = 0
Width = 145
Height = 22
ElementID = 'wcblocation'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
LookupValues = <
item
DisplayText = 'All'
end
item
Value = '(716) 681-8820'
DisplayText = 'Galleria'
end
item
Value = '(716) 297-4654'
DisplayText = 'NF Outlet'
end
item
Value = '(585) 445-8911'
DisplayText = 'Rochester'
end
item
Value = '(315) 565-4138'
DisplayText = 'Syracuse'
end>
end
object wcbPageSize: TWebComboBox
Left = 0
Top = 0
......@@ -65,29 +34,13 @@ object FViewCalls: TFViewCalls
HeightPercent = 100.000000000000000000
Text = '10'
WidthPercent = 100.000000000000000000
OnChange = wcbPageSizeChange
ItemIndex = -1
Items.Strings = (
'10'
'25'
'50')
end
object wcbSortBy: TWebComboBox
Left = 442
Top = 52
Width = 145
Height = 21
ElementClassName = 'custom-select'
ElementID = 'wcbsortby'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Text = 'Date'
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'Date'
'Phone Number')
end
object btnApply: TWebButton
Left = 478
Top = 128
......@@ -103,43 +56,42 @@ object FViewCalls: TFViewCalls
WidthPercent = 100.000000000000000000
OnClick = btnApplyClick
end
object edtSearch: TWebEdit
Left = 48
Top = 382
object edtName: TWebEdit
Left = 342
Top = 0
Width = 121
Height = 22
HelpType = htKeyword
ChildOrder = 8
ChildOrder = 10
ElementClassName = 'form-control'
ElementID = 'edtsearch'
ElementID = 'edtname'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
HideSelection = False
TextHint = 'Format: (XXX) XXX-XXXX'
WidthPercent = 100.000000000000000000
end
object dtpStartDate: TWebEdit
Left = 342
object edtDescription: TWebEdit
Left = 478
Top = 0
Width = 121
Height = 22
ChildOrder = 10
ElementClassName = 'form-control'
ElementID = 'dtpstartdate'
ElementID = 'edtdescription'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object dtpEndDate: TWebEdit
Left = 478
Top = 0
Width = 121
object cbStatus: TWebCheckBox
Left = 354
Top = 52
Width = 113
Height = 22
ChildOrder = 10
ElementClassName = 'form-control'
ElementID = 'dtpenddate'
ChildOrder = 5
ElementClassName = 'custom-control custom-checkbox'
ElementButtonClassName = 'custom-control-input'
ElementLabelClassName = 'custom-control-label'
ElementID = 'cbstatus'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
......
<div class="row">
<div class="col-12">
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<form class="form-inline">
<div class="row">
<div class="col-sm-6">
<label style="font-weight: 700;">Name:</label>
<input class="form-control input-sm" id="edtname">
</div>
<div class="col-sm-6">
<label class= 'pe-2'style="font-weight: 700;">Description:</label>
<input class="form-control input-sm" id="edtdescription">
</div>
</div>
</form>
<div class="row">
<div class="col-sm">
<form class='form-inline'>
<div class="col-sm">
<div class="form-cells"><input type="checkbox" id="cbstatus"></div>
<div class="form-cells ps-1 py-2"><label style="font-weight: 700;font-size: 15px" id="lblactive">Active?</label></div>
</div>
</form>
</div>
</div>
<form class="form-inline">
<div class= "row">
<div class="col-sm-5">
<label class="py-2" style="font-weight: 700;">Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries</label>
</div>
<div class="col-sm-5">
<button class= "ps-3" id="btnapply"></button>
</div>
</div>
</form>
<table class="table table-responsive table-striped table-bordered" id="tblPhoneGrid">
<thead class="thead-dark">
<tr>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Description</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<!-- Rows will be added dynamically via Delphi code -->
</tbody>
</table>
<label id="lblentries"></label>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination">
<!-- Pagination items will be added dynamically via Delphi code -->
</ul>
</nav>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="audioModal" tabindex="-1" aria-labelledby="audioModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="audioModalLabel">Audio Player</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="stopAudio()"></button>
</div>
<div class="modal-body">
<audio controls id="audioPlayer">
<source src="" type="audio/mp3" id="audioSource">
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
</div>
<script>
document.getElementById('tblPhoneGrid').addEventListener('click', function(event) {
// Check if the clicked element is a table cell (td)
if (event.target.tagName === 'TD') {
const row = event.target.parentNode;
const cells = row.getElementsByTagName('td');
// Extract data from the row
const id = cells[0].textContent;
const name = cells[1].textContent;
const description = cells[2].textContent;
const status = cells[3].textContent.trim().toLowerCase();
// Populate form fields
document.getElementById('edtname').value = name;
document.getElementById('edtdescription').value = description;
// Set the checkbox based on the status
const isActive = status === 'active';
document.getElementById('cbstatus').checked = isActive;
console.log(`Row clicked! ID: ${id}, Name: ${name}, Description: ${description}, Status: ${status}`);
}
});
</script>
<nav class="navbar navbar-light bg-light login-navbar">
<div class="container-fluid">
<a class="navbar-brand" href="#">Envoy Calls</a>
<a class="navbar-brand" href="#">Koehler-Gibson Orders</a>
</div>
</nav>
<div class="container mt-5">
<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="card login-card">
<div class="card-header">
......
......@@ -6,7 +6,7 @@ uses
System.SysUtils, System.Classes, Web, WEBLib.Graphics, WEBLib.Controls, WEBLib.Forms, WEBLib.Dialogs,
Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls, WEBLib.JSON,
JS, XData.Web.Connection, WEBLib.ExtCtrls,
App.Types, ConnectionModule, XData.Web.Client;
App.Types, ConnectionModule, XData.Web.Client, Vcl.Imaging.pngimage;
type
TFViewLogin = class(TWebForm)
......@@ -18,6 +18,7 @@ type
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
XDataWebClient: TXDataWebClient;
WebImageControl1: TWebImageControl;
procedure btnLoginClick(Sender: TObject);
procedure btnCloseNotificationClick(Sender: TObject);
procedure WebFormCreate(Sender: TObject);
......
......@@ -28,7 +28,7 @@ object FViewMain: TFViewMain
end
object wllblLogout: TWebLinkLabel
Left = 551
Top = 85
Top = 143
Width = 41
Height = 15
ElementID = 'dropdown.menu.logout'
......@@ -51,29 +51,29 @@ object FViewMain: TFViewMain
object lblAppTitle: TWebLabel
Left = 57
Top = 31
Width = 60
Width = 82
Height = 15
Caption = 'Envoy Calls'
Caption = 'Koehler-Gibson'
ElementID = 'view.main.apptitle'
HeightPercent = 100.000000000000000000
Transparent = False
WidthPercent = 100.000000000000000000
end
object lblCallsList: TWebLinkLabel
Left = 564
Top = 56
Width = 25
object lblItemsList: TWebLinkLabel
Left = 560
Top = 85
Width = 29
Height = 15
ElementID = 'dropdown.menu.callslist'
ElementID = 'dropdown.menu.itemlist'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblCallsListClick
Caption = 'Calls'
OnClick = lblItemsListClick
Caption = 'Items'
end
object lblUsers: TWebLinkLabel
Left = 561
Top = 70
Top = 108
Width = 28
Height = 15
ElementID = 'dropdown.menu.users'
......@@ -83,9 +83,48 @@ object FViewMain: TFViewMain
OnClick = lblUsersClick
Caption = 'Users'
end
object lblorders: TWebLabel
Left = 556
Top = 52
Width = 35
Height = 15
Caption = 'Orders'
ElementID = 'lblorders'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblordersClick
end
object lblCustomers: TWebLabel
Left = 540
Top = 69
Width = 57
Height = 15
Caption = 'Customers'
ElementID = 'lblcustomers'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblCustomersClick
end
object lblQuickbooks: TWebLabel
Left = 546
Top = 125
Width = 63
Height = 15
Caption = 'QuickBooks'
ElementID = 'lblquickbooks'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblQuickbooksClick
end
object WebPanel1: TWebPanel
Left = 136
Top = 110
Left = 77
Top = 112
Width = 471
Height = 369
ElementID = 'main.webpanel'
......@@ -102,8 +141,8 @@ object FViewMain: TFViewMain
Opacity = 0.200000000000000000
end
object WebMemo1: TWebMemo
Left = 136
Top = 467
Left = 77
Top = 479
Width = 471
Height = 83
ElementID = 'main.debugmemo'
......
<div id="wrapper">
<nav class="navbar navbar-expand navbar-light bg-light" style="margin-bottom: 0px;">
<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>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="dropdown-item" id="lblorders" href="#"><i class="fa fa-tags fa-fw"></i><span> Orders</span></a>
</li>
<li class="nav-item">
<a class="dropdown-item" id="lblcustomers" href="#"><i class="fa fa-tags fa-fw"></i><span> Customers</span></a>
</li>
<li class="nav-item">
<a class="dropdown-item" id="dropdown.menu.itemlist" href="#"><i class="fa fa-cubes fa-fw"></i><span> Items</span></a>
</li>
<li class="nav-item">
<a class="dropdown-item" id="lblquickbooks" href="#"><i class="fa fa-tags fa-fw"></i><span> QuickBooks</span></a>
</li>
</ul>
<div class="collapse navbar-collapse show" id="navbarNavDropdown">
<ul class="navbar-nav ms-auto">
<li class="nav-item dropdown">
......@@ -16,9 +30,6 @@
<a class="dropdown-item" id="dropdown.menu.userprofile" href="#"><i class="fa fa-user fa-fw"></i><span> User Profile</span></a>
</li>
<li>
<a class="dropdown-item" id="dropdown.menu.callslist" href="#"><i class="fa fa-phone fa-fw"></i><span> Calls</span></a>
</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>
</li>
<li>
......
......@@ -19,15 +19,21 @@ type
lblAppTitle: TWebLabel;
WebMemo1: TWebMemo;
XDataWebClient: TXDataWebClient;
lblCallsList: TWebLinkLabel;
lblItemsList: TWebLinkLabel;
lblUsers: TWebLinkLabel;
lblorders: TWebLabel;
lblCustomers: TWebLabel;
lblQuickbooks: TWebLabel;
procedure WebFormCreate(Sender: TObject);
procedure mnuLogoutClick(Sender: TObject);
procedure wllblUserProfileClick(Sender: TObject);
procedure wllblLogoutClick(Sender: TObject);
procedure lblHomeClick(Sender: TObject);
procedure lblCallsListClick(Sender: TObject);
procedure lblItemsListClick(Sender: TObject);
procedure lblUsersClick(Sender: TObject);
procedure lblordersClick(Sender: TObject);
procedure lblCustomersClick(Sender: TObject);
procedure lblQuickbooksClick(Sender: TObject);
private
{ Private declarations }
FUserInfo: string;
......@@ -38,11 +44,15 @@ type
procedure ShowCrudForm( AFormClass: TWebFormClass );
//procedure EditUser( AParam, BParam, CParam, DParam, EParam: string);
function GetUserInfo: string;
procedure setActive(page: string);
public
{ Public declarations }
class procedure Display(LogoutProc: TLogoutProc);
procedure ShowForm( AFormClass: TWebFormClass );
procedure EditUser( Mode, FullName, Username, Phone, Email, Location: string; admin, active: boolean);
procedure EditUser( Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string);
procedure ViewOrderEntry(orderInfo, mode: string);
procedure ViewOrders(info: string);
procedure ShowUserForm(Info: string);
end;
......@@ -56,10 +66,11 @@ uses
View.Login,
View.UserProfile,
View.Home,
View.Calls,
View.Admin,
View.Items,
View.Users,
View.EditUser;
View.EditUser,
View.Orders,
View.OrderEntryCorrugated;
{$R *.dfm}
......@@ -76,25 +87,71 @@ begin
//Change this later
lblUsers.Visible := true;
ShowForm(TFViewHome);
ShowForm(TFViewOrders);
lblAppTitle.Caption := 'Koehler-Gibson Orders';
setActive('Orders');
end;
procedure TFViewMain.lblCustomersClick(Sender: TObject);
begin
//ShowForm(TFViewCustomers);
lblAppTitle.Caption := 'Koehler-Gibson Customers';
setActive('Customers');
end;
procedure TFViewMain.lblHomeClick(Sender: TObject);
begin
ShowForm(TFViewHome);
lblAppTitle.Caption := 'Koehler-Gibson Home';
//setActive('Home');
end;
procedure TFViewMain.lblordersClick(Sender: TObject);
begin
ShowForm(TFViewOrders);
lblAppTitle.Caption := 'Koehler-Gibson Orders';
setActive('Orders');
end;
procedure TFViewMain.lblQuickbooksClick(Sender: TObject);
begin
//ShowForm(TFViewQuickbooks);
lblAppTitle.Caption := 'Koehler-Gibson QuickBooks';
setActive('QuickBooks');
end;
procedure TFViewMain.lblUsersClick(Sender: TObject);
begin
ShowForm(TFViewUsers);
lblAppTitle.Caption := 'Koehler-Gibson Users';
end;
procedure TFViewMain.lblItemsListClick(Sender: TObject);
begin
ShowForm(TFViewItems);
lblAppTitle.Caption := 'Koehler-Gibson Items';
setActive('Items');
end;
procedure TFViewMain.lblCallsListClick(Sender: TObject);
procedure TFViewMain.setActive(page: string);
var
links: TJSNodeList;
link: TJSHTMLElement;
i: integer;
begin
ShowForm(TFViewCalls);
// Get all the links in the navbar
links := document.querySelectorAll('.navbar-nav .nav-item a');
for i := 0 to links.length - 1 do
begin
link := TJSHTMLElement(links[i]);
link.classList.remove('active');
if link.innerText.Contains(page) then
link.classList.add('active');
end;
end;
procedure TFViewMain.mnuLogoutClick(Sender: TObject);
......@@ -112,6 +169,7 @@ end;
procedure TFViewMain.wllblUserProfileClick(Sender: TObject);
begin
ShowCrudForm(TFViewUserProfile);
lblAppTitle.Caption := 'Koehler-Gibson User Profile';
end;
......@@ -152,11 +210,29 @@ begin
Application.CreateForm(AFormClass, WebPanel1.ElementID, FChildForm);
end;
procedure TFViewMain.EditUser( Mode, FullName, Username, Phone, Email, Location: string; Admin, Active: boolean);
procedure TFViewMain.EditUser(Mode, Username, Password, Name, Status, Email,
Access, Rights, Perspective, QB: string);
begin
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFViewEditUser.CreateForm(WebPanel1.ElementID, Mode, Username,
Password, Name, Status, Email, Access, Rights, Perspective, QB);
end;
procedure TFViewMain.ViewOrders(info: string);
begin
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFViewOrders.CreateForm(WebPanel1.ElementID, info);
end;
procedure TFViewMain.ViewOrderEntry(orderInfo, mode: string);
begin
lblAppTitle.Caption := 'Koehler-Gibson Order Entry';
if Assigned(FChildForm) then
FChildForm.Free;
FChildForm := TFViewEditUser.CreateForm(WebPanel1.ElementID, Mode, FullName, Username, Phone, Email, Location, Admin, Active);
FChildForm := TFOrderEntry.CreateForm(WebPanel1.ElementID, orderInfo, mode);
end;
procedure TFViewMain.ShowUserForm(Info: string);
......
object FOrderList: TFOrderList
Width = 1016
Height = 683
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
OnShow = WebFormShow
object lblEntries: TWebLabel
Left = 0
Top = 336
Width = 77
Height = 14
Caption = 'Showing 0 of ...'
ElementID = 'lblentries'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object lblEntries2: TWebLabel
Left = 8
Top = 358
Width = 49
Height = 14
Caption = 'lblEntries2'
ElementID = 'lblentries2'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtSearch: TWebEdit
Left = 8
Top = 384
Width = 121
Height = 22
HelpType = htKeyword
ChildOrder = 8
ElementClassName = 'form-control'
ElementID = 'edtsearch'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
HideSelection = False
WidthPercent = 100.000000000000000000
end
object pnlMessage: TWebPanel
Left = 24
Top = 57
Width = 121
Height = 33
ElementClassName = 'card'
ElementID = 'pnl_message'
ChildOrder = 5
ElementBodyClassName = 'card-body'
ElementFont = efCSS
ElementPosition = epRelative
Role = 'alert'
TabOrder = 1
object lblMessage: TWebLabel
Left = 28
Top = 9
Width = 44
Height = 14
Caption = 'Message'
ElementID = 'pnl_message'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnCloseNotification: TWebButton
Left = 96
Top = 3
Width = 22
Height = 25
ChildOrder = 1
ElementClassName = 'btn btn-light'
ElementID = 'view.login.message.button'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Role = 'button'
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000
end
end
object WebDBTableControl: TWebDBTableControl
Left = 172
Top = 287
Width = 530
Height = 265
ElementClassName = 'table-responsive'
ElementId = 'customer_list'
BorderColor = clSilver
ChildOrder = 5
ColHeader = False
ElementTableClassName = 'table table-striped table-bordered table-hover dataTable'
Options.ResizeColumns = True
Columns = <
item
DataField = 'ID'
Title = 'ID'
Width = 24
end
item
DataField = 'NAME'
Title = 'NAME'
Width = 100
end
item
DataField = 'SHORT_NAME'
Title = 'SHORT_NAME'
end
item
DataField = 'ADDRESS'
Title = 'ADDRESS'
end>
DataSource = wdsCustomers
end
object cbCorrugatedPlate: TWebCheckBox
Left = 172
Top = 210
Width = 113
Height = 22
Caption = 'Corrugated Plate'
Checked = True
ChildOrder = 5
HeightPercent = 100.000000000000000000
State = cbChecked
WidthPercent = 100.000000000000000000
OnClick = cbCorrugatedPlateClick
end
object cbWebPlate: TWebCheckBox
Left = 304
Top = 210
Width = 113
Height = 22
Caption = 'Web Plate'
ChildOrder = 5
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = cbWebPlateClick
end
object edtCompanyName: TWebEdit
Left = 302
Top = 252
Width = 121
Height = 22
ChildOrder = 7
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object edtID: TWebEdit
Left = 172
Top = 252
Width = 121
Height = 22
ChildOrder = 8
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnConfirm: TWebButton
Left = 564
Top = 251
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 9
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 88
Top = 434
end
object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 84
Top = 490
object xdwdsCustomersID: TIntegerField
FieldName = 'ID'
end
object xdwdsCustomersNAME: TStringField
FieldName = 'NAME'
end
object xdwdsCustomersSHORT_NAME: TStringField
FieldName = 'SHORT_NAME'
end
object xdwdsCustomersADDRESS: TStringField
FieldName = 'ADDRESS'
end
end
object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers
Left = 38
Top = 562
end
end
<div class="row">
<div class="col-12">
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<div class="row">
<div class="col-sm">
<div id="pnl_message" class="alert alert-danger">
<button id="view.login.message.button" type="button" class="btn-close" aria-label="Close"></button>
<span id="view.login.message.label"></span>
</div>
</div>
</div>
<div class="row">
<label id="lblentries"></label>
</div>
<label id="lblentries2"></label>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination">
<!-- Pagination items will be added dynamically via Delphi code -->
</ul>
</nav>
</div>
</div>
</div>
</div>
unit View.OrderList;
interface
uses
System.SysUtils, System.Generics.Collections, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, WEBLib.Menus, WEBLib.ExtCtrls, WEBLib.StdCtrls,
WEBLib.JSON, Auth.Service, XData.Web.Client, WebLib.Storage,
ConnectionModule, App.Types, Vcl.StdCtrls, Vcl.Controls, WEBLib.DBCtrls,
Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.DB, WEBLib.Grids,
Vcl.Grids;
type
TFOrderList = class(TWebForm)
lblEntries: TWebLabel;
lblEntries2: TWebLabel;
edtSearch: TWebEdit;
pnlMessage: TWebPanel;
lblMessage: TWebLabel;
btnCloseNotification: TWebButton;
XDataWebClient1: TXDataWebClient;
xdwdsCustomers: TXDataWebDataSet;
wdsCustomers: TWebDataSource;
xdwdsCustomersID: TIntegerField;
xdwdsCustomersNAME: TStringField;
xdwdsCustomersSHORT_NAME: TStringField;
xdwdsCustomersADDRESS: TStringField;
WebDBTableControl: TWebDBTableControl;
cbCorrugatedPlate: TWebCheckBox;
cbWebPlate: TWebCheckBox;
edtCompanyName: TWebEdit;
edtID: TWebEdit;
btnConfirm: TWebButton;
procedure WebFormShow(Sender: TObject);
procedure WebDBTableControlGetCellChildren(Sender: TObject; ACol,
ARow: Integer; AField: TField; AValue: string;
AElement: TJSHTMLElementRecord);
procedure cbCorrugatedPlateClick(Sender: TObject);
procedure cbWebPlateClick(Sender: TObject);
private
//FJSONProc: TJSONProc;
procedure AddRowToTable();
procedure ClearTable();
[async] procedure getCustomers();
public
class function CreateForm(AElementID: string): TWebForm;
end;
var
FOrderList: TFOrderList;
implementation
{$R *.dfm}
class function TFOrderList.CreateForm(AElementID: string): TWebForm;
begin
Application.CreateForm(TFOrderList, AElementID, Result,
procedure(AForm: TObject)
begin
with TFOrderList(AForm) do
begin
end;
end
);
end;
procedure TFOrderList.WebDBTableControlGetCellChildren(Sender: TObject; ACol,
ARow: Integer; AField: TField; AValue: string;
AElement: TJSHTMLElementRecord);
begin
//WebDBTableControl.WidthStyle := TSizeStyle.ssAuto;
console.log(AValue);
WebDBTableControl.ColWidths[ACol] := AValue.Length * 12;
end;
procedure TFOrderList.WebFormShow(Sender: TObject);
begin
getCustomers();
end;
procedure TFOrderList.cbCorrugatedPlateClick(Sender: TObject);
begin
cbWebPlate.Checked := false;
end;
procedure TFOrderList.cbWebPlateClick(Sender: TObject);
begin
cbCorrugatedPlate.Checked := false;
end;
procedure TFOrderList.ClearTable();
// clears the table
var
tbody: TJSHTMLElement;
begin
tbody := TJSHTMLElement(document.getElementById('tblCustomerGrid').getElementsByTagName('tbody')[0]);
tbody.innerHTML := '';
end;
procedure TFOrderList.getCustomers();
var
xdcResponse: TXDataClientResponse;
customerList: TJSObject;
data: TJSArray;
i, count: integer;
temp: TJSONObject;
customer: TJSObject;
begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomers',
[]));
customerList := TJSObject(xdcResponse.Result);
data := TJSArray(customerList['data']);
count := integer(customerList['count']);
xdwdsCustomers.Close;
xdwdsCustomers.SetJsonData(customerList['data']);
xdwdsCustomers.Open;
end;
procedure TFOrderList.AddRowToTable();
var
NewRow, Cell, P, Button, Audio: TJSHTMLElement;
ClickHandler: TJSFunction;
//strColorList: string;
id: integer;
begin
NewRow := TJSHTMLElement(document.createElement('tr'));
//NewRow.Attrs['orderType'] := XDataWebDataSet1orderType.Value;
NewRow.addEventListener('click', procedure
begin
//orderEntry(NewRow.Attrs['id'], 'EDIT');
end);
// Company ID Cell
NewRow.Attrs['id'] := xdwdsCustomersID.AsString;
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order ID');
if xdwdsCustomersID.AsString = '' then
Cell.innerText := 'None'
else
Cell.innerText := xdwdsCustomersID.AsString;
NewRow.appendChild(Cell);
// Company Name Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Company Name');
if xdwdsCustomersNAME.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := xdwdsCustomersNAME.Value;
NewRow.appendChild(Cell);
// Short Name Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Job Name');
if xdwdsCustomersSHORT_NAME.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := xdwdsCustomersSHORT_NAME.Value;
NewRow.appendChild(Cell);
// Address Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Order Date');
if xdwdsCustomersADDRESS.Value = '' then
Cell.innerText := 'None'
else
Cell.innerText := xdwdsCustomersADDRESS.Value;
NewRow.appendChild(Cell);
// Appends new rows to the table body
TJSHTMLElement(document.getElementById('tblCustomerGrid').getElementsByTagName('tbody')[0]).appendChild(NewRow);
end;
end.
object FViewOrders: TFViewOrders
Width = 676
Height = 480
CSSLibrary = cssBootstrap
ElementFont = efCSS
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
OnCreate = WebFormCreate
OnShow = WebFormShow
object lblEntries: TWebLabel
Left = 0
Top = 336
Width = 77
Height = 13
Caption = 'Showing 0 of ...'
ElementID = 'lblentries'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object lblEntries2: TWebLabel
Left = 8
Top = 358
Width = 49
Height = 13
Caption = 'lblEntries2'
ElementID = 'lblentries2'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object wcbPageSize: TWebComboBox
Left = -4
Top = 52
Width = 145
Height = 21
ElementClassName = 'custom-select'
ElementID = 'wcbpagesize'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Text = '10'
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'10'
'25'
'50')
end
object wcbSortBy: TWebComboBox
Left = 0
Top = 18
Width = 145
Height = 21
ElementClassName = 'custom-select'
ElementID = 'wcbsortby'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Text = 'PROOF DONE'
WidthPercent = 100.000000000000000000
ItemIndex = -1
Items.Strings = (
'PROOF DUE'
'PROOF DONE'
'ART DUE'
'ART DONE'
'PLATE DUE'
'PLATE DONE'
'MOUNT DUE'
'MOUNT DONE'
'SHIP DUE'
'SHIP DONE')
end
object btnApply: TWebButton
Left = 542
Top = 16
Width = 96
Height = 25
Caption = 'Apply'
ChildOrder = 7
ElementClassName = 'btn btn-light'
ElementID = 'btnapply'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnApplyClick
end
object edtSearch: TWebEdit
Left = 48
Top = 382
Width = 121
Height = 22
HelpType = htKeyword
ChildOrder = 8
ElementClassName = 'form-control'
ElementID = 'edtsearch'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
HideSelection = False
WidthPercent = 100.000000000000000000
end
object btnaddOrder: TWebButton
Left = 0
Top = 79
Width = 96
Height = 25
Caption = 'Add Order'
ChildOrder = 5
ElementClassName = 'btn btn-light'
ElementID = 'btnaddorder'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnaddOrderClick
end
object btnFilters: TWebButton
Left = 542
Top = 50
Width = 96
Height = 25
Caption = 'Show Filters'
ChildOrder = 6
ElementClassName = 'btn btn-light'
ElementID = 'btnfilters'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnFiltersClick
end
object dtpStartDate: TWebDateTimePicker
Left = 168
Top = 16
Width = 170
Height = 22
ElementClassName = 'form-control'
ElementID = 'dtpstartdate'
HeightStyle = ssAuto
BorderStyle = bsSingle
ChildOrder = 7
Color = clWhite
Date = 45553.505972858790000000
ElementFont = efCSS
Role = ''
Text = ''
end
object dtpEndDate: TWebDateTimePicker
Left = 356
Top = 16
Width = 170
Height = 22
ElementClassName = 'form-control'
ElementID = 'dtpenddate'
HeightStyle = ssAuto
BorderStyle = bsSingle
ChildOrder = 7
Color = clWhite
Date = 45553.505972858790000000
ElementFont = efCSS
Role = ''
Text = ''
end
object pnlMessage: TWebPanel
Left = 220
Top = 429
Width = 121
Height = 33
ElementClassName = 'card'
ElementID = 'pnl_message'
ChildOrder = 5
ElementBodyClassName = 'card-body'
ElementFont = efCSS
ElementPosition = epRelative
Role = 'alert'
TabOrder = 8
object lblMessage: TWebLabel
Left = 28
Top = 9
Width = 42
Height = 13
Caption = 'Message'
ElementID = 'pnl_message'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnCloseNotification: TWebButton
Left = 96
Top = 3
Width = 22
Height = 25
ChildOrder = 1
ElementClassName = 'btn btn-light'
ElementID = 'view.login.message.button'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
Role = 'button'
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000
OnClick = btnCloseNotificationClick
end
end
object WebButton1: TWebButton
Left = 174
Top = 79
Width = 96
Height = 25
Caption = 'Set Status'
ChildOrder = 11
ElementClassName = 'btn btn-light'
ElementID = 'btnsetstatus'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebButton2: TWebButton
Left = 344
Top = 79
Width = 96
Height = 25
Caption = 'PDF'
ChildOrder = 12
ElementClassName = 'btn btn-light'
ElementID = 'btngeneratepdf'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object btnConfirm: TWebButton
Left = 566
Top = 317
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 13
ElementClassName = 'btn btn-light'
ElementID = 'btn_confirm_order'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
object wcbCustomers: TWebDBLookupComboBox
Left = 550
Top = 286
Width = 145
Height = 22
ElementClassName = 'custom-select'
ElementID = 'wcbcustomer'
ElementFont = efCSS
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = wcbCustomersChange
DataField = 'CURR_ID'
DataSource = wdsSave
KeyField = 'ID'
ListField = 'NAME'
ListSource = wdsCustomers
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 8
Top = 430
end
object XDataWebDataSet1: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 58
Top = 432
object XDataWebDataSet1ID: TStringField
FieldName = 'ID'
end
object XDataWebDataSet1companyName: TStringField
FieldName = 'companyName'
end
object XDataWebDataSet1jobName: TStringField
FieldName = 'jobName'
end
object XDataWebDataSet1orderDate: TStringField
FieldName = 'orderDate'
end
object XDataWebDataSet1proofDue: TStringField
FieldName = 'proofDue'
end
object XDataWebDataSet1proofDone: TStringField
FieldName = 'proofDone'
end
object XDataWebDataSet1artDue: TStringField
FieldName = 'artDue'
end
object XDataWebDataSet1artDone: TStringField
FieldName = 'artDone'
end
object XDataWebDataSet1mountDue: TStringField
FieldName = 'mountDue'
end
object XDataWebDataSet1mountDone: TStringField
FieldName = 'mountDone'
end
object XDataWebDataSet1shipDue: TStringField
FieldName = 'shipDue'
end
object XDataWebDataSet1shipDone: TStringField
FieldName = 'shipDone'
end
object XDataWebDataSet1price: TStringField
FieldName = 'price'
end
object XDataWebDataSet1qbRefNum: TStringField
FieldName = 'qbRefNum'
end
object XDataWebDataSet1colors: TStringField
FieldName = 'colors'
end
object XDataWebDataSet1plateDue: TStringField
FieldName = 'plateDue'
end
object XDataWebDataSet1plateDone: TStringField
FieldName = 'plateDone'
end
object XDataWebDataSet1orderType: TStringField
FieldName = 'orderType'
end
end
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
Left = 94
Top = 430
end
object wdsCustomers: TWebDataSource
DataSet = xdwdsCustomers
Left = 598
Top = 406
end
object xdwdsCustomers: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 596
Top = 354
object xdwdsCustomersNAME: TStringField
FieldName = 'NAME'
end
object xdwdsCustomersID: TIntegerField
FieldName = 'ID'
end
object xdwdsCustomersCURR_ID: TIntegerField
FieldName = 'CURR_ID'
end
end
object xdwdsSave: TXDataWebDataSet
Connection = DMConnection.ApiConnection
Left = 498
Top = 352
object xdwdsSaveCURR_ID: TIntegerField
FieldName = 'CURR_ID'
end
end
object wdsSave: TWebDataSource
DataSet = xdwdsSave
Left = 490
Top = 408
end
end
<div class="row">
<div class="col-12">
<div class="container mt-4">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<div class="row">
<div class="col-sm">
<div id="pnl_message" class="alert alert-danger">
<button id="view.login.message.button" type="button" class="btn-close" aria-label="Close"></button>
<span id="view.login.message.label"></span>
</div>
</div>
</div>
<div class="mb-3" id="filter_info" style="display: none;">
<div class="row">
<!-- Search Input Field -->
<div class="col-auto">
<label class='pe-2' style="font-weight: 700;">Search:</label>
<input class="form-control input-sm" id="edtsearch">
</div>
<!-- Start Date Input Field -->
<div class="col-auto">
<label class='pe-2' style="font-weight: 700;">Start Date:</label>
<input class="form-control input-sm" id="dtpstartdate" type="date">
</div>
<!-- End Date Input Field -->
<div class="col-auto">
<label class='pe-2' style="font-weight: 700;">End Date:</label>
<input class="form-control input-sm" id="dtpenddate" type="date">
</div>
<!-- Status Type Dropdown -->
<div class="col-auto">
<label style="font-weight: 700;">Status Type:</label>
<div>
<select class="form-control input-sm" id="wcbsortby" style="font-size: 1.00rem; height: calc(2.25rem + 2px); padding-top: 0.375rem; padding-bottom: 0.375rem;"></select>
</div>
</div>
<!-- Button (Align this with the inputs) -->
<div class="col-auto d-flex align-items-end">
<label style="font-weight: 700;"> </label>
<button class="btn btn-primary btn-sm" id="btnapply">Apply</button>
</div>
</div>
</div>
<form class="form-inline">
<div class= "row">
<div class="col-sm-3">
<label class="py-2" style="font-weight: 700;">Show <select class="custom-select" id="wcbpagesize" style="font-size: 1.00rem;"></select> entries</label>
</div>
<div class="col-sm-2">
<button class= "ps-3" id="btnaddorder"></button>
</div>
<div class="col-sm-2">
<button class= "ps-3" id="btnsetstatus"></button>
</div>
<div class="col-sm-2">
<button class= "ps-3" id="btngeneratepdf"></button>
</div>
<div class="col-sm-2">
<button class= "ps-3" id="btnfilters"></button>
</div>
</div>
</form>
</div>
<div class="row">
<label id="lblentries"></label>
</div>
<table class="table table-responsive table-striped table-bordered" id="tblPhoneGrid">
<thead class="thead-dark">
<tr>
<th scope="col">Order ID</th>
<th scope="col">Company Name</th>
<th scope="col">Job Name</th>
<th scope="col">Order Date</th>
<th scope="col">Proof Due</th>
<th scope="col">Proof Date</th>
<th scope="col">Art Due</th>
<th scope="col">Art Done</th>
<th scope="col">Plate Due</th>
<th scope="col">Plate Done</th>
<th scope="col">Mount Due</th>
<th scope="col">Mount Done</th>
<th scope="col">Ship Due</th>
<th scope="col">Ship Done</th>
<th scope="col">Price</th>
<th scope="col">Quickbooks Reference Number</th>
<th scope="col">Colors</th>
</tr>
</thead>
<tbody>
<!-- Rows will be added dynamically via Delphi code -->
</tbody>
</table>
<label id="lblentries2"></label>
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center" id="pagination">
<!-- Pagination items will be added dynamically via Delphi code -->
</ul>
</nav>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirmation_modal_label">Select Customer</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<select class="form-control input-sm" id="wcbcustomer"></select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" id="btn_confirm_order">Confirm</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header" id="view.userprofile.title">User Profile</h1>
<div class="row">
<div class=col-sm>
<div id="view.login.message" class="alert alert-danger">
......
<div class="row">
<div class="col-12">
<h1 class="page-header pt-3" id="view.calls.title" style="font-size: 24px;">Users</h1>
<div class="container mt-4">
<div class="container mt-4 px-0">
<div class="row justify-content-center">
<div class="col-12 col-md-8">
<div class="row">
......@@ -12,6 +11,7 @@
</div>
</div>
</div>
</div>
<div class="row justify-content-center py-2">
<div class="col-sm">
<button id="btnadduser" class="btn btn-primary">Add User></button>
......@@ -30,6 +30,7 @@
<th scope="col">System Rights</th>
<th scope="col">Perspective ID</th>
<th scope="col">QB ID</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
......@@ -47,7 +48,7 @@
</div>
</div>
</div>
</div>
<!--</div> -->
<!--</div> -->
<div class="modal fade" id="confirmation_modal" tabindex="-1" aria-labelledby="confirmation_modal_label" aria-hidden="true">
<div class="modal-dialog">
......
......@@ -121,12 +121,14 @@ var
cells: TJSHTMLCollection;
UserID: TJSNode;
Username: TJSNode;
Password: TJSNode;
FullName: TJSNode;
PhoneNum: TJSNode;
Status: TJSNode;
Email: TJSNode;
Admin: TJSNode;
Password: TJSNode;
Location: TJSNode;
Access: TJSNode;
Rights: TJSNode;
Perspective: TJSNode;
QB: TJSNode;
isAdmin: boolean;
isActive: boolean;
ButtonCancel: TJSHTMLElement;
......@@ -143,18 +145,16 @@ begin
Username := cells[1];
Password := cells[2];
FullName := cells[3];
PhoneNum := cells[4];
Status := cells[4];
Email := cells[5];
Location := cells[6];
if TJSHTMLElement(cells[7].childNodes.item(0).childNodes.item(0)).attributes.Attrs['checked'] = nil then
isAdmin := false
else
isAdmin := true;
if TJSHTMLElement(cells[8].childNodes.item(0).childNodes.item(0)).attributes.Attrs['checked'] = nil then
isActive := false
else
isActive := true;
FViewMain.EditUser('Edit', Username.innerText, FullName.innerText, PhoneNum.innerText, Email.innerText, Location.innerText, isAdmin, isActive);
Access := cells[6];
Rights := cells[7];
Perspective := cells[8];
QB := cells[9];
FViewMain.EditUser('Edit', Username.innerText, Password.innerText, FullName.innerText,
Status.innerText, Email.innerText, Access.innerText,
Rights.innerText, Perspective.innerText, QB.innerText);
end;
......@@ -346,10 +346,9 @@ begin
XDataWebDataSet1.Open;
for i := 0 to data.Length - 1 do
begin
console.log(user);
user := TJSObject(data[i]);
AddRowToTable(XDataWebDataSet1userID.AsString, XDataWebDataSet1username.AsString,
XDataWebDataSet1full_name.AsString, XDataWebDataSet1password.AsString,
XDataWebDataSet1password.AsString, XDataWebDataSet1full_name.AsString,
XDataWebDataSet1status.AsString, XDataWebDataSet1email_address.AsString,
XDataWebDataSet1Atype.AsString, XDataWebDataSet1perspectiveID.AsString,
XDataWebDataSet1QBID.AsString, XDataWebDataSet1rights.AsInteger);
......@@ -409,7 +408,7 @@ begin
Cell.innerText := Full_Name;
NewRow.appendChild(Cell);
// Phone Cell
// Status Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Status');
Cell.innerText := Status;
......@@ -446,6 +445,19 @@ begin
Cell.innerText := QBID;
NewRow.appendChild(Cell);
// Edit Cell
Cell := TJSHTMLElement(document.createElement('td'));
Cell.setAttribute('data-label', 'Edit');
Button := TJSHTMLElement(document.createElement('a'));
Button.className := 'btn btn-primary';
Button.innerHTML := '<i class="far fa-edit fa-fw"></i><span>Edit</span>';
Button.addEventListener('click', procedure(Event: TJSMouseEvent)
begin
EditUser(TJSHTMLElement(NewRow));
end);
Cell.appendChild(Button);
NewRow.appendChild(Cell);
// Appends new rows to the table body
TJSHTMLElement(document.getElementById('tblPhoneGrid').getElementsByTagName('tbody')[0]).appendChild(NewRow);
end;
......@@ -453,7 +465,7 @@ end;
procedure TFViewUsers.btnAddUserClick(Sender: TObject);
begin
//Info := '';
FViewMain.EditUser('Add', '', '', '', '', 'All', false, true);
FViewMain.EditUser('Add', '', '', '', '', '', '', '', '', '');
end;
procedure TFViewUsers.btnCloseNotificationClick(Sender: TObject);
......
......@@ -7,6 +7,8 @@
background-color: #fff;
}
.card-header {
width: 100%;
text-align: left; /* Align text to the left */
......@@ -19,10 +21,84 @@
box-sizing: border-box; /* Ensure padding is included in the element's total width and height */
}
/* Ensure that the title does not affect the navbar layout */
#view.main.apptitle {
display: flex;
align-items: center;
justify-content: flex-start; /* Align title to the left */
width: auto; /* Ensure it doesn't stretch the container */
margin-right: 20px; /* Optional: add space between title and navbar items */
}
/* Fixed width for title area to prevent shifting */
#title {
white-space: nowrap; /* Prevent the title text from wrapping */
width: 200px; /* Fixed width for the title */
text-overflow: ellipsis; /* Truncate text with ellipsis if it overflows */
overflow: hidden;
font-weight: bold; /* Optional: make the title text bold */
}
/* Navbar items - keep them aligned and spaced out */
.navbar-nav .nav-item {
padding: 0 15px; /* Adjust spacing between navbar items */
}
/* Flexbox for the entire navbar */
.navbar-nav {
display: flex;
justify-content: flex-end; /* Align navbar items to the right */
width: 100%;
}
/* Additional mobile responsiveness (optional) */
@media (max-width: 1200px) {
.navbar-nav {
flex-direction: column; /* Stack items vertically on smaller screens */
align-items: flex-start; /* Align items to the left */
}
.navbar-nav-spaced .nav-item {
padding: 10px 0; /* Adjust vertical spacing between items */
}
}
/* Make sure active navbar item color gets applied */
.navbar-nav .nav-item a.active {
color: #fff !important; /* Set text color to white for active item */
background-color: #004F84 !important; /* Darker blue for active background */
font-weight: bold;
}
/* Default navbar item color */
.navbar-nav .nav-item a {
color: #000 !important; /* Default color for links */
transition: color 0.3s ease;
}
/* Navbar item hover state */
.navbar-nav .nav-item a:hover {
color: #fff !important; /* Set hover text color to white */
background-color: #286090 !important; /* Light blue on hover */
}
.nav-item {
padding: 0 20px; /* Adjust this value for desired spacing between labels */
}
.mr-2 {
margin-right: 0.5rem;
}
.custom-h4 {
margin-bottom: 5px;
}
.custom-hr {
margin-top: 5px;
margin-bottom: 10px;
}
.custom-select-large {
font-size: 1.25rem;
padding: 0.5rem;
......
program webKGOrders;
uses
Vcl.Forms,
XData.Web.Connection,
......@@ -13,12 +11,14 @@ uses
View.ErrorPage in 'View.ErrorPage.pas' {FViewErrorPage: TWebForm} {*.html},
App.Config in 'App.Config.pas',
Paginator.Plugins in 'Paginator.Plugins.pas',
View.Calls in 'View.Calls.pas' {FViewCalls: TWebForm} {*.html},
View.Items in 'View.Items.pas' {FViewItems: TWebForm} {*.html},
View.Main in 'View.Main.pas' {FViewMain: TWebForm} {*.html},
View.Home in 'View.Home.pas' {FViewHome: TWebForm} {*.html},
View.Admin in 'View.Admin.pas' {FViewAdmin: TWebForm} {*.html},
View.Users in 'View.Users.pas' {FViewUsers: TWebForm} {*.html},
View.EditUser in 'View.EditUser.pas' {FViewEditUser: TWebForm} {*.html};
View.EditUser in 'View.EditUser.pas' {FViewEditUser: TWebForm} {*.html},
View.Orders in 'View.Orders.pas' {FViewOrders: TWebForm} {*.html},
View.OrderEntryCorrugated in 'View.OrderEntryCorrugated.pas' {FOrderEntry: TWebForm} {*.html},
View.OrderList in 'View.OrderList.pas' {FOrderList: TWebForm} {*.html};
{$R *.res}
......
......@@ -136,8 +136,8 @@
</DCCReference>
<DCCReference Include="App.Config.pas"/>
<DCCReference Include="Paginator.Plugins.pas"/>
<DCCReference Include="View.Calls.pas">
<Form>FViewCalls</Form>
<DCCReference Include="View.Items.pas">
<Form>FViewItems</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
......@@ -151,11 +151,6 @@
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.Admin.pas">
<Form>FViewAdmin</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.Users.pas">
<Form>FViewUsers</Form>
<FormType>dfm</FormType>
......@@ -166,6 +161,21 @@
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.Orders.pas">
<Form>FViewOrders</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.OrderEntryCorrugated.pas">
<Form>FOrderEntry</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<DCCReference Include="View.OrderList.pas">
<Form>FOrderList</Form>
<FormType>dfm</FormType>
<DesignClass>TWebForm</DesignClass>
</DCCReference>
<None Include="index.html"/>
<None Include="template\css\app.css"/>
<BuildConfiguration Include="Base">
......
......@@ -15,6 +15,95 @@ type
ucKG: TUniConnection;
UniQuery1: TUniQuery;
MySQLUniProvider1: TMySQLUniProvider;
UniQuery2: TUniQuery;
uqOrders: TUniQuery;
uqOrdersORDER_ID: TIntegerField;
uqOrdersCOMPANY_ID: TIntegerField;
uqOrdersUSER_ID: TIntegerField;
uqOrdersORDER_DATE: TDateTimeField;
uqOrdersSTART_DATE: TDateField;
uqOrdersEND_DATE: TDateField;
uqOrdersORDER_STATUS: TStringField;
uqOrdersSCHED_JSON: TStringField;
uqOrdersstaff_fields_order_date: TDateField;
uqOrdersstaff_fields_proof_date: TDateField;
uqOrdersstaff_fields_ship_date: TDateField;
uqOrdersstaff_fields_ship_via: TStringField;
uqOrdersstaff_fields_price: TStringField;
uqOrdersstaff_fields_invoice_to: TStringField;
uqOrdersstaff_fields_invoice_attention: TStringField;
uqOrdersstaff_fields_ship_to: TStringField;
uqOrdersstaff_fields_ship_attention: TStringField;
uqOrdersstaff_fields_po_number: TStringField;
uqOrdersstaff_fields_job_name: TStringField;
uqOrdersstaff_fields_art_due: TDateField;
uqOrdersstaff_fields_plate_due: TDateField;
uqOrdersstaff_fields_mount_due: TDateField;
uqOrdersplates_job_number: TStringField;
uqOrderssupplied_by_customer_b_w_copy: TStringField;
uqOrderssupplied_by_customer_color_copy: TStringField;
uqOrderssupplied_by_customer_plates: TStringField;
uqOrderssupplied_by_customer_sample_ca: TStringField;
uqOrderssupplied_by_customer_dimension: TStringField;
uqOrderssupplied_by_customer_disk_or_cd: TStringField;
uqOrderssupplied_by_customer_e_mail: TStringField;
uqOrderssupplied_by_customer_ftp: TStringField;
uqOrderssupplied_by_customer_other: TStringField;
uqOrderssupplied_by_customer_existing_: TStringField;
uqOrderssupplied_by_customer_ref_art_p: TStringField;
uqOrderssupplied_by_customer_ref_art_a: TStringField;
uqOrderscut_die_cutdier: TStringField;
uqOrderscut_die_cutdieb: TStringField;
uqOrderscut_die_cutdief: TStringField;
uqOrderscut_die_cutdierkr: TStringField;
uqOrderscut_die_cutdiefkr: TStringField;
uqOrderscut_die_cad_file: TStringField;
uqOrderscut_die_attached: TStringField;
uqOrderscut_die_boxpol250: TStringField;
uqOrderscut_die_boxpol155: TStringField;
uqOrderscut_die_boxpol125: TStringField;
uqOrderscut_die_brub: TStringField;
uqOrdersproofing_fax: TStringField;
uqOrdersproofing_fax_attn: TStringField;
uqOrdersproofing_e_mail: TStringField;
uqOrdersproofing_e_mail_attn: TStringField;
uqOrdersproofing_ship_to: TStringField;
uqOrdersproofing_full_size_panel: TStringField;
uqOrdersproofing_print_card: TStringField;
uqOrdersproofing_wide_format: TStringField;
uqOrdersproofing_pdf_file: TStringField;
uqOrdersproofing_other: TStringField;
uqOrdersproofing_art_approved_as_is: TStringField;
uqOrdersproofing_approved_date: TDateField;
uqOrdersproofing_changes_required: TStringField;
uqOrdersproofing_changes_date: TDateField;
uqOrderslayout_rsc_l: TStringField;
uqOrderslayout_rcs_w: TStringField;
uqOrderslayout_rcs_d: TStringField;
uqOrderslayout_die_cut_no: TStringField;
uqOrderslayout_accross_no: TStringField;
uqOrderslayout_around_no: TStringField;
uqOrderslayout_cad_file: TStringField;
uqOrderslayout_excalibur_die: TStringField;
uqOrdersmounting_loose: TStringField;
uqOrdersmounting_sticky_bak: TStringField;
uqOrdersmounting_full_mount: TStringField;
uqOrdersmounting_strip_mount: TStringField;
uqOrderscolors_cylinder_size: TStringField;
uqOrderscolors_machine_ident: TStringField;
uqOrdersmounting_standard_setup: TStringField;
uqOrdersmounting_custom_backing: TStringField;
uqOrdersmounting_custom_adhesive: TStringField;
uqOrderscolors_cross_hairs: TStringField;
uqOrderscolors_clemson: TStringField;
uqOrdersplates_thickness: TStringField;
uqOrdersplates_plate_material: TStringField;
uqOrdersgeneral_special_instructions: TStringField;
uqOrderscolors_colors: TStringField;
uqOrdersstaff_fields_quickbooks_item: TStringField;
uqOrdersstaff_fields_quantity: TStringField;
uqOrderslayout_rsc_style: TStringField;
uqOrdersstaff_fields_art_location: TStringField;
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
......
......@@ -20,34 +20,6 @@ const
API_MODEL = 'Api';
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
public
......@@ -69,17 +41,174 @@ type
data: TList<TUserItem>;
end;
TItemItem = class
public
ID: string;
name: string;
description: string;
status: string;
end;
TItemList = class
public
count: integer;
data: TList<TItemItem>;
end;
TOrderItem = class
public
ID,
companyName,
jobName,
orderDate,
proofDue,
proofDone,
artDue,
artDone,
plateDue,
plateDone,
mountDue,
mountDone,
shipDue,
shipDone,
price,
qbRefNum,
orderType,
colors: string;
end;
TOrderList = class
Public
count: integer;
data: TList<TOrderItem>;
end;
TCustomerItem = class
Public
NAME: string;
ID: integer;
SHORT_NAME: string;
ADDRESS: string;
end;
TCustomerList = class
Public
count: integer;
data: TList<TCustomerItem>;
end;
TFullOrder = class
Public
//Company
NAME: string;
SHORT_NAME: string;
inQuickBooks: string;
// Staff Fields:
staff_fields_order_date: string;
staff_fields_proof_date: string;
staff_fields_ship_date: string;
staff_fields_ship_via: string;
staff_fields_quantity: string;
staff_fields_price: string;
staff_fields_invoice_to: string;
staff_fields_ship_to: string;
staff_fields_po_number: string;
staff_fields_job_name: string;
staff_fields_quickbooks_item: string;
staff_fields_art_due: string;
staff_fields_plate_due: string;
staff_fields_mount_due: string;
staff_fields_art_location: string;
// Supplied by Customer:
supplied_by_customer_b_w_copy: boolean;
supplied_by_customer_color_copy: boolean;
supplied_by_customer_plates: boolean;
supplied_by_customer_sample_ca: boolean;
supplied_by_customer_dimension: string;
supplied_by_customer_disk_or_cd: boolean;
supplied_by_customer_e_mail: string;
supplied_by_customer_ftp: string;
supplied_by_customer_other: string;
supplied_by_customer_existing_: string;
supplied_by_customer_ref_art_p: string;
supplied_by_customer_ref_art_a: string;
// Layout
layout_rsc_l: string;
//Typos to match database typos
layout_rcs_w: string;
layout_rcs_d: string;
layout_die_cut_no: string;
layout_accross_no: string;
layout_around_no: string;
layout_cad_file: string;
layout_excalibur_die: boolean;
layout_rsc_style: string;
// Mounting
mounting_loose: string;
mounting_sticky_bak: boolean;
mounting_full_mount: boolean;
mounting_strip_mount: string;
mounting_standard_setup: string;
mounting_custom_backing: string;
mounting_custom_adhesive: string;
// Colors
colors_cylinder_size: string;
colors_machine_ident: string;
colors_cross_hairs: string;
colors_clemson: string;
colors_colors: string;
// Proofing
proofing_fax: string;
proofing_fax_attn: string;
proofing_e_mail: string;
proofing_e_mail_attn: string;
proofing_ship_to: string;
proofing_full_size_panel: boolean;
proofing_print_card: boolean;
proofing_wide_format: boolean;
proofing_pdf_file: boolean;
proofing_other: string;
proofing_art_approved_as_is: boolean;
proofing_approved_date: string;
// Plates
plates_thickness: string;
plates_plate_material: string;
plates_job_number: string;
// General
general_special_instructions: string;
end;
type
[ServiceContract]
ILookupService = interface(IInvokable)
['{F24E1468-5279-401F-A877-CD48B44F4416}']
[HttpGet] function GetCalls(searchOptions: string): TCallList;
[HttpGet] function Search(phoneNum: string): TCallList;
[HttpGet] function Search(phoneNum: string): TOrderList;
[HttpGet] function GetUsers(searchOptions: string): TUserList;
[HttpGet] function GetItems(searchOptions: string): TItemList;
[HttpGet] function GetOrders(searchOptions: string): TOrderList;
[HttpGet] function GetOrder(orderInfo: string): TFullOrder;
[HttpGet] function GetCustomers(): TCustomerList;
function AddUser(userInfo: string): string;
function AddItem(itemInfo: string): string;
function DelUser(username: string): string;
function EditUser(const editOptions: string): string;
function AddCorrugatedOrder(orderInfo: string): TJSONObject;
function AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string;
end;
implementation
......
object FMain: TFMain
Left = 0
Top = 0
Caption = 'envoy Calls Server 2'
Caption = 'KG Orders Server'
ClientHeight = 597
ClientWidth = 764
Color = clBtnFace
......
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:
//Elias Sarraf
//Mac ...
......
......@@ -156,6 +156,6 @@ begin
Application.MainFormOnTaskbar := True;
Application.CreateForm(TFMain, FMain);
Logger.AddAppender(TMemoLogAppender.Create( 5, FMain.memoinfo ));
Logger.AddAppender(TFileLogAppender.Create( 5, 'envoyCallsServer' ));
Logger.AddAppender(TFileLogAppender.Create( 5, 'kgOrdersServer' ));
Application.Run;
end.
[Options]
LogFileNum=15
LogFileNum=223
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