-
-
Save Maxghp/87924fb92585039db1237bab28d1706c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| $res = $this->dbAdapter->query("SELECT location FROM users WHERE user_id=:user_id")->execute([ | |
| ':user_id'=>$user_id, | |
| ])->getResource()->fetchAll(); | |
| if(!empty($res)){ | |
| $loc = $res[0]['location']; | |
| } | |
| if(!empty($loc)){ | |
| if($loc == 'Toronto'){ | |
| $x = array(18900, 36000); | |
| //count time | |
| list($h,$m) = explode(":", $total['total']); | |
| $min = ($h*60)+$m; | |
| $sec = ($min*60); | |
| if($x[0] > $sec){ | |
| $seconds = ($sec + 299); | |
| $time = new DateTime('@'.$seconds); | |
| $timeT ='+' . $time->format('H:i'); | |
| }else if(($sec > $x[0]) && ($sec < $x[1])){ | |
| $seconds = $sec - 1548; | |
| $time = new DateTime('@'.$seconds); | |
| $timeT ='-' . $time->format('H:i'); | |
| }else if($sec > $x[1]){ | |
| $seconds = $sec - 3420; | |
| $time = new DateTime('@'.$seconds); | |
| $timeT ='-' . $time->format('H:i'); | |
| } | |
| }else{ | |
| $timeT = 'NULL'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment