Archive for April 2009

New Training For The Job

In order to assure the highest levels of quality work and productivity from employees well trained through our program of SPECIAL HIGH INTENSITY TRAINING (S.H.I.T.). We are trying to give employees more S.H.I.T. then anyone else. If you feel that you do not receive your share of S.H.I.T. on the job, please see your manager. You will be immediately placed at the top of the S.H.I.T. list, and our managers are especially skilled at seeing that you get all the S.H.I.T. you can handle..

Employees that don’t take their S.H.I.T. will be placed in DEPARTMENTAL EMPLOYEE EVALUATION PROGRAMS (D.E.E.P. S.H.I.T.). Those who fail to take D.E.E.P. S.H.I.T. seriously will have to go to EMPLOYEE ATTITUDE TRAINING (E.A.T. S.H.I.T.). Since out managers took S.H.I.T. before they were prompted, they don’t have to do S.H.I.T. anymore, and are all full of S.H.I.T. already.

If you are full of S.H.I.T., you may be interested in a job training of others. We can add your name to our BASIC UNDERSTANDING LECTURE LIST (B.U.L.L. S.H.I.T.). Those who are full of B.U.L.L. S.H.I.T. will get the S.H.I.T. jobs, and can apply for promotion to DIRECTOR OF INTENSITY PROGRAMMING (D.I.P. S.H.I.T.).

If you have further questions, please direct them to our HEAD OF TRAINING, SPECIAL HIGH INTENSITY TRAINING (H.O.T. S.H.I.T.)

© SOTA Glazing Inc.

PHP Pagination Simple Mechanics

It is actually very simple. All you need to know is what page you are on and how many items there is to list in total. Here is an out line:

Step one, get those values:
total_items
items_per_page
current_page

Step two, calculate total pages:
total_pages = ( total_items / items_per_page )

Step three, calculate limit offset for database query:
start_item = current_page * items_per_page
end_item = if on last page then ( total_pages – start_item ) else ( items_per_page ) “asuming your database works like mysql”

Be mindful that arrays and databases start from 0 not from 1.

And from there just make your PHP code and add on nifty features of your own.

Check out my previous guide for a nice pagination script with demo.