Okay, I have implemented Search function in my data list
Problem and Example:
For The Table consist of : username, email address, role, day created
What i wanted to do and problem that I have met
There is 2 different input , 1 is "Date/Time" , and 1 is "role" search function
What i want: When I type : roles (teacher) , it show able to list out all the details of the data(teacher) when i choose : 06/16/2019 , it show show all the data that have been created today
Is there any tips/idea how to do it ? what i have done : I am able to perform a search function when i choose a date and input a role . But I can't do it when i tried to separate it . Such as "search for "teacher" ) it will show Error for me .
EDIT(UPDATE)
$roles = ($this>url>segment(3)) ? $this>url>segment(3) : $dbRoles ;
$dateCreated = ($this>url>segment(4)) ? $this>url>segment(4) : $createDate;
The code above show is the part of the code that i trying to do .
When user only search for roles it will use the first line which is only using segment(3) , but when user search by "date" it will use the segment(4) code.
In other part of my codes , include of segment(5) which is when both(roles and date) is search together.
In other words, i wanted to know how do i able to make it when search by roles it force to use the segment(3) code, when search by date , use segment(4) .