예제 #1
0
 public function delete_info_page()
 {
     $id = Request::segment(4);
     Information::where('id', $id)->delete();
     return Redirect::to("/admin/informations");
 }
예제 #2
0
$info = Information::where('type', '=', 'contact')->get();
foreach ($info as $key => $value) {
    echo '<b>' . ucfirst($value['keyname']) . ': </b>';
    echo $value['value'] . '<br/>';
}
?>
	                       </p>
	                </div>

	                <!-- Footer stay connected -->
	                <div class="col-footer col-md-3 col-xs-6">
	                    <h3>Stay Connected</h3>
	                        <ul class="footer-stay-connected no-list-style">

                                <?php 
$info = Information::where('type', '=', 'link')->get();
foreach ($info as $key => $value) {
    echo '<li> <a href="' . $value['value'] . '" class="' . $value['keyname'] . '" ></a></li>';
}
?>
	                        </ul>
	                    </div>
	                </div>

	                <!-- All Rights Reserved -->
	                <div class="row">
	                    <div class="col-md-12">
	                        <div class="footer-copyright">&copy; All rights reserved.</div>
	                    </div>
	                </div>
	            </div>
예제 #3
0
 public function monthly($res, $id)
 {
     $dt = DateTime::createFromFormat('!m', $id);
     $fpdf = new Fpdf();
     $fpdf->AddPage('L');
     $fpdf->SetFont('Arial', 'B', 16);
     $fpdf->Cell(130);
     $fpdf->Cell(20, 10, Information::where('keyname', '=', 'name')->first()->value, 0, 1, 'C');
     $fpdf->Cell(130);
     $fpdf->SetFont('Arial', '', 14);
     $fpdf->Cell(20, 10, Information::where('keyname', '=', 'address')->first()->value, 0, 1, 'C');
     $header = array('ID', 'Date', 'Pax', 'Status', 'Amount', 'Payment Method', 'Duration');
     $fpdf->SetFont('Arial', 'B', 16);
     $fpdf->Cell(130);
     $fpdf->Cell(20, 10, 'Monthly Report for the Month of: ' . $dt->format('F'), 0, 1, 'C');
     // Colors, line width and bold font
     $fpdf->SetFillColor(255, 0, 0);
     $fpdf->SetTextColor(255);
     $fpdf->SetDrawColor(128, 0, 0);
     $fpdf->SetLineWidth(0.3);
     $fpdf->SetFont('', '');
     // Header
     $fpdf->Ln();
     $fpdf->Cell(10);
     $w = array(35, 25, 25, 45, 23, 50, 55);
     for ($i = 0; $i < count($header); $i++) {
         $fpdf->Cell($w[$i], 7, $header[$i], 1, 0, 'C', true);
     }
     $fpdf->Ln();
     // Color and font restoration
     $fpdf->SetFillColor(224, 235, 255);
     $fpdf->SetTextColor(0);
     $fpdf->SetFont('Arial', '', 12);
     // Data
     $fill = false;
     $total = 0;
     foreach ($res as $row) {
         $fpdf->Cell(10);
         $fpdf->Cell($w[0], 6, $row->id, 'LR', 0, 'L', $fill);
         $fpdf->Cell($w[1], 6, $row->date_request, 'LR', 0, 'L', $fill);
         $fpdf->Cell($w[2], 6, $row->pax, 'LR', 0, 'R', $fill);
         $fpdf->Cell($w[3], 6, $row->status, 'LR', 0, 'R', $fill);
         $fpdf->Cell($w[4], 6, $row->net_total, 'LR', 0, 'R', $fill);
         if ($row->payment_mode != '') {
             $fpdf->Cell($w[5], 6, $row->payment_mode . " (" . $row->payment_method . ")", 'LR', 0, 'L', $fill);
         } else {
             $fpdf->Cell($w[5], 6, 'Payment Method not set', 'LR', 0, 'L', $fill);
         }
         $fpdf->Cell($w[6], 6, $row->reservation_start . ' to ' . $row->reservation_end, 'LR', 0, 'L', $fill);
         $fpdf->Ln();
         $fill = !$fill;
         $total = +$row->net_total;
     }
     // Closing line
     $fpdf->Cell(10);
     $fpdf->Cell(array_sum($w), 0, '', 'T');
     $fpdf->Ln();
     $fpdf->Cell(190);
     $fpdf->SetFont('Arial', 'B', 13);
     $fpdf->Cell(40, 7, 'Total:', '', 0, 'R');
     $fpdf->SetFont('Arial', '', 13);
     $fpdf->Cell(40, 7, "{$total}", 0);
     $fpdf->Output();
     exit;
 }