Saturday, April 14, 2018

Total Salary Computation in JQuery

Here is a simple program that I wrote using JQuery to compute the total salary of the employee's in the company. The code is very easy to understand and use.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.




Sample Program Output


Program Listing

index.htm

<html>
<head>
<title>Total Salary Computation in JQuery</title>
</head>
<body>
 <style type="text/css">
 
  body {
  font-family: arial;
  size:15px;
  font-weight: bold;
  background-color: lightgreen;
  }
 </style>
 <br>
 <h2> Total Salary Computation in JQuery </h2>
<table cellpadding="5">
<tr>
<td><b>Employee Name</b></td> 
<td><b>Salary</b></td>
</tr>
<tr><td></td> </tr>
<tr>
<td>Allie Pomperada</td>
<td><input type='text' class='salary' /></td>
</tr>
<tr>
<td>Jake Pomperada</td>
<td><input type='text' class='salary' /></td>
</tr>
<tr>
<td>Jacob Samuel Pomperada</td>
<td><input type='text' class='salary' /></td>
</tr>
<tr>
<td>Julianna Rae Pomperada</td>
<td><input type='text' class='salary' /></td>
</tr>

<tr>
<td>Total Salary PHP</td>
<td><input type='text' id='totalSalary' disabled/></td>
</tr>
</table>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js "></script>

<script>
$('.salary').keyup(function () {
    var sum = 0;
    $('.salary').each(function() {
        sum += Number($(this).val());
    });
$('#totalSalary').val(sum.toFixed(2));
});
</script>

</body>
</html>





Friday, April 13, 2018

Sum and Project of Two Numbers Using JQuery

In this article I would like to share with you a sample program that will ask the user to give two numbers and then our program will automatically compute the sum and product of the two numbers using JQuery.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Sample Program Output




Program Listing

index.htm

<html>
<head>
<title>JQuery Sum & Product of Two Numbers</title>
</head>
<body>
<form name="form">
<table>
<tr>
<td>Number 1:</td>
<td><input type="text" name="num1" id="num1" /></td>
</tr>
<tr>
<td>Number 2:</td>
<td><input type="text" name="num2" id="num2" /></td>
</tr>
<tr>
<td>Sum:</td>
<td><input type="text" name="sum" id="sum" readonly /></td>
</tr>
<tr>
<td>Product:</td>
<td><input type="text" name="subt" id="subt" readonly /></td>
</tr>
</table>
</form>

<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
<script>
$(function() {
    $("#num1, #num2").on("keydown keyup", sum);
function sum() {
$("#sum").val(Number($("#num1").val()) + Number($("#num2").val()));
$("#subt").val(Number($("#num1").val()) * Number($("#num2").val()));
}
});
</script>
</body>
</html>

Display All Record in Java JDBC and MySQL

Here is a code that I wrote using Java and MySQL to display all the records from the database.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.


Program Listing

DisplayRecords.java

package jdbcdemo;

import java.sql.*;

/**
 * NetBeans IDE 8.2
 * @author Mr. Jake R. Pomperada
 * March 27, 2018  Tuesday
 * Bacolod City, Negros Occidental
 */

public class DisplayRecords {

    static Connection conn;

