• Home
  • Outdoor Adventure
    • Hiking
    • Backpacking
    • Camping
    • Caving
  • Travel
  • Life Style
    • Diploma Life
    • Degree Life
    • Work and Part Time
  • Code Test and Project
  • FYP

Jack Hau Story

facebook twitter instagram
  • Create a search function for member page.
  • Create page for member reservation homestay, rating homestay and view history of their reservation.




The picture above is showing the homestay information. The right side column is show the member selected check-In date and check-out date it will auto calculate how many nights that the member selected and the total booking amount.



After confirm the check-In check-out date and booking amount, click the payment button it will direct jump to Paypal sandbox system. The picture above is showing the order summary with the name of the homestay.


In the other hand, our system can generate PDF statement. The statement details included guest name, homestay name, check-In date, check-out date, night and total amount.


This is the member dashboard with homestay list. Once the owner done the add function it will direct go to homestay list and the have several homestay that the owner before. We did the edit and delete function for the homestay list also but cannot multiple edit homestay information.



Share
Tweet
Pin
Share
No comments
Member Page :
  • Create a table for Member at phpMyAdmin.
  • Create a member registration and login page with not duplicate email and password.
Member Dashboard :
  • Create a dashboard for members include function view and edit.
  • Create another page for members which are used to store homestay details. In this page, members are able to view, edit, delete and view each of the homestay details.
  • How to upload multiple image in one time to my homestay.

  • Create member registration and login page for MyHomestay.
  • Create a member dashboard.

This is the member homepage. The sign up form is a pop up function and the user in order to do a reservation must sign up as a member first. Other than that, user must key in their real email and the mobile number start with 6 due to our system will send out message if the member done any reservation or cancellation.


The picture above is showing Myhomestay reservation member dashboard. It has 6 features that we focus which is reservation, myhomestay lisy, transaction history, member profile, homestay list and log out button.


This is the member dashboard with add homestay information. Once the member become an owner he or she has the authority to add homestay with key in the homestay name, category, address, description of homestay, price and upload less than 5 photo of the homestay.


Share
Tweet
Pin
Share
No comments
  • Create a button and pagination at administration list for print the PDF report.
Last found out Working PHP Pagination Function
also here how to modify the limit the pagination


This is all the Reservation that reserved by members. The admin are able to keep tracking the homestay reservation details which have been made by members and who are the homestay owners.
Share
Tweet
Pin
Share
No comments

FPDF is a PHP class which allows to generate PDF files with pure PHP.

Design and generate PDF. Reservation statement


Sample code : 

<?php 

require('fpdf.php');
include("../connection.php");

$reservation_id = $_REQUEST['reservation_id'];
$member_id = $_REQUEST['member_id'];

$sql = "select member_name from member where member_id = $member_id";
$result_member = mysql_query($sql);
$row_member = mysql_fetch_assoc($result_member);
$member_name = $row_member['member_name'];

$sql = "select * from reservation join homestay on reservation.homestay_id = homestay.homestay_id ".
        "join member on homestay.member_id = member.member_id where reservation.reservation_id = $reservation_id";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);

$start = $row['checkIn_date'];
$end = $row['checkOut_date'];
$reservation_date = $row['reservation_date'];
$night = (strtotime($end)- strtotime($start))/24/3600; 

