-
Notifications
You must be signed in to change notification settings - Fork 0
/
Token_dao.php
47 lines (31 loc) · 1.3 KB
/
Token_dao.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/*
A domain Class to demonstrate RESTful web services
*/
require_once("connection_.php");
Class Token {
public function setCompteToken(){
header("Access-Control-Allow-Origin: *");
header('Content-type:application/json');
header('Access-Control-Allow-Headers: Content-Type, Content-Range, Content-Disposition, Content-Description');
$DBConnection = new DBConnection();
$db = $DBConnection->DBConnection();
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$code_user=$request->email;
// $code_user="abderazak.daray@essp.com";
$device_token=$request->device_token;
//$messageT="besoin de savoir les note de mon enfant";
// $device_token='54gd25566251sd5f15df4';
// $code_user='benbihi.nourddine@essp.com';
$stmt=$db->prepare('update compte_application_mobile set device_token=:device_token where email=:code_user');
// $stmt->bind_param($date, $value, $id_temps,$codeClasse);
//$stmt->bindParam(':date', $date, PDO::PARAM_INT);
$stmt->bindParam(':code_user', $code_user, PDO::PARAM_STR);
$stmt->bindParam(':device_token', $device_token, PDO::PARAM_STR);
$stmt->execute();
$result = 'Done';
return $result;
}
}
?>