#StayAtHome ×

ramiwahdan

Members

70

Community Reputation

0 Neutral

• Rank
Regular Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. calculate absent days

Hi, I need to calculate absent percentage but not sure how. working days from Sunday to Thursday every week so 5 working days a week. i will calculate the absent days from joining date until current date. Example if joining date is 24-3-2020 and today's date is 7-4-2020 i should get the number of absent days to 11 days since both Friday and Saturday are excluded. How to do that? here is what I have: \$workingdays = \$curdate - \$joindate; \$workingdays = \$workingdays - \$absent = (\$counter / \$workingdays) * 100; the second line i missing the number of days for (Fridays and Saturdays) that should be excluded from calculations. The third line i did calculate the actual working days (\$counter) for the employee so then i can get percentage of absent days. How to exclude the weekend days from calculations?
2. php array and where clause

Figured it out \$ids = join("','",\$arr); \$qry = "select OracleID, StaffName,joindate from staff WHERE OracleID NOT IN ('\$ids')"; \$answ = mysqli_query(\$con, \$qry); Thanks
3. php array and where clause

Hi, I have an empty array and i populated the array through code and i printed to check if everything ok. So far so good. I now have an array say \$ids = ('123','456'). Now, i have a table in db that has ids as well, I need to make a query to check for id's that are not inside the array, so if the db table have '123','456','789' i want the result of the query to be only the last one '789'. \$arr = array(); array_push(\$arr,\$previd2); print_r (\$arr); I get the result as follows: Array ( [0] => 533349 [1] => 533355 ) so what query i can use to get the other id's from db table that is not part of that array? here is what i tried: \$qry = "select staffname, joindate from staff WHERE OracleID NOT IN (\$arr)"; \$answ = mysqli_query(\$con, \$qry); I get error: Notice : Array to string conversion in C:\xampp\htdocs\AttendanceSystem\login\reportsforallid.php
4. page break for table

it should output to a single link to go to the fpdf file you shared with me

6. page break for table

i am getting a link for each record not each oracle id! i need to have one link for all the id's Print Attendance and Absent Reports for Rami T Wahdan Print Attendance and Absent Reports for Rami T Wahdan Print Attendance and Absent Reports for Shahed R Wahdan Print Attendance and Absent Reports for Shahed R Wahdan As you see, I have 2 records for Rami and 2 records for Shahed, the reason why i am getting for each record because i have this inside while loop. I can figure it out to print once for each oracle id, but the problem is, how to send one link for all oracle ids? Thanks
7. page break for table

I am using your code, i passed link from my old page to new page that has your code, the line that makes the select statement is having that error. for fpdf i am using your code with page named fpdf.php
8. mysqli insert from form

Hi, you need to change \$conn to \$link you have: if (\$conn->query(\$sql) === TRUE) { and have: \$conn->close(); change them to if (\$link->query(\$sql) === TRUE) { and \$link->close();

10. page break for table

First, thanks for the big help. So i will keep my original untouched or i will only take the code you gave me? If i keep the original, what changes i need to do to that? your screenshots shows both attendance and absent tables, is if from the file you gave me? If i need to add the link you gave me to my original php file, it changes based on choices, how to get that? Lastly, I used to get the dates from a form, in your file, how are we getting these dates?

12. page break for table

screenshot, the data split to second page, instead i want the absent table to all move to second page in the printer
13. page break for table

I have print page using window.print in the body tag at the beginning of php file and i am trying to make the rest of the code as second page, the last table will be on the second page. it is not working. code: <b>Absent Report:</b> <table style ="page-break-before: always;" border='1'> <tr><th>ID</th><th>Name</th><th>Absent</th></tr> <?=\$tdata?> </table> <a href="singlereportbyid.php" width="100%">Click here to go back to Main Menu</a> </div> </div> </div> </div> </body> </html> why it is not working?
14. SQL for specific user (oracle id)

i got it when you said the word date and realized i have start date. now, can i add to that code an end date? \$month = \$sdate1; \$start_date = new DateTime("\$month"); \$incr = DateInterval::createFromDateString('next weekday'); \$period = new DatePeriod(\$start_date, \$incr, new DateTime()); can i have end date since it is taking start date?
15. SQL for specific user (oracle id)

i am sorry that you got upset but in my company they might search for someone for a week as example so they dont want to look the whole month.
×

• Activity

• Chat
×
• Create New...