Monday, November 15, 2021

Human Resource Information System in C++

 A simple Human Resource Information System in C++ that I wrote a long time ago I hope you will find my work useful.

 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at 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.





Program Listing

#include <iostream>

#include <iomanip>

#include <cmath>

#include <stdlib.h>

#include <string.h>

#include <conio.h>

#include <ctype.h>


using namespace std;


const int PASSLEN = 5;

 

void menu()

{

FILE *fp, *ft ;

char another, choice ;

struct employee

{

char emp_id_no[300];

char name[300];

char address[300];

char position[300];

    float salary;

    char email[300];

    long int mobile;

    long int sss,tin,pag_ibig,philhealth;

} ;

struct employee emp;

char employee_id[300];

long int recsize;

    int flag=0;

fp = fopen ("EMPLOYEE.TXT", "rb+" ) ;

if ( fp == NULL )

{

fp = fopen ( "EMPLOYEE.TXT", "wb+" ) ;

if ( fp == NULL )

{

puts ( "Cannot open file" ) ;

exit(0) ;

}

}

recsize = sizeof ( employee ) ;

while ( 1 )

{

        system("CLS");

        system("COLOR F0"); 

        

cout << fixed <<setprecision(2);

        cout <<"\n";

cout << "\n\t==========================================";

cout <<"\n";

cout <<"\n\t HUMAN RESOURCE INFORMATION SYSTEM IN C++";

cout <<"\n\n";

cout << "\tCreated By Jake R. Pomperada,MAED-IT,MIT   ";

cout <<"\n\t==========================================";

cout <<"\n\n";

cout << "\t[1] INSERT EMPLOYEE RECORD";

cout <<"\n";

cout << "\t[2] BROWSE EMPLOYEE RECORD";

cout <<"\n";

cout << "\t[3] EDIT EMPLOYEE RECORDS" ;

cout <<"\n";

cout  <<"\t[4] FIND EMPLOYEE RECORDS";

cout <<"\n";

cout << "\t[5] REMOVE EMPLOYEE RECORDS";

cout <<"\n";

cout  << "\t[6] QUIT PROGRAM" ;

cout <<"\n\n";

cout  <<"\tSELECT YOUR OPTION :=> ";

fflush (stdin) ;

choice = getche() ;

switch ( choice )

{

case '1' :

fseek ( fp, 0 , SEEK_END ) ;

another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

cout <<"\n";

cout << "\t=== INSERT NEW EMPLOYEE RECORD ===";

cout <<"\n\n";

cout <<"\tEmployee ID Number           : ";

                    fflush (stdin) ;

gets(emp.emp_id_no);;

cout << "\tEmployee Name               : ";

fflush (stdin) ;

gets(emp.name);

cout <<"\tEmployee Home Address        : ";

fflush (stdin) ;

gets(emp.address);

                    cout <<"\tEmployee Position            : ";

fflush (stdin) ;

gets(emp.position);

cout << fixed <<setprecision(2);

    cout <<"\tEmployee Salary              : ";

cin >> emp.salary;

cout <<"\tEmployee Email Address       : ";

fflush (stdin) ;

gets(emp.email);

cout <<"\tEmployee Mobile Number       : ";

    scanf("%ld",&emp.mobile);

cout <<"\tEmployee SSS Number          : ";

    scanf("%ld",&emp.sss);

cout << "\tEmployee TIN Number         : ";

scanf("%ld",&emp.tin);

cout << "\tEmployee PAG-IBIG Number    : ";

scanf("%ld",&emp.pag_ibig);

cout << "\tEmployee PHILHEALTH Number  : ";

scanf("%ld",&emp.philhealth);

cout << "\n";

                    fwrite (&emp,recsize, 1,fp) ;

cout << "\n\n";

cout  << "\n\tAdd New Employee Record (Y/N) : " ;

fflush (stdin) ;

another = toupper(getche()) ;

}

break ;

case '2' :

        system("cls");

rewind ( fp );

cout << "\n\n";

                cout <<"\t=== VIEW EMPLOYEE RECORD ===";

                cout <<"\n\n";

while (fread( &emp, recsize, 1, fp ) == 1 )

        {

       cout <<"\n\tEmployee ID No              : " <<emp.emp_id_no;

       cout <<"\n\tEmployee Name               : " <<emp.name;

       cout <<"\n\tEmployee Home Address       : " <<emp.address;

       cout <<"\n\tEmployee Position           : " <<emp.position;

       cout <<"\n\tEmployee Salary             : PHP " <<emp.salary;

       cout <<"\n\tEmployee Email Address      : " <<emp.email;

       cout <<"\n\tEmployee Mobile Number      : " <<emp.mobile;

       cout <<"\n\tEmployee SSS Number         : " <<emp.sss;

       cout <<"\n\tEmployee TIN Number         : " <<emp.tin;

       cout <<"\n\tEmployee PAG-IBIG Number    : " <<emp.sss;

       cout <<"\n\tEmployee PHILHEALTH Number  : " <<emp.philhealth;

       cout <<"\n";

       }

          cout <<"\n\n";

         system("pause");

break ;

case '3' :

another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

          cout <<"\t=== EDIT STUDENT GRADE RECORD ===";

        cout <<"\n\n";

          cout <<"\tEnter Employee ID Number : ";

                cin >> employee_id;

    rewind ( fp ) ;

cout <<"\n";

while ( fread ( &emp, recsize, 1, fp ) == 1 )

{

if ( strcmp ( emp.emp_id_no,employee_id) == 0 )

{

cout <<"\tEnter Employee ID Number  : ";

                    fflush (stdin) ;

                    gets(emp.emp_id_no);

cout << "\tEmployee Name            : ";

fflush (stdin) ;

gets(emp.name);

cout <<"\tEmployee Home Address     : ";

fflush (stdin) ;

gets(emp.address);

                    cout <<"\tEmployee Position         : ";

fflush (stdin) ;

gets(emp.position);

cout << fixed <<setprecision(2);

cout <<"\tEmployee Salary             : ";

cin >> emp.salary;

cout<<"\tEmployee Email Address       : ";

fflush (stdin) ;

gets(emp.email);

cout <<"\tEmployee Mobile Number      : ";

    scanf("%ld",&emp.mobile);

cout <<"\tEmployee SSS Number         : ";

    scanf("%ld",&emp.sss);

cout << "\tEmployee TIN Number        : ";

scanf("%ld",&emp.tin);

cout << "\tEmployee PAG-IBIG Number   : ";

scanf("%ld",&emp.pag_ibig);

cout << "\tEmployee PHILHEALTH Number : ";

scanf("%ld",&emp.philhealth);

cout << "\n";

fseek ( fp, - recsize, SEEK_CUR ) ;

fwrite ( &emp, recsize, 1, fp ) ;

break ;

}

}

if (strcmp(emp.emp_id_no,employee_id) != 0 )

                 {  

                   cout <<"\n\n";

                   cout <<"\tNo Employee Record in the Database.";

                   cout <<"\n";

                   system("pause");

                   break;

                   }

                 cout <<"\n\n";

     cout  <<"\n\tEdit Another Employee Record (Y/N) : ";

fflush ( stdin ) ;

another = toupper(getche());

}

break ;

      case '4' :

   rewind ( fp ) ;

   another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

        cout <<"\t=== Find Employee Records ===";

        cout <<"\n\n";

     cout <<"\tEnter Student ID Number : ";

                 fflush (stdin) ;

gets(employee_id);

cout <<"\n";

rewind ( fp ) ;

while ( fread ( &emp, recsize, 1, fp ) == 1 )

{

if ( strcmp (emp.emp_id_no,employee_id) == 0 )

{

        cout <<"\n";

        cout <<"\n\tEmployee ID No              : " <<emp.emp_id_no;

      cout <<"\n\tEmployee Name               : " <<emp.name;

      cout <<"\n\tEmployee Home Address       : " <<emp.address;

        cout <<"\n\tEmployee Position           : " <<emp.position;

        cout <<"\n\tEmployee Salary             : PHP " <<emp.salary;

          cout <<"\n\tEmployee Email Address      : " <<emp.email;

      cout <<"\n\tEmployee Mobile Number      : " <<emp.mobile;

        cout <<"\n\tEmployee SSS Number         : " <<emp.sss;

        cout <<"\n\tEmployee TIN Number         : " <<emp.tin;

        cout <<"\n\tEmployee PAG-IBIG Number    : " <<emp.sss;

        cout <<"\n\tEmployee PHILHEALTH Number  : " <<emp.philhealth; 

                    cout <<"\n\n";

        system("pause");

         break;

}

}

      if (strcmp(emp.emp_id_no,employee_id) != 0 )

          {

            cout <<"\n\n";

            cout <<"\tNo Employee Record Found in the Database.";

            cout <<"\n";

            system("pause");

            break;

           }

                    cout  <<"\n\n";

cout  <<"\n\tFind Another Student Record (Y/N) : " ;

fflush ( stdin ) ;

another = toupper(getche());

}