class PDF extends FPDF
{
// Page header
function Header()
{
    // Logo
    $this->Image('../images/homestay-logo.png',10,10,50);   
    // Move to the right
    $this->Cell(100);
    // Arial bold 15
    $this->SetFont('Arial','B',20);
    // Title
    $this->Cell(0,20,'Statement of Reservation','C');
    // Line break
    $this->Ln(20);
}

// Page footer
function Footer()
{
    // Position at 1.5 cm from bottom
    $this->SetY(-15);
    // Arial italic 8
    $this->SetFont('Arial','I',8);
    // Page number
    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}


// Instanciation of inherited class
$pdf = new PDF();
$pdf->AddPage();

$pdf->SetFont('Times','B',18);
$pdf->Cell(80,10,'MyHomestay');
$pdf->Ln();
$pdf->SetFont('Times','',11);
$pdf->Cell(80,0,'1234 ST.');
$pdf->Ln();
$pdf->SetFont('Times','',11);
$pdf->Cell(80,7.5,'Denver, CO 80202');
$pdf->Ln();
$pdf->SetFont('Times','',11);
$pdf->Cell(80,0,'Phone:(60)123-4567');
$pdf->Ln();
$pdf->SetFont('Times','',11);
$pdf->Cell(80,7.5,'myhomestaymmu@gmail.com');
$pdf->Ln();
$pdf->SetFont('Times','',11);
$pdf->Cell(80,0,'www.homestay.com');
$pdf->Ln();
$pdf->Cell(130);
$pdf->SetFont('Arial','',12);
$reservation_date = date("Y-m-d",strtotime($reservation_date));
$pdf->Cell(0,-40,'Reservation Date :  '.$reservation_date,'C');
$pdf->Cell(0,-40,'','C');

$date = date("Y-m-d");
$pdf->Cell(-53.5,-25,'Generate Date :  '.$date,0,1,'C');

$pdf->Cell(0,40,'',0,1,'R');



$word = "To,".
        "\n$member_name".
        "\nDear Sir/Madam,".
        "\nThank you for your reservation. We confirm with pleasure your accommodation.".
        "\nPlease note the information below for accuracy".
        "\nPlease review it and report any discrepancies.";
$pdf->Multicell(160,6,$word);

$pdf->Cell(0,10,'',0,1,'R');

$pdf->SetFillColor(169, 169, 169);
$pdf->SetTextColor(0);
$pdf->SetDrawColor(255, 255, 255);
$pdf->Cell(18,7,'Res.Id',0,0,'L',true);
$pdf->Cell(35,7,'Guest Name',0,0,'L',true);
$pdf->Cell(35,7,'Homestay Name',0,0,'L',true);
$pdf->Cell(28,7,'Check In',0,0,'C',true);
$pdf->Cell(28,7,'Check Out',0,0,'C',true);
$pdf->Cell(18,7,'Nights',0,0,'C',true);
$pdf->Cell(26,7,'Amount',0,1,'C',true);

$pdf->Cell(0,0,'',0,1,'R');
$pdf->Cell(15,7,$row['reservation_id'],1,0,'C',0);
$pdf->Cell(28,7,$member_name,1,0,'C',0);
$pdf->Cell(44,7,$row['homestay_name'],1,0,'C',0);
$pdf->Cell(28,7,$row['checkIn_date'],1,0,'C',0);
$pdf->Cell(30,7,$row['checkOut_date'],1,0,'C',0);
$pdf->Cell(17,7,$night,1,0,'C',0);
$pdf->Cell(25,7,$row['reservation_total_price'],1,0,'C',0);

// Linienfarbe auf Blau einstellen 
$pdf->SetDrawColor(0, 0, 0);

// Linienbreite einstellen, 0.5 mm
$pdf->SetLineWidth(0.5);

// Linie zeichnen
$pdf->Line(10,132,198,132);

$pdf->SetFont('Arial','B',12);

$reservation_total_price = $row['reservation_total_price'];

$pdf->Cell(0,18,'',0,1,'R');
$pdf->Cell(182,3,'Total:  RM'.$reservation_total_price,0,1,'R');
$pdf->Cell(0,3,'',0,1,'R');


$pdf->Output();

?>
Share
Tweet
Pin
Share
No comments
  • Create admin table.
  • Generate login page for administration page
  • Generate admin page and edit profile page with JQuery
  • Add one attribute at admin table to track when the last is updated.
  • Create the login page with validation. The error message should show with red color.
  • Add on Admin_Image at admin table and while upload the image it will directly save into folder not database.
This is the admin that add normal admin in the system. The add normal admin will only display if the admin level is master admin in MyHomestay.
sample using JQuery validation

<pre style="background:#0c1021;color:#f8f8f8"><span style="color:#aeaeae">//validate functions</span>
    <span style="color:#fbde2d">function</span> <span style="color:#ff6400">validateName</span>()
    {
        <span style="color:#aeaeae">//if it's NOT valid</span>
        <span style="color:#fbde2d">if</span>(admin_name<span style="color:#8da6ce">.val</span>()<span style="color:#8da6ce">.length</span> <span style="color:#fbde2d">&lt;</span> <span style="color:#d8fa3c">4</span>)
        {
            admin_name<span style="color:#8da6ce">.addClass</span>(<span style="color:#61ce3c">"boxred"</span>);
            nameInfo<span style="color:#8da6ce">.html</span>(<span style="color:#61ce3c">"&lt;div class='alert alert-warning span4'>"</span><span style="color:#fbde2d">+</span>
                                <span style="color:#61ce3c">"&lt;strong>Wrong!&lt;/strong> The names must with more than 3 letters!"</span><span style="color:#fbde2d">+</span>
                            <span style="color:#61ce3c">"&lt;/div>"</span>);
            <span style="color:#8da6ce">$</span>('<span style="color:#ff6400">#update_name</span>')<span style="color:#8da6ce">.attr</span>(<span style="color:#61ce3c">"disabled"</span>, <span style="color:#d8fa3c">true</span>);
            <span style="color:#8da6ce">$</span>('<span style="color:#ff6400">#update_name</span>')<span style="color:#8da6ce">.fadeTo</span>(<span style="color:#d8fa3c">10</span>,<span style="color:#d8fa3c">0.5</span>);          
        }
        <span style="color:#aeaeae">//if it's valid</span>
        <span style="color:#fbde2d">else</span>
        {
            admin_name<span style="color:#8da6ce">.removeClass</span>(<span style="color:#61ce3c">"boxred"</span>);
            nameInfo<span style="color:#8da6ce">.html</span>(<span style="color:#61ce3c">"&lt;div class='alert alert-success span4'>"</span><span style="color:#fbde2d">+</span>
                                <span style="color:#61ce3c">"&lt;strong>Correct!&lt;/strong> Now can click the save button"</span><span style="color:#fbde2d">+</span>
                            <span style="color:#61ce3c">"&lt;/div>"</span>);     
            <span style="color:#8da6ce">$</span>('<span style="color:#ff6400">#update_name</span>')<span style="color:#8da6ce">.removeAttr</span>(<span style="color:#61ce3c">"disabled"</span>);
            <span style="color:#8da6ce">$</span>('<span style="color:#ff6400">#update_name</span>')<span style="color:#8da6ce">.fadeTo</span>(<span style="color:#d8fa3c">10</span>,<span style="color:#d8fa3c">1.0</span>);          
        }
    }
</pre>
Share
Tweet
Pin
Share
No comments
Newer Posts
Older Posts

About me



Jack is a programmer, hiker who loves to take challages. Programming can be hard, but no pain no gain. Beside that, Jack like to use cooking for stress relief. “Cooking is a great destresser because it serves as a creative outlet”. During cooking the chef have to well handle of food ingredients. “Cooking is like giving birth because you are mixing things together to create something new and wonderful.”

Labels

Backpacking Camping car Caving Code Test and Project Degree Life Diploma Life Event FYP Hiking Mountain Internship MMU Cyberjaya MMU Melaka Outdoor Adventure Part Time and Work Penang Singapora Thailand Trip and Travel

recent posts

Follow Us

Blog Archive

  • ▼  2018 (2)
    • ▼  May (1)
      • Say hi to Pahang Maran Berkelah Waterfall Camping
    • ►  January (1)
  • ►  2017 (8)
    • ►  August (2)
    • ►  July (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2016 (22)
    • ►  December (3)
    • ►  November (1)
    • ►  October (2)
    • ►  September (3)
    • ►  July (1)
    • ►  May (2)
    • ►  April (6)
    • ►  March (2)
    • ►  February (1)
    • ►  January (1)
  • ►  2015 (3)
    • ►  December (1)
    • ►  September (2)
  • ►  2014 (19)
    • ►  October (1)
    • ►  September (2)
    • ►  July (4)
    • ►  June (5)
    • ►  April (2)
    • ►  March (3)
    • ►  January (2)
  • ►  2013 (10)
    • ►  December (2)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (3)
    • ►  June (2)
  • ►  2012 (4)
    • ►  September (1)
    • ►  June (2)
    • ►  February (1)
  • ►  2011 (2)
    • ►  December (1)
    • ►  August (1)
Powered by Blogger.