Tuesday, April 21, 2020

Personnel Information System in Perl and MySQL

I wrote these simple crud applications that I called Personnel Information System in Perl and MySQL that can add, edit, update, view and delete records of personnel. It is a menu-driven program that is written in console-based in Perl and the backend in MySQL database I hope you will find my work useful.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/







Sample Program Output


menu.pl

# menu.pl
# Author   : Jake R. Pomperada,MAED-IT,MIT
# Date     : April 32, 2020   Tuesday   1:03 PM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Websites : http://www.jakerpomperada.com
#            http://www.jakerpomperada.blogspot.com


use DBI;

$myConnection = DBI->connect('DBI:mysql:records:localhost','root','');


# infinite loop for menu
while ( 1 )
{
printf("\n\n");
printf("\t\t===== MAIN MENU ======\n\n");
printf"\tPersonnel Information System in Perl and MySQL\n\n";
printf("\tCreated By Mr. Jake R. Pomperada,MAED-IT,MIT\n");
printf("\n");
print "\t[1] Add Personnel Record\n";
print "\t[2] Update Personnel Record\n";
print "\t[3] Delete Personnel Record\n";
print "\t[4] View Personnel Record\n";
print "\t[5] Quit Program\n\n";
printf("\tSelect the number in the menu : ");
my $option=<STDIN>;# get input
chomp($option);# remove "enter key"

# redirect options
if ( $option == 1 )
{
# set the value of your SQL query
$query1 = "INSERT INTO persons (name,age,address) 
values (?, ?, ?) ";

# prepare your statement for connecting to the database
$statement1 = $myConnection->prepare($query1);

printf("\n");
printf("\t\t===== ADD RECORD =====");
printf("\n\n");
print "\tEnter Persons Name    : ";
chomp($name =<>);
printf("\n");
print "\tEnter Persons Age      : ";
chomp($age =<>);
printf("\n");
print "\tEnter Persons Address  : ";
chomp($address =<>);

$name_saved = uc $name;
$address_saved = uc $address;

# execute your SQL statement
$statement1->execute($name_saved,$age,$address_saved);
printf("\n\n");
printf("\tRecord has been saved.");
printf("\n\n");
$statement1->finish();
}
elsif ( $option == 2 )
{
# update statement
$query2 = "UPDATE persons SET 
                 name =?,
                 age =? ,
                 address=?  
                 WHERE id = ?";

# prepare your statement for connecting to the database
$statement2 = $myConnection->prepare($query2);

printf("\n");
printf("\t\t===== UPDATE RECORD =====");
printf("\n\n");
print "\tEnter Persons ID    : ";
chomp($id =<>);
printf("\n");
print "\tEnter Persons Name    : ";
chomp($name =<>);
printf("\n");
print "\tEnter Persons Age      : ";
chomp($age =<>);
printf("\n");
print "\tEnter Persons Address  : ";
chomp($address =<>);

$name_saved = uc $name;
$address_saved = uc $address;

# execute your SQL statement
$statement2->execute($name_saved,$age,$address_saved,$id);
printf("\n\n");
printf("\tRecords has been updated successfully.");
printf("\n\n");

}
elsif ( $option == 3 )
{
# set the value of your SQL query
$query3 = "DELETE FROM persons WHERE id = ? ";

# prepare your statement for connecting to the database
$statement3 = $myConnection->prepare($query3);

printf("\n");
printf("\t\t===== DELETE RECORD =====");
printf("\n\n");
print "\tEnter Persons ID    : ";
chomp($id =<>);
printf("\n\n");
$statement3->execute($id);
printf("\tRecord deleted successfully");

}
elsif ( $option == 4 )
{
$query4 = $myConnection->prepare('SELECT * FROM persons');
$result4 = $query4->execute();

printf("\n");
printf("\t\t===== VIEW ALL RECORD =====");
# retrieve the records from the table Persons
printf("\n\n");
while(  my $ref = $query4->fetchrow_hashref() ) {
printf("\tID       :  $ref->{'id'} \n");
        printf("\tNAME     :  $ref->{'name'} \n");
        printf("\tAGE      :  $ref->{'age'} \n");
printf("\tADDRESS  :  $ref->{'address'} \n\n");

    }
  }  
elsif ( $option == 5 )
{
printf("\n\n");
printf("\tExiting the program. Thank you for using this Program.\n");
last;
}
else
{
print "Invalid Option\n. Try Again Please.";
}
}


persons.sql


-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 21, 2020 at 07:05 AM
-- Server version: 5.6.11
-- PHP Version: 5.5.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `records`
--

-- --------------------------------------------------------

--
-- Table structure for table `persons`
--

