KUIS November 2015 academic enrollment

Template for PHP database system - MyCompanyHR

Web Programming – PHP & MySQL
(with Boostrap HTML framework)

Template 1: Template for the Lab Exercise.

PHP mysql bootstrap flat-ui template

Download the template here - https://drive.google.com/file/d/0B5_Hw_xzXWcXV1VpYmpIdlRrMzQ/view?usp=sharing

  • You can import the MySQL database by importing the mycompanyhr.sql in MySQL server.
  • The template file is php-db-template.php
  • The files for inclusion are available at folder inc
    • dbconn.php
    • navbar.php
    • sidebar-menu.php
    • footer.php
  • CSS and JS folders are also availaable contain the FLAT-UI BootStrap framework.

 

Template 2: Template for the Project Assignment – Proceeding Simple Ssytem.

Download here - https://drive.google.com/file/d/0B5_Hw_xzXWcXaElxeENBTDB2aXc/view?usp=sharing

image

image

SmartSolat – learn how to perform solat with Ustaz Don

SmartSolat banner


FSTM - KUISCELL - Creative Vault - MDEC

 

FEATURES

  • SmartSolat is a multimedia guide book on how to perform Solat, the daily prayer for Muslims.
  • It has the pictures of how to perform each step of Solat.
  • The recitations Arabic are also provided for each of the steps.
  • Every page has the recitation in Arabic and the meanings in English, France and Malay.
  • SmartSolat also has the step-by-step guide to perform abulation (wudhu': method to cleanse ourselves before performing Solat).

Developers:
Developed with the funding from ICONDAP, MDeC by a team from Faculty of Information Science & Technology and KUISCELL Sdn Bhd.
  • Ustaz Don Daniyal Don Biyajid
  • Nur Muizz Mohamed Salleh
  • Hailrudin Jaafar
  • Khirulnizam Abd Rahman

 

VIDEO PROMO



DESCRIPTION
Guide to Perform Solat (Muslim Daily Prayer) performed by al-Ustaz Don Daniyal.
Our team in the Faculty of Information Science & Technology (FSTM, KUIS) has come-up with a multimedia apps on how to perform solat (Muslim daily prayer) – SmartSolat.
SmartSolat contains the step-by-step animated guide to perform Solat (the Muslim daily prayer). The Solat are performed five times a day including Subh (before sunrise), Zuhr (noon), Asr (afternoon before dawn), Maghrib (dawn) and Isha' (at night). Before performing Solat, Muslim will cleanse themselves by performing Wudhu'.
Language available: English, France & Malay
Label: Salah, Solat, Sembahyang, Wudhu

 

ANDROID VERSION

The Android version is available for download from the Google Play Store

bit.ly/smartsolat2


 

IOS VERSION



iOS Version: We are in the process of waiting the approval from Apple Appstore.






smartsolat-languages 

smartsolat-doa-wudhu  smartsolat-takbir 

smartsolat-takbir2 

smartsolat-tahiyat

ADOBD for PHP – starting guidelines

It’s been a while since II ‘d like to share more on ADODB for PHP. Download the API here - http://adodb.sourceforge.net/ and copy to your PHP project folder. In this case am using XAMPP standard installation.

image

ADOdb is a database abstraction library (API/framework) for PHP that support mostly major database server, among others MySQL, MSSQL, Oracle etc...

image

Let say you have this table contact(idstaf, nama, jawatan, email,mobile,ext, web, idjabatan,imej), from database mobile_fstm.

SQL-dump

-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 09, 2015 at 05:56 AM
-- Server version: 5.6.14
-- PHP Version: 5.5.6

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: `mobile_fstm`
--
CREATE DATABASE IF NOT EXISTS `mobile_fstm` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `mobile_fstm`;

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

--
-- Table structure for table `contact`
--
CREATE TABLE IF NOT EXISTS `contact` (
`idstaf` varchar(4) NOT NULL,
`nama` text NOT NULL,
`jawatan` text NOT NULL,
`email` text NOT NULL,
`mobile` text NOT NULL,
`ext` varchar(4) NOT NULL,
`web` text NOT NULL,
`idjabatan` varchar(5) NOT NULL,
`imej` text NOT NULL,
PRIMARY KEY (`idstaf`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `contact`
--
INSERT INTO `contact` (`idstaf`, `nama`, `jawatan`, `email`, `mobile`, `ext`, `web`, `idjabatan`, `imej`) VALUES
('0001', 'Muizz Salleh', 'Timbalan Dekan Mahasiswa', 'Muizz.Salleh@gmail.com', '+6012345234', '2313', 'http://muizz.com.my', 'JMM', 'muizz.png'),
('0132', 'Khirulnizam Abd Rahman', 'Pensyarah', 'khirulnizam@kuis.edu.my', '+60129034614', '2345', 'http://kerul.net', 'JSK', 'khirulnizam.jpg'),
('9999', 'Mohd Asyraf Chunawi', 'Trainee', 'masyrafchunawi@gmail.com', '+6012345678', '-', 'http://fstm.kuis.edu.my', 'JSK', 'asyraf.jpg');

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


 


Connecting and fetching records from table.


<?php
//Test AdoBD...
$server="localhost";
$user="root";
$pwd="";
$db="mobile_fstm";

//incude adodb5 library
include('adodb5/adodb.inc.php');
//select what database server is used
$DB = NewADOConnection('mysql');
//provide database server connection details
$DB->Connect($server, $user, $pwd, $db);

// M'soft style data retrieval with binds
$rs = $DB->Execute("select * from contact");
//resultset available
while (!$rs->EOF) {
//just browse thru all records
print_r($rs->fields);
$rs->MoveNext();
echo "<hr>";
}

?>


 


Output


imageTada…


Delete a record from a ListView–Android database SQLite (p8)

This tutorial is the continuation of the tutorial in Add new Record

By long-pressing a record, user will invoke the Dialog box. Choose DELETE to confirm deleting the selected record. Choosing UPDATE will invoke the update record screen.

delete-record-screenshot1delete-record-screenshot2delete-record-screenshot3

Download the complete code here  ic_file_download_black_24dp_2x http://khirulnizam.com/android/FSTMDirektori.zip

STEP 1: Adjusting the onItemLongClickListener to accommodate the deleting a record facilities.

delete-record update-alert-dialog

delete-record delete-alert-dialog

The updated DisplayList.java with the delete record function

package net.kerul.fstmdirektori;

import java.util.ArrayList;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ListView;
import android.widget.Toast;

public class DisplayList extends Activity {

private String id;//to hold selected stafid
private DBHelper mHelper;
private SQLiteDatabase dataBase;

//variables to hold staff records
private ArrayList<String> stafid = new ArrayList<String>();
private ArrayList<String> nama = new ArrayList<String>();
private ArrayList<String> jbt = new ArrayList<String>();

private ListView userList;
private AlertDialog.Builder build;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display_list);

userList = (ListView) findViewById(R.id.List);

mHelper = new DBHelper(this);

//click to update data
userList.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {

Intent i = new Intent(getApplicationContext(),
ViewRecord.class);
i.putExtra("stafid", stafid.get(arg2));
startActivity(i);
}
});//end setOnItemClickListener

//long-press to update data
userList.setOnItemLongClickListener(new OnItemLongClickListener() {

public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
final int arg2, long arg3) {

//invoking AlertDialog box
build = new AlertDialog.Builder(DisplayList.this);
build.setTitle("Update/Delete staff " + nama.get(arg2));
build.setMessage("Do you want to update/delete the record?(Hit back to cancel)");

//user select UPDATE
build.setNegativeButton("UPDATE",
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog,
int which) {
//Update record selected
Intent i = new Intent(getApplicationContext(),
UpdateRecord.class);
i.putExtra("stafid", stafid.get(arg2));
startActivity(i);
dialog.cancel();
}
});//end UPDATE

//user select DELETE
build.setPositiveButton("DELETE",
new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog,int which) {
dataBase.delete(
DBHelper.TABLE_NAME,
DBHelper.STAFID + "="
+ stafid.get(arg2), null);
Toast.makeText(
getApplicationContext(),
nama.get(arg2)+
" is deleted.", Toast.LENGTH_SHORT).show();
displayData();
dialog.cancel();
}
});//end DELETE
AlertDialog alert = build.create();
alert.show();

