rrottmann / timesheet

A small automation for tracking working hours for personal use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timesheet

Even employees with trust-based working hours need to track times. With a small script, calling a webpage inserts the current timestamp in a database to track clock-in and clock-out timestamps.

URLs

PHP Insert Timestamp

<?php
$servername = "localhost";
$username = "d03ca9da";
$password = "";
$dbname = "d03ca9da";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

$sql = "INSERT INTO `timesheet` (`idt`, `ts`) VALUES (NULL, CURRENT_TIMESTAMP)";

if ($conn->query($sql) === TRUE) {
  echo "New record created successfully";
} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?> 

Database Schema

create table timesheet
(
    idt int auto_increment
        primary key,
    ts  datetime default CURRENT_TIMESTAMP not null
);

About

A small automation for tracking working hours for personal use.


Languages

Language:Python 100.0%