CREATE TABLE IF NOT EXISTS `persons` (
  `id` int(15) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `age` int(3) NOT NULL,
  `address` varchar(200) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `persons`
--

INSERT INTO `persons` (`id`, `name`, `age`, `address`) VALUES
(2, 'Julianna Rae Pomperada', 6, 'Eroreco, Bacolod City'),
(3, 'Jacob Samuel Pomperada', 7, 'Eroreco Subd.,Bacolod City'),
(7, 'BILL GATES', 65, 'ONE MICROSOFT WAY, WASHINGTON USA'),
(8, 'JAKE POMPERADA', 41, 'PUROK PAG-ASA,BARANGAY ALIJIS 6100 BACOLOD CITY, NEGROS OCCIDENTAL'),
(9, 'MA. JUNALLIE POMPERADA', 48, '#25-31 VICTORIA MALAGA STREET, ERORECO SUBD. BRGY. MANDALAGAN BACOLOD CITY,NEGROS OCCIDENTAL');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;



How I Train For Food Challenges After a Long Weight Loss Break!!

Sunday, April 19, 2020

Until Loop Example No. 1 in Perl

Another example of how to declare and use until loop statement in Perl programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Program Listing

# until_example_one.pl
# It will display a series of numbers from 1 to 10
# using until loop statement.
# Author   : Jake R. Pomperada,MAED-IT,MIT
# Date     : April 5, 2020   Sunday  9:29 PM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Website  : http://www.jakerpomperada.com
print("\n");
print("\tUntil Loop Example No. 1 in Perl");
print("\n\n");
$num_val = 1;
printf("\t");
until ($num_val == 11) {
    print("$num_val ");
    $num_val++;
}
print("\n\n");
print("\t\tEnd of Program");

print("\n\n");

Modal in HTML and CSS

This program is being written by my good friend and fellow software engineer Sir Ernel G. Fadriquilan thank you very much, Sir, for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Program Listing

<!DOCTYPE html> 
<html> 
<head> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<style> 
@-webkit-keyframes example { 
from { 
top: -100px; 
opacity: 0; 

to { 
top: 0px; 
opacity: 1; 


/* Add animation (Standard syntax) */ 
@keyframes example { 
from { 
top: -100px; 
opacity: 0; 

to { 
top: 0px; 
opacity: 1; 


/* The modal's background */ 
.modal { 
display: none; 
position: fixed; 
left: 0; 
top: 0; 
width: 100%; 
height: 100%; 
overflow: auto; 
background-color: rgb(0, 0, 0); 
background-color: rgba(0, 0, 0, 0.4); 

/* Display the modal when targeted */ 
.modal:target { 
display: table; 
position: absolute; 

/* The modal box */ 
.modal-dialog { 
display: table-cell; 
vertical-align: middle; 

/* The modal's content */ 
.modal-dialog .modal-content { 
margin: auto; 
background-color: #f3f3f3; 
position: relative; 
padding: 0; 
outline: 0; 
border: 1px #777 solid; 
text-align: justify; 
width: 80%; 
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 
/* Add animation */ 
-webkit-animation-name: example; 
/* Chrome, Safari, Opera */ 
-webkit-animation-duration: 0.5s; 
/* Chrome, Safari, Opera */ 
animation-name: example; 
animation-duration: 0.5s; 

/* The button used to close the modal */ 
.closebtn { 
text-decoration: none; 
float: right; 
font-size: 50px; 
font-weight: bold; 
color: #fff; 

.closebtn:hover, 
.closebtn:focus { 
color: #000; 
text-decoration: none; 
cursor: pointer; 

.container { 
padding: 2px 16px; 

header { 
background-color: #5cb85c; 
font-size: 25px; 
color: white; 

footer { 
background-color: #5cb85c; 
font-size: 20px; 
color: white; 

</style> 
</head> 
<body contenteditable="false"> 
<a href="#id01">Open Modal</a> 
<div id="id01" class="modal"> 
<div class="modal-dialog"> 
<div class="modal-content"> 
<header class="container"> 
<a href="#" class="closebtn">x</a> 
<h2>Modal Header</h2> 
</header> 
<div class="container"> 
<p>Some text in the modal.</p> 
<p>Some text in the modal.</p> 
</div> 
<footer class="container"> 
<p>Modal footer</p> 
</footer> 
</div> 
</div> 
</div> 
</body> 

</html>

Tables in HTML

This program is being written by my good friend and fellow software engineer Sir Ernel G. Fadriquilan thank you very much, Sir, for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Program Listing

<html>
<body>
<h4>Cell that spans two columns:</h4>
<table border="1">
<tr>
  <th>Name</th>
  <th colspan="2">Telephone</th>
</tr>
<tr>
  <td>Ernel G. Fadriquilan</td>
  <td>09355835409</td>
  <td>09355835409</td>
</tr>
</table>
<h4>Cell that spans two rows:</h4>
<table border="1">
<tr>
  <th>First Name:</th>
  <td>Ernel G. Fadriquilan</td>
</tr>
<tr>
  <th rowspan="2">Telephone:</th>
  <td>09355835409</td>
</tr>
<tr>
  <td>09355835409</td>
</tr>
</table>
</body>

</html>

Until Loop Example No. 2 in Perl

A simple program that I wrote using Until Loop Example No. 2 in Perl using the Perl programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Program Listing

# until_example_two.pl
# It will display a series of numbers in descending order from 10 to 1
# using until loop statement.
# Author   : Jake R. Pomperada,MAED-IT,MIT
# Date     : April 5, 2020   Sunday  9:29 PM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Website  : http://www.jakerpomperada.com
print("\n");
print("\tUntil Loop Example No. 2 in Perl");
print("\n\n");
$num_val = 10;
printf("\t");
until ($num_val < 1) {
    print("$num_val ");
    $num_val--;
}
print("\n\n");
print("\t\tEnd of Program");

print("\n\n");

While Loop Example No. 1 in Perl

A simple program that I wrote using while loop statement example number one using the Perl programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Program Listing

# While Loop Example No. 1 Perl
# Author   : Jake R. Pomperada,MAED-IT,MAIT
# Date     : April 4, 2020   Saturday  7:34 PM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Website  : http://www.jakerpomperada.com

$test = 1;

print("\n");
print("\tWhile Loop Example No. 1 in Perl");
print("\n\n");
while ($test <= 5)
{
 print "\tStill Counting at $test. \n";
 $test++;
}
print("\n");
print("\tEnd of Program");

print("\n\n");

While Loop Example No. 2 in Perl

A simple program that I wrote using while loop statement using the Perl programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Program Listing

# While Loop Example No. 2 Perl
# Author   : Jake R. Pomperada,MAED-IT,MAIT
# Date     : April 4, 2020   Saturday  8:09 PM
# Location : Bacolod City, Negros Occidental
# Email    : jakerpomperada@gmail.com
# Website  : http://www.jakerpomperada.com

$a = 10;

print("\n");
print("\tWhile Loop Example No. 2 in Perl");
print("\n\n");
while ($a >= 1)
{
 print "\tCounting at $a. \n";
 $a = $a - 1;
}
print("\n");
print("\tEnd of Program");

print("\n\n");

Responsive Form Using HTML and CSS

This program is being written by my good friend and fellow software engineer Sir Ernel G. Fadriquilan thank you very much, Sir, for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.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.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/

Program Listing


<!DOCTYPE html>
<html>
<head>
<style>
* {
    box-sizing: border-box;
}
input[type=text], select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}
label {
    padding: 12px 12px 12px 0;
    display: inline-block;
}
input[type=submit] {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}
input[type=submit]:hover {
    background-color: #45a049;
}
.container {
    border-radius: 5px;
    background-color: #f2f2f2;
    padding: 20px;
}
.col-25 {
    float: left;
    width: 25%;
    margin-top: 6px;
}
.col-75 {
    float: left;
    width: 75%;
    margin-top: 6px;
}
/* Clear floats after the columns */
.row:after {
    content: "";
    display: table;
    clear: both;
}
/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
    .col-25, .col-75, input[type=submit] {
        width: 100%;
        margin-top: 0;
    }
}
</style>
</head>
<body>
<h2>Responsive Form</h2>
<p>Resize the browser window to see the effect. When the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other.</p>
<div class="container">
  <form action="/action_page.php">
    <div class="row">
      <div class="col-25">
        <label for="fname">First Name</label>
      </div>
      <div class="col-75">
        <input type="text" id="fname" name="firstname" placeholder="Your name..">
      </div>
    </div>
    <div class="row">
      <div class="col-25">
        <label for="lname">Last Name</label>
      </div>
      <div class="col-75">
        <input type="text" id="lname" name="lastname" placeholder="Your last name..">
      </div>
    </div>
    <div class="row">
      <div class="col-25">
        <label for="country">Country</label>
      </div>
      <div class="col-75">
        <select id="country" name="country">
          <option value="australia">Australia</option>
          <option value="canada">Canada</option>
          <option value="usa">USA</option>
        </select>
      </div>
    </div>
    <div class="row">
      <div class="col-25">
        <label for="subject">Subject</label>
      </div>
      <div class="col-75">
        <textarea id="subject" name="subject" placeholder="Write something.." style="height:200px"></textarea>
      </div>
    </div>
    <div class="row">
      <input type="submit" value="Submit">
    </div>
  </form>
</div>
</body>

</html>