Tuesday, December 9, 2014

Addition of Numbers in PHP Using OOP

As I try to improve my programming skills in PHP I modify my previous code and converted it into Object Oriented Programming approach. This program is very simple application that will ask the user to enter three numbers and find the total sum of the three numbers. I will give the user a chance to clear the text box using the clear button.

The things that you can learn in this sample program it will introduce you will the concept of object oriented programming by creating a class, creating an object and using the attributes like the variables we declare and the use of behavior or method to carry out the addition of the three numbers. I use Twitter Bootstrap CSS framework to improve the appearance of the web page. I make this program very simple to understand and use for beginners that are new in PHP programming and object oriented approach in PHP.

If you have some questions about my work feel free to send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com. I will be happy to read all your emails and suggestions how I can improve my works in programming.

People here in the Philippines who wish to contact me can reach me at my mobile numbers : 09173084360 and 09993969756.

Thank you very much and Happy Productive Programming.



Sample Output of Our Program

Program Listing

header.php

<head>
<title> Addition of Numbers in OOP </title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<style type="text/css">
#wrapper {
margin: 0 auto;
float: none;
width:70%;
}
.header {
padding:10px 0;
}
.title {
padding: 0 5px 0 0;
float:left;
margin:0;
}
.container form input {
height: 30px;
}
</style>
</head>
<body>
<div id="wrapper">
<div class="header">
<h3 class="title"> Addition of Numbers Using OOP</h3>
<br>
</div>

index.php

<html>
<body>
<?php include 'template-parts/header.php' ?><br>
<?php 
class find_sum {
    private $val1 , $val2, $val3;
    public function __construct($val_1, $val_2, $val_3){
        $this->val1 = $val_1;
        $this->val2 = $val_2;
$this->val3 = $val_3;
    }
    public function add(){
       return $this->val1 + $this->val2 + $this->val3;
    }
}
?>
<div class="container home">
<?php
    $value1 = $_POST['num1'];
    $value2 = $_POST['num2'];
$value3 = $_POST['num3'];
    if(isset($_POST['solve']))
    {
        $add_calc = new find_sum($value1,$value2,$value3);    
$result = "The total sum of $value1, $value2 
         and $value3 is ".$add_calc->add().".";
    }
if (isset($_POST['clear']))
{
$value1=""; $value2=""; $value3="";
$holder=""; $result="";
}
?>
<form action="index.php" method="post">
<font size="4">
<label> Enter First Number: </label>
<input type="text" placeholder="first number"  name="num1" value="<?php echo $value1; ?>" />
<br />
<label> Enter Second Number: </label>
<input type="text" placeholder="second number"  name="num2" value="<?php echo $value2; ?>"  />
<br />
<label> Enter Third Number: </label>
<input type="text" placeholder="third number"  name="num3" value="<?php echo $value3; ?>"  />
<br /> </font>
<input type="submit" name="solve" value="Compute"
 title="Click here to find the total sum." class="btn btn-info">
<input type="submit" name="clear" value="Clear"
 title="Click here to clear text box." class="btn btn-info">
</form>
<?php
echo "<br>";
echo "<font size='5'>";
echo $result;
echo "</font>";
?>
</div>
</body>
</html>

Monday, December 8, 2014

Users Address Book in PHP and MySQL Using OOP

Hi there In this article I would like to share with you an application that I wrote using PHP and MySQL using object oriented programming approach. Most of the database applications that I developed through the years in PHP and MySQL is written in structured or procedural format. One of the benefits of object oriented approach in programming particularly in PHP and MySQL is that our application is becomes more easier to maintain, update compared to structured approach. Object oriented programming is design for large scale software development that more developers or programmers involved.

 I called this program Users Address Book it allows the user to add, edit and update information of the person about this address,mobiles numbers and other important information related to the person. It introduces the beginners in object oriented approach on how to create and object and use it effectively in writing a database application in PHP and MySQL.

I hope you will find my work useful and beneficial in your quest to learn object oriented programming in PHP and MySQL. If you have some questions about my works feel free to send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.

People here in the Philippines who wish to contact me can reach me in my mobile numbers 09173084360 and 09993969756.

