SHARE
TWEET

Untitled

a guest Jul 18th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Table
  2.     dayorder:
  3.         id day
  4.         1 day1
  5.         2 day2
  6.         3 day3
  7.         4 day4
  8.         5 day5
  9.         6 SAT
  10.         7 day6
  11. Table
  12. Hour:
  13.    id
  14.     1
  15.     2
  16.     3
  17.     4
  18.     5
  19.     6
  20.     7
  21.      
  22. SELECT student_id,deptno,Month, Year_c,
  23. branch.description as bdesc,
  24. course.coursecode as ccd,
  25. users.firstname as ufn,
  26. users.lastname as uln,
  27. course.description as ccdes,schedules.hour as hhour,
  28. h,dayorder,AttdDate,
  29. CONCAT(AttdDate,h,dayorder) AS fate,
  30. IF(Day_c=1, p, " ") AS '1',
  31. IF(Day_c=2, p, " ") AS '2',
  32. IF(Day_c=3, p, " ") AS '3',
  33. IF(Day_c=4, p, " ") AS '4',
  34. IF(Day_c=5, p, " ") AS '5',
  35. IF(Day_c=6, p, " ") AS '6',
  36. IF(Day_c=7, p, " ") AS '7',
  37. IF(Day_c=8, p, " ") AS '8',
  38. IF(Day_c=9, p, " ") AS '9',
  39. IF(Day_c=10, p, " ") AS '10',
  40. IF(Day_c=11, p, " ") AS '11',
  41. IF(Day_c=12, p, " ") AS '12',
  42. IF(Day_c=13, p, " ") AS '13',
  43. IF(Day_c=14, p, " ") AS '14',
  44. IF(Day_c=15, p, " ") AS '15',
  45. IF(Day_c=16, p, " ") AS '16',
  46. IF(Day_c=17, p, " ") AS '17',
  47. IF(Day_c=18, p, " ") AS '18',
  48. IF(Day_c=19, p, " ") AS '19',
  49. IF(Day_c=20, p, " ") AS '20',
  50. IF(Day_c=21, p, " ") AS '21',
  51. IF(Day_c=22, p, " ") AS '22',
  52. IF(Day_c=23, p, " ") AS '23',
  53. IF(Day_c=24, p, " ") AS '24',
  54. IF(Day_c=25, p, " ") AS '25',
  55. IF(Day_c=26, p, " ") AS '26',
  56. IF(Day_c=27, p, " ") AS '27',
  57. IF(Day_c=28, p, " ") AS '28',
  58. IF(Day_c=29, p, " ") AS '29',
  59. IF(Day_c=30, p, " ") AS '30',
  60. IF(Day_c=31, p, " ") AS '31'
  61. FROM
  62. (SELECT *,DAY(date) AS Day_c,
  63. MONTHNAME(date) AS Month,
  64. Year(date) AS Year_c,
  65. date(date) AS AttdDate,hour as h, day as dayorder,
  66. (CASE  WHEN present = 1
  67.     THEN 'P'
  68.     WHEN present = 0
  69.     THEN 'A'
  70.     WHEN present is null  
  71.     THEN ' '
  72. END) AS p
  73. FROM attendance a
  74. WHERE date between '$from' AND '$to' And branch = $branchid AND coursecode = $courseid AND batch = $batchid
  75. GROUP BY student_id
  76. ORDER BY student_rollno ASC
  77. )
  78. as report
  79. LEFT JOIN branch on branch.id = report.branch
  80. LEFT JOIN course on course.id = report.coursecode
  81. LEFT JOIN users on users.id = report.user
  82. LEFT JOIN schedules on schedules.id = report.hour
  83. ORDER BY Month DESC, Year_c DESC
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top