I'm having two arrays : first one is empdata
holding empid
and events attended by that employee, then second array is holding event details.
I need to compare empid
from array with user input and display particular event details attended by respective employee using collapsible jQuery. Find total price also.
$scope.empdata=[];
$scope.data = [];
//first array data
$scope.empdata.push({
empid:'empid_1',
events:[{
event:'First Event'
},
{
event:'Second Event'
}
]})
$scope.empdata.push({
empid:'empid_2',
events:[{
event:'First Event'
},
{
event:'Second Event'
},
{
event:'Third Event'
}]
})
//second array data
$scope.data.push({
event:'First Event',
date: '10-jun-2015',
type:[{
name: 'Hotel Booking',
price: 400.00
},{
name: 'Flight',
price: 400.00
},{
name: 'Honorarium',
price: 900.00
}]
})
$scope.data.push({
event:'Second Event',
date: '27-july-2015',
type:[{
name: 'Hotel Booking',
price: 530.00
},{
name: 'Train',
price: 400.00
},{
name: 'Honorarium',
price: 600.00
}]
})
$scope.data.push({
event:'Third Event',
date: '20-aug-2015',
type:[{
name: 'Hotel Booking',
price: 910.00
},{
name: 'Flight',
price: 500.00
},{
name: 'Honorarium',
price: 1500.00
}]
})
Thanks in advance!