Ejemplo n.º 1
0
 function edit($document_id, $section)
 {
     //        return __METHOD__." $document_id  $section ";
     $dataManager = new \DataManager();
     $doc = $dataManager->getDocument($document_id);
     $template = new \PHPTemplate();
     $template->assign("document", $doc);
     $template_name = "form_" . $section;
     return $template->fetch($template_name);
 }
Ejemplo n.º 2
0
 function show($name)
 {
     $dataManager = new \DataManager();
     $doc = $dataManager->getDocument($name);
     if ($doc === null) {
         $resp = new \Symfony\Component\HttpFoundation\Response("", 404);
         return $resp;
     }
     $template = new \PHPTemplate();
     $template->assign("document", $doc);
     return $template->fetch('show');
 }
Ejemplo n.º 3
0
 function render($name)
 {
     $dataManager = new \DataManager();
     $doc = $dataManager->getDocument($name);
     if ($doc === null) {
         $resp = new \Symfony\Component\HttpFoundation\Response("", 404);
         return $resp;
     }
     $url1 = $doc->member_one->photo_url;
     $data1 = $dataManager->getPhotoDataBase64($url1);
     $url2 = $doc->member_two->photo_url;
     $data2 = $dataManager->getPhotoDataBase64($url2);
     $url3 = $doc->vehicle->photo_url;
     $data3 = $dataManager->getPhotoDataBase64($url3);
     $imageData = base64_encode($imageContent);
     $template = new \PHPTemplate();
     $template->assign("document", $doc);
     $template->assign("member_one", $doc->member_one);
     $template->assign("member_one_photo_data_base64", $data1);
     $template->assign("member_two", $doc->member_two);
     $template->assign("member_two_photo_data_base64", $data2);
     $template->assign("home_base", $doc->home_base);
     $template->assign("completed_journeys", $doc->completed_journeys);
     $template->assign("planned_journeys", $doc->planned_journeys);
     $template->assign("wish_list_journeys", $doc->wish_list_journeys);
     $template->assign("vehicle", $doc->vehicle);
     $template->assign("vehicle_photo_data_base64", $data3);
     $h = $template->fetch('html');
     file_put_contents($name . "_html_." . "html", $h);
     return $h;
 }