public static function _body($options) { $template = $options["template"]; $view = new \Framework\View(array("file" => APP_PATH . "/application/views/layouts/email/{$template}.html")); foreach ($options as $key => $value) { $view->set($key, $value); } return $view->render(); }
/** * Teacher can publish notification for the assignment which will be sent * to all the students of the classroom * @before _secure, _teacher */ public function assignment($assignment_id) { $redirect = $_SERVER['HTTP_REFERER']; $assignment = Assignment::first(array("id = ?" => $assignment_id)); if (!$assignment) { self::redirect($redirect); } $this->JSONView(); $view = $this->getActionView(); $template = new Framework\View(array("file" => APP_PATH . "/application/views/notification/templates/newAssignment.html")); $template->set("title", $assignment->title); $content = $template->render(); $classroom = TeacherService::$_classes[$assignment->classroom_id]; $service = new Shared\Services\Classroom(); $users = $service->enrollments($classroom, array('only_user' => true)); $this->_save(array('type' => 'assignment', 'type_id' => $assignment->id, 'url' => '/student/assignments/' . $assignment->course_id), $content, $users); Registry::get("session")->set('$redirectMessage', "Notification sent to students"); self::redirect($_SERVER['HTTP_REFERER']); }
protected function paymentsInvoice($organization, $appointments, $revenue, $cash, $online, $action = "gen") { $view = new Framework\View(array("file" => APP_PATH . "/application/views/layouts/others/paymentsInvoice.html")); $now = strftime("%Y-%m-%d", strtotime('now')); $view->set("now", $now); $view->set("appointments", $appointments); $view->set("revenue", $revenue); $view->set("cash", $cash); $view->set("online", $online); $name = $organization->id . "-" . $now; if (!file_exists(APP_PATH . "/public/assets/uploads/files/invoice/{$name}.pdf")) { $this->generatepdf($view->render(), $name); } if ($action == "show") { $this->redirect("/public/assets/uploads/files/invoice/{$name}.pdf"); } }
public function generateinvoice($order_id, $instamojo_id = "not found", $action = "gen") { if ($instamojo_id == "not found") { $this->redirect("/patient/profile"); } $view = new Framework\View(array("file" => APP_PATH . "/application/views/layouts/others/invoice.html")); $order = Order::first(array("id = ?" => $order_id)); $instamojo = Instamojo::first(array("id = ?" => $instamojo_id)); $patient = User::first(array("id = ?" => $order->user_id)); $appointments = Appointment::all(array("order_id = ?" => $order->id)); $view->set("order", $order); $view->set("patient", $patient); $view->set("appointments", $appointments); $view->set("instamojo", $instamojo); if (!file_exists(APP_PATH . "/public/assets/uploads/files/orders/{$order->id}.pdf")) { $this->generatepdf($view->render(), $order->id); } if ($action == "show") { $this->redirect("/public/assets/uploads/files/orders/{$order->id}.pdf"); } }