У меня в бд записывается время таким образом 15 mins как его записать так 15 мин?
Данное время записывается с андроид приложения!
Слово mins записываться с кодировки или отдельным словом?
<?php
date_default_timezone_set ('Africa/Ouagadougou');
include("query/connexion.php");
// include("query/fonction.php");
$con->set_charset("utf8");
include_once 'GCM.php';
if($_SERVER['REQUEST_METHOD'] =='POST'){
$user_id = $_POST['user_id'];
$lat1 = $_POST['lat1'];
$lng1 = $_POST['lng1'];
$lat2 = $_POST['lat2'];
$lng2 = $_POST['lng2'];
$cout = $_POST['cout'];
$duree = $_POST['duree'];
$distance = $_POST['distance'];
// $otp = $_POST['otp'];
$id_conducteur = $_POST['id_conducteur'];
$id_payment = $_POST['id_payment'];
$depart_name = $_POST['depart_name'];
$destination_name = $_POST['destination_name'];
$image = $_POST['image'];
$image_name = $_POST['image_name'];
$place = $_POST['place'];
$place = str_replace("'","\'",$place);
$number_poeple = $_POST['number_poeple'];
$number_poeple = str_replace("'","\'",$number_poeple);
$statut_round = $_POST['statut_round'];
$date_retour = $_POST['date_retour'];
$heure_retour = $_POST['heure_retour'];
$date_heure = date('Y-m-d H:i:s');
if(!empty($image)){
$img_name = $image_name;
$ImagePath = "images/recu_trajet_course/$img_name";
}else{
$img_name = "";
}
$image_name = str_replace("'","\'",$image_name);
$tmsg='';
$terrormsg='';
$title=str_replace("'","\'","New ride");
$msg=str_replace("'","\'","You have just received a request from a client");
$tab[] = array();
$tab = explode("\\",$msg);
$msg_ = "";
for($i=0; $i<count($tab); $i++){
$msg_ = $msg_."".$tab[$i];
}
$gcm = new GCM();
$message=array("body"=>$msg_,"title"=>$title,"sound"=>"mySound","tag"=>"ridenewrider");
$query = "select fcm_id from tj_conducteur where fcm_id<>'' and id=$id_conducteur";
$result = mysqli_query($con, $query);
$tokens = array();
if (mysqli_num_rows($result) > 0) {
while ($user = $result->fetch_assoc()) {
if (!empty($user['fcm_id'])) {
$tokens[] = $user['fcm_id'];
}
}
}
$temp = array();
if (count($tokens) > 0) {
$gcm->send_notification($tokens, $message, $temp);
}
$date_heure = date('Y-m-d H:i:s');
$query = "INSERT INTO tj_requete(date_retour,statut_round,heure_retour,number_poeple,place,id_payment_method,trajet,depart_name,destination_name,id_conducteur,id_user_app,latitude_depart,longitude_depart,latitude_arrivee,longitude_arrivee,statut,creer,distance,montant,duree)
VALUES('$date_retour','$statut_round','$heure_retour',$number_poeple,'$place',$id_payment,'$image_name','$depart_name','$destination_name',$id_conducteur,$user_id,'$lat1','$lng1','$lat2','$lng2','новый','$date_heure',$distance,$cout,'$duree')";
$insertdata = mysqli_query($con, $query);
if($insertdata > 0){
if(!empty($image))
file_put_contents($ImagePath,base64_decode($image));
}
$response['msg']['etat'] = 1;
echo json_encode($response);
mysqli_close($con);
}
?>