Commit c99d264d by cam

Finished the item page

parent 6d65b61f
...@@ -22,37 +22,6 @@ object FViewCalls: TFViewCalls ...@@ -22,37 +22,6 @@ object FViewCalls: TFViewCalls
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end 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 object wcbPageSize: TWebComboBox
Left = 0 Left = 0
Top = 0 Top = 0
...@@ -71,23 +40,6 @@ object FViewCalls: TFViewCalls ...@@ -71,23 +40,6 @@ object FViewCalls: TFViewCalls
'25' '25'
'50') '50')
end 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 object btnApply: TWebButton
Left = 478 Left = 478
Top = 128 Top = 128
...@@ -103,43 +55,27 @@ object FViewCalls: TFViewCalls ...@@ -103,43 +55,27 @@ object FViewCalls: TFViewCalls
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = btnApplyClick OnClick = btnApplyClick
end end
object edtSearch: TWebEdit object edtName: 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
TextHint = 'Format: (XXX) XXX-XXXX'
WidthPercent = 100.000000000000000000
end
object dtpStartDate: TWebEdit
Left = 342 Left = 342
Top = 0 Top = 0
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 10 ChildOrder = 10
ElementClassName = 'form-control' ElementClassName = 'form-control'
ElementID = 'dtpstartdate' ElementID = 'edtname'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object dtpEndDate: TWebEdit object edtDescription: TWebEdit
Left = 478 Left = 478
Top = 0 Top = 0
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 10 ChildOrder = 10
ElementClassName = 'form-control' ElementClassName = 'form-control'
ElementID = 'dtpenddate' ElementID = 'edtdescription'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
......
...@@ -5,39 +5,33 @@ ...@@ -5,39 +5,33 @@
<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">
<form class="form-inline"> <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="row">
<div class="col-sm-6"> <div class="col-sm-6">
<label style="font-weight: 700;">Start Date:</label> <label style="font-weight: 700;">Name:</label>
<input class="form-control input-sm" id="dtpstartdate" type="date"> <input class="form-control input-sm" id="edtname">
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<label class= 'pe-2'style="font-weight: 700;">End Date:</label> <label class= 'pe-2'style="font-weight: 700;">Description:</label>
<input class="form-control input-sm" id="dtpenddate" type="date"> <input class="form-control input-sm" id="edtdescription">
</div> </div>
</div> </div>
</form> </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"> <form class="form-inline">
<div class= "row"> <div class= "row">
<div class="col-sm-5"> <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> <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>
<div class="col-sm-5"> <div class="col-sm-5">
<label class="py-2" style="font-weight: 700;">Sorted by:</label>
<select class="custom-select" id="wcbsortby" style="font-size: 1.00rem;"></select>
</div>
<div class="col-sm-2">
<button class= "ps-3" id="btnapply"></button> <button class= "ps-3" id="btnapply"></button>
</div> </div>
</div> </div>
...@@ -86,10 +80,27 @@ ...@@ -86,10 +80,27 @@
</div> </div>
<script> <script>
// JavaScript function to stop audio document.getElementById('tblPhoneGrid').addEventListener('click', function(event) {
function stopAudio() { // Check if the clicked element is a table cell (td)
var audioPlayer = document.getElementById('audioPlayer'); if (event.target.tagName === 'TD') {
audioPlayer.pause(); // Pause the audio const row = event.target.parentNode;
audioPlayer.currentTime = 0; // Reset audio to beginning 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> </script>
...@@ -16,16 +16,13 @@ uses ...@@ -16,16 +16,13 @@ uses
type type
TFViewCalls = class(TWebForm) TFViewCalls = class(TWebForm)
wcbLocation: TWebLookupComboBox;
XDataWebClient1: TXDataWebClient; XDataWebClient1: TXDataWebClient;
XDataWebDataSet1: TXDataWebDataSet; XDataWebDataSet1: TXDataWebDataSet;
lblEntries: TWebLabel; lblEntries: TWebLabel;
wcbPageSize: TWebComboBox; wcbPageSize: TWebComboBox;
wcbSortBy: TWebComboBox;
btnApply: TWebButton; btnApply: TWebButton;
edtSearch: TWebEdit; edtName: TWebEdit;
dtpStartDate: TWebEdit; edtDescription: TWebEdit;
dtpEndDate: TWebEdit;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
procedure btnApplyClick(Sender: TObject); procedure btnApplyClick(Sender: TObject);
procedure btnSearchClick(Sender: TObject); procedure btnSearchClick(Sender: TObject);
...@@ -72,8 +69,7 @@ begin ...@@ -72,8 +69,7 @@ begin
PageNumber := 1; PageNumber := 1;
TotalPages := 1; // Initial total pages TotalPages := 1; // Initial total pages
wcbPageSize.Text := '10'; wcbPageSize.Text := '10';
getUser(); getItems(GenerateSearchOptions());
wcbSortBy.Text := 'Date';
end; end;
procedure TFViewCalls.getUser(); procedure TFViewCalls.getUser();
...@@ -82,12 +78,7 @@ var ...@@ -82,12 +78,7 @@ var
userList, user: TJSObject; userList, user: TJSObject;
data: TJSArray; data: TJSArray;
begin begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetUsers',
[JS.toString(AuthService.TokenPayload.Properties['user_name'])]));
userList := TJSObject(xdcResponse.Result);
data := TJSArray(userList['data']);
user := TJSObject(data[0]);
wcbLocation.DisplayText := string(user['location']);
end; end;
...@@ -403,17 +394,10 @@ searchOptions: string; ...@@ -403,17 +394,10 @@ searchOptions: string;
begin begin
PageNumber := 1; PageNumber := 1;
PageSize := StrToInt(wcbPageSize.Text); PageSize := StrToInt(wcbPageSize.Text);
StartDate := dtpStartDate.Text; searchOptions := '&pagenumber=' + IntToStr(PageNumber) +
EndDate := dtpEndDate.Text;
OrderBy := wcbSortBy.Text;
Caller := edtSearch.Text;
searchOptions := '&phonenumber=' + wcbLocation.Value +
'&pagenumber=' + IntToStr(PageNumber) +
'&pagesize=' + IntToStr(PageSize) + '&pagesize=' + IntToStr(PageSize) +
'&startdate=' + StartDate + '&orderby=' + OrderBy;
'&enddate=' + EndDate +
'&orderby=' + OrderBy +
'&caller=' + Caller;
console.log('GetItems'); console.log('GetItems');
GetItems(searchOptions); GetItems(searchOptions);
end; end;
...@@ -451,7 +435,7 @@ end; ...@@ -451,7 +435,7 @@ end;
procedure TFViewCalls.btnSearchClick(Sender: TObject); procedure TFViewCalls.btnSearchClick(Sender: TObject);
// calls Search method // calls Search method
begin begin
Search(edtSearch.Text); //Search(edtSearch.Text);
end; end;
procedure TFViewCalls.ClearTable(); procedure TFViewCalls.ClearTable();
...@@ -469,16 +453,9 @@ var ...@@ -469,16 +453,9 @@ var
searchOptions: string; searchOptions: string;
begin begin
PageSize := StrToInt(wcbPageSize.Text); PageSize := StrToInt(wcbPageSize.Text);
StartDate := dtpStartDate.Text; searchOptions := '&pagenumber=' + IntToStr(PageNumber) +
EndDate := dtpEndDate.Text;
OrderBy := wcbSortBy.Text;
searchOptions := '&phonenumber=' + wcbLocation.Value +
'&pagenumber=' + IntToStr(PageNumber) +
'&pagesize=' + IntToStr(PageSize) + '&pagesize=' + IntToStr(PageSize) +
'&startdate=' + StartDate + '&orderby=' + OrderBy;
'&enddate=' + EndDate +
'&orderby=' + OrderBy +
'&caller=' + Caller;
Result := searchOptions; Result := searchOptions;
end; end;
......
...@@ -64,7 +64,7 @@ object FViewMain: TFViewMain ...@@ -64,7 +64,7 @@ object FViewMain: TFViewMain
Top = 56 Top = 56
Width = 29 Width = 29
Height = 15 Height = 15
ElementID = 'dropdown.menu.callslist' ElementID = 'dropdown.menu.itemlist'
ElementFont = efCSS ElementFont = efCSS
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<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="dropdown.menu.callslist" href="#"><i class="fa fa-phone fa-fw"></i><span> Calls</span></a> <a class="dropdown-item" id="dropdown.menu.itemlist" href="#"><i class="fa fa-phone 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>
......
[Options] [Options]
LogFileNum=31 LogFileNum=32
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