    static {
        try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            String url = "jdbc:mysql://localhost:3306/persons";
            conn = DriverManager.getConnection(url, "root", "");
        } catch (Exception e) {
            e.printStackTrace();;
        }
    }
    public static void main(String[] args)throws Exception  {
      
     
      try {

          // calling the method selectRecords() to display  
          // all the records from MySQL in our screen.
          selectRecords();           
        
           closeConnection();
        }  catch (SQLException ex) {
            ex.printStackTrace();
        }
     
   
    }
    
 static void closeConnection() {
        try {
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

  private static void selectRecords() 
          throws Exception {
       String selectrecordSQL = "SELECT * FROM users"; 
         
     PreparedStatement statement = conn.prepareStatement(selectrecordSQL);
     
     ResultSet result = statement.executeQuery(selectrecordSQL);
        
         if (result.next()) {
                ResultSetMetaData metaData = result.getMetaData();
                int numberOfColumns = metaData.getColumnCount();
                 System.out.println();
                 System.out.println("\t\t\t ===== LIST OF USER RECORDS =====");
                 System.out.println();
                 System.out.println("\t\t    Created By: Mr. Jake R. Pomperada, MAED-IT");
                 System.out.println();

                for (int i = 1; i <= numberOfColumns; i++) {
                    System.out.printf("%-15s", metaData.getColumnName(i));
                }
                System.out.println();

                do {
                    for (int i = 1; i <= numberOfColumns; i++) {
                        System.out.printf("%-15s", result.getObject(i));
                    }
                    System.out.println();
                } while (result.next());
                
                System.out.println();

            } else {
                System.out.println("No database records found.");
            }

         
    }

}

Check Email Format in JavaScript

Here is a simple script that I wrote using JavaScript to check if the given email format by our user is valid or not.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Program Listing

email.htm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Check Email Format</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
function checkemail( ){
if(document.myForm.email.value.length!=0){
if(document.myForm.email.value.charAt(0)=="."||
   document.myForm.email.value.charAt(0)=="@"||
   document.myForm.email.value.indexOf('@',0)==-1||
  document.myForm.email.value.indexOf('.',0)==-1||
          document.myForm.email.value.lastIndexOf('@')==document.myForm.email.value.length-1||
        document.myForm.email.value.lastIndexOf('.')==document.myForm.email.value.length-1 ) {
alert("E-mail format wrong!");
document.myForm.email.focus();
return false;
}
else {
alert("Email Format Correct!");}
}
else{
alert("Email cannot be empty!");
document.myForm.email.focus();
return false;
}
return false;
}
</script>
</head>
<body>
<center>
  <h2>Check E-mail Format </h2>
  <hr>
</center>
<form name="myForm" method="POST" action onSubmit="return checkemail()">
  <div align="center">E-mail: 
    <input type="text" name="email" id="email" size="20">
    &nbsp;
    <input type="submit" value="Submit" >
  </div>
</form>
</body>
</html>


Filter Bad Words in JavaScript

Here is a sample script to filter bad words from a sentence given by our user using JavaScript

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Program Listing

filter.htm

<html>
<head>
<title>Filter Bad Words in JavaScript</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="javascript">
message=prompt("Filter “fool, idiot, imbecile and moron” words. Please enter your message: ","");
subsitude = /fool|idiot|imbecile|moron|fuck/g;
if (message.match(subsitude)){
message=message.replace(subsitude,"master");
message=message.bold().fontcolor("#FF0000");
myText="Your message has a ungraceful word, which has been replaced by: " + message;
}
else{
message=message.bold().fontcolor("#0000FF");
myText="Yor message has no ungraceful word, you said:  " + message;
}
</script>
</head>
<body>
<script language="javascript">
document.write(myText)
</script>
<br>
</body>
</html>



Check for Digit Number in JavaScript

A very simple script that I wrote using JavaScript to check if the given value of the user is number or not.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.


Program Listing

num.htm

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Check for Digit Number in JavaScript</title>
<script language="JavaScript">
<script language="javascript">
function checkDigitals()
{
if(isNaN(myForm.num.value)){
  alert("Please enter a digital number!");
  myForm.num.focus();
  myForm.num.value=""
  return (false);
}
else
{
alert("Input correct!");
}
}
</script>
<body>
<br>
<h4> 
<div align="center">Check Digital Input
</div></h4>
<form name=myForm>
  <div align="center">
    <input type=text name=num size=25>
    <input type=button onClick="checkDigitals()" value= "Check Digitals">
  </div>
</form>
</body>
</html>


Check Input in JavaScript

Here is a sample script written in JavaScript to check if the form input is valid or not and not empty.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.


Program Listing

check.htm


<html> 
<head> 
<title>Check Empty Input</title> 
<script language="JavaScript"> 
function checkEmpty(myForm) 
if (myForm.phone.value == "")      
alert("Please enter phone number!");
myForm.email.focus();
return (false); 
if (myForm.email.value == "") 
alert("Please enter email address!"); 
myForm.message.focus(); 
return (false); 
if (myForm.message.value == "") 
alert("Please leave a message!"); 
myForm.phone.focus(); 
return (false); 
}
</script>
</head> 
<body> 
<br>
<center>
  <p><strong>Check Empty Input</strong></p>
  <br>
