exists('itgc_locationsupd'))
{
// echo $allSeesionData[$r]['gps_longitude'].'----'.$allSeesionData[$r]['gps_latitude'];
// echo "
";
// get geo poi data
if($redis_geopoi_data=get_geoPoi($sess_userid.':geopois',$idleSeesionData[$r]["gps_longitude"],$idleSeesionData[$r]["gps_latitude"],'500000','m',$redis))
{
$redis_poi_km = round($redis_geopoi_data[0][1]/1000,0).' Km From '; // poi km redis
$redis_poi_name = str_replace(' ','_',$redis_geopoi_data[0][0]);//get redis poi name
$redis_inside_poi = str_replace(' ','_',$redis_geopoi_data[0][0]);//get redis poi name
$redis_poi_hset = json_decode(getPoi($sess_userid,$redis_poi_name,$redis)); // function to get stored poi data redis
// check if the vehicle is inside the poi
if($redis_geopoi_data[0][1] <= $redis_poi_hset->radius)
{
// if inside the poi get the poi name
$LocationName = $redis_geopoi_data[0][0]; // redis poiname
$redis_inside_poi = 'INSIDE POI';
$redis_poi_km ='';
}
else
{
// if the out of poi get the vehine locaiton name redis geodata
$get_data = get_geoData('itgc_locationsupd',$idleSeesionData[$r]["gps_longitude"],$idleSeesionData[$r]["gps_latitude"],'5000','m',$redis);
$LocationName = str_replace('_',' ',$get_data[0][0]);// redis location name
$lat = $get_data[0][2][1]; // getting lat redis
$lng = $get_data[0][2][0]; // getting lng redis
$LocationName = (!empty($LocationName))? $LocationName.' ('.$lat.','.$lng.')':$idleSeesionData[$r]['gps_longitude'].','.$idleSeesionData[$r]['gps_latitude'];
// $LocationName = 'redis locatio';
}
}
else
{
// if the out of poi get the vehine locaiton name redis geodata
$get_data = get_geoData('itgc_locationsupd',$idleSeesionData[$r]['gps_longitude'],$idleSeesionData[$r]["gps_latitude"],'5000','m',$redis);
$LocationName = str_replace('_',' ',$get_data[0][0]);// redis location name
$lat = $get_data[0][2][1]; // getting lat redis
$lng = $get_data[0][2][0]; // getting lng redis
$LocationName = (!empty($LocationName))? $LocationName.' ('.$lat.','.$lng.')':$allSeesionData[$r]['gps_longitude'].','.$allSeesionData[$r]['gps_latitude'];
// $LocationName = 'redis locatio';
}
}
else
{
//echo "Location";exit;
/* pdf/excel location name in case the redis key does not exists */
$Locationdata = $masterObj->GetLocationWitPOI($idleSeesionData[$r]["gps_latitude"].','.$idleSeesionData[$r]["gps_longitude"]);
$LocationNameArr = explode("##",$Locationdata);
$LocationName = $LocationNameArr[0];
if($LocationNameArr[1]=="")
{
$redis_inside_poi = "INSIDE POI";
} else {
$redis_inside_poi = $LocationNameArr[1];
}
/* pdf/excel location name */
}
/* redis location name end */
// $Locationdata=$masterObj->GetLocationWitPOI($idleSeesionData[$r]["gps_latitude"].','.$idleSeesionData[$r]["gps_longitude"]);
//$LocationNameArr= explode("##",$Locationdata);
//$LocationName=$LocationNameArr[0];
$showTemp="";
$lastUpdate=$idleSeesionData[$r]["updatetime"];
$haltedSince=$idleSeesionData[$r]["gps_time"];
$lat = $idleSeesionData[$r]["gps_latitude"];
$lng = $idleSeesionData[$r]["gps_longitude"];
//if (in_array($_SESSION['sys_group_id'], $ShowTempIndashboard))
if (in_array($_SESSION['sys_group_id'], $ShowTempIndashboard) or in_array($_SESSION['sys_group_id_parent'], $ShowTempIndashboard))
{
$tel_temp=$idleSeesionData[$r]["tel_temperature"];
if($tel_temp>50 && $tel_temp<-50)
{
$tel_temp="--";
}
/* if($idleSeesionData[$r]["sys_service_id"]=="54368")
{
$tempOfPrevious= db__select("select tel_temperature from matrix.latest_telemetry where sys_service_id=54039", $condition);
$tel_temp=$tempOfPrevious[0]["tel_temperature"]-1;
}*/
if($_SESSION['ParentId'] == '7607' || $_SESSION['ParentId'] == '4871' || $_SESSION['UserId'] == '81548' )
{
$Temp_data = db__select_staging("select t2_temp,set_temp,set_temp_to from matrix.temperature_manual_entry_tbl where sys_veh_id='".$sys_service_id."' and '".$lastUpdate."' BETWEEN start_date AND end_date order by id desc ", $condition);
//echo "";print_r($Temp_data);die;
//$div_temp = $Temp_data[0]['t2_temp'];
if(count($Temp_data)>0)
{
$div_temp = $Temp_data[0]['t2_temp'];
if($Temp_data[0]['set_temp'] != '' && $Temp_data[0]['set_temp_to'] != '' && $Temp_data[0]["set_temp_to"] != 0)
{
if($Temp_data[0]["set_temp"] == -18 && $Temp_data[0]["set_temp_to"] == -25)
{
$Temp_data[0]["set_temp"] = -25;
$Temp_data[0]["set_temp_to"] = -18;
}
if($idleSeesionData[$r]["tel_temperature"]>=$Temp_data[0]['set_temp'] && $idleSeesionData[$r]["tel_temperature"]<=$Temp_data[0]['set_temp_to'])
{
$tel_temp=round(($idleSeesionData[$r]["tel_temperature"]),2);
}
elseif($idleSeesionData[$r]["tel_temperature"]<$Temp_data[0]['set_temp'])
{
$idleSeesionData[$r]["tel_temperature"] = SetTempLessVal($Temp_data[0]["set_temp"],$Temp_data[0]["set_temp_to"],$idleSeesionData[$r]["tel_temperature"]);
$tel_temp=$idleSeesionData[$r]["tel_temperature"];
}
else
{
$idleSeesionData[$r]["tel_temperature"] = SetTempGreateVal($Temp_data[0]["set_temp"],$Temp_data[0]["set_temp_to"],$idleSeesionData[$r]["tel_temperature"]);
$tel_temp=$idleSeesionData[$r]["tel_temperature"];
}
}
else
{
$tel_temp=round(($idleSeesionData[$r]["tel_temperature"]-$div_temp),2);
}
}
else
{
$div_temp = 0;
$tel_temp=round(($idleSeesionData[$r]["tel_temperature"]-$div_temp),2);
}
//$tel_temp=round(($idleSeesionData[$r]["tel_temperature"]-$div_temp),2);
}
if($tel_temp=="" || $tel_temp=="0.000000")
{
$temptoday1 = db__select("select round(tel_temperature,2) as tel_temperature from matrix.today_ideal where tel_temperature!=0 and tel_temperature<40 and today_ideal.sys_Service_id=".$idleSeesionData[$r]["sys_service_id"]." order by gps_time desc limit 1", $condition);
$tel_temp=$temptoday1[0]["tel_temperature"];
}
}
else
{
$tel_temp="";
}
//$KMFromNearPOI=$LocationNameArr[1];
//if($LocationNameArr[1]=="")
//{
// $KMFromNearPOI="INSIDE POI";
// }
if($tel_temp!="" && $tel_temp!="0.000000")
{
$showTemp=" (".round($tel_temp);
}
$IdleHour=$idleSeesionData[$r]["HourDiff"];
$chkdata=$idleSeesionData[$r]["chkdata"];
/*$content_idle .='{ slno: "'.$SlNo.'", vehno: "'.$VehicleNumber.'", LocationName: "'.$LocationName.'", lastUpdate: "'.$lastUpdate.'", IdleHour: "'.$IdleHour.'", KMFromNearPOI: "'.$KMFromNearPOI.'", lat: "'.$lat.'", lng: "'.$lng.'" },';*/
if($IdleHour>=830)
{
$IdleHourShow=0;
}
$comparenotworkinghours=24;
if($_SESSION['UserId']=="80932" || $_SESSION['sys_group_id_parent']=="53002" )
{
$comparenotworkinghours=48;
}
if($chkdata>=$comparenotworkinghours)
{
$tranmittingStatus=" Non Working";
$tranmittingStatusExcel=" Non Working";
$IdleHourShow=0;
$poweronoff=true;
if($_SESSION['UserId']=="81509" || $_SESSION['sys_group_id_parent']=="81509" )
{
if( $idleSeesionData[$r]['gps_fix']== 0 )
{
$tranmittingStatus="Transmitting";
$tranmittingStatusExcel="Transmitting";
}
if($idleSeesionData[$r]['tel_voltage']!=null && $idleSeesionData[$r]['tel_voltage']>0)
{
$poweronoff=$idleSeesionData[$r]['poweroff'];
}
if( $poweronoff== false )
{
$tranmittingStatus="Transmitting";
$tranmittingStatusExcel="Transmitting";
}
}
else
{
if($idleSeesionData[$r]['tel_voltage']!=null && $idleSeesionData[$r]['tel_voltage']>0)
{
$poweronoff=$idleSeesionData[$r]['poweroff'];
}
if( $poweronoff== false && $_SESSION['UserName']!='srcfbd' )
{
$tranmittingStatus.=' (
) ';
}
if($_SESSION['UserId']=="80932" || $_SESSION['sys_group_id_parent']=="53002" )
{
}
else
{
if( $idleSeesionData[$r]['gps_fix']== 0 )
{
$tranmittingStatus.=' (
) ';
}
}
}
}
else
{
$tranmittingStatus="Transmitting";
$tranmittingStatusExcel="Transmitting";
$IdleHourShow=$IdleHour;
}
$veh_status=$idleSeesionData[$r]["veh_status"];
?>
if($idleSeesionData[$r]["sys_service_id"]=="71527")
{
$showTemp=-18;
$tel_temp=-18;
}
if (in_array($_SESSION['sys_group_id'], $ShowTempIndashboard) or in_array($_SESSION['sys_group_id_parent'], $ShowTempIndashboard))
{
$styletemp = "";
if($tel_temp!="" && $tel_temp!="0.000000")
{
if ($_SESSION['sys_group_id'] == '53003' || $_SESSION['sys_group_id_parent'] == '53003')
{
if($tel_temp >= '-18' && $tel_temp <= '-16')
{
$styletemp = "style='background:#40d640;color:white';";
}
elseif($tel_temp >= '-15.99' && $tel_temp <= '-14')
{
$styletemp = "style='background:#ebb34b;color:white';";
}
elseif($tel_temp >= '-14')
{
$styletemp = "style='background:#ef6666;color:white';";
}
}
$showTemp= $tel_temp."°C";
}
else
{
$showTemp="";
}
?>
| >=$showTemp?> |
=$VehicleNumber?> |
}
else
{?>
=$SlNo?> |
if (in_array($_SESSION['sys_group_id'], $StopVehicleProfile) or in_array($_SESSION['sys_group_id_parent'], $StopVehicleProfile)){?>
=$VehicleNumber?> |
} else {?>
=$VehicleNumber?> |
} }?>
if (in_array($_SESSION['sys_group_id'], $ecomvehicle) || in_array($_SESSION['sys_group_id_parent'], $ecomvehicle)){?>
=ucfirst($runtype);?> |
=ucfirst($vendorName);?> |
}?>
if( in_array($_SESSION['sys_group_id'], $extraShowInBranch))
{
$controlling_branch=$idleSeesionData[$r]["thana_name"];?>
=$controlling_branch?> |
}
?>
if (in_array($_SESSION['sys_group_id'], $vehicle_type) or in_array($_SESSION['sys_group_id_parent'], $vehicle_type))
{?>
=$veh_status;?> |
}?>
if(in_array($_SESSION['sys_group_id'], $ShowACStatusAll) or in_array($_SESSION['sys_group_id_parent'], $ShowACStatusAll))
{
if($idleSeesionData[$r]["aconoff"] == 1){$aconoff = 'ON';}else{$aconoff = 'OFF';}
?>
=$aconoff;?> |
} ?>
if (in_array($_SESSION['sys_group_id'], $googleviewmap) or in_array($_SESSION['sys_group_id_parent'], $googleviewmap))
{?>
}else
{?>
}?>
=$LocationName?>
|
=$lastUpdate?> |
if (in_array($_SESSION['sys_group_id'], $HaltedTimeinmins)) {echo $idleSeesionData[$r]["timeDiff"];}
else{echo $IdleHourShow;}?>
|
=$haltedSince?> |
if(in_array($_SESSION['sys_group_id'], $ExtraColShow) || in_array($_SESSION['sys_group_id_parent'], $ExtraColShow)) {?>
=$idleSeesionData[$r]["veh_trasport_name"];?> |
=$idleSeesionData[$r]["thana_name"];?> |
} else {?>
if (in_array($_SESSION['sys_group_id'], $googleviewmap) or in_array($_SESSION['sys_group_id_parent'], $googleviewmap))
{?>
}else
{?>
}?>
|
} ?>
|
if (in_array($_SESSION['sys_group_id'], $batteryshowGT) or in_array($_SESSION['sys_group_id_parent'], $batteryshowGT))
{
if($idleSeesionData[$r]["tel_input_3"] == 1)
{
$headlight = "ON";
} else {
$headlight = "OFF";
}
?>
$SHowVoltage="";
if($idleSeesionData[$r]["tel_rfid"]==6)
{
$SHowVoltage="80% to 100%";
}
if($idleSeesionData[$r]["tel_rfid"]==5)
{
$SHowVoltage="60% to 80%";
}
if($idleSeesionData[$r]["tel_rfid"]==4)
{
$SHowVoltage="40% to 60%";
}
if($idleSeesionData[$r]["tel_rfid"]==3)
{
$SHowVoltage="20% to 40%";
}
if($idleSeesionData[$r]["tel_rfid"]==2)
{
$SHowVoltage="10% to 20%";
}
if($idleSeesionData[$r]["tel_rfid"]==1)
{
$SHowVoltage="5% to 10%";
}
if($SHowVoltage=="")
{
$voltagecheck=$masterObj->GEtbatterystatusSOC($sys_service_id);
$SHowVoltage=$voltagecheck;
}
if($SHowVoltage=="" && $_SESSION['sys_group_id']!=53594)
{
if($idleSeesionData[$r]["tel_voltage"]>=4 )
{
$SHowVoltage="80% to 100%"."(".round($idleSeesionData[$r]["tel_voltage"],2).")";
}
if($idleSeesionData[$r]["tel_voltage"]>=3.8 && $idleSeesionData[$r]["tel_voltage"]<4)
{
$SHowVoltage="60% to 80%"."(".round($idleSeesionData[$r]["tel_voltage"],2).")";
}
if($idleSeesionData[$r]["tel_voltage"]>=3.6 && $idleSeesionData[$r]["tel_voltage"]<3.8)
{
$SHowVoltage="40% to 60%"."(".round($idleSeesionData[$r]["tel_voltage"],2).")";
}
if($idleSeesionData[$r]["tel_voltage"]>=3.4 && $idleSeesionData[$r]["tel_voltage"]<3.6)
{
$SHowVoltage="20% to 40%"."(".round($idleSeesionData[$r]["tel_voltage"],2).")";
}
if($idleSeesionData[$r]["tel_voltage"]<3.4)
{
$SHowVoltage="10% to 20%"."(".round($idleSeesionData[$r]["tel_voltage"],2).")";
}
}
echo $SHowVoltage;
?> |
=$headlight;?> |
} ?>
=$tranmittingStatus;?> |
if (in_array($_SESSION['sys_group_id'], $distStateShow) or in_array($_SESSION['sys_group_id_parent'], $distStateShow)){
$latlng = $idleSeesionData[$r]["gps_latitude"].",".$idleSeesionData[$r]["gps_longitude"];
if( $idleSeesionData[$r]["gps_latitude"] != "0.000000000" && $idleSeesionData[$r]["gps_longitude"] != "0.000000000")
{
$get_latlng = $masterObj->nearestDistState($latlng);
} else {$get_latlng = "";}
$ArrayData = explode(",",$get_latlng);
//$getDist = substr($get_latlng, strpos($get_latlng, "District:-") + 1);
//$getstate = substr($get_latlng, strpos($get_latlng, ",State:-") + 1);
?>
echo $ArrayData[0];?> |
echo $ArrayData[1];?> |
} ?>
if($tel_temp!="" && $tel_temp!="0.000000")
{
$showTemp= round($tel_temp)." C";
?>
} else {?>
}
if (in_array($_SESSION['sys_group_id'], $vehicle_type) or in_array($_SESSION['sys_group_id_parent'], $vehicle_type)) {
?>
}
if(in_array($_SESSION['sys_group_id'], $ShowACStatusAll) or in_array($_SESSION['sys_group_id_parent'], $ShowACStatusAll))
{
?>
} ?>
" />
if(in_array($_SESSION['sys_group_id'], $ExtraColShow) or in_array($_SESSION['sys_group_id_parent'], $ExtraColShow)) {?>
" />
" />
} else {?>
} ?>
}
?>