Thank you very much and Happy Programming.



Main Page of Our Program


Add of Record Page


After we save the record it will return to main page


Update of Record Page


Saturday, December 6, 2014

Point of Sale System in Visual Basic 6

In this article I would like to share with you an application that is written by a friend of mine named Mr. Dave R. Marcellana. This fellow is a close friend of mine he is also a programmer just like me I ask him if he can share some of his codes to us and he agree to share his Point of Sale System written entirely in Microsoft Visual Basic 6 and Microsoft Access.

This system is very useful in small and medium businesses just like a retail store or a small supermarket. It can track down daily sales, generate reports and perform of inventory of stocks that makes running a business is a breeze and efficient.

If you have some questions about this application your can send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.

Thank you very much and Happy Productive Programming.










Sample Output of Our Program


Odd and Even Number Using Function in C++

In this article I would like to share with you how to write a function that will check if the number being given by our user is odd or even number in C++. The code is very simple and very easy to follow. I hope you will find my useful in your quest in learning C++ as your primary programming language.

If you have some questions regarding about my work in C++ please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines can reach me through my mobile number 09173084360 and 09993969756.



Sample Output of Our Program

Program Listing

#include <iostream>

using namespace std;

int odd_even(int value);

int odd_even(int value)
{
    if (value %2 == 0 ) 
    {
        cout << "The number is " << value << " Even Number.";
     }
    else 
    {
        cout << "The number is " << value << " Odd Number.";
     }
    cout << "\n\n";
    system("pause");
  
}


main()
{
      int number=0;
      
      cout << "Enter a Number : ";
      cin >> number;
      odd_even(number);
}     
      

Set Precision in C++

In this article I would like to share with you a very short and simple program in C++ how to use set precision function in your C++ program. As a programmer using C++ there are some programming problems which deals with decimal values. One of the most interesting solution that I find is the use of C++ library file called iomanip or input / output manipulator. A standard library file in C++ that adds functionality in our program.

Our program will as the user to enter a number and then it will display the number with only two decimal places using the set precision function in C++. If you have some questions regarding about my work in C++ please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines can reach me through my mobile number 09173084360 and 09993969756.

Thank you very much and God Bless.



Sample Output of Our Program

Program Listing

#include <iostream>
#include <iomanip>

using namespace std;

main()
{
      float price=0.00;
      cout << setprecision(2) << fixed;
      
      cout << "Set Precision Demo ";
      cout << "\n\n";
      cout << setw(20) << "Enter price : ";
      cin >> price;
      cout << setw(10) <<  "The price is " << price;
      cout << "\n\n";
      system("pause");
}




Wednesday, December 3, 2014

Employee's Payroll System Using Javascript



This program will show you how to use Javascript in developing an employees payroll system what the program will do is to ask the user the number of hours the employee works and the rate per hour after that our program will compute and display the salary of the employee.

Our program will only stop processing the salary of the employee but give -1 to the number of hours work and rate per hour. What is good about this program it will sum all the salary of all employees being processed to get the final sum of the salary to be paid by the company. 

I hope you will find my code useful in learning programming using JavaScript.
 If you have some questions feel free to send me an email     at jakerpomperada@yahoo.com and jakerpomperada@gmail.com

My mobile numbers are 09173084360 and 09993969756

Thank you very much and Happy Programming.





Sample Output of Our Program


    




Saturday, November 29, 2014

Coin Head and Tail Checker

This program will check the occurrence of head and tail in a coin if it is being flip by the person. I wrote this program when I started programming in Visual Basic 6 as one of my programming assignments. I hope you will find this code useful.

I hope you can learn from this simple program that I wrote. If you find my work useful please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.

Thank you very much and Happy Programming.



Sample Output of Our Program



Monthly Sales Commission Solver in Visual Basic 6

This program that I wrote in Visual Basic 6 will compute the monthly sales commission of an employee per monthly for every product he or she sold to their customer. The code is very short and easy to understand by learners in Visual Basic 6 programming

I hope you can learn from this simple program that I wrote. If you find my work useful please send me an email at jakerpomperada@yahoo.com andjakerpomperada@gmail.com.

