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
| complete : function(data){ | |
| var html = $.parseHTML( data ); | |
| var container = $(".accomodation", html); | |
| $(".accomodation", html).each(function(index,item){ | |
| AllCurrentAccomodations.push($(item).attr('data-id')); | |
| console.log($(item)); | |
| console.log($(item).attr('data-id')); |
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
| <?php | |
| $arrGeoData = array( | |
| array( | |
| "zipcode" => 777, | |
| "latitude" => 37.234982, | |
| "longitude" => -82.913799, | |
| "cityname" => "tiflis", | |
| ), | |
| array( | |
| "zipcode" => 666, |
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
| SELECT * FROM Table1 a | |
| WHERE ( | |
| acos(sin(a.Latitude * 0.0175) * sin(YOUR_LATITUDE_X * 0.0175) | |
| + cos(a.Latitude * 0.0175) * cos(YOUR_LATITUDE_X * 0.0175) * | |
| cos((YOUR_LONGITUDE_Y * 0.0175) - (a.Longitude * 0.0175)) | |
| ) * 3959 <= YOUR_RADIUS_INMILES | |
| ) | |
| ////////////////////////////////////////////////////////////////////////////////////////////////// |
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
| echo sum_the_time('01:20:22', '02:10:00'); // this will give you a result: 19:12:25 | |
| function sum_the_time($time1, $time2) { | |
| $times = array($time1, $time2); | |
| $seconds = 0; | |
| foreach ($times as $time) | |
| { | |
| list($hour,$minute,$second) = explode(':', $time); | |
| $seconds += $hour*3600; | |
| $seconds += $minute*60; |
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
| $datas = explode("/",'23/04/2018'); | |
| $correctDAta = $datas[2].'-'.$datas[1].'-'.$datas[0].' 10:00:00'; | |
| echo $correctDAta; | |
| echo '<hr>'; | |
| $time = explode(":",'02:50:50'); | |
| //var_dump($time); |
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
| $start_date = new DateTime('2007-09-01 04:10:58'); | |
| $since_start = $start_date->diff(new DateTime('2012-09-11 10:25:00')); | |
| echo $since_start->days.' days total<br>'; | |
| echo $since_start->y.' years<br>'; | |
| echo $since_start->m.' months<br>'; | |
| echo $since_start->d.' days<br>'; | |
| echo $since_start->h.' hours<br>'; | |
| echo $since_start->i.' minutes<br>'; | |
| echo $since_start->s.' seconds<br>'; |
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
| /* | |
| seconds: | |
| 12879 | |
| 6262 | |
| metrs: | |
| 130229 | |
| */ | |
| print 12879 / 60; | |
| echo '<br>Hours : '. floor(12879 / 3600); |
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
| namespace App\Http\Controllers\Auth; | |
| class LoginController extends Controller | |
| public function redirectTo(){ | |
| $roles = Auth::user()->roles; | |
| if(!is_null($roles )){ | |
| foreach (Auth::user()->roles as $role) { | |
| if($role->name == "SUPER_ADMIN"){ |
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
| <!DOCTYPE html> | |
| <html lang="en" dir="ltr"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title></title> | |
| </head> | |
| <body> | |
| <style media="screen"> | |
| #map_canvas { | |
| width: 980px; |
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
| function arr_diff (a1, a2) { | |
| var a = [], diff = []; | |
| for (var i = 0; i < a1.length; i++) { | |
| a[a1[i]] = true; | |
| // a = [a: true, b: true, x: true] | |
| // console.log(a1[i]); | |
| } | |
| //console.log(a); |