return true;
}
});//end setOnItemLongClickListener


}// end onCreate method

@Override
protected void onResume() {
//refresh data for screen is invoked/displayed
displayData();
Toast.makeText(getApplicationContext(), "TAP to view complete info, \n LONG-TAP to update/delete...", Toast.LENGTH_LONG).show();
super.onResume();
}

/**
* displays data from SQLite
*/
private void displayData() {
dataBase = mHelper.getWritableDatabase();
//the SQL command to fetched all records from the table
Cursor mCursor = dataBase.rawQuery("SELECT * FROM "
+ DBHelper.TABLE_NAME, null);

//reset variables
stafid.clear();
nama.clear();
jbt.clear();

//fetch each record
if (mCursor.moveToFirst()) {
do {
//get data from field
stafid.add(mCursor.getString(mCursor.getColumnIndex(DBHelper.STAFID)));
nama.add(mCursor.getString(mCursor.getColumnIndex(DBHelper.NAMA)));
jbt.add(mCursor.getString(mCursor.getColumnIndex(DBHelper.JBT)));

} while (mCursor.moveToNext());
//do above till data exhausted
}

//display to screen
DisplayAdapter disadpt = new DisplayAdapter(DisplayList.this, stafid, nama, jbt);
userList.setAdapter(disadpt);
mCursor.close();
}//end displayData




@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.display_list, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
if (item.getItemId()==R.id.m_add_record) {

//invoke the AddNewRecord screen using Intent
Intent i = new Intent(getApplicationContext(),
AddNewRecord.class);
startActivity(i);
}
return true;
}

}//end DisplayList class

Add new Record - Android database SQLite (p7)

Tutorial description: The product of this tutorial is to invoke (from MENU) another screen to insert a new record. The first screen is the list of all records. User is able to add a new record through this screen. The screenshots below is the output.

add-new-record screenshot1add-new-record screenshot2add-new-record screenshot3

Before you proceed with the tutorial, you might want to read the previous tutorial - Update Record by long-press ListView - Android database SQLite (p6)

Download the complete code here  ic_file_download_black_24dp_2x4 http://khirulnizam.com/android/FSTMDirektori.zip

STEP 1: Add a new screen named AddNewRecord

Right-click on the project name –>New –> Other… Select the Android Activity –> Blank Activity. Provide the new Activity (screen) name AddNewRecord

add new screen to display complete record

new screen select Android ctivity

Provide the Activity Name as AddNewRecord, and hit Finish

new activity add-new-record

Popular Posts

WorldConferences.net