Tuesday, February 20, 2018

Database Driven Login System with Username Display in Microsoft Visual Foxrpo

This is a database drive login system with username display that I wrote using Microsoft Visual Foxpro. Writing this program is much easier company to other programming language that I used before maybe because Microsoft Visual Foxpro was designed to be database centered language. You can write a complete database application with only a few codes.

I am currently accepting programming 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 is (034) 4335675.





Table Structure and Sample Records










Sample Program Output


Program Listing


Password Form

Object: Form1   Procedure: Init
=====================================

 thisform.text2.value =0
 thisform.text2.Visible= .F.
 thisform.txtPassword.PasswordChar = "*"
 thisform.txtusername.SetFocus

 
 Ok Button
 
 Object: Command1 Procedure: Click
 ========================================
 
SELECT users

LOCATE FOR ALLTRIM(LOWER(username)) == ALLTRIM(LOWER(thisform.txtusername.value)) AND ALLTRIM(LOWER(password)) =  ALLTRIM(LOWER(thisform.txtpassword.Value)) 
       
        IF FOUND() then
           DO form menu 
            thisform.Release
            thisform.Hide
            RETURN .t.
        endif

if thisform.text2.Value <3 then
thisform.text2.Value = thisform.text2.Value +1
thisform.txtusername.Value=""
thisform.txtpassword.Value =""
thisform.txtusername.SetFocus
thisform.label1.caption ="User login attempt number " + TRANSFORM(thisform.text2.value) + "."
endif
IF thisform.text2.Value = 3 then
  MESSAGEBOX("Please contact your programmer to solve this problem")
  thisform.txtusername.Enabled= .F.
  thisform.txtpassword.Enabled= .F.
  thisform.command1.Enabled= .F.
  ENDIF
  
  
  Cancel Button
 
 Object: Command2 Procedure: Click
 ========================================
 
 
thisform.Release


Menu Form

Object: Form1 Procedure: Init

SELECT users

fullname = TRIM(firstname) + "   " + TRIM(lastname)
thisform.label1.Caption = "Welcome " +fullname

Close Button

Object: Command1 Procedure: Click
=========================================
 
thisform.Release
thisform.hide
DO FORM password




Login Security System with Three Attempts in Microsoft Visual Foxpro

In this article I would like to share with you a sample application that I wrote in Microsoft Visual Foxpro 9 it is not yet database driven for this example but shows you how to create a login security to protect your application from intruders. I hope you will find my work useful.  Thank you.

I am currently accepting programming 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 is (034) 4335675.







Sample Program Output


Program Listing


Object : Form1           Procedure: Init
=========================================

 thisform.text2.value =0
 thisform.text2.Visible= .F.
 thisform.txtPassword.PasswordChar = "*"
 thisform.txtusername.SetFocus
  
  
  Object: Command1 Procedure: Click
  ========================================
  
  if thisform.txtpassword.value = "123" AND thisform.txtusername.Value="123" then
MESSAGEBOX("Password Accepted")
RETURN .t.
endif


if thisform.text2.Value <3 then
thisform.text2.Value = thisform.text2.Value +1
thisform.txtusername.Value=""
thisform.txtpassword.Value =""
thisform.txtusername.SetFocus
thisform.label1.caption ="User login attempt number " + TRANSFORM(thisform.text2.value) + "."
endif
IF thisform.text2.Value = 3 then
  MESSAGEBOX("Please contact your programmer to solve this problem")
  thisform.txtusername.Enabled= .F.
  thisform.txtpassword.Enabled= .F.
  thisform.command1.Enabled= .F.
  ENDIF
  
  
  Object : Command2             Procedure: Click
  ==============================================
  
  thisform.release
  
  
  






Monday, February 19, 2018

Enrollment System in Microsoft Visual Foxpro

In this article I would like to share with you my very simple enrollment system that I wrote using Microsoft Visual Foxpro 9. I hope you will like my work. Thank you.

I am currently accepting programming 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 is (034) 4335675.








Sample Program Output



Program Listing

Table Stucture

student 
============

sid
name
course


subjects
=============
sid
subject
units


form1    Init

m.sid =""
m.sname=""
m.scource=""
m.ssubject=""
m.sunits=0

SET DEFAULT TO D:\vfp\enrollment
WITH thisform
    .txtsid.enabled=.f.
    .txtsname.enabled=.f.
    .txtscourse.enabled=.f.