break ;

case '5' :

another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

                    cout <<"\t=== REMOVE EMPLOYEE GRADE RECORD ===";

                    cout <<"\n\n";

cout <<"\tEnter Employee ID Number : ";

                    fflush (stdin) ;

gets(employee_id);

cout <<"\n";

ft = fopen ("TEMP.DAT", "wb" ) ;

rewind (fp) ;

while ( fread (&emp, recsize, 1, fp ) == 1 )

{

if ( strcmp (emp.emp_id_no,employee_id) != 0 )

fwrite ( &emp, recsize, 1, ft ) ;

                 else

                flag=1;

                  }

fclose ( fp ) ;

fclose ( ft ) ;

remove ( "EMPLOYEE.TXT" ) ;

rename ( "TEMP.DAT", "EMPLOYEE.TXT" ) ;

    fp = fopen ( "EMPLOYEE.TXT", "rb+" ) ;

       if(flag==1) {

         cout <<"\n\n";

         cout <<"\tRecord Successfully Deleted From the Database.";

         cout <<"\n";

         system("pause");

         }

else {

             cout <<"\n\n";

             cout <<"\tRecord Not Found in the Database.";

             cout <<"\n";

            system("pause");

             }

                    cout <<"\n";

cout << "\tRemove Another Employee Record (Y/N) : " ;