</center> 
<form name="myForm" method="post" onSubmit="javascript:return checkEmpty(this);"> 
<table width="36" border="0" cellspacing="1" cellpadding="1" align="center"> 
<tr> 
<td>Phone:
  <input type=text name=phone size=30> 
</td> 
</tr> 
<tr> 
<td>Email:
  <input type="text" name=email size="30"> 
</td> 
</tr> 
<tr> 
<td>Message:<br>
  <textarea name=message  cols=37 rows=6></textarea> 
</td> 
</tr> 
<tr> 
<td>
<div align="right">
  <input type="submit" name="pub" value="Check Empty">
</div>
</td> 
</tr> 
</table> 
</form> 
</body> 
</html>


Three Times Password in JavaScript

Here is a simple script to allow the user to give username and password at least three times. The code is very simple and easy to understand.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Program Listing

pass.htm

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Three Times Password in JavaScript</title>
<script language="JavaScript">
numberTimes=0
function checkpassword(){
if (numberTimes== 3){
alert("You have entered wrong password for three times, you must not use this system anymore!")
window.close();
}
else{
if((document.myForm.username.value == "123")&&(document.myForm.myPassword.value == "123"))
{
alert("Password Correct!")
window.location="http://www.jakerpomperada.blogspotcom";
            }
else{
numberTimes=numberTimes+1
alert("Wrong password, please try again!")
return false
}
}
}
</script>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<body>
<h2> Three Times Password in JavaScript </h2>
<br>
<form name="myForm" method="post">
  <div align="center"><p>&nbsp;</p><br>
Username:
<input name="username" type="text"><br>
Password:
<input name="myPassword" type="password"><br>
<input type="button" name="submit" value="Submit" onClick="checkpassword();">
  </p>
<br>
    <p>If you enter wrong password for three times, </p>
    <p>you will be not allowed to use this system anymore! </p>
  </div>
</form>
</body>

</html>

Disable Right-Click menu in JavaScript

Here is a simple script written in JavaScript that will disable right click to prevent user to view the code of your web page.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.




Sample Program Output


Program Listing

rightclick.htm

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Disable righ-click menu</title>
<script language="javascript">
 function click() 
 {
    if (event.button==2)     
    {
    alert('Stop using right-click menu!');
    }
 }
 document.onmousedown=click; 
</script>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<body oncontextmenu="return false;" >
<div>
  <div align="center">
    <p>&nbsp;</p>
    <p>Stop using right-click menu! </p>
 </div>
</div>
</body>
</html>





Print This Page in JavaScript

A very simple script which allows you to print the whole web page via a web browser using JavaScript as your programming language.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Program Listing

print.htm

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Print this page</title>
</head>
<body>
<form name="form1" method="post" action="">
  <div align="center">
    <input type="submit" name="Submit" value="Print This Page" onClick="javascript:window.print()">
    </div>
</form>
</body>
</html>




Password Protects Web Page in JavaScript

A simple password protect web page script in JavaScript that I would like to share with you guys.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Program Listing

password.htm

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Input Correct Password</title>
<style type="text/css">
.style1 {
font-size: 30px;
color: #FF00FF;
font-family: "Times New Roman", Times, serif;
font-weight: bold;
}
</style>
<script language="JavaScript">
var password="";
password=prompt('Please input a password, then you can visit our web page:');
if (password != '123admin')
{alert("Wrong password! You cannot visit our web page!");
window.close( );} 
</script>
</head>
<body>
<div align="center">
  <p>&nbsp;</p>
  <p class="style1">Password correct! </p>
  <p class="style1">Welcome to our website!!!</p>
</div>
</body>
</html>