ENDWITH


New Record Button

WITH thisform 
    .txtsid.value=""
    .txtsname.value=""
    .txtscourse.value=""
    .txtsid.enabled=.t.
    .txtsname.enabled=.t.
    .txtscourse.enabled=.t.
    .txtsid.setfocus
  ENDWITH
  
  
  Save and Update Button
  =====================
  
  SELECT student

LOCATE FOR sid = m.sid

if !found()
   && new record
   if Messagebox("Are you sure to add new record?",32+4,"Confirmation") = 6
   append blank  && add new record
   gather memvar
  endif
 else && update record
       if Messagebox("Are you sure to update existing record?",32+4,"Confirmation") = 6
       gather memvar && overwrite existing record
     endif
  endif

  thisform.grdStudent.refresh
  
  
  Delete Button
  ==============
  
   SELECT STUDENT
SET DELETED on
locate for sid = m.sid
if found()
   
   if Messagebox("Are you sure to delete this record?",32+4,"Confirmation") = 6
   DELETE
    Messagebox("Record Successfully deleted","Information")
      thisform.refresh
  thisform.grdstudent.refresh
  Endif
 ENDIF
  
   thisform.refresh
  thisform.grdstudent.refresh
  thisform.txtsid.Enabled= .F.
  thisform.txtsname.Enabled= .F.
   thisform.txtscourse.Enabled= .F.
  thisform.command1.SetFocus
  
  
  
* Code To Print Single Record
* Written By Mr. Jake R. Pomperada
* February 19, 2017

Print Single Record Button
============================

SELECT Student
SET FILTER TO sid=ALLTRIM(thisform.txtId.Value)
REPORT FORM student_report to PRINTER preview
Thisform.Refresh


Print All Record Button
=========================


SELECT Student

REPORT FORM student_report to PRINTER preview

thisform.Refresh



Form1 Init  for counting of units enrolled
===========================================

SET TALK OFF
SET ECHO OFF
SET CENTURY ON


SET DEFAULT TO D:\vfp\enrollment


thisform.txtName.Value=""

SELECT student
IF !BOF() THEN 
SKIP -1
SET FILTER TO sid = student.sid IN subjects
Select subjects

sum units  to thisform.txtTotalunits.value 
thisform.Refresh
thisform.txtId.SetFocus
ELSE
 MESSAGEBOX("Beginning of Record")
 ENDIF


 Previous Button
 ===============
 
 
thisform.Refresh

SELECT student



IF !BOF() 
SKIP -1
  
 
SET FILTER TO sid = student.sid IN subjects

Select subjects
sum units  to thisform.txtTotalunits.value 
ELSE
MESSAGEBOX("This is the first record.")
thisform.command1.Enabled= .F.
thisform.command2.Enabled= .T.
 
 ENDIF
 thisform.Refresh

 
 Next Button
 ============
 
 
thisform.Refresh
SELECT student
IF  !EOF() THEN 
SKIP 
 
SET FILTER TO sid = student.sid IN subjects
thisform.Refresh
Select subjects
    sum units  to thisform.txtTotalunits.value
ELSE
 MESSAGEBOX("End of Record")
 thisform.command2.Enabled = .F.
 thisform.command1.Enabled= .T.
 ENDIF
 
 Close button
 ===============
 
 thisform.Release
thisform.Hide
DO FORM main_menu




 
 

Friday, February 16, 2018

CRUD Application in Microsoft Visual Foxpro 9

In this article I would like to share with you a simple program that I wrote using Microsoft Visual Foxpro 9 to demostrate CRUD application it can add, edit, delete, view, print and search it is can generate reports and have error correction capability. I hope you will learn something in my program.

I am currently accepting programming 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 is (034) 4335675.



About Page





Report Generation and Preview


Table Structure

Sample Records in the Table


Program Listing


Search Button
=============

SELECT demo

thisform.txtT_id.Enabled = .T.
thisform.txtT_id.ReadOnly = .F.

IF  Empty(thisform.txtT_id.Value)
   MESSAGEBOX("Please provide ID Number." + CHR(13) + " Please try again.",0+48,"Reminder")
    
    thisform.txtT_id.Value=""
    thisform.txtT_id.SetFocus
    
   ENDIF