fflush (stdin) ;

another = toupper(getche());

}

break ;

case '6' :

fclose ( fp ) ;

cout <<"\n\n";

cout <<"\tEND OF PROGRAM";

cout <<"\n\n";

cout << "\tThank You Very Much For Using This Software.";

cout <<"\n\n";

system("PAUSE");

exit(0);

}

}

} // End of Code


string passget()

{

char password[PASSLEN], letter;

int loop;

int len;

string password2;

//Get Password and replace letters with *--------------

loop = 0;

while(loop != PASSLEN)

{

password[loop] = '\0';

loop++;

}

loop = 0;

len = 0;

letter = '\0';

while( letter != '\r' )

{

letter = getch();

if( letter == '\b' && password[0] == '\0')

{

loop = 0;

len = 0;

}

else

{

if( letter == '\b' && password[0] != '\0')

{

cout << "\b";

cout << " ";

cout << "\b";

loop--;

password[loop] = '\0';

len--;

}

else

{

if( isprint( letter ) != 0 && loop < PASSLEN)

{

password[loop] = tolower(letter);

cout << "*" ;

}

loop++;

if (loop <= PASSLEN)

len++;

}

}

}

//Convert Password from character array to string

loop = 0;

len = len;

password2 = "";

while (loop != len)

{

password2 = password2+password[loop];

loop++;

}

return password2;

 } // End of Function Password


void start()

{

string password;

system("COLOR F0"); 

cout << "\n\n";

cout << "\tPASSWORD SECURITY VERSION 1.0";

cout << "\n\n";

cout << "\tEnter Your Password: ";

password = passget();

if (password == "admin") {

menu();

}

else {

cout << "\n\n";

cout << "\tPassword Denied Try Again !!!";

start();

}

} // End of Start Function


int main()

 {

  start();

 }

 



Sunday, November 14, 2021

CRUD Using AngularJS, PHP, and MySQL

