public function action_mk011($id = null) { if ($mk011 = Model_DocMK011::find($id)) { $docmk = $this->get_docmk($mk011->mk_id); $pdf = $this->create_doc(); $data['doc_name'] = 'ใบสั่งตัดสต็อค'; $data['doc_code'] = 'FMMK-011 REV:1-14/02/50'; $data['suggest_roll'] = $mk011->suggest_roll; $data['length'] = $mk011->length; $data['remark'] = $mk011->remark; $data['docmk'] = $docmk; $content = View::forge('print/fmmk-011', $data)->render(); // return $content; $pdf->write_html($content); $pdf->output(); } else { echo "Document not found!"; } }
/** * Delete */ public function action_delete($id = null) { if ($mk011 = Model_DocMK011::find($id)) { $mk011->delete(); Session::set_flash('notice', 'Deleted docmk011 #' . $id); } else { Session::set_flash('notice', 'Could not delete docmk011 #' . $id); } Response::redirect('docmk011'); }
/** * View */ public function action_view($id = null) { $docmk = Model_DocMK::find($id); $data['docinfo'] = Petro::render_panel('Document Information', $this->display_info($docmk)); $mk011 = Model_DocMK011::find()->where('mk_id', $docmk->id)->get_one(); $this->sidebars->add('Client Sales History', 'Total this month' . '<br>Total this year '); $this->sidebars->add('Belt History', View::forge('docmk2/flow2', array('docmk' => $docmk, 'mk011' => $mk011))); // $this->sidebars->add( // 'Belt History', // 'วันที่รับ order'. // '<br>วันที่สั่งผลิต'. // '<br>วันที่ตัด-ประกบ'. // '<br>วันที่เคลื่อบผิว'. // '<br>วันที่อบ'. // '<br>วันที่ QC'. // '<br>วันที่จัดส่ง' // ); $routes = Petro::get_routes($id); $this->action_items = array(array('title' => 'Print', 'link' => 'print/mk/' . $id, 'attr' => array('target' => '_blank')), array('title' => 'Edit Docmk', 'link' => $routes['edit']), array('title' => 'Delete Docmk', 'link' => $routes['delete'])); $data['comments'] = Petro_Comment::render($this->app, $id, 'History'); $this->template->page_title = "MK Info"; $this->template->content = View::forge('docmk2/view', $data, false); }