<?php require_once 'vendor/autoload.php'; require 'db.php'; require_once 'speechtotext.php'; $response = new Services_Twilio_Twiml(); $say_str = "ご利用ありがとうございました"; $recording_url = $_REQUEST['RecordingUrl']; $id = $_REQUEST['id']; $data = json_decode(getDocument($id), true); $data['recording_url'] = $recording_url; $speechtext = speechtotext($recording_url); $data['speechtext'] = $speechtext['results'][0]['alternatives'][0]['transcript']; update($data); $response = new Services_Twilio_Twiml(); $response->say($say_str, array('language' => 'ja-jp')); $response->hangup(); header("Content-type: text/xml"); print $response;
} } else { $data = json_encode($doc); } $cb = getparam('callback'); if ($cb) { echo $cb . '(' . $data . ')'; } else { echo $data; } } F3::route('POST /@db/objects/@model', function () { $dbName = F3::get('PARAMS["db"]'); $model = F3::get('PARAMS["model"]'); $doc = json_decode(file_get_contents('php://input')); if (!isset($doc->_id)) { $doc->_id = $model; } $response = saveDocument($dbName, $doc, true); if (isset($response->rev)) { $doc->_rev = $response->rev; } wrapResponse($response, $doc); }); F3::route('GET /@db/objects/@model', function () { $dbName = F3::get('PARAMS["db"]'); $model = F3::get('PARAMS["model"]'); $response = getDocument($dbName, $model); wrapResponse($response, $response); }); F3::run();
$app->get('/', function () use($app, $cb) { global $categories; // Modèles non gérés actuellement, donc supprimer unset($categories['modeles']); return $app['twig']->render('welcome.twig.html', compact('categories')); }); //$pages = array('usine','produitTechnique','operation','unite','valeur','caracteristique'); foreach ($pages as $page) { $app->get('/' . $page, function (Request $request) use($app, $cb) { return listeTypeDocument(cutUri($request), $app, $cb); }); $app->get('/' . $page . '/json', function (Request $request) use($app, $cb) { return $app->json(listeDocumentJSON(cutUri($request), $app, $cb), 200); }); $app->get('/' . $page . '/show/{id}', function (Request $request, $id) use($app, $cb) { return getDocument($id, cutUri($request), $app, $cb); }); $app->get('/' . $page . '/edit/{id}', function (Request $request, $id) use($app, $cb) { return addDocument($id, cutUri($request), $app, $cb); })->value('id', 'new'); $app->post('/' . $page . '/edit/{id}', function (Request $request, $id) use($app, $cb) { return pushJson($request, $id, cutUri($request), $app, $cb); })->value('id', 'new'); } /********************************* Fonctions transverses ***********************************/ function listeDocumentJSON($type, $app, $cb) { if ("caracteristique" == substr($type, 0, 15) and strlen($type) > 16) { return json_decode($cb->get($type)->value);
font-family: sans-serif; text-align: left; white-space: normal; font-style: normal; vertical-align: middle; border-left: .5pt solid #95B3D7; border-right: medium none; border-top: .5pt solid #95B3D7; border-bottom: .5pt solid #95B3D7; padding: 5px; background: #7f7f7f; } </style> </head> <body> ' . getDocument($idprofit, $nroliq) . ' </body> </html>'; //echo htmlentities($TPLOrden) ;die; //echo $TPLOrden ;die; //$TPLOrden = 'HOLA!!!'; $dompdf = new DOMPDF(); $dompdf->load_html($TPLOrden); $dompdf->set_base_path("pdfstyles.css"); $dompdf->render(); $array_opciones = array("afichero" => 1, "compress" => 1); $dompdf->stream("Documento_Finiquito.pdf", $array_opciones); function getImgLocation() { $arrayDir = explode("\\", $_SERVER['SCRIPT_FILENAME']); $arrayDir[count($arrayDir) - 1] = "";