In the spirit of SHARING IS CARING, blog.kerul.net is providing PHP training manual for FREE. Please feel free to download it…
- Basic PHP (for Web/Internet Programming I)
- Chapter 01: Intro to PHP
- Chapter 02: PHP Syntax
- Chapter 03: Form Interactions
- Chapter 04: PHP Operators
- Chapter 05: Array
- Chapter 06: Selection Structures
- Chapter 07: Repetition Structures
- Intermediate PHP with SQL for Database Driven Website – for Web/Internet Programming II
- Chapter 08: Tools for Web Application Development
- Chapter 09: Record Listing using SELECT
- Chapter 10: Search Record using SELECT
- Chapter 11: Inserting a New Record using INSERT
- Chapter 12: DELETE an Existing Record
- Chapter 13: UPDATE an Existing Record
- Chapter 14: Logging in using Username and Password
- Chapter 15: Server-side Session
- Chapter 16: Securing the System’s Parameter using Session
- The database sample (MyCompanyHR) copy from SQL dump below or download from
mycompanyhr (the sample database )
-- phpMyAdmin SQL Dump
-- version 2.11.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 11, 2008 at 10:36 PM
-- Server version: 5.0.45
-- PHP Version: 5.2.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `mycompanyhr`
--
CREATE DATABASE `mycompanyhr` DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci;
USE `mycompanyhr`;
-- --------------------------------------------------------
--
-- Table structure for table `adminusers`
--
CREATE TABLE `adminusers` (
`EMPNO` varchar(6) character set latin1 NOT NULL,
`PASSWORD` varchar(200) character set latin1 NOT NULL,
`LEVEL` varchar(1) character set latin1 NOT NULL,
PRIMARY KEY (`EMPNO`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
--
-- Dumping data for table `adminusers`
--
INSERT INTO `adminusers` (`EMPNO`, `PASSWORD`, `LEVEL`) VALUES
('000341', '0192023a7bbd73250516f069df18b500', '1'),
('000020', '0acf4539a14b3aa27deeb4cbdf6e989f', '2');
-- --------------------------------------------------------
--
-- Table structure for table `department`
--
CREATE TABLE `department` (
`DEPTNO` char(3) NOT NULL default '',
`DEPTNAME` varchar(30) default NULL,
`MGRNO` varchar(6) default NULL,
`ADMRDEPT` char(3) default NULL,
`LOCATION` varchar(16) default NULL,
PRIMARY KEY (`DEPTNO`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `department`
--
INSERT INTO `department` (`DEPTNO`, `DEPTNAME`, `MGRNO`, `ADMRDEPT`, `LOCATION`) VALUES
('A00', 'SPIFFY COMPUTER SERVICE DIV.', '000010', 'A00', NULL),
('B01', 'PLANNING', '000020', 'A00', NULL),
('C01', 'INFORMATION CENTER', '000030', 'A00', NULL),
('D01', 'DEVELOPMENT CENTER', NULL, 'A00', NULL),
('D11', 'MANUFACTURING SYSTEMS', '000060', 'D01', NULL),
('D21', 'ADMINISTRATION SYSTEMS', '000070', 'D01', NULL),
('E01', 'SUPPORT SERVICES', '000050', 'A00', NULL),
('E11', 'OPERATIONS', '000090', 'E01', NULL),
('E21', 'SOFTWARE SUPPORT', '000100', 'E01', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `emp_act`
--
CREATE TABLE `emp_act` (
`EMPNO` char(6) default NULL,
`PROJNO` char(6) default NULL,
`ACTNO` smallint(6) default NULL,
`EMPTIME` decimal(5,2) default NULL,
`EMSTDATE` date default NULL,
`EMENDATE` date default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `emp_act`
--
INSERT INTO `emp_act` (`EMPNO`, `PROJNO`, `ACTNO`, `EMPTIME`, `EMSTDATE`, `EMENDATE`) VALUES
('000010', 'MA2100', 10, 0.50, '1982-01-01', '1982-11-01'),
('000010', 'MA2110', 10, 1.00, '1982-01-01', '1983-02-01'),
('000010', 'AD3100', 10, 0.50, '1982-01-01', '1982-07-01'),
('000020', 'PL2100', 30, 1.00, '1982-01-01', '1982-09-15'),
('000030', 'IF1000', 10, 0.50, '1982-06-01', '1983-01-01'),
('000030', 'IF2000', 10, 0.50, '1982-01-01', '1983-01-01'),
('000050', 'OP1000', 10, 0.25, '1982-01-01', '1983-02-01'),
('000050', 'OP2010', 10, 0.75, '1982-01-01', '1983-02-01'),
('000070', 'AD3110', 10, 1.00, '1982-01-01', '1983-02-01'),
('000090', 'OP1010', 10, 1.00, '1982-01-01', '1983-02-01'),
('000100', 'OP2010', 10, 1.00, '1982-01-01', '1983-02-01'),
('000110', 'MA2100', 20, 1.00, '1982-01-01', '1982-03-01'),
('000130', 'IF1000', 90, 1.00, '1982-01-01', '1982-10-01'),
('000130', 'IF1000', 100, 0.50, '1982-10-01', '1983-01-01'),
('000140', 'IF1000', 90, 0.50, '1982-10-01', '1983-01-01'),
('000140', 'IF2000', 100, 1.00, '1982-01-01', '1982-03-01'),
('000140', 'IF2000', 100, 0.50, '1982-03-01', '1982-07-01'),
('000140', 'IF2000', 110, 0.50, '1982-03-01', '1982-07-01'),
('000140', 'IF2000', 110, 0.50, '1982-10-01', '1983-01-01'),
('000150', 'MA2112', 60, 1.00, '1982-01-01', '1982-07-15'),
('000150', 'MA2112', 180, 1.00, '1982-07-15', '1983-02-01'),
('000160', 'MA2113', 60, 1.00, '1982-07-15', '1983-02-01'),
('000170', 'MA2112', 60, 1.00, '1982-01-01', '1983-06-01'),
('000170', 'MA2112', 70, 1.00, '1982-06-01', '1983-02-01'),
('000170', 'MA2113', 80, 1.00, '1982-01-01', '1983-02-01'),
('000180', 'MA2113', 70, 1.00, '1982-04-01', '1982-06-15'),
('000190', 'MA2112', 70, 1.00, '1982-02-01', '1982-10-01'),
('000190', 'MA2112', 80, 1.00, '1982-10-01', '1983-10-01'),
('000200', 'MA2111', 50, 1.00, '1982-01-01', '1982-06-15'),
('000200', 'MA2111', 60, 1.00, '1982-06-15', '1983-02-01'),
('000210', 'MA2113', 80, 0.50, '1982-10-01', '1983-02-01'),
('000210', 'MA2113', 180, 0.50, '1982-10-01', '1983-02-01'),
('000220', 'MA2111', 40, 1.00, '1982-01-01', '1983-02-01'),
('000230', 'AD3111', 60, 1.00, '1982-01-01', '1982-03-15'),
('000230', 'AD3111', 60, 0.50, '1982-03-15', '1982-04-15'),
('000230', 'AD3111', 70, 0.50, '1982-03-15', '1982-10-15'),
('000230', 'AD3111', 80, 0.50, '1982-04-15', '1982-10-15'),
('000230', 'AD3111', 180, 1.00, '1982-10-15', '1983-01-01'),
('000240', 'AD3111', 70, 1.00, '1982-02-15', '1982-09-15'),
('000240', 'AD3111', 80, 1.00, '1982-09-15', '1983-01-01'),
('000250', 'AD3112', 60, 1.00, '1982-01-01', '1982-02-01'),
('000250', 'AD3112', 60, 0.50, '1982-02-01', '1982-03-15'),
('000250', 'AD3112', 60, 0.50, '1982-12-01', '1983-01-01'),
('000250', 'AD3112', 60, 1.00, '1983-01-01', '1983-02-01'),
('000250', 'AD3112', 70, 0.50, '1982-02-01', '1982-03-15'),
('000250', 'AD3112', 70, 1.00, '1982-03-15', '1982-08-15'),
('000250', 'AD3112', 70, 0.25, '1982-08-15', '1982-10-15'),
('000250', 'AD3112', 80, 0.25, '1982-08-15', '1982-10-15'),
('000250', 'AD3112', 80, 0.50, '1982-10-15', '1982-12-01'),
('000250', 'AD3112', 180, 0.50, '1982-08-15', '1983-01-01'),
('000260', 'AD3113', 70, 0.50, '1982-06-15', '1982-07-01'),
('000260', 'AD3113', 70, 1.00, '1982-07-01', '1983-02-01'),
('000260', 'AD3113', 80, 1.00, '1982-01-01', '1982-03-01'),
('000260', 'AD3113', 80, 0.50, '1982-03-01', '1982-04-15'),
('000260', 'AD3113', 180, 0.50, '1982-03-01', '1982-04-15'),
('000260', 'AD3113', 180, 1.00, '1982-04-15', '1982-06-01'),
('000260', 'AD3113', 180, 0.50, '1982-06-01', '1982-07-01'),
('000270', 'AD3113', 60, 0.50, '1982-03-01', '1982-04-01'),
('000270', 'AD3113', 60, 1.00, '1982-04-01', '1982-09-01'),
('000270', 'AD3113', 60, 0.25, '1982-09-01', '1982-10-15'),
('000270', 'AD3113', 70, 0.75, '1982-09-01', '1982-10-15'),
('000270', 'AD3113', 70, 1.00, '1982-10-15', '1983-02-01'),
('000270', 'AD3113', 80, 1.00, '1982-01-01', '1982-03-01'),
('000270', 'AD3113', 80, 0.50, '1982-03-01', '1982-04-01'),
('000280', 'OP1010', 130, 1.00, '1982-01-01', '1983-02-01'),
('000290', 'OP1010', 130, 1.00, '1982-01-01', '1983-02-01'),
('000300', 'OP1010', 130, 1.00, '1982-01-01', '1983-02-01'),
('000310', 'OP1010', 130, 1.00, '1982-01-01', '1983-02-01'),
('000320', 'OP2011', 140, 0.75, '1982-01-01', '1983-02-01'),
('000320', 'OP2011', 150, 0.25, '1982-01-01', '1983-02-01'),
('000330', 'OP2012', 140, 0.25, '1982-01-01', '1983-02-01'),
('000330', 'OP2012', 160, 0.75, '1982-01-01', '1983-02-01'),
('000340', 'OP2013', 140, 0.50, '1982-01-01', '1983-02-01'),
('000340', 'OP2013', 170, 0.50, '1982-01-01', '1983-02-01'),
('000020', 'PL2100', 30, 1.00, '1982-01-01', '1982-09-15');
-- --------------------------------------------------------
--
-- Table structure for table `employee`
--
CREATE TABLE `employee` (
`EMPNO` varchar(6) NOT NULL default '',
`FIRSTNAME` varchar(20) default NULL,
`MIDINT` char(1) default NULL,
`LASTNAME` varchar(20) default NULL,
`WORKDEPT` char(3) default NULL,
`PHONENO` varchar(4) default NULL,
`HIREDATE` date default NULL,
`JOB` varchar(8) default NULL,
`EDLEVEL` smallint(6) default NULL,
`SEX` char(1) default NULL,
`BIRTHDATE` date default NULL,
`SALARY` decimal(9,2) default NULL,
`BONUS` decimal(9,2) default NULL,
`COMM` decimal(9,2) default NULL,
PRIMARY KEY (`EMPNO`),
FULLTEXT KEY `JOB` (`JOB`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `employee`
--
INSERT INTO `employee` (`EMPNO`, `FIRSTNAME`, `MIDINT`, `LASTNAME`, `WORKDEPT`, `PHONENO`, `HIREDATE`, `JOB`, `EDLEVEL`, `SEX`, `BIRTHDATE`, `SALARY`, `BONUS`, `COMM`) VALUES
('000341', 'KHIRULNIZAM', NULL, 'ABD RAHMAN', 'C01', '1111', '2000-01-29', 'PROGRAMM', 17, 'M', '1976-08-18', 36000.00, 6000.00, 2000.00),
('000020', 'MICHAEL', 'L', 'THOMPSONS', 'C01', '2222', '1973-10-10', 'MANAGER', 18, 'M', '1948-02-02', 41250.00, 800.00, 3300.00),
('000050', 'JOHN', 'B', 'GEYER', 'E01', '6789', '1949-08-17', 'MANAGER', 16, 'M', '1925-09-15', 40175.00, 800.00, 3214.00),
('000070', 'EVA', 'D', 'PULASKI', 'D21', '7831', '1980-09-30', 'MANAGER', 16, 'F', '1953-05-26', 36170.00, 700.00, 2893.00),
('000090', 'EILEEN', 'W', 'HENDERSON', 'E11', '5498', '1970-08-15', 'MANAGER', 16, 'F', '1941-05-15', 29750.00, 600.00, 2380.00),
('000100', 'THEODORE', 'Q', 'SPENSER', 'E21', '0972', '1980-06-19', 'MANAGER', 14, 'M', '1956-12-18', 26150.00, 500.00, 2092.00),
('000110', 'VINCENZO', 'G', 'LUCCHESSI', 'A00', '3490', '1958-05-16', 'SALESREP', 19, 'M', '1929-11-05', 46500.00, 900.00, 3720.00),
('000120', 'SEAN', '', 'O''CONNELL', 'A00', '2167', '1963-12-05', 'CLERK', 14, 'M', '1942-10-18', 29250.00, 600.00, 2340.00),
('000130', 'DOLORES', 'M', 'QUINTANA', 'C01', '4578', '1971-07-28', 'ANALYST', 16, 'F', '1925-09-15', 23800.00, 500.00, 1904.00),
('000140', 'HEATHER', 'A', 'NICHOLLS', 'C01', '1793', '1976-12-15', 'ANALYST', 18, 'F', '1946-01-19', 28420.00, 600.00, 2274.00),
('000150', 'BRUCE', '', 'ADAMSON', 'D11', '4510', '1972-02-12', 'DESIGNER', 16, 'M', '1947-05-17', 25280.00, 500.00, 2022.00),
('000160', 'ELIZABETH', 'R', 'PIANKA', 'D11', '3782', '1977-10-11', 'DESIGNER', 17, 'F', '1955-04-12', 22250.00, 400.00, 1780.00),
('000180', 'MARILYN', 'S', 'SCOUTTEN', 'D11', '1682', '1973-07-07', 'DESIGNER', 17, 'F', '1949-02-21', 21340.00, 500.00, 1707.00),
('000190', 'JAMES', 'H', 'WALKER', 'D11', '2986', '1974-07-26', 'DESIGNER', 16, 'M', '1952-06-25', 20450.00, 400.00, 1636.00),
('000200', 'DAVID', '', 'BROWN', 'D11', '4501', '1966-03-03', 'DESIGNER', 16, 'M', '1941-05-29', 27740.00, 600.00, 2217.00),
('000210', 'WILLIAM', 'T', 'JONES', 'D11', '0942', '1979-04-11', 'DESIGNER', 17, 'M', '1953-02-23', 18270.00, 400.00, 1462.00),
('000220', 'JENNIFER', 'K', 'LUTZ', 'D11', '0672', '1968-08-29', 'DESIGNER', 18, 'F', '1948-03-19', 29840.00, 600.00, 2387.00),
('000230', 'JAMES', 'J', 'JEFFERSON', 'D21', '2094', '1966-11-21', 'CLERK', 14, 'M', '1935-05-30', 22180.00, 400.00, 1774.00),
('000240', 'SALVATORE', 'M', 'MARINO', 'D21', '3780', '1979-12-05', 'CLERK', 17, 'M', '1954-03-31', 28760.00, 600.00, 2301.00),
('000250', 'DANIEL', 'S', 'SMITH', 'D21', '0961', '1969-10-30', 'CLERK', 15, 'M', '1939-11-12', 19180.00, 400.00, 1534.00),
('000260', 'SYBIL', 'P', 'JOHNSON', 'D21', '8953', '1975-09-11', 'CLERK', 16, 'F', '1936-10-05', 17250.00, 300.00, 1380.00),
('000270', 'MARIA', 'L', 'PEREZ', 'D21', '9001', '1980-09-30', 'CLERK', 15, 'F', '1953-05-26', 27380.00, 500.00, 2190.00),
('000280', 'ETHEL', 'R', 'SCHNEIDER', 'E11', '8997', '1967-03-24', 'OPERATOR', 17, 'F', '1936-03-28', 26250.00, 500.00, 2100.00),
('000290', 'JOHN', 'R', 'PARKER', 'E11', '4502', '1980-05-30', 'OPERATOR', 12, 'M', '1946-07-09', 15340.00, 300.00, 1227.00),
('000300', 'PHILIP', 'X', 'SMITH', 'E11', '2095', '1972-06-19', 'OPERATOR', 14, 'M', '1936-10-27', 17750.00, 400.00, 1420.00),
('000310', 'MAUDE', 'F', 'SETRIGHT', 'E11', '3332', '1964-09-12', 'OPERATOR', 12, 'F', '1931-04-21', 15900.00, 300.00, 1272.00),
('000320', 'RAMLAL', 'V', 'MEHTA', 'E21', '9990', '1965-07-07', 'FIELDREP', 16, 'M', '1932-08-11', 19950.00, 400.00, 1596.00),
('000330', 'WING', '', 'LEE', 'E21', '2103', '1976-02-23', 'FIELDREP', 14, 'M', '1941-07-18', 25370.00, 500.00, 2030.00),
('000340', 'JASON', 'R', 'GOUNOT', 'E21', '5698', '1947-05-05', 'FIELDREP', 16, 'M', '1926-05-17', 23840.00, 500.00, 1907.00);
-- --------------------------------------------------------
--
-- Table structure for table `project`
--
CREATE TABLE `project` (
`PROJNO` varchar(6) NOT NULL default '',
`PROJNAME` varchar(24) default NULL,
`DEPTNO` char(3) default NULL,
`RESPEMP` varchar(6) default NULL,
`PRSTAFF` decimal(5,2) default NULL,
`PRSDATE` date default NULL,
`PRENDATE` date default NULL,
`MAJPROJ` varchar(6) default NULL,
PRIMARY KEY (`PROJNO`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `project`
--
INSERT INTO `project` (`PROJNO`, `PROJNAME`, `DEPTNO`, `RESPEMP`, `PRSTAFF`, `PRSDATE`, `PRENDATE`, `MAJPROJ`) VALUES
('AD3100', 'ADMIN SERVICES', 'D01', '000010', 6.50, '1982-01-01', '1983-02-01', ''),
('AD3110', 'GENERAL ADMIN SYSTEMS', 'D21', '000070', 6.00, '1982-01-01', '1983-02-01', 'AD3100'),
('AD3111', 'PAYROLL PROGRAMMING', 'D21', '000230', 2.00, '1982-01-01', '1983-02-01', 'AD3110'),
('AD3112', 'PERSONNEL PROGRAMMING', 'D21', '000250', 1.00, '1982-01-01', '1983-02-01', 'AD3110'),
('AD3113', 'ACCOUNT PROGRAMMING', 'D21', '000270', 2.00, '1982-01-01', '1983-02-01', 'AD3110'),
('IF1000', 'QUERY SERVICES', 'C01', '000030', 2.00, '1982-01-01', '1983-02-01', NULL),
('IF2000', 'USER EDUCATION', 'C01', '000030', 1.00, '1982-01-01', '1983-02-01', NULL),
('MA2100', 'WELD LINE AUTOMATION', 'D01', '000010', 12.00, '1982-01-01', '1983-02-01', NULL),
('MA2110', 'W L PROGRAMMING', 'D11', '000060', 9.00, '1982-01-01', '1983-02-01', 'MA2100'),
('MA2111', 'W L PROGRAM DESIGN', 'D11', '000220', 2.00, '1982-01-01', '1982-12-01', 'MA2110'),
('MA2112', 'W L ROBOT DESIGN', 'D11', '000150', 3.00, '1982-01-01', '1982-12-01', 'MA2110'),
('MA2113', 'W L PROD CONT PROGS', 'D11', '000160', 3.00, '1982-02-15', '1982-12-01', 'MA2110'),
('OP1000', 'OPERATION SUPPORT', 'E01', '000050', 6.00, '1982-01-01', '1983-02-01', NULL),
('OP1010', 'OPERATION', 'E11', '000090', 5.00, '1982-01-01', '1983-02-01', 'OP1000'),
('OP2000', 'GEN SYSTEMS SERVICES', 'E01', '000050', 5.00, '1982-01-01', '1983-02-01', NULL),
('OP2010', 'SYSTEMS SUPPORT', 'E21', '000100', 4.00, '1982-01-01', '1983-02-01', 'OP2000'),
('OP2011', 'SCP SYSTEMS SUPPORT', 'E21', '000320', 1.00, '1982-01-01', '1983-02-01', 'OP2010'),
('OP2012', 'APPLICATIONS SUPPORT', 'E21', '000330', 1.00, '1982-01-01', '1983-02-01', 'OP2010'),
('OP2013', 'DB/DC SUPPORT', 'E21', '000340', 1.00, '1982-01-01', '1983-02-01', 'OP2010'),
('PL2100', 'WELD LINE PLANNING', 'B01', '000020', 1.00, '1982-01-01', '1982-09-15', 'MA2100');
This FREE PHP Training Manual is licensed under the;
CreativeCommons Licensed All articles written by Khirulnizam Abd Rahman are licensed under a Creative Commons Attribution-Noncommercial 2.5 Malaysia License.
If you are interested to use these training manual for your commercial training/classes, please contact me at khirulnizam[at]gmail.com to ask for permission.
salam.. bro thanks to share..
ReplyDeleteNk tanye skit..?tau tak AS 400 (advance system 400) technology for future dari IBM.teknologi ini digunakan untuk server bank dan lain2 company.
ia satu mainframe atau advance machine.. susah x programming dier..
kalo buleh share lagi gempak..
Thanks
Sorry bro Rafael,
ReplyDeleteSaya tak sempat bertemu dan berkenal mesra dgn AS400. Ni dah kira legacy system dah nih... Awal millenium nih meme popular, tp sekarang ???
woww..very useful!! thanks a lot
ReplyDeletethanks ... cikguu.. hehhehe... biasa cikgu sy kat cni youtube je.. ni bru jupe versi melayu... pergghh susah nak cari
ReplyDeletekenapa saya tak boleh import...error dekat line 1..
ReplyDeleteLine 1 is to create a database name "mycompanyhr", most likely u already have the database in the database server... DROP this database first...
DeleteIBM AS400 ialah satu sistem mainframe yg beroperasi dlm Unix environment. bahasa pengaturcaraan yg biasa digunakan dan popular dlm environment AS400 ni antaranya ialah COBOL, Java, Perl, dan C++... utk databasenya boleh jadi macam2 seperti DB2, Oracle, kecuali MS SQL Server atau mySQL.. bahasa utk DB pula ialah seperti Focus dan JCL (Job Control Language) utk execution syntax SQL Focus tersebut. Bank2 dan Kilang2 besar masih menggunakan Mainframe ini sebab security yg mmg bagus, serta processing time yg laju, cuma hardwarenya BESAAARRR dan consume power banyak.
ReplyDelete