< web  portfolio >

Brenda C. Mondragon

< Main Page >


PHP :: Baby Tracker


This "Baby Tracker" application written in PHP allows for entering and display of several helpful "baby stats" such as wake and sleep times during the day, diaper changes and meals.


This is not only a fun way for a working parent or other family members to get near-real-time updates on the new baby's status, it's also a great way to help parents keep track of trends in their baby's development and to check that baby's health is "on track".


The modular code is written using object-oriented principals for easiest maintenance and re-use.

The entry administration interface is quick and easy to use for entering data.


Sample PHP code:


//===============================================
include($DISPLAY_ROOT . 'classes/class.data.php');
$data_dir = "data/baby/";
$get_data = &new data($D, $DOCUMENT_ROOT, $data_dir);
 
//===============================================
$data = $get_data->data_sleep();
include($DISPLAY_ROOT . 'includes/sleep_status.php');


<?php
class sleep
{
...
//==============================================
function sleep($D, $data, $dd)
{
  $this->D = $D;
  $this->data = $data;
  $this->ddBegin = strtotime($dd);
  $this->ddEnd = strtotime('+1 days', $this->ddBegin);
  $this->ddNow = mktime();
  $this->displayBegin = date("D j M Y", $this->ddBegin);
  $this->displayEnd = date("D j M Y", $this->ddEnd);
  $this->displayNow = date("D j M Y H:i:s", $this->ddNow);

Categories:



< Main Page >

This portfolio powered by Blosxom

All content Copyright © 1995 - 2024 Brenda C. Mondragon