Search This Blog

Few guidelines for start developing an online software application

I usually use PHP and MySQl for my projects. Since these two are the driving mechanism of the system, look and feel or the layout designing need to use HTML and CSS. Generally uses bootstrap framework, because it has almost all components need to develop a web application. These days, a responsiveness is crucial.

For a web app, easiest approach to design is use a admin template that uses bootstrap framework and possibly latest HTML and CSS standards (at the time of writing this HTML5 and CSS3). Because a template can save lots of time you need to spend on designing interfaces and use that time for coding.

There are lots of good free admin templates available. I generally prefer to use only one template for one project. Because it is good when you showcase your works.

After downloading a template, first need to open the index.html file and see if it is fully functioning. There are some free templates that not gives full functions as it shows in their demo. So, before starts developing checking downloaded files are important. Generally checks for forms, tables, charts, icons, and responsiveness.

Next create a project folder and copy only index.html file and all folders. Don't copy other files now. We need to create our app templates from using only index file and then copy other components when needed. Open the index.html file in a text editor (I prefer using notepad++) and see for linked css and js files. Some css and js files may linked to the original location online. It is good to download these outside linked files and link them locally. Because if those files some day removed or updated, your application may not work correctly. You should download all online linked files to your project folder (css files into css directory and js files in to js directory) and change the link in the index.html file to local path. After changing all links, open the index.html file and check if all functions in the home page works. If not most probably you made a mistake in updating local path links. Carefully check for path errors. Additionally if you are using Google Chrome or Firefox, you can open developer console (F12) and see for error information. This developer console is a very important tool when developing web apps.

The next thing you need to do is creating the app template from index.html file. Since I use PHP, first I rename index.html in to index.php so I have a php file. Next thing is to define header and footer of the template. Header is to top static part of the page including left side control panel (if any) and other static navigation menus until main page contents begin. Footer is the static bottom part of the page. This header and footer is common all over the application (in all other pages).

Generally the header starts from open html tag and stops at starting of main page contents div element. Cut and create a separate php file called header.php and paste all header codes to that file. Then you can include the header file to the index page. Same way should create footer.php file and include it to the index file. Now you have your basic app template of index.php, header.php and footer.php files.

Now the index.php file looks like this;

include('header.php');
Page contents HTML codes
include('footer.php');

This format resembled the complete index.php file at runtime.

Next we need to strip out all unwanted elements from dashboard and include only wanted elements or you can leave the dashboard as it is until finishing the whole app and develop the dashboard last.

IT Project for Students to Learn Coding


A basic IT Project using PHP and MySQL. This system is for a retail electronic store that sells products for its customers on installment payment schemes. I uploaded all development notes, source codes and the full project folder including MySQL database for IT students to learn coding using PHP.

You can read all about this project at https://phpfromexample.blogspot.com/ website.


PHP File Upload Script


Uploading a file using PHP to a web server is a basic function. But many students having difficulty in understanding this process. So, I created this simple script to explain you how to upload a file to web server using PHP and HTML Form.

First we need to create an HTML form with a special additional option in the form tag. When uploading a file we need to define the "enctype" stands for encode type. This tell the browser how to send data to the web server. We need to use "multipart/form-data" as the enctype when uploading files.




You need to include this form in an HTML file with proper headers and definitions. After selecting a file (in this case a photo) and when click on the submit button, web browser sends file data to the web server. Following PHP script validate and save file in the web server.


// ********************* global image upload script ***************************//
if($_FILES['photo']['name'] == '') { // if this is empty, no file is selected, show error message
$error = "Please select an image file to upload";
}else{
$attachment = strtolower($_FILES['photo']['name']); // convert file name to lower case
$attachment = str_replace(" ", "_", $attachment); // replace white spaces with underscore
        // photo should be either jpg or peng and less than 5MB
if ((
($_FILES['photo']['type'] == "image/png") || 
($_FILES['photo']['type'] == "image/jpeg") || 
($_FILES['photo']['type'] == "image/pjpeg")
) && ($_FILES['photo']['size'] < 5000000)) {
if ($_FILES['photo']['error'] > 0) { // if server error occurs
// There is an error in the uploaded file
$error = 'There was an error in the uploaded file. Please upload again!';
}else{
// No errors in the uploaded file, proceed to uploading the file
$attachment = rand(111,999)."_".$attachment; // create a random file name
$save_file = "files/".$attachment; // save file in "files" folder
move_uploaded_file($_FILES['photo']['tmp_name'], $save_file); // save file
}
}else{
$error = "Error during the file upload, please try again!";
}
}
// *********************** end of photo upload script ********************************//
?>

You can create a function  using this script and easily call the function when need to upload a file.

Creating a simple POS (Point of Sale) software

I created this project about seven years ago in 2011. Project was created using PHP. HTML, CSS, Javascrits, Ajax and Jquery also used. Some PHP functions may outdated now - such as mysql_connect, mysql_query, etc. For basic understanding this is good enough, but it is good to update obsolete codes when you practice coding.

What is a Point of Sale (POS) system?

Point of Sale, often called as POS is the main software system in a retail outlet. Consider a grocery, when you about to pay for your items, sales person in the counter will scan barcodes of products, enter how many quantity you purchase from each item, give you discounts, etc. The process at the sales counter and the software in the terminal computer is called Point of Sale. Because this is the point that sale is actually happen.

Main functions of this POS

This is a basic POS which includes only few functions;

  • Create /Edit and Delete products
  • Create a sales bill
  • View sales report
  • Accept sales returns
  • Login using username and password

Import data from Excel to CheqMate





This video shows how to import data from Excel to CheqMate software. Using this method you can import data from any other accounting software.



For more information and to purchase CheqMate software please visit http://cheqmatepro.com website.

CheqMate - How to write a new cheque?





This video shows how to write a new cheque using CheqMate Pro V5. For more information visit website http://cheqmatepro.com

CheqMate - චෙක් ලියන මෘදුකාංගය

The best cheque writing software in Sri Lanka. Your investment is only Rs.9,500/- for the lifetime. We give a CD to reinstall the softw...