forked from ertait/uvm-studentportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtranslate.php
28 lines (27 loc) · 859 Bytes
/
translate.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
<?php
require("includes/top.php");
require("watsonServices.php");
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$lan = $_GET['q'];
$fileId = $_GET['id'];
try {
$db->beginTransaction();
$query = "SELECT * FROM tblNotes WHERE pmkNoteId =" . $fileId;
$statement = $db->prepare($query);
$statement->execute();
$results = $statement->fetchAll(PDO::FETCH_ASSOC);
$db->commit();
} catch (PDOException $e) {
$db->rollBack();
echo $e->getMessage();
}
if($lan !== "en"){
echo "<p class='text-justify noteMessage'>" . watsonLanguageTranslate("en", $lan, urlencode($results[0]['fldText'])) . "</p>";
}else{
echo "<p class='text-justify noteMessage'>" . $results[0]['fldText'] . "</p>";
}
?>