Thank you very much and Happy Programming.



Sample Output of Our Program






Fahrenheit To Celsius Converter in Visual Basic 6

This one of the earliest program that I wrote in Microsoft Visual Basic 6 to convert temperature in Fahrenheit to its Celsius equivalent. The code is very simple and easy to follow for beginners in Visual Basic 6 programming.

I hope you can learn from this simple program that I wrote. If you find my work useful please send me an email at jakerpomperada@yahoo.com andjakerpomperada@gmail.com.

Thank you very much and Happy Programming.


Sample Output of Our Program



Calculator in Visual Basic 6

This very simple program that I wrote in Visual Basic 6 a very long time ago when I started learning how to program in visual basic 6. This program is a calculator program that will ask the user to enter two values and then the user can select in four operations using command buttons such as add, subtract, divide and multiply.

I hope you can learn from this simple program that I wrote. If you find my work useful please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.

Thank you very much and Happy Programming.


Sample Output of Our Program



Friday, November 28, 2014

SMS Sender System in Visual Basic NET

  This simple program will allows you to send sms using your Visual Basic NET I wrote this application using Microsoft Visual Studio 2010. For my GSM Modem I'm using Sun BroadBand Internet with sim.  The code will also work in Globe Tattoo and Smart Bro Plugin.

The code is very simple and very easy to understand. I hope you will benefit from it. If you have some questions please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com

People here in the Philippines can reach me through my mobile numbers 09173084360 and 09993969756. Thank you very much and Happy Productive Programming.



Sample Output of Program




Tuesday, November 25, 2014

Sending SMS Using PHP Via GSM Modem


     After I was able to send sms text message in Visual Basic 6 my intention to improve my skills and knowledge in programming does not stop there. My next plan is to write an application to send sms using PHP as my programming language. PHP is one of my favorite language I earned from it and it is easy to learned for beginners. After some research over the Internet I find a class code in PHP that enables us to send sms using a gsm modem. 

I modify the code to suit to my needs and then test using my gsm modem provided by Sun Broadband Internet. In my computer at home it runs on Windows XP the gsm modem uses communication port 3 for sending information specially sms messages. After some trial and error and refinement of my code I was able to send text messages from PHP into my mobile phone. 

My code works using globe tattoo, sun broadband internet and smart bro plugin gsm modem here in the Philippines. If you are trying to use my code in your country please check your telecommunication company about it. I hope you find my work useful and beneficial in your programming assignments and projects which involves integrating SMS functionality in your application. 

Questions and comments your can send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com. People here in the Philippines who wish to contact me can reach me in my mobile number 09173084360 and my telephone number at home at (034) 4335675. Thank you very much and Happy Programming.





Sample Output of Our Program



Check your GSM Modem here device manager to determine the communication port before you run the program




Sunday, November 23, 2014

Sending SMS in Visual Basic 6


     About this code I wrote this program that enables the user to send text or short messaging system from Visual Basic 6 to a mobile phone using gsm modem. In this example my gsm modem that I used is Huawei and my provider is Globe Telecom here in the Philippines. The code can be used by other telecom gsm modem like sun broadband internet and smart bro plugin gsm modem. To determine what communication port your gsm modem resides select my computer in your windows desktop. Then right click your mouse and select properties select device manager and to directly to modem. Remember not all gsm modem has the same communication port number. Please check it properly before you run our program.



If you like my work please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com

You are reach me at my mobile numbers 09173084360 and 09993969756

Thank you very much and Happy Programming 


Sample Output of Our Program



Student Grading System with Form Validation in JavaScript

While learning Javascript I come up with the idea to write a program in Javascript that I will compute the student grade. This program that I wrote is very simple it teaches the user and learner how to use html forms and form validations using Javascript as our scripting language.

How this program works is very simple it will ask the user to enter the student name, student course, subject, midterm grade and endterm grade to be solve to get the final grade of the student in the particular subject. I also include checking for remarks if the grade of the student greater than 75 percent the student passed the subject. If the grade is less then 75 percent means the student was not able to pass the subject.