CRUD USING ANGULARJS, PHP AND MYSQL

 A simple CRUD application using AngularJS, PHP and MySQL it has a search function to search a record.

 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at 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.


DOWNLOAD THE COMPLETE SOURCE CODE HERE


Saturday, November 13, 2021

Age Checker in C++

Age Checker in C++

 Machine Problem

Make a program that will input age, Check… age<=20 Display "Young" Age>=21 Display "Adult"

Your program will be terminated if you input zero in age.

 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at 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.





Program Listing


/*


Author : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT

www.jakerpomperada.blogspot.com and www.jakerpomperada.com

jakerpomperada@gmail.com

Bacolod City, Negros Occidental Philippines.


Machine Problem in C++


Make a program that will input age,

Check… age<=20 Display "Young"

Age>=21 Display "Adult"

Your program will be terminated if you input zero in age.


*/


#include <iostream>



int main()

{

   int age=0;    

do {


std::cout << "\n\n";

std::cout << "\tAge Checker in C++";

std::cout <<"\n\n";

std::cout <<"\tEnter Your Age : ";

std:: cin >>age;

     if (age==0) {

break; 

}

if (age <= 20) {

std::cout <<"\n";

std::cout <<"\tYoung";

} else if  (age>= 21) {

std::cout <<"\n";

std::cout <<"\tAdult";

} while (age!=0);

  std::cout << "\n\n";

std::cout << "\tEnd of Program";

std::cout <<"\n";

}


Friday, November 12, 2021

Capitalize Vowels in PHP

Capitalize Vowels in PHP

 A simple program to ask the user to give a string or sentence and then the program will convert the vowel characters in a given string or sentence by the user using PHP programming language.

 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at 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.






Program Listing

index.php

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Capitalize Vowels in PHP</title>

    <style>

        *,html {

            box-sizing: border-box;

            padding: 0;

            margin: 0;

        }


        body {

            display: flex;

            justify-content: center;

            align-items: center;

            min-height: 100vh;

            background: #fefefe;

            font-family: sans-serif;

            background-color: #19BC9D;

        }


        .container {

            background: #fff;

            border: none;

            text-align: center;

            min-width: 300px;

            color: #fff;

        }


        .title {

            background-color: #14A083;

            padding: 20px;

            border: none;

        }


        .output_wrapper {

            padding: 20px;

            font-size: 20px;

            background-color: #fff;

            margin: 10px 0;

            border: none;

            color: #14A083;

        }


        h1 {

            margin: 0 0 5px;

            line-height: 1;

        }


        p {

            margin: 15px 0 0;

        }

        

        input {

            display: block;

            width: 100%;

            margin-bottom: 20px;

            padding: 10px;

            font-size: 15px;

            text-align: center;

        }


        .output {

            margin: 10px 0;

        }


        button,

        .btnRetry {

            background-color: #14A083;

            color: #fff;

            border: none;

            border-radius: 2px;

            text-align: center;

            text-transform: uppercase;

            text-decoration: none;

            cursor: pointer;

            font-size: 15px;

            padding: 15px 10px;

            width: 100%;

            display: block;

            margin: 20px 0 0;

        }

    </style>

</head>

<body>

    <div class="container">

        <div class="title">

            <h1>Capitalize Vowels in PHP</h1>

            <p>Created By:</p>

            <h2>&#187; Jake R. Pomperada, MAED-IT, MIT &#171;</h2>

        </div>

        <div class="output_wrapper">

        <?php

            if(isset($_POST["txtString"])){

                $string = strtolower($_POST["txtString"]);

                $vowels = array('a', 'e', 'i', 'o', 'u');

                $output = str_replace($vowels, array_map('strtoupper', $vowels), $string);


                echo '<p>The output is:</p>

                    <h3 class="output">'.$output.'</h3>

                    <a href="php_capitalize_vowels.php" class="btnRetry">Retry?</a>';

            } else {

                echo '<form action="" method="post">

                        <label>Enter a string here:</label>

                        <input type="text" name="txtString" required>


                        <button type="submit">Submit</button>

                    </form>';

            }

        ?>

        </div>

    </div>

</body>

</html>