Wednesday, April 22, 2020

Subject Grade Solver in PHP

I wrote this program to ask the teacher to give the prelim, midterm, and final grade of the student, and then the program will compute the average of the student and display the result. I am using PHP as my 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.unlimitedbooksph.com/

Program Listing

index.php

<!doctype html>
<html>
<head>
<title>Subject Grade Solver in PHP</title>
</head>
<body>
<form method="POST" action="">
<h2>PHP Example 3.4</h2>
<?php
$ave=0;
$remark=$pre=$mid=$end="";
if(isset($_POST['compute'])){
$pre=$_POST['prelim'];
$mid=$_POST['midterm'];
$end=$_POST['endterm'];

$ave=($pre+$mid+$end)/3;

if($ave < 75){
$remark="Failed";
}
else if($ave >= 75 and $ave <= 80){
$remark="Below Average";
}
else if($ave > 80 and $ave <= 85){
$remark="Average";
}
else if($ave > 85 and $ave <= 90){
$remark="Above Average";
}
else if($ave > 90){
$remark="Excellent";
}
}
?>
<p>Prelim Grade: <input type="text" name="prelim" value="<?=$pre;?>"></p>
<p>Midterm Grade: <input type="text" name="midterm" value="<?=$mid;?>"></p>
<p>Endterm Grade: <input type="text" name="endterm" value="<?=$end;?>"></p>
<p><input type="submit" name="compute" value="Compute"></p>
<p>
Average Grade: <?=number_format($ave, 2);?><br/>
Remark: <?=$remark;?><br/>
</p>
</form>
</body>

</html>

Grade Checker in PHP

A simple grade checker program that I wrote using PHP 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.unlimitedbooksph.com/

Program Listing

index.php

<!doctype html>
<html>
    <head>
        <title>Grade Checker in PHP</title>
    </head>
    <body>
        <form method="POST" action="">        
            <h2>Grade Checker in PHP</h2>
<?php
$grade="";
$remark="?";
if(isset($_POST['remark'])){
    $grade=$_POST['grade'];
    if($grade < 75){
        $remark="Failing Grade!";
    }
    else{
        $remark="Passing Grade!";
    }
}
?>
            <p>
                Final Grade: <input type="text" name="grade" size="8" value="<?=$grade;?>"/>
                <input type="submit" name="remark" value="Remark"/>
            </p>
             
            <p>Remark: <?=$remark;?></p>
        </form>
    </body>
</html>

PHP Concatenating Operator

Here is a simple code to demonstrate how to concatenate the two string in PHP.

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.unlimitedbooksph.com/

Program Listing

index.php

<?php
$firstname=”James”;
$lastname=”Reid”;
echo “My name is ” . $firstname . ” ” . $lastname; 

?>

Echo and Print Statements in PHP

A simple code snippet to show what is the echo and print statement in PHP programming language how to use it in you're program.

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.unlimitedbooksph.com/


Program Listing


index.php

<?php
echo “Hello, world<br/>”;
echo “This is PHP programming.<br/>”;
print “Hello, world<br/>”;
print “This is PHP programming.<br/>”;

?>

Basic Animation in JavaScript and CSS

This program shows how to write a program to perform basic computer animation using JavaScript 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.unlimitedbooksph.com/


Program Listing

index.html

<!DOCTYPE HTML>
<html>
<head>
<title>
Youtube
</title>
<style>
#container{
position: relative;
background-color: red;
border: 1px solid black;
height: 300px;
width: 300px;
}
#box{
position: absolute;
background-color: rgb(0,0,75);
border: 1px solid black;
height: 50px;
width: 50px;
margin: 2px;
}
</style>
</head>
<body>
<div id="container">
<div id="box">
This box Is move Down
</div>
</div>
<button onclick="down()">down</button>
<button id="butt" style="float: right">Stop</button>
<script>
function down()
{
var pos =0;
var box = document.getElementById("box");
var op = setInterval(boxes, 50);
function boxes(){
if(pos >= 240){
clearInterval(op);
var ii = document.createElement("h4");
var txt = document.createTextNode("now you know");
ii.appendChild(txt);
var con = document.getElementById("container");
con.appendChild(ii);
}
else{
pos+= 1;
box.style.top = pos+"px";
}
var oi = document.getElementById("butt").addEventListener("click", function(){
clearInterval(op);
});
}
}
</script>
</body>

</html>

Tuesday, April 21, 2020

LOGIN SYSTEM IN PERL AND MYSQL

I wrote this login system using Perl programming language and MySQL database I try to search this code over the Internet but unfortunately, I can't found any so I decided to write one. I hope this can help you learn database programming and security using Perl and MySQL.

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


Program Listing

login.pl

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


# Login System Using Perl and MySQL Database


use DBI;

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

sub get_pword {
    use Term::ReadKey;

    my ($prompt) = shift; 
    my $pword;
    my $key;
    local $| = 1;  
    print "$prompt: ";
    ReadMode 4;   
    while( 1 ) {
        while (not defined ($key = ReadKey(-1))) { }
        if(ord($key) == 13) {
            print "\n";       
            last;            
        }
        print '*';
        $pword .= $key;
    }
    ReadMode 0; 
    return $pword; 
}


back:
printf("\n\n");
printf("\t\t===== LOGIN SYSTEM IN PERL AND MYSQL =====");
printf("\n\n");
printf("\t\tCreated By: Mr. Jake R. Pomperada,MAED-IT,MIT");
printf("\n\n");
print "\tEnter Username   : ";
chomp($name =<>);

printf("\n");
my $pass = get_pword("\tEnter Password   " );

$username= lc $name;
$password = uc $pass;


my $sql = q{
   SELECT COUNT(*) 
   FROM users 
   WHERE username = ? and 
         password = ?
};

if (($myConnection->selectcol_arrayref($sql, undef, $username, $password)->[0] == 1)) {
printf("\n\n");
     printf("\tUsername and Password Accepted. Welcome to the System.");
} else {
     printf("\n\n");
     printf("\tUsername and Password is Not Correct. Please Try Again.");
     goto back;
}
printf("\n\n");
# End of Code 


logil.sql

-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 21, 2020 at 11:57 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: `login`
--
CREATE DATABASE IF NOT EXISTS `login` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `login`;

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

--
-- Table structure for table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(15) NOT NULL AUTO_INCREMENT,
  `username` varchar(100) NOT NULL,
  `password` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`) VALUES
(1, '123', '123'),
(2, 'admin', 'admin');

/*!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 */;





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!!