I'm hoping that your learn something in my program feel free to use my code in your school or programming projects in mind. If you have some questions please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.

People here in the Philippines who wish to contact me can reach me at my mobile number 09173084360.

Thank you very much and Happy Programming



Sample Output of Our Program

Program Listing

<!-- Student Grading System in Javascript -->
<!-- Written By: Mr. Jake R. Pomperada,MAED-IT -->
<!-- November 23, 2014 Sunday -->
<html>
<title> Student Grading System</title>
<style>
h3 {
     font-family: "arial";
     color: blue;
align:left;
}
table, td, th {
     font-family: "arial";
     color: blue;
}
div {
    font-family: "arial";
    font-size: 20px;
color: blue;
}
</style>
<script type="text/javascript">
function test()
{
   var _stud_name = document.grade.stud_name;
var _course = document.grade.course ;
var _subject = document.grade.subject;
var _midterm = document.grade.midterm;
var _endterm = document.grade.endterm;
if (_stud_name.value=="" || _stud_name.value==null){
_stud_name.focus();
alert("Student name field cannot be empty.");
return false;
    }
else if (_course.value=="" || _course.value==null){
_course.focus();
alert("Course field  cannot be empy.");
return false;
} else if (_subject.value=="" || _subject.value==null) {
_subject.focus();
alert("Subject field cannot be empty.");
return false;
} else if (_midterm.value=="" || _midterm.value==null) {
_midterm.focus();
alert("Midterm Grade cannot be empty.");
return false;
}
    else if (_endterm.value=="" || _endterm.value==null) {
_endterm.focus();
alert("Endterm Grade cannot be empty.");
return false;
midterm_grade=document.grade.midterm.value;
endterm_grade=document.grade.endterm.value;

var solve_midterm = parseInt(midterm_grade) * 0.5;
var solve_endterm = parseInt(endterm_grade) * 0.5;

final_grade = (solve_midterm + solve_endterm);
final_grade2 = final_grade.toFixed(2);

if  (final_grade2 >= 75)  {
    remarks = "Passed";
}
  else {
   remarks = "Failed";
}

report_title="Student Grade Report";
stud_name = document.grade.stud_name.value;
stud_course = document.grade.course.value;
stud_subject = document.grade.subject.value;

content ="Your Final Grade is  " + final_grade2 + "." 
document.getElementById('report_title').innerHTML = report_title;
document.getElementById('stud_name').innerHTML = "Name : " + stud_name;
document.getElementById('course').innerHTML = "Course : "  + stud_course;
document.getElementById('subject').innerHTML = "Subject : " + stud_subject;
document.getElementById('final_grade').innerHTML = content;
document.getElementById('remarks').innerHTML = "Grade Remarks : " + remarks;
}
</script>

<body bgcolor="yellow">
<br>
<font color="blue">
<h3> Student Grading System </h3>
</font>
 <form method="post" name="grade" >
  <table>
    <tr>
      <td align="right">Student Name :</td>
      <td align="left"><input type="text" name="stud_name" size="40" /></td>
    </tr>
    <tr>
      <td align="right">Course:</td>
      <td align="left"><input type="text" name="course" size="40" /></td>
    </tr>
    <tr>
      <td align="right">Subject:</td>
      <td align="left"><input type="text" name="subject" size="40" /></td>
    </tr><td> &nbsp; </td>
<tr>
      <td align="right">Midterm Grade:</td>
      <td align="left"><input type="text" name="midterm" size="2" /></td>
    </tr>
<tr>
      <td align="right">Endterm Grade:</td>
      <td align="left"><input type="text" name="endterm" size="2" /></td>
    </tr>
<td> &nbsp; </td>
<tr>
<td align="right"> 
<input type="button" value="Solve Grade" 
     title="Click here to compute the grade."
      onclick="test();">
</td>  
</tr>
  </table> 
</form>
    <br> 
<div id="report_title">  </div> 
<br>
<div id="stud_name">  </div> 
<div id="course">   </div> 
<div id="subject"> </div> 
    <div id="final_grade"> </div> 
    <div id="remarks">   </div>
</body>
</html>


Wednesday, November 19, 2014

Total Sum Results With Data Report in Visual Basic 6 and Microsoft Access



This is the second revision of my code on Total Sum Results by this time I included a print command button that enables the user to generate report based of the values that is being presented in the form. The code is very simple and can be used as starting point in developing business applications such as inventory system, accounting system, student enrollment system and among others. 

If you find my work useful please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.
 

People here in the Philippines who wish to contact me you can reach me at the following mobile numbers 09173084360 and 09993969756.

Thank you very much and Happy Programming. 





Sample Output of Our Program



DOWNLOAD SOURCE CODE HERE







Tuesday, November 18, 2014

Total Sum Results Using Visual Basic 6 and MS Access


 This code that I wrote using Visual Basic 6 and Microsoft Access will display a list of values in our sum field using data grid in Visual Basic 6. What the program will do is to sum up all the values and then display the results in our text box. This code is very useful in creating business applications using Visual Basic 6 as your programming language. 

If you find my work useful please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com. People here in the Philippines who wish to contact me can reach me at 09173084360 and 09993969756. Thank you very much and Happy Programming.


Sample Output of Our Program


Sunday, November 16, 2014

Users Database Using Client - Server in Visual Basic 6

As a programmer majority of my applications that I have written before in Microsoft Visual Basic 6 is more on single user or one computer alone. As time passes by business applications should be network in order for many users can use the application efficiently and they where able process as many data as they can. 

The first time I heard the term Client - Server Architecture that first thing that comes up with my mind is that it is very difficult to learn or even to achieve in writing a program that has client-server capabilities. I do some extensive research and study and I was able to find out developing a database applications in Visual Basic 6 and Microsoft Access for client-server deployment is not difficult but easy if you know how to plan and implement your system properly.

The fist thing that we must do is to create a folder in our computer in our windows operating system. In my case I named the folder vb afterwards I share the vb folder in my network so that it can be accessed by other computer in the network. In this article I added some screen shoots to give up some idea how to share and configure your client and server side of your Visual Basic application.

In my client side of the application in my module in Visual Basic 6 I declare the following code to access the ms access database in the server computer.

Public Sub con()
cn.Open "Provider=Microsoft.jet.OLEDB.4.0;Data Source=\\10.0.0.2\vb\server3\user1.mdb; Persist Security Info= false"
rs.CursorLocation = adUseClient
End Sub


I hope this article gives you an idea how to write and develop a database system in Microsoft Visual Basic 6 and Microsoft Access Client-Server Database Architecture. If you have some questions please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com.

You can text or call me here in the Philippines in the following mobile numbers 09173084360 and 09993969756.

Thank you very much and Happy Programming



Client Side Screen Shoot


Server Side Screen Shoot


Sharing of Folder in the Server Side I am using Windows XP for the Server






Wednesday, November 12, 2014

Today's Time Using JavaScript

In this article I would like to share with you a sample program that I wrote using JavaScript as my programming language. I called this program Today's Time what this program will do is to display the current time in your computer. For your information the date and time is being stored in our computer bios and powered by a battery called CR2032 3 volts.  

The code can be used to add functionality to your webpage by providing the visitor or user of your website to know what is the present time. If you have some questions please send me an email at jakerpomperada@yahoo.com and jakerpomperada@gmail.com

Thank you very much and Happy Programming.

Sample Output of Our Program

Program Listing

<html>
<script>
function clock(){
var time = new Date()
var hr = time.getHours()
var min = time.getMinutes()
var sec = time.getSeconds()
var ampm = " PM "
if (hr < 12){
ampm = " AM "
}
if (hr > 12){
hr -= 12
}
if (hr < 10){
hr = " " + hr
}
if (min < 10){
min = "0" + min
}
if (sec < 10){
sec = "0" + sec
}
text = hr + ":" + min + ":" + sec + ampm
document.getElementById("time").innerHTML ="The time is " + text;
setTimeout("clock()", 1000)
}
window.onload=clock;
</script>
<body onload="clock()"> 
<font face="arial" size=6" color="blue">
 <p id="time">  
</p> 
</font> 
</body>
</html>