Giter Site home page Giter Site logo

goerdy / printablepdfyearcalendar Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 89 KB

creates a printable single page year calendar

Home Page: https://github.com/goerdy/PrintablePDFYearCalendar/

License: GNU General Public License v3.0

PHP 100.00%
calendar printable-pdf-files year-calendar

printablepdfyearcalendar's Introduction

PrintablePDFYearCalendar

This project provides a script that renders a year calendar on a single page PDF file. This is perfect for workshift schedules, club meetings, school holidays and much more. The option to color highlight days makes it clearer to read and gives an easy overview.

This project was made to print a 24-hour shift schedule for a career fire department and is used in that project [link to fireshift git].

It was a well considered decision to use 2-dimensional arrays as input because they are easy to fill with data from different sources and don't blow the code that much.

Features

  • highly customizable
  • text and color for each day separately
  • multi-language support
  • supports holidays (color highlighting)
  • color highlighting for Saturday and Sunday (AFAIK that fits western and hebrew demands, if your culture needs other highlighting, let me know and I will add support for this)

Usage

  1. include mkCal.php in your project
  2. store your data in Arrays.
  3. call PrintablePDFYearCalendar function

require('mkCal.php');

PrintablePDFYearCalendar("Example Calendar", 2024 ,"en_US", $DaysTextArray, $DaysColorArray, $DaysHolidaysArray, "#AAAA00" ,"#FF0000", "#990000", "some customizable footer text", "A4Landscape", "#0000FF");

style

$locale [string] e.g. "en_US" or "de_DE" for correct display of month and days in your language

$highlightHolidays [string] contains the Hex color key for holiday highlighting

$highlightSunday [string] contains the Hex color key for sunday highlighting

$highlightSaturday [string] contains the Hex color key for saturday highlighting

$format [string] "A4Landscape / LetterLandscape"

$colorScheme [string] "red/blue/green/yellow"

Calendar content

$title [string] contains the printed title of the calendar.

$Year [int] contains the Year of the Calendar (used to calculate weekdays...)

$footer [string] contains the footer text you want to be displayed.

Function expects three 2-dimensional Arrays. Where the first index is the month and the second is the day.

$DaysTextArray [string] contains the text to display in each given Day

$DaysColorArray [string] contains the Hex color key for background color of each given Day

$DaysHolidaysArray [boolean] specifies if the given day is a holiday

example:

$DaysTextArray[2][18]="goerdy";

//February the 18th displays "goerdy".

$DaysColorArray[2][18]="#FF0000";

//February the 18th has a red background.

$DaysHolidaysArray[3][17]="true";

//March the 17th is highlighted as holiday.

See well documented example.php for further information.

Licence

GNU GPL v3

Credits

Uses FPDF in version 1.86 http://www.fpdf.org/

unchanged used FPDF Files:

fpdf.php

/fonts/...

printablepdfyearcalendar's People

Contributors

goerdy avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.