LOCATE FOR t_id = m.t_id
IF FOUND() 
   thisform.txtT_name.Enabled = .T.
   thisform.txtT_id.Value = t_id
   thisform.txtT_name.Value = t_name
   thisform.Refresh
  
  ELSE 
    Messagebox("Record not found Try Again",32,"Reminder") 
    thisform.txtT_id.value = 0
    thisform.txtT_name.value=""
    thisform.txtT_name.Enabled = .F.
    thisform.txtT_id.SetFocus
endif

New button
==========

m.t_id =RECCOUNT()+1
m.t_name=""
thisform.Refresh
thisform.txtT_id.ReadOnly = .T.
thisform.txtT_name.Enabled = .T.

Save Button
===========

select demo

locate for t_id = m.t_id
if !found()
   && new record
   if Messagebox("Are you sure to add new record?",32+4,"Confirmation") = 6
   append blank  && add new record
   gather memvar
  endif
 else && update record
       if Messagebox("Are you sure to update existing record?",32+4,"Confirmation") = 6
       gather memvar && overwrite existing record
     endif
  endif

  thisform.grdDemo.refresh

  Delete Button
  =============

 select demo
SET DELETED on
locate for t_id = m.t_id
if found()
   
   if Messagebox("Are you sure to delete this record?",32+4,"Confirmation") = 6
   delete
  endif
 ENDIF
  m.t_id=""
  m.t_name=""
  thisform.refresh
  thisform.grdDemo.refresh
  thisform.txtT_id.Enabled= .F.
  thisform.txtT_name.Enabled= .F.
  thisform.command1.SetFocus

  Print Button
  ===========

select demo
report form demo to printer prompt preview

Close Button
============

thisform.Release




Sunday, February 11, 2018

Factors of a Number in JavaScript

A simple program that I wrote using Javascript to ask the user to give a number and then our program will display the factors of the given number.

I am currently accepting programming 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 is (034) 4335675.






Sample Program Output


Program Listing

index.htm

<!--
 Written By Mr. Jake R. Pomperada, MAED-IT
 February 11, 2018   04:24 PM   Sunday
 Bacolod City, Negros Occidental Republic of the Philippines
 jakerpomperada@yahoo.com and jakerpomperada@gmail.com -->
<!doctype html>
<html>
<head>
<title>Factors of a Number in JavaScript </title>
<style>

   .art {

      font-family: arial;
      font-weight: bold;
      color:red;
      text-align: center;
      width:60%;
      background-color:yellow;
   }

.art2 {

      font-family: arial;
      font-weight: bold;
      font-size: 25px;
      color:blue;
      text-align: center;
      width:45%;
      background-color:lightgreen;
   }

   body {
     font-family: arial;
     font-weight: bold;
     font-size: 20px;
   }

   #button_me {
    background-color: #008CBA;
    font-family: arial;
    font-weight: bold;
    font-size: 20px;
    height: 50px;
    width: 120px
     text-align: center;
    cursor: pointer;
 }

 input[type=text] {
    font-family: arial;
    font-weight: bold;
    font-size: 20px;
   
 }
</style>
      
<script>
function factors(n)
{
 var num_factors = [], i;

 for (i = 1; i <= Math.floor(Math.sqrt(n)); i += 1)
  if (n % i === 0)
  {
   num_factors.push(i);
   if (n / i !== i)
    num_factors.push(n / i);
  }
 num_factors.sort(function(x, y)
   {
     return x - y;});  // numeric sort
     return num_factors;
    }


function start()
{
num1=Number(document.getElementById("val1").value);

document.getElementById("result").value= factors(num1);
}

</script>


<script>
function clear_me()
{
document.getElementById("val1").value = "";
document.getElementById("result").value = "";
document.getElementById("val1").focus();
}
</script>

</head>
<body>
<h1 class="art"> Factors of a Number in JavaScript </h1>
    <p  class="art2"> Created By Mr. Jake R. Pomperada, MAED-IT </p>
<br><br>
Give a Number <input id="val1" type="text" size="5" autofocus>
<br><br>
The result is <input id="result" type="text" size="50"
<br> <br> <br>
<button id="button_me" onclick="start()">Check</button>
&nbsp;&nbsp;&nbsp;
<button id="button_me" onclick="clear_me()">Clear</button>
</br></br>
</body>
</html>