Monday, August 7, 2023

OOP PHP

Halaman OOP PHP Soal Ujian Labor, Silahkan Download
Tahapan untuk menjawab soal diatas lakukanlah kegiatan-kegiatan Algoritma berikut
  1. ANALSISIS
  2. Pelajari masalah dalam soal
    desain database
    desain SQL Query
    input data
    susun SQL Query
  3. BUAT FOLDER
  4. Alamat web dalam kasus disebut: gaji. Untuk itu buatlah folder di drive C atau D
    Cari folder xampp
    masuk ke folder tersebut (caranya, double click folder tersebut)
    masuk ke folder htdocs (caranya, double click folder tersebut)
    buat folder gaji (cara: click kanan > new, ketik gaji)
  5. UJI
  6. Uji apakah folder tersebut (gaji) telah aktif
    dari browser ketik: localhost/gaji
  7. CODING
  8. Buka text editor: Visual Studio Code, VS COde / code
    open folder gaji (nama ruang kerja)
    tulis program Model, misal model.php
    tulis program index.php
  1. Tulis Class

  2. Buat sebuah class disebut Model. Simpan program dengan nama file: model.php

    Pastikan nama file sama dengan nama Class.


    < ?php

    Class Model // //awal class
    {
    //Author: Muhammad Amrin Lubis
    //date-written: 7 Juli 2023
    private $server = "localhost";
    private $username = "root";
    private $password;
    private $db = " "; //misal namadatabase: gajikaryawan
    private $conn;
    public function __construct(){ //awal construct
    try{
    $this->conn = new mysqli($this->server, $this->username, $this->password, $this->db);
    } catch(Exception $e) {
    echo "Koneksi Gagal".$e->getMessage();
    }
    } //akhir construct
    }// AKHIR class
    ?> //akhir class
  3. Tulis Method

  4. Method berfungsi untuk mengerjakan satu tugas, misal tugas membaca data dari database dan menampilkannya
    nama method disini yaitu fetchGajiBulanan. Simpan program method ini dalam file model.php. Disebabkan program model.php
    telah dibuat, maka langsung sisipkan method fetchGajiBulanan pada program model.php
    Tabel yang dibaca untuk penulisan method ini yaitu tabel gaji
    Script dibawah ini

    public function fetchGajiBulanan(){
    $data = null;
    $query = " "; // isi script SQL dalam tanda kutip tsb
    if($sql = $this->conn->query ($query)){
    while ($rows = mysqli_fetch_assoc($sql)){
    $data []=$rows;
    }
    }
    return $data;
    }
  5. Tulis program index

  6. Tulis program utama yang disebut index dan simpan program dengan nama file index.php
    < ?php require 'model.php';
    $model = New Model();
    // baca data gaji karyawan bulanan
    $recordGaji = $model->fetchGajiBulanan();
    // uji apakah data gaji bulanan bisa ditampilkan var_dump( $recordGaji ); // tampilkan data gaji kary bulanan die; // stop
    ?>

Monday, June 19, 2023

Surf Book Reviews

Surf Shack: Laid-Back Living by the Water

by Nina Freudenberger, Heather Summerville, et al


Below are outlined a number of excellent book reviews by the brilliant author Freudenberger and friends. It's a shame if you miss reading a book whose presentation is great. Surf Shack: Laid-Back Living by the Water, described as follows:

"Surf Shack: Laid-Back Living by the Water" is a captivating book that takes readers on a visual journey through stunning coastal homes and their unique, laid-back style. Nina Freudenberger beautifully captures the essence of coastal living and the surf culture in this thoughtfully curated collection.

The book offers a refreshing and inspiring perspective on how to create a surf-inspired lifestyle in any coastal setting. From the West Coast of the United States to Australia and beyond, the author showcases a diverse range of surf shacks that reflect the owners' personalities and love for the ocean.

One of the standout features of this book is the exceptional photography by Brittany Ambridge. The images are breathtaking, capturing the essence of each surf shack and its surrounding environment. The attention to detail is remarkable, allowing readers to immerse themselves in the coastal aesthetic.

Nina Freudenberger's storytelling ability shines through in "Surf Shack." She weaves together personal anecdotes, interviews with homeowners, and practical tips on incorporating the surf lifestyle into one's own home. The writing is engaging, informative, and evokes a sense of wanderlust and appreciation for the ocean.

The book goes beyond showcasing beautiful interiors and dives into the lifestyle aspects of surf culture. It explores the connection between nature, art, sustainability, and the ocean. Readers will find themselves inspired to bring elements of these themes into their own lives, whether they live by the water or not.

Each surf shack featured in the book has its own unique style and personality, reflecting the owners' creativity and passion. From bohemian-inspired retreats to minimalist beach houses, there is something for every design taste. The book offers a wealth of ideas and inspiration for anyone looking to infuse their home with coastal charm.

"Surf Shack" also highlights the importance of community and the relationships that are formed through the love of surfing. The stories shared by the homeowners and surfers featured in the book create a sense of camaraderie and remind readers of the power of connection in living a fulfilling coastal lifestyle.

The book is not only visually appealing but also practical. It provides helpful tips on choosing sustainable materials, maximizing natural light, and creating a space that fosters relaxation and tranquility. The ideas presented are accessible and can be adapted to fit various budgets and living spaces.

As a coffee table book, "Surf Shack" is a conversation starter. Guests will be drawn to its beautiful cover and quickly find themselves flipping through the pages, captivated by the stunning visuals and engaging narratives. It is a book that can be enjoyed repeatedly, discovering new details and insights with each reading.

Whether you are a surfing enthusiast, a lover of coastal design, or simply someone seeking inspiration for creating a serene home, "Surf Shack: Laid-Back Living by the Water" is a must-read. It encapsulates the essence of coastal living and leaves readers yearning for their own slice of paradise by the sea.

In conclusion, "Surf Shack: Laid-Back Living by the Water" is a delightful book that beautifully combines stunning visuals, captivating stories, and practical design advice. Nina Freudenberger's passion for the surf lifestyle shines through, making this book an excellent addition to any design or beach lover's collection.

Post-1

OOP PHP

Halaman OOP PHP Soal Ujian Labor, Silahkan Download Tahapan untuk menjawab soal diatas lakukanlah kegiatan-kegiatan Algoritma berikut ...