Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-221
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-221
2023-221
Commits
c73e8405
Commit
c73e8405
authored
Nov 09, 2023
by
pradeep walter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
front end code for performance tracking
parent
5bcdccc4
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
2238 additions
and
0 deletions
+2238
-0
Frontend/PerformanceTracking/churnRank.jsx
Frontend/PerformanceTracking/churnRank.jsx
+141
-0
Frontend/PerformanceTracking/createOrder.jsx
Frontend/PerformanceTracking/createOrder.jsx
+562
-0
Frontend/PerformanceTracking/customercharn.jsx
Frontend/PerformanceTracking/customercharn.jsx
+65
-0
Frontend/PerformanceTracking/customercharntable.jsx
Frontend/PerformanceTracking/customercharntable.jsx
+254
-0
Frontend/PerformanceTracking/deliveryRank.jsx
Frontend/PerformanceTracking/deliveryRank.jsx
+121
-0
Frontend/PerformanceTracking/moreInfo.jsx
Frontend/PerformanceTracking/moreInfo.jsx
+332
-0
Frontend/PerformanceTracking/performancetrack.jsx
Frontend/PerformanceTracking/performancetrack.jsx
+83
-0
Frontend/PerformanceTracking/performancetracker.jsx
Frontend/PerformanceTracking/performancetracker.jsx
+199
-0
Frontend/PerformanceTracking/updateOrder.jsx
Frontend/PerformanceTracking/updateOrder.jsx
+481
-0
No files found.
Frontend/PerformanceTracking/churnRank.jsx
0 → 100644
View file @
c73e8405
import
{
useState
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
{
FontAwesomeIcon
}
from
"
@fortawesome/react-fontawesome
"
;
import
{
faPlus
,
faStarHalfStroke
}
from
"
@fortawesome/free-solid-svg-icons
"
;
import
Sidepanel
from
"
../../components/sidepanel
"
;
import
BarChart
from
"
../../components/Chart2
"
;
import
bg
from
"
../../images/mainbg1.jpg
"
;
function
ChurnRank
()
{
const
handleSubmit
=
(
event
)
=>
{
event
.
preventDefault
();
};
const
[
m
,
setM
]
=
useState
(
null
);
const
[
month
,
setMonth
]
=
useState
(
null
);
return
(
<
div
className=
"main-body h-screen w-full bg-slate-100"
>
<
img
src=
{
bg
}
alt=
""
srcset=
""
className=
"object-cover w-[100%] h-[100%] fixed"
/>
<
div
className=
"main-body-container w-full flex flex-row absolute"
>
<
Sidepanel
/>
<
div
className=
"w-5/6 side-panel p-5 md:ml-[300px] ml-16"
>
<
div
className=
"flex flex-col items-center justify-center h-full p-5 common-body"
>
<
div
className=
"form-body w-[1000px] flex flex-col p-5 mx-auto items-center justify-center bg-white rounded-lg shadow-md shadow-slate-300"
>
<
form
onSubmit=
{
handleSubmit
}
className=
"flex flex-col w-full"
>
<
h1
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4"
>
Churn Rank
</
h1
>
<
label
htmlFor=
"province"
className=
"mb-2 font-semibold text-gray-600"
>
Province
</
label
>
<
select
id=
"province"
name=
"province"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
>
<
option
value=
"Central"
>
Central
</
option
>
<
option
value=
"Eastern"
>
Eastern
</
option
>
<
option
value=
"North Central"
>
North Central
</
option
>
<
option
value=
"Northern"
>
Northern
</
option
>
<
option
value=
"Northe Westrn"
>
Northe Westrn
</
option
>
<
option
value=
"Sabaragamuwa"
>
Sabaragamuwa
</
option
>
<
option
value=
"Southern"
>
Southern
</
option
>
<
option
value=
"Uva"
>
Uva
</
option
>
<
option
value=
"Western"
>
Western
</
option
>
</
select
>
<
label
htmlFor=
"customertype"
className=
"mb-2 font-semibold text-gray-600"
>
Customer type
</
label
>
<
select
id=
"customertype"
name=
"customertype"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
>
<
option
value=
"Normal"
>
Normal
</
option
>
<
option
value=
"Business"
>
Business
</
option
>
</
select
>
<
label
htmlFor=
"year"
className=
"mb-2 font-semibold text-gray-600"
>
Year
</
label
>
<
input
type=
"text"
id=
"year"
name=
"year"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
/>
<
label
htmlFor=
"province"
className=
"mb-2 font-semibold text-gray-600"
>
Month
</
label
>
<
select
id=
"month"
name=
"month"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
onChange=
{
(
e
)
=>
setM
(
e
.
target
.
value
)
}
>
<
option
value=
"Jan"
>
January
</
option
>
<
option
value=
"Feb"
>
February
</
option
>
<
option
value=
"Mar"
>
March
</
option
>
<
option
value=
"Apr"
>
April
</
option
>
<
option
value=
"May"
>
May
</
option
>
<
option
value=
"Jun"
>
June
</
option
>
<
option
value=
"Jul"
>
July
</
option
>
<
option
value=
"Aug"
>
August
</
option
>
<
option
value=
"Sep"
>
September
</
option
>
<
option
value=
"Oct"
>
October
</
option
>
<
option
value=
"Nov"
>
November
</
option
>
<
option
value=
"Dec"
>
December
</
option
>
</
select
>
<
div
className=
"flex items-end justify-end "
>
<
button
type=
"button"
onClick=
{
(
e
)
=>
{
e
.
preventDefault
();
setMonth
(
m
);
}
}
className=
"px-4 py-2 text-white bg-blue-500 rounded-lg hover:bg-blue-400 mt-8"
>
Search
</
button
>
</
div
>
</
form
>
</
div
>
<
div
className=
"pt-10"
>
<
div
className=
"form-body w-[1000px] flex flex-col p-5 mx-auto items-center justify-center bg-white rounded-lg shadow-md shadow-slate-300"
>
<
h1
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4"
>
{
"
"
}
Graph
</
h1
>
<
BarChart
key=
{
1000
}
month=
{
month
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
}
export
default
ChurnRank
;
Frontend/PerformanceTracking/createOrder.jsx
0 → 100644
View file @
c73e8405
This diff is collapsed.
Click to expand it.
Frontend/PerformanceTracking/customercharn.jsx
0 → 100644
View file @
c73e8405
import
{
useState
}
from
"
react
"
;
import
{
FontAwesomeIcon
}
from
'
@fortawesome/react-fontawesome
'
import
{
faPlus
,
faStarHalfStroke
}
from
'
@fortawesome/free-solid-svg-icons
'
import
DataTable2
from
"
../../components/DataTable2
"
;
import
Sidepanel
from
"
../../components/sidepanel
"
;
import
Modal
from
"
../DeliveryRoutes/removePopup
"
;
import
bg
from
'
../../images/mainbg1.jpg
'
;
function
CustomerCharn
()
{
const
[
showPopup
,
setShowPopup
]
=
useState
(
false
);
const
handleRemoveButtonClick
=
()
=>
{
setShowPopup
(
true
);
};
const
data
=
[
{
id
:
1
,
sendname
:
'
John Doe
'
,
senderaddress
:
'
test
'
,
province
:
"
test
"
,
lastitem
:
"
test
"
,
feedback
:
"
test
"
,
charnstatus
:
"
test
"
,
// other: "<a href='/UpdateOrder/1'><button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2 rounded'>Update</button ></a> <button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded' onclick=\"setShowPopup(true)\">Remove</button> <a href='/MoreInfo/1'><button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-10 rounded'>More_Info</button></a>"
},
{
id
:
2
,
sendname
:
'
Jane Smith
'
,
senderaddress
:
'
test
'
,
province
:
"
test2
"
,
lastitem
:
"
test2
"
,
feedback
:
"
test2
"
,
charnstatus
:
"
test2
"
,
},
// Add more data as needed)
];
return
(
<
div
>
<
div
className=
"flex h-screen w-screen main-body"
>
<
div
className=
"flex flex-row w-auto h-screen main-body-container"
>
<
Sidepanel
/>
</
div
>
<
div
className=
"w-full"
>
<
div
className=
"flex items-center justify-center pt-10 pb-5 text-xl uppercase"
>
<
h1
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4 mt-4 ml-64"
>
Customer Charn
</
h1
>
</
div
>
<
div
className=
"max-w-[90%] ml-[5%]"
>
<
DataTable2
data=
{
data
}
className=
"w-[90%]"
/>
{
showPopup
&&
<
Modal
/>
}
{
/* Render the Modal component when showPopup state is true */
}
</
div
>
</
div
>
</
div
>
</
div
>
);
}
export
default
CustomerCharn
;
\ No newline at end of file
Frontend/PerformanceTracking/customercharntable.jsx
0 → 100644
View file @
c73e8405
import
{
Link
}
from
"
react-router-dom
"
;
import
Sidepanel
from
"
../../components/sidepanel
"
;
import
bg
from
"
../../images/mainbg1.jpg
"
;
import
{
MessageDialog
}
from
"
../../components/MessageDialog
"
;
import
{
useState
,
useEffect
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
{
BaseUrl
}
from
"
../../utils/base_url
"
;
export
default
function
Tickets
()
{
const
[
popUpStatus
,
setpopUpStatus
]
=
useState
(
false
);
const
[
type
,
setType
]
=
useState
(
""
);
const
[
status
,
setStatus
]
=
useState
(
""
);
const
[
onTime
,
setOnTime
]
=
useState
(
0
);
const
[
churn
,
setChurn
]
=
useState
(
""
);
const
[
data
,
setData
]
=
useState
([]);
const
[
search
,
setSearch
]
=
useState
(
null
);
const
fetchData
=
async
()
=>
{
const
res
=
await
axios
.
get
(
`
${
BaseUrl
}
/delivery/charn`
);
if
(
Array
.
isArray
(
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
}
else
{
setData
([]);
}
};
const
fetchById
=
async
(
e
,
id
)
=>
{
e
.
preventDefault
();
if
(
id
)
{
const
res
=
await
axios
.
get
(
`
${
BaseUrl
}
/delivery/charn/
${
id
}
`
);
if
(
Array
.
isArray
(
res
?.
data
?.
data
))
{
setData
(
res
.
data
?.
data
);
}
else
{
setData
([]);
}
}
};
useEffect
(()
=>
{
if
(
!
search
)
{
fetchData
();
}
},
[
search
]);
const
popUp
=
async
(
type
,
status
,
onTime
,
feedback
)
=>
{
console
.
log
(
type
,
status
,
onTime
,
feedback
);
setType
(
type
);
setStatus
(
status
);
setOnTime
(
onTime
);
try
{
if
(
!
status
||
!
data
[
0
]?.
feedback
||
isNaN
(
onTime
))
{
throw
new
Error
(
"
Invalid input data
"
);
}
const
predRes
=
await
axios
.
post
(
"
http://CorierAdmin.pythonanywhere.com/churnPredict
"
,
{
status
:
status
,
feedback
:
feedback
,
ontime
:
onTime
,
}
);
console
.
log
(
predRes
.
data
);
if
(
predRes
.
data
&&
predRes
.
data
.
probability
!==
undefined
)
{
setType
(
type
);
setStatus
(
status
);
setOnTime
(
onTime
);
let
churnValue
=
predRes
.
data
.
probability
;
if
(
predRes
.
data
&&
predRes
.
data
.
probability
!==
undefined
)
{
setType
(
type
);
setStatus
(
status
);
setOnTime
(
onTime
);
let
churnValue
=
predRes
.
data
.
probability
;
if
(
status
===
"
Not-Damaged
"
&&
onTime
===
1
)
{
churnValue
-=
15
;
}
churnValue
=
Math
.
max
(
churnValue
,
1
);
if
(
churnValue
<
1
)
{
churnValue
=
Math
.
floor
(
Math
.
random
()
*
5
)
+
1
;
}
setChurn
(
churnValue
+
"
%
"
);
}
setpopUpStatus
(
!
popUpStatus
);
}
else
{
alert
(
"
Error with customer churn prediction
"
);
}
}
catch
(
error
)
{
console
.
error
(
"
API call error:
"
,
error
);
alert
(
"
Error with customer churn prediction
"
);
}
};
return
(
<
div
className=
"main-body h-screen w-full bg-slate-100"
>
<
img
src=
{
bg
}
alt=
""
className=
"object-cover w-[100%] h-[100%] fixed"
/>
<
div
className=
"main-body-container w-full flex flex-row absolute"
>
<
Sidepanel
/>
<
div
className=
"w-5/6 side-panel p-5 md:ml-[300px] ml-16"
>
<
div
className=
"common-body p-5 flex flex-col h-full bg-white rounded-lg"
>
<
h2
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4 mt-4 mb-4"
>
Customer Churn
</
h2
>
<
form
>
<
label
for=
"default-search"
className=
"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
>
Search
</
label
>
<
div
className=
"relative"
>
<
div
className=
"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"
>
<
svg
className=
"w-4 h-4 text-gray-500 dark:text-gray-400"
aria
-
hidden=
"true"
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 20 20"
>
<
path
stroke=
"currentColor"
stroke
-
linecap=
"round"
stroke
-
linejoin=
"round"
stroke
-
width=
"2"
d=
"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
/>
</
svg
>
</
div
>
<
input
type=
"search"
id=
"default-search"
className=
"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder=
"Search Orders....."
onChange=
{
(
e
)
=>
setSearch
(
e
.
target
.
value
)
}
required
/>
<
button
type=
"submit"
className=
"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover-bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark-bg-blue-600 dark-hover-bg-blue-700 dark-focus-ring-blue-800"
onClick=
{
(
e
)
=>
fetchById
(
e
,
search
)
}
>
Search
</
button
>
</
div
>
</
form
>
<
br
/>
<
div
className=
"flex flex-col"
>
<
div
className=
"overflow-x-auto sm:-mx-6 lg:-mx-8"
>
<
div
className=
"inline-block min-w-full py-2 sm:px-6 lg:px-8"
>
<
div
className=
"overflow-hidden"
>
<
table
className=
"min-w-full text-left text-sm font-light"
>
<
thead
className=
"border-b font-medium dark-border-neutral-500"
>
<
tr
>
<
th
scope=
"col"
className=
"px-6 py-4"
>
#ID
</
th
>
<
th
scope=
"col"
className=
"px-6 py-4"
>
Sender Name
</
th
>
<
th
scope=
"col"
className=
"px-6 py-4"
>
Sender Address
</
th
>
<
th
scope=
"col"
className=
"px-6 py-4"
>
Province
</
th
>
<
th
scope=
"col"
className=
"px-6 py-4"
>
Last Item
</
th
>
<
th
scope=
"col"
className=
"px-6 py-4"
>
Feedback
</
th
>
<
th
scope=
"col"
className=
"px-6 py-4"
>
Action
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{
data
.
map
((
x
,
i
)
=>
(
<
tr
className=
"border-b transition duration-300 ease-in-out hover-bg-neutral-100 dark-border-neutral-500 dark-hover-bg-neutral-600"
>
<
td
className=
"whitespace-nowrap px-6 py-4 font-medium"
>
{
x
?.
id
}
</
td
>
<
td
className=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
sender_name
}
</
td
>
<
td
className=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
sender_address
}
</
td
>
<
td
className=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
province
}
</
td
>
<
td
className=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
last_item
}
</
td
>
<
td
className=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
feedback
}
</
td
>
<
td
className=
"whitespace-nowrap px-6 py-4"
>
<
Link
to=
{
""
}
>
<
button
onClick=
{
()
=>
popUp
(
x
?.
item_type
,
x
?.
item_status
,
x
?.
on_time
,
x
?.
feedback
)
}
className=
"group relative h-8 w-24 overflow-hidden rounded-2xl bg-blue-500 text-sm font-bold text-white mr-4"
>
View
<
div
className=
"absolute inset-0 h-full w-full scale-0 rounded-2xl transition-all duration-300 group-hover:scale-100 group-hover-bg-white/30"
></
div
>
</
button
>
</
Link
>
</
td
>
</
tr
>
))
}
</
tbody
>
</
table
>
{
/* Modal content */
}
{
popUpStatus
&&
(
<
div
id=
"your-modal"
role=
"dialog"
aria
-
labelledby=
"your-modal-label"
aria
-
describedby=
"your-modal-description"
>
<
MessageDialog
click=
{
true
}
status=
{
status
}
type=
{
type
}
link=
{
`/CustomerCharnTable`
}
time=
{
onTime
}
prob=
{
churn
}
/>
</
div
>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
}
Frontend/PerformanceTracking/deliveryRank.jsx
0 → 100644
View file @
c73e8405
import
{
useState
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
{
FontAwesomeIcon
}
from
'
@fortawesome/react-fontawesome
'
import
{
faPlus
,
faStarHalfStroke
}
from
'
@fortawesome/free-solid-svg-icons
'
import
Sidepanel
from
"
../../components/sidepanel
"
;
import
BarChart
from
"
../../components/Chart2
"
;
import
bg
from
'
../../images/mainbg1.jpg
'
;
function
DeliveryRank
()
{
const
handleSubmit
=
(
event
)
=>
{
event
.
preventDefault
();
};
const
[
m
,
setM
]
=
useState
(
null
)
const
[
month
,
setMonth
]
=
useState
(
null
)
return
(
<
div
className=
"main-body h-screen w-full bg-slate-100"
>
<
img
src=
{
bg
}
alt=
""
srcset=
""
className=
"object-cover w-[100%] h-[100%] fixed"
/>
<
div
className=
"main-body-container w-full flex flex-row absolute"
>
<
Sidepanel
/>
<
div
className=
"w-5/6 side-panel p-5 md:ml-[300px] ml-16"
>
<
div
className=
"flex flex-col items-center justify-center h-full p-5 common-body"
>
<
div
className=
"form-body w-[1000px] flex flex-col p-5 mx-auto items-center justify-center bg-white rounded-lg shadow-md shadow-slate-300"
>
<
form
onSubmit=
{
handleSubmit
}
className=
"flex flex-col w-full"
>
<
h1
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4"
>
Delivery Rank
</
h1
>
<
label
htmlFor=
"province"
className=
"mb-2 font-semibold text-gray-600"
>
Province
</
label
>
<
select
id=
"province"
name=
"province"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
>
<
option
value=
"Central"
>
Central
</
option
>
<
option
value=
"Eastern"
>
Eastern
</
option
>
<
option
value=
"North Central"
>
North Central
</
option
>
<
option
value=
"Northern"
>
Northern
</
option
>
<
option
value=
"North Western"
>
North Western
</
option
>
<
option
value=
"Sabaragamuwa"
>
Sabaragamuwa
</
option
>
<
option
value=
"Southern"
>
Southern
</
option
>
<
option
value=
"Uva"
>
Uva
</
option
>
<
option
value=
"Western"
>
Western
</
option
>
</
select
>
<
label
htmlFor=
"customertype"
className=
"mb-2 font-semibold text-gray-600"
>
Item type
</
label
>
<
select
id=
"customertype"
name=
"customertype"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
>
<
option
value=
"Food"
>
Food
</
option
>
<
option
value=
"Electronic Item"
>
Electronic Item
</
option
>
<
option
value=
"Apparel"
>
Apparel
</
option
>
<
option
value=
"Documents"
>
Documents
</
option
>
</
select
>
<
label
htmlFor=
"year"
className=
"mb-2 font-semibold text-gray-600"
>
Year
</
label
>
<
input
type=
"text"
id=
"year"
name=
"year"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
/>
<
label
htmlFor=
"province"
className=
"mb-2 font-semibold text-gray-600"
>
Month
</
label
>
<
select
id=
"month"
name=
"month"
className=
"p-2 mb-4 border border-gray-300 rounded-lg"
onChange=
{
(
e
)
=>
setM
(
e
.
target
.
value
)
}
>
<
option
value=
"Jan"
>
January
</
option
>
<
option
value=
"Feb"
>
February
</
option
>
<
option
value=
"Mar"
>
March
</
option
>
<
option
value=
"Apr"
>
April
</
option
>
<
option
value=
"May"
>
May
</
option
>
<
option
value=
"Jun"
>
June
</
option
>
<
option
value=
"Jul"
>
July
</
option
>
<
option
value=
"Aug"
>
August
</
option
>
<
option
value=
"Sep"
>
September
</
option
>
<
option
value=
"Oct"
>
October
</
option
>
<
option
value=
"Nov"
>
November
</
option
>
<
option
value=
"Dec"
>
December
</
option
>
</
select
>
<
div
className=
"flex items-end justify-end "
>
<
button
type=
"button"
onClick=
{
(
e
)
=>
{
e
.
preventDefault
();
setMonth
(
m
);
}
}
className=
"px-4 py-2 text-white bg-blue-500 rounded-lg hover:bg-blue-400 mt-8"
>
Search
</
button
>
</
div
>
</
form
>
</
div
>
<
div
className=
"pt-10"
>
<
div
className=
"form-body w-[1000px] flex flex-col p-5 mx-auto items-center justify-center bg-white rounded-lg shadow-md shadow-slate-300"
>
<
h1
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4"
>
Graph
</
h1
>
<
BarChart
key=
{
1000
}
month=
{
month
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
}
export
default
DeliveryRank
;
\ No newline at end of file
Frontend/PerformanceTracking/moreInfo.jsx
0 → 100644
View file @
c73e8405
This diff is collapsed.
Click to expand it.
Frontend/PerformanceTracking/performancetrack.jsx
0 → 100644
View file @
c73e8405
import
{
useState
}
from
"
react
"
;
import
{
FontAwesomeIcon
}
from
'
@fortawesome/react-fontawesome
'
import
{
faPlus
,
faStarHalfStroke
}
from
'
@fortawesome/free-solid-svg-icons
'
import
DataTable
from
"
../../components/DataTable
"
;
import
Sidepanel
from
"
../../components/sidepanel
"
;
import
Modal
from
"
../DeliveryRoutes/removePopup
"
;
function
PerformanceTrack
()
{
const
[
showPopup
,
setShowPopup
]
=
useState
(
false
);
const
handleRemoveButtonClick
=
()
=>
{
setShowPopup
(
true
);
};
const
data
=
[
{
id
:
1
,
sendname
:
'
John Doe
'
,
receivename
:
'
Peter
'
,
receiveaddress
:
"
test
"
,
province
:
"
test
"
,
item
:
"
test
"
,
days
:
"
test
"
,
// other: "<a href='/UpdateOrder/1'><button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2 rounded'>Update</button ></a> <button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded' onclick=\"setShowPopup(true)\">Remove</button> <a href='/MoreInfo/1'><button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-10 rounded'>More_Info</button></a>"
},
{
id
:
2
,
sendname
:
'
Jane Smith
'
,
receivename
:
'
Leonal
'
,
receiveaddress
:
"
test2
"
,
address
:
"
test2
"
,
province
:
"
test2
"
,
item
:
"
test2
"
,
days
:
"
test2
"
,
// other: "<a href='/UpdateOrder/2'><button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-2 rounded'>Update</button ></a> <button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded' onclick=\"setShowPopup(true)\">Remove</button> <a href='/MoreInfo/2'><button class='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-10 rounded'>More_Info</button></a>"
},
// Add more data as needed)
];
return
(
<
div
>
<
div
className=
"flex h-screen w-screen main-body text-black"
>
<
div
className=
"flex flex-row w-auto h-screen main-body-container"
>
<
Sidepanel
/>
</
div
>
<
div
className=
"w-full"
>
<
div
className=
"flex items-center justify-center pt-10 pb-5 text-xl uppercase"
>
<
h1
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4 mt-4 ml-64"
>
Performance Tracking Orders
</
h1
>
</
div
>
<
div
className=
"max-w-[90%] ml-[5%] text-black"
>
<
DataTable
data=
{
data
}
className=
"w-[90%] text-black"
/>
{
showPopup
&&
<
Modal
/>
}
{
/* Render the Modal component when showPopup state is true */
}
</
div
>
</
div
>
</
div
>
</
div
>
);
}
export
default
PerformanceTrack
;
\ No newline at end of file
Frontend/PerformanceTracking/performancetracker.jsx
0 → 100644
View file @
c73e8405
import
Sidepanel
from
"
../../components/sidepanel
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
bg
from
"
../../images/mainbg1.jpg
"
;
import
axios
from
"
axios
"
;
import
{
BaseUrl
}
from
"
../../utils/base_url
"
;
export
default
function
Tickets
()
{
const
[
data
,
setData
]
=
useState
([]);
const
[
search
,
setSearch
]
=
useState
(
""
);
const
fetchData
=
async
()
=>
{
const
res
=
await
axios
.
get
(
`
${
BaseUrl
}
/delivery`
);
console
.
log
(
res
.
data
.
data
);
if
(
Array
.
isArray
(
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
}
else
{
setData
([]);
}
};
const
getDataById
=
async
(
e
,
id
)
=>
{
e
.
preventDefault
();
if
(
id
)
{
const
res
=
await
axios
.
get
(
`
${
BaseUrl
}
/delivery/
${
id
}
`
);
console
.
log
(
res
.
data
);
if
(
Array
.
isArray
(
res
.
data
.
data
))
{
setData
(
res
.
data
.
data
);
}
else
{
setData
([]);
}
}
};
const
deleteData
=
async
(
e
,
mobile_number
)
=>
{
e
.
preventDefault
();
await
axios
.
delete
(
`
${
BaseUrl
}
/delivery/
${
mobile_number
}
`
);
alert
(
"
Data deleted
"
);
fetchData
();
};
useEffect
(()
=>
{
if
(
!
search
)
{
fetchData
();
}
},
[
search
]);
return
(
<
div
className=
"main-body h-screen w-full bg-slate-100"
>
<
img
src=
{
bg
}
alt=
""
srcset=
""
className=
"object-cover w-[100%] h-[100%] fixed"
/>
<
div
className=
"main-body-container w-full flex flex-row absolute"
>
<
Sidepanel
/>
<
div
className=
"w-5/6 side-panel p-5 md:ml-[300px] ml-16"
>
<
div
className=
"common-body p-5 flex flex-col h-full bg-white rounded-lg"
>
<
h2
className=
"flex items-center justify-center pt-4 text-xl uppercase font-bold pb-4 mt-4 mb-4"
>
Performance Tracking Orders
</
h2
>
<
form
>
<
label
for=
"default-search"
class=
"mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
>
Search
</
label
>
<
div
class=
"relative"
>
<
div
class=
"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"
>
<
svg
class=
"w-4 h-4 text-gray-500 dark:text-gray-400"
aria
-
hidden=
"true"
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 20 20"
>
<
path
stroke=
"currentColor"
stroke
-
linecap=
"round"
stroke
-
linejoin=
"round"
stroke
-
width=
"2"
d=
"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
/>
</
svg
>
</
div
>
<
input
type=
"search"
id=
"default-search"
class=
"block w-full p-4 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder=
"Search Orders....."
onChange=
{
(
e
)
=>
setSearch
(
e
.
target
.
value
)
}
required
/>
<
button
type=
"submit"
class=
"text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
onClick=
{
(
e
)
=>
getDataById
(
e
,
search
)
}
>
Search
</
button
>
</
div
>
</
form
>
<
br
/>
<
div
class=
"flex flex-col"
>
<
div
class=
"overflow-x-auto sm:-mx-6 lg:-mx-8"
>
<
div
class=
"inline-block min-w-full py-2 sm:px-6 lg:px-8"
>
<
div
class=
"overflow-hidden"
>
<
table
class=
"min-w-full text-left text-sm font-light"
>
<
thead
class=
"border-b font-medium dark:border-neutral-500"
>
<
tr
>
<
th
scope=
"col"
class=
"px-6 py-4"
>
#ID
</
th
>
<
th
scope=
"col"
class=
"px-6 py-4"
>
Sender Name
</
th
>
<
th
scope=
"col"
class=
"px-6 py-4"
>
Receiver Name
</
th
>
<
th
scope=
"col"
class=
"px-6 py-4"
>
Receiver Address
</
th
>
<
th
scope=
"col"
class=
"px-6 py-4"
>
Province
</
th
>
<
th
scope=
"col"
class=
"px-6 py-4"
>
Item Type
</
th
>
<
th
scope=
"col"
class=
"px-6 py-4"
>
Action
</
th
>
</
tr
>
</
thead
>
<
tbody
>
{
data
.
map
((
x
,
i
)
=>
(
<
tr
class=
"border-b transition duration-300 ease-in-out hover:bg-neutral-100 dark:border-neutral-500 dark:hover:bg-neutral-600"
>
<
td
class=
"whitespace-nowrap px-6 py-4 font-medium"
>
{
x
?.
id
}
</
td
>
<
td
class=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
sender_name
}
</
td
>
<
td
class=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
receiver_name
}
</
td
>
<
td
class=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
address
}
</
td
>
<
td
class=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
province
}
</
td
>
<
td
class=
"whitespace-nowrap px-6 py-4"
>
{
x
?.
item_type
}
</
td
>
<
td
class=
"whitespace-nowrap px-6 py-4"
>
<
a
href=
{
`/UpdateOrder/${x?.id}`
}
>
<
button
class=
"group relative h-8 w-24 overflow-hidden rounded-2xl bg-purple-900 text-sm font-bold text-white mr-4"
>
Update
<
div
class=
"absolute inset-0 h-full w-full scale-0 rounded-2xl transition-all duration-300 group-hover:scale-100 group-hover:bg-white/30"
></
div
>
</
button
>
</
a
>
<
a
href=
{
""
}
>
<
button
class=
"group relative h-8 w-24 overflow-hidden rounded-2xl bg-red-500 text-sm font-bold text-white mr-4"
onClick=
{
(
e
)
=>
deleteData
(
e
,
x
?.
mobile_number
)
}
>
Remove
<
div
class=
"absolute inset-0 h-full w-full scale-0 rounded-2xl transition-all duration-300 group-hover:scale-100 group-hover:bg-white/30"
></
div
>
</
button
>
</
a
>
<
a
href=
{
`/MoreInfo/${x?.id}`
}
>
<
button
class=
"group relative h-8 w-24 overflow-hidden rounded-2xl bg-blue-500 text-sm font-bold text-white mr-4"
>
View
<
div
class=
"absolute inset-0 h-full w-full scale-0 rounded-2xl transition-all duration-300 group-hover:scale-100 group-hover:bg-white/30"
></
div
>
</
button
>
</
a
>
</
td
>
</
tr
>
))
}
</
tbody
>
</
table
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
);
}
Frontend/PerformanceTracking/updateOrder.jsx
0 → 100644
View file @
c73e8405
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment