Last active
September 25, 2018 03:27
-
-
Save jonorsky/6dc426864e017933d14cfac94e3f51df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.theverge.com/2018/8/2/17642868/robots-turn-off-beg-not-to-empathy-media-equation | |
Public function getEvents() | |
{ | |
// From Block Table | |
$result=$this->S_Appointment_M->getEvents(); | |
// Requirement [ TO BE FIX!! ] | |
$student_counselor = $this->S_Appointment_M->check_my_counselor(); | |
//echo $resulted[0]->Counselor_ID; | |
//echo "<br>"; | |
//print_r($result); | |
// Major Fix: 7/5/2018 Default Start & End Table Conversion | |
// Changing Key Name with Switch and Unset | |
// Requirement [ TO BE FIX!! ] | |
foreach($result as $item) { | |
echo (int)$item->Counselor_ID; | |
echo ' '; | |
echo (int)$student_counselor[0]->Counselor_ID; | |
echo '<br>'; | |
if((int)$item->Counselor_ID == (int)$student_counselor[0]->Counselor_ID){ | |
// For ID | |
$temp_id = new StdClass(); | |
$temp_id = 0; | |
unset($item->Service_ID); | |
$item->{"id"} = $temp_id; | |
// For Title | |
$temp_title = new StdClass(); | |
$temp_title = "Not Available"; | |
unset($item->Service_Name); | |
$item->{"title"} = $temp_title; | |
// For Description | |
$temp_desc = new StdClass(); | |
$temp_desc = "Your Counselor is not available in this time."; | |
unset($item->Service_Description); | |
$item->{"description"} = $temp_desc; | |
// For Color | |
$temp_color = new StdClass(); | |
$temp_color = "#fdc830"; | |
unset($item->Service_Color); | |
$item->{"color"} = $temp_color; | |
// For Start | |
$temp_start = new StdClass(); | |
$temp_start = $item->Date_Start; | |
unset($item->Date_Start); | |
$item->{"start"} = $temp_start; | |
// For End | |
$temp_end = new StdClass(); | |
$temp_end = $item->Date_End; | |
unset($item->Date_End); | |
$item->{"end"} = $temp_end; | |
} | |
// echo '<br>'; | |
// echo $item->start; | |
// echo '<br>'; | |
} | |
Appointment Model | |
Public function check_my_counselor(){ | |
// echo $_SESSION['college_id']; | |
// echo '<br>'; | |
// echo $_SESSION['course']; | |
$array = array('College_ID' => (int)$_SESSION['college_id'], 'Course' => $_SESSION['course']); | |
//echo $this->db->where($array); | |
// echo $this->db->get('ASSIGNMENT'); | |
$this->db->select('Counselor_ID') | |
->where($array); | |
$query = $this->db->get('ASSIGNMENT'); | |
return $query->result(); | |
//print_r($query->result()); | |
//print_r($query); | |
} | |
ASSIGNMENT DATABASE | |
Full texts | |
Appointment_ID | |
Interview_ID | |
Foreign Key points to Service_ID @ INTERVIEW | |
Student_ID | |
Foreign Key points to User_ID @ STUDENT | |
Nature | |
Urgent | |
Confirmation | |
Attendance | |
Date_Start | |
Date_End | |
000000092 | |
000000002 | |
000000010 | |
NO | |
NO | |
NO | |
YES | |
2018-09-20 13:30:00 | |
2018-09-20 14:00:00 | |
000000093 | |
000000004 | |
000000010 | |
NO | |
NO | |
NO | |
YES | |
2018-09-20 13:30:00 | |
2018-09-20 14:00:00 | |
000000094 | |
000000002 | |
000000010 | |
NO | |
NO | |
NO | |
YES | |
2018-09-20 13:30:00 | |
2018-09-20 14:00:00 | |
000000095 | |
000000002 | |
000000010 | |
NO | |
NO | |
NO | |
YES | |
2018-09-19 14:30:00 | |
2018-09-19 15:00:00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment