Memaparkan catatan dengan label Peribadi. Papar semua catatan
Memaparkan catatan dengan label Peribadi. Papar semua catatan

Jumaat, Januari 17, 2014

Linux / CentOS 6 : owncloud

Langkah 1 : Pasang pakej EPEL yang terkini melalui Fedora Project1
#  wget http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
#  rpm -i epel-release-6-8.noarch.rpm

Langkah 2 : Masukan owncloud terkini kedalam repo
http://owncloud.org/install/
# wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo

Langkah 3 : Pasangkan owncloud
# yum install owncloud

1. https://fedoraproject.org/wiki/EPEL

Isnin, Januari 06, 2014

New Strait Time - 06 January 2014 : Trend ICT careers still hot

By Rozana Sani - FANCY a career in ICT but unsure of whether there is a bright future in the field? There is and prospects in ICT are expected to continue to be rosy.

After all, the industry has been a significant contributor in efforts to develop the country into a high-income-based economy. With that, more high skilled talents are needed, especially in the newly developing and emerging areas of ICT, such as big data, cloud computing and embedded systems — in tandem with key trends in the industry.

“With more world-class ICT companies setting up businesses and building their regional facilities in Malaysia, coupled with local champions who are growing to be world-class players in their own right, the demand for ta-lents who are highly skilled and certified will continue to rise, and this is something that we need to address swiftly and holistically,” says Muhammad Imran Kunalan Abdullah, talent head at the Multimedia Development Corporation (MDeC) — the outfit responsible for the growth of the ICT industry in the country.

He says MSC Malaysia, the national ICT initiative driven by MDeC, continues to play a vital role in talent development for the ICT industry by forging relationships with key industry players and institutions of higher learning (IHLs) in the country to increase interest and participation in the industry.

“The ICT industry is rather unique. The pace of technology changes is very rapid and IHLs will continuously face a catching-up game with the industry demand. Hence, we will always see the need for specific interventions based on skills and competencies required by industry at certain point of time. These interventions are in the form of up-skilling training or certification training to specific needs of the industry. The MSC Malaysia MyProCert and MyUniAlliance training and international certification programmes is one of many ongoing intiatives led by MDeC which seeks to address this skill gap.”


ENCOURAGE USE OF ICT
Muhammad Imran stresses that there is a need to equip graduates across all disciplines and fields with ICT skills.“About five million Malaysians will be entering the workforce over the next few years and they need to be prepared to face the new work environment and go beyond being just casual users of technology. To achieve that, there must be encouragement on the use of ICT as a tool with efforts to push for minimum hours of ICT in education, be it in the form of labs or practical training.”He notes that the focus is now on how to institutionalise ICT use further in schools so it can benefit more young people, especially those from outside urban hotspots where parents may not be aware of or have no access to ICT.

“We have to improve on institutionalising such training in schools from the start to avoid increasing the digital divide,” he says.

On market trends, the MSC Malaysia MSC Malaysia Talent Supply-Demand Study 2010-2013 report cites that 90 per cent of companies hired workers with at least one to five years of experience, with only 10 per cent of companies hiring fresh graduates. The study was conducted with more than 1,000 companies and 133 faculties in IHLs, in addition to secondary research and consultation with industry experts.

Current skill gaps highlighted by the study saw software development (42 per cent) skills topping the list followed by database (23 per cent) and networking and security (18 per cent).
To that end, IHLs must adapt their curricula accordingly with more emphasis on practical industry experience, says Muhammad Imran.

Additionally, the e-leadership capabilities also need to be addressed in tandem with the maturity level of the ICT organisation as well as the progress the organisation may be going through especially the small and medium enterprises (SMEs).
“This type of organisation tends to focus on the technical capabilities that is necessary for the successful running of its day to day operations. They need to look at the other management capability development aspects if they want to grow their business. So, the emphasis on e-leadership is rather timely if we wish to see the local ICT companies grow and compete in the global arena since ICT has made the world borderless.”

Muhammad Imran also notes that in the shared services and outsourcing industry, the country is taking various measures to move beyond the business process outsourcing.

“Our strategy is to move up the value chain and concentrate on high value Knowledge Process Outsourcing (KPO)-type of services, in line with the country’s vision to be a sustainable, highly-competitive, high-value and high-income developed nation by 2020,” he says.MSC Malaysia has developed suitable niches within the local ICT industry and inspired local companies to become leaders in them, he adds.“The creative and animation industry is one where Malaysia is a newcomer, but has grown exponentially over the past few years, with many of our locally developed animated programmes showing all over the world, from China and Indonesia to UK and the Middle East,” he says. “All in all, we observed that demand generally exceeds supply in almost all areas. This is not surprising as the trend remains true worldwide and not just limited to Malaysia. What is more interesting is that the demand for experienced ICT personnel has grown noticeably and has exceeded the demand for fresh graduates. This trend also holds for the rest of the world. For example, Europe expects to face shortages for e-leaders (organisational leaders who are apt at business as well as ICT skills) in the near to medium-term.”

And what are the job trends he sees moving forward? “Job trends will always follow the technology trends,” he says, citing Gartner’s top 10 technology trends for 2014. “They are in line with the general trend that we have observed in 2013, i.e. Cloud and Big Data, Mobile and Mobility, Internet of Things, and 3D printing. So there will be increasing demand for engineers, programmers and technicians to support these emerging trends and technologies.”

Gartner’s top ten technology trends for 2014:

1. Mobile Device Diversity and Management
2. Mobile Apps and Applications
3. The Internet of Everything
4. Hybrid Cloud and IT as Service Broker
5. Cloud/Client Arhitecture
6. The Era of Personal Cloud
7. Software-Defined Anything
8. Web-Scale IT
9. Smart Machines
10. 3D Printing

Sumber :
Rozana Sani (2014). TRENDS: ICT careers still hot. The Electronic Text Center. Retrieved January 6, 2014, from New Strait Time website: http://www.nst.com.my/life-times/tech/trends-ict-careers-still-hot-1.455618

Selasa, Disember 31, 2013

Selamat tinggal 2013

Assalamualaikum dan salam sejahtera,
Hari ini bertarikh 31hb Disember 2013 adalah hari terakhir dan penutup buat tahun 2013. Angka '2013' adalah sebahagian daripada nama alamat weblog ini. Tidak membawa apa-apa makna pun cuma mungkin ia menjadi simbolik tersendiri yang tidak dapat diungkap.

Pejam dan celik dengan pantas masa berlalu pergi meninggalkan kita yang masih hanyut didalam buaian mimpi realiti dan fantasi. Bermacam suka dan duka telah kita lalui sepanjang tahun 2013. Aku dengan kisah aku yang tersendiri. Kamu dengan kisah kamu. Kita masing-masing hadir dengan jalan cerita, plot dan pengembaraan tersendiri...



Walau apa pun yang berlaku kita jangan putus asa. Teruskan hidup. Perjalan masih lagi jauh. Teringat pula beberapa hari lepas, sahabat ku mengadu dia sangat sedih sebab tidak pernah mendapat dekan sepanjang pengajian. Bersabarlah, teruskan berusaha. Namun kelak nanti bila berjaya jangan lupa pada rakan-rakan yang dibawah.

Aku tiada apa-apa yang hendak aku ungkapkan dalam entri terakhir buat tahun 2013 ini. Cuma aku berharap dan doakan tahun 2014 akan menjadi tahun yang bermakna buat aku.. wassalam~

Jumaat, Disember 20, 2013

JAVA : MyKamus @ Putera.com

package com.putera.kamus;

/**
 * Created with IntelliJ IDEA.
 * User: Syahmi
 * Date: 16/11/2013
 * Time: 3:29
 * To change this template use File | Settings | File Templates.
 */
public class Kamus {

    public static void main(String[] args) {
        Scraper scraper = new Scraper();

        for (String arg : args) {
            String data[] = scraper.get(arg);
            if (data == null) {
                System.out.println("Ralat");
                return;
            }

            for (String s : data) {
                System.out.println(s);
            }
        }
    }
}


package com.putera.kamus;

import org.jsoup.Jsoup;
import org.jsoup.nodes.*;

import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created with IntelliJ IDEA.
 * User: Syahmi
 * Date: 16/11/2013
 * Time: 3:35
 * To change this template use File | Settings | File Templates.
 */
public class Scraper {
    private static final String QUERY_URL = "http://prpm.dbp.gov.my/Search.aspx?k=";

    public String[] get(String word) {
        URL url;
        ArrayList<String> list = new ArrayList<String>();

        try {
            url = new URL(QUERY_URL + URLEncoder.encode(word, "UTF-8"));
            Document doc = Jsoup.parse(url, 30000);
            String resp = "";

            Iterator<Element> it = doc.select(".alternate").iterator();

            while(it.hasNext()) {
                Element e = it.next();
                list.add(e.text());
            }

            String[] array = list.toArray(new String[list.size()]);

            return array;

        } catch (Exception e) {
            String[] error = new String[1];
            error[0] = e.getMessage();

            return error;
        }
    }
}

Isnin, Disember 16, 2013

FIX PHP : Warning: Cannot modify header information - headers already sent

<?php
  ob_start();

  // sumbat dan goreng kod kat dalam ni 

 ob_end_flush();
?> 
* Dengan sedikit hack (pakai dengan cara ni).. kita boleh abaikan masalah warning @ notice tersebut. Masalah ni biasanya berpunya daripada whitespace antara tag <?php dan ?> ...tapi kalau kod dah cecah lebih daripada 2K baris. Tak sanggup dah nak baca beb..huhu.. pakai cara ni mudah. Letak je ob_start(); kat atas fail kemudian ob_end_flush(); kat baris paling bawah dalam fail..semoga mujarab \m/

Isnin, Oktober 07, 2013

Akhbar UTUSAN 6 Okt 2013 - Titisan air mata iringi kejayaan anak yang telah tiada

MOHD. Noh Daliman (dua dari kiri) menyerahkan ijazah sarjana muda kepada Halimah@Noriah Dollah, ibu kepada Allahyarham Balqis Amira Mat Hasan pada Majlis Konvokesyen UTHM Ke-13 di Batu Pahat, semalam
BATU PAHAT 6 Okt. - Hanya doa dan titisan air mata mengiringi dua keluarga yang sepatutnya bergembira melihat kejayaan anak-anak mereka menggenggam skrol pada Majlis Konvokesyen Universiti Tun Hussein Onn Malaysia (UTHM) Ke-13 di sini hari ini.

Bagi Rustam Jinis, 53, hasratnya untuk meraikan anaknya, Maisurah Rustam, 24, pada majlis konvokesyen tersebut tidak kesampaian apabila anak keempat daripada 12 beradik itu terlebih dahulu menghadap Ilahi akibat nahas jalan raya 23 Mei tahun lalu.

Menurutnya, arwah anaknya yang mengambil jurusan Sarjana Muda Pengurusan Teknologi (Pengeluaran dan Operasi) sedang menjalani latihan praktikal industri apabila terlibat kemalangan ketika menunggang motosikal ke pejabat di Paka, Terengganu.

"Perasaan saya ketika ini bercampur baur antara sedih, bangga dan juga sedikit terkilan kerana tidak sempat untuk meraikan kejayaan arwah pada hari ini.

"Namun, saya pasrah dengan ketentuan Ilahi kerana yakin apa yang berlaku ada hikmahnya," katanya dalam nada sebak selepas menerima ijazah arwah anaknya itu yang disampaikan oleh Naib Canselor UTHM, Prof. Datuk. Dr. Mohd. Noh Daliman di Bilik Kenamaan, Dewan Sultan Ibrahim di sini hari ini.

Rustam berkata, meskipun masih merasai kehilangan Maisurah, beliau sekeluarga tetap berbangga apabila seorang lagi anaknya, Bazilah, 22, berjaya menyambung pengajian dalam jurusan sama di UTHM kira-kira tiga minggu lalu.

Perasaan sama turut dirasai Halimah@Noriah Dollah, 63, ibu kepada Balqis Amira Mat Hasan, 26, graduan Sarjana Muda Kejuruteraan Mekanikal yang meninggal dunia akibat nahas jalan raya tahun lalu.

Menurutnya, arwah anaknya yang merupakan anak kesembilan daripada 10 beradik meninggal dunia dalam satu kemalangan ngeri di Kuantan, Pahang pada 1 September tahun lalu ketika dalam perjalanan ke majlis perkahwinan sahabatnya.

"Arwah pernah melahirkan hasrat untuk menjadi jurutera suatu hari nanti, namun cita-citanya itu tidak kesampaian. Saya reda dengan ketentuan Ilahi," katanya

Sumber :
- http://www.utusan.com.my/utusan/Dalam_Negeri/20131007/dn_16/Titisan-air-mata-iringi--kejayaan-anak-yang-telah-tiada

Ahad, Ogos 18, 2013

Peribadi : Andai kata ku dapat terbang membawa diriku

Sabtu, Ogos 03, 2013

Kisah : Si anak pelajar baru universiti, seorang bapa dan sebuah komputer riba

Ada seorang bapa datang ke kedai, melihat-lihat seperti pelanggan lain.Aku menerjahnya, "Pak cik..."Dia tersenyum dan masih melihat-lihat laptop yang ada di kedai. Aku menyambung lagi, "Nak beli untuk anak ke?""Ya, nak beli untuk anak. Dia nak sambung belajar, laptop yang mana yang ok?" Aku mempromosi barang seperti biasa - aku biasanya mengesyorkan yang paling murah. "Kalau nak yang bagus, mahal pakcik. Tapi kalau setakat nak buat belajar yang ni lah, Samsung, seribu seratus lebih je...". Dalam aku bercakap dengan dia, dia banyak diam dan seperti berfikir. Sedikit lama dia terdiam, dia membuka mulut "Nanti saya datang balik ya, duit tak berapa nak ada lagi ni..." - dia pergi dengan suatu perasaan yang lain.

Aku dengan rutinku berkerja setiap hujung minggu sahaja. Kebetulan, sedang aku duduk di kaunter menunggu pelanggan, dia datang semula ke kedai, tapi kali ini dengan membawa anaknya - perempuan. "Yang mana ya yang hari tu, ada lagi tak?", "Yang ni lah Samsung hari tu, tapi yang ni stok baru, harga sama je", aku menyambut soalannya.

Dia bertanya kepada anaknya, "Yang ni, ok ke dik?" ,"Ermmm, ok ke ni, murah je. Karang rosak, karang susah..." jawabnya dengan muka yang kurang puas hati - anaknya seperti menginginkan yang lain; yang lebih mahal." Yang acer nie x boleh ke ayah?", ayahnya terdiam seketika dan menyambut dengan negosiasi. "Yang acer nie, berapa boleh murah lagi?". "Yang tu tak dapat dah pakcik,... Dah harga kos dah tu..."

Aku dengan rasa geram namun masih dalam nada yang baik menyambung lagi,"Dik, nak laptop untuk belajar kan? Rasanya kalau untuk belajar, yang ni lebih dari cukup, rosak tak payah fikir sangat, warenti setahun.".Aku mengeluarkan kata-kata tersebut atas dasar aku seperti mengerti kerut di wajah bapanya.

"Oklah, yang ini." jawab anaknya. Sedang aku menulis resit dan membungkus laptop dari meja 'display', aku terpandang bapanya yang mengira duit untuk membayar. Aku nampak dompetnya kosong - habis semua duit digunakan untuk membayar laptop.

Dia menyerahkan duit kepadaku dan aku mengiranya semula. Dia melihat tanganku yang mengira. Habis aku mengira, wang aku masukkan dalam "cash drawer". "Cukup duit tadi dik?"."Cukup, Terima kasih ya...".

Dia dan anaknya meninggalkan kedai. Aku hanya menahan airmata mengira duit yang diberikan - banyak not RM1, RM5, RM10 dan hanya sekeping RM50. Sebak rasanya.

Aku membayangkan dari mana si ayah mencari duit untuk membeli sebuah laptop untuk anaknya; penuh harapan. Aku geram kepada anaknya, seperti dia tidak tahu ayahnya bagaimana - hanya tahu minta. Aku tahu ayahnya tiada duit, dah disebut awal-awal pada aku, aku nampak air mukanya, aku perhati sekeping-sekeping duit yang diserahkan. Aku tahu dia tiada duit pulang ke rumah dan perlu 'mengais' untuk hari esoknya.

Ya Allah, ampunilah segala dosaku, dan (dosa) kedua ibubapaku, dan rahmatilah keduanya seperti mana mereka mendidikku pada waktu kecil. Amin...

C++ : Sistem perpustakaan

//***************************************************************
//                   HEADER FILE USED IN PROJECT
//****************************************************************

#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<string.h>
#include<iomanip.h>

//***************************************************************
//                   CLASS USED IN PROJECT
//****************************************************************



class book
{
    char bno[6];
    char bname[50];
    char aname[20];
  public:
    void create_book()
    {
        cout<<"\nNEW BOOK ENTRY...\n";
        cout<<"\nEnter The book no.";
        cin>>bno;
        cout<<"\n\nEnter The Name of The Book ";
        gets(bname);
        cout<<"\n\nEnter The Author's Name ";
        gets(aname);
        cout<<"\n\n\nBook Created..";
    }

    void show_book()
    {
        cout<<"\nBook no. : "<<bno;
        cout<<"\nBook Name : ";
        puts(bname);
        cout<<"Author Name : ";
        puts(aname);
    }

    void modify_book()
    {
        cout<<"\nBook no. : "<<bno;
        cout<<"\nModify Book Name : ";
        gets(bname);
        cout<<"\nModify Author's Name of Book : ";
        gets(aname);
    }

    char* retbno()
    {
        return bno;
    }

    void report()
    {cout<<bno<<setw(30)<<bname<<setw(30)<<aname<<endl;}


};         //class ends here




class student
{
    char admno[6];
    char name[20];
    char stbno[6];
    int token;
public:
    void create_student()
    {
        clrscr();
         cout<<"\nNEW STUDENT ENTRY...\n";
        cout<<"\nEnter The admission no. ";
        cin>>admno;
        cout<<"\n\nEnter The Name of The Student ";
        gets(name);
        token=0;
        stbno[0]='/0';
        cout<<"\n\nStudent Record Created..";
    }

    void show_student()
    {
        cout<<"\nAdmission no. : "<<admno;
        cout<<"\nStudent Name : ";
        puts(name);
        cout<<"\nNo of Book issued : "<<token;
        if(token==1)
            cout<<"\nBook No "<<stbno;
    }

    void modify_student()
    {
        cout<<"\nAdmission no. : "<<admno;
        cout<<"\nModify Student Name : ";
        gets(name);
    }

    char* retadmno()
    {
        return admno;
    }

    char* retstbno()
    {
        return stbno;
    }

    int rettoken()
    {
        return token;
    }

    void addtoken()
    {token=1;}

    void resettoken()
    {token=0;}

    void getstbno(char t[])
    {
        strcpy(stbno,t);
    }

    void report()
    {cout<<"\t"<<admno<<setw(20)<<name<<setw(10)<<token<<endl;}

};         //class ends here




//***************************************************************
//        global declaration for stream object, object
//****************************************************************

fstream fp,fp1;
book bk;
student st;


//***************************************************************
//        function to write in file
//****************************************************************

void write_book()
{
    char ch;
    fp.open("book.dat",ios::out|ios::app);
    do
    {
        clrscr();
        bk.create_book();
        fp.write((char*)&bk,sizeof(book));
        cout<<"\n\nDo you want to add more record..(y/n?)";
        cin>>ch;
    }while(ch=='y'||ch=='Y');
    fp.close();
}

void write_student()
{
    char ch;
    fp.open("student.dat",ios::out|ios::app);
    do
    {
        st.create_student();
        fp.write((char*)&st,sizeof(student));
        cout<<"\n\ndo you want to add more record..(y/n?)";
        cin>>ch;
    }while(ch=='y'||ch=='Y');
    fp.close();
}


//***************************************************************
//        function to read specific record from file
//****************************************************************


void display_spb(char n[])
{
    cout<<"\nBOOK DETAILS\n";
    int flag=0;
    fp.open("book.dat",ios::in);
    while(fp.read((char*)&bk,sizeof(book)))
    {
        if(strcmpi(bk.retbno(),n)==0)
        {
            bk.show_book();
             flag=1;
        }
    }
    
    fp.close();
    if(flag==0)
        cout<<"\n\nBook does not exist";
    getch();
}

void display_sps(char n[])
{
    cout<<"\nSTUDENT DETAILS\n";
    int flag=0;
    fp.open("student.dat",ios::in);
    while(fp.read((char*)&st,sizeof(student)))
    {
        if((strcmpi(st.retadmno(),n)==0))
        {
            st.show_student();
            flag=1;
        }
    }
    
    fp.close();
    if(flag==0)
            cout<<"\n\nStudent does not exist";
    getch();
}


//***************************************************************
//        function to modify record of file
//****************************************************************


void modify_book()
{
    char n[6];
    int found=0;
    clrscr();
    cout<<"\n\n\tMODIFY BOOK REOCORD.... ";
    cout<<"\n\n\tEnter The book no. of The book";
    cin>>n;
    fp.open("book.dat",ios::in|ios::out);
    while(fp.read((char*)&bk,sizeof(book)) && found==0)
    {
        if(strcmpi(bk.retbno(),n)==0)
        {
            bk.show_book();
            cout<<"\nEnter The New Details of book"<<endl;
            bk.modify_book();
            int pos=-1*sizeof(bk);
                fp.seekp(pos,ios::cur);
                fp.write((char*)&bk,sizeof(book));
                cout<<"\n\n\t Record Updated";
                found=1;
        }
    }

        fp.close();
        if(found==0)
            cout<<"\n\n Record Not Found ";
        getch();
}


void modify_student()
{
    char n[6];
    int found=0;
    clrscr();
    cout<<"\n\n\tMODIFY STUDENT RECORD... ";
    cout<<"\n\n\tEnter The admission no. of The student";
    cin>>n;
    fp.open("student.dat",ios::in|ios::out);
    while(fp.read((char*)&st,sizeof(student)) && found==0)
    {
        if(strcmpi(st.retadmno(),n)==0)
        {
            st.show_student();
            cout<<"\nEnter The New Details of student"<<endl;
            st.modify_student();
            int pos=-1*sizeof(st);
            fp.seekp(pos,ios::cur);
            fp.write((char*)&st,sizeof(student));
            cout<<"\n\n\t Record Updated";
            found=1;
        }
    }
    
    fp.close();
    if(found==0)
        cout<<"\n\n Record Not Found ";
    getch();
}

//***************************************************************
//        function to delete record of file
//****************************************************************


void delete_student()
{
    char n[6];
    int flag=0;    
    clrscr();
        cout<<"\n\n\n\tDELETE STUDENT...";
        cout<<"\n\nEnter The admission no. of the Student You Want To Delete : ";
        cin>>n;
        fp.open("student.dat",ios::in|ios::out);
        fstream fp2;
        fp2.open("Temp.dat",ios::out);
        fp.seekg(0,ios::beg);
        while(fp.read((char*)&st,sizeof(student)))
    {
        if(strcmpi(st.retadmno(),n)!=0)
                 fp2.write((char*)&st,sizeof(student));
        else
               flag=1;
    }
        
    fp2.close();
        fp.close();
        remove("student.dat");
        rename("Temp.dat","student.dat");
        if(flag==1)
             cout<<"\n\n\tRecord Deleted ..";
        else
             cout<<"\n\nRecord not found";
        getch();
}


void delete_book()
{
    char n[6];
    clrscr();
    cout<<"\n\n\n\tDELETE BOOK ...";
    cout<<"\n\nEnter The Book no. of the Book You Want To Delete : ";
    cin>>n;
    fp.open("book.dat",ios::in|ios::out);
    fstream fp2;
    fp2.open("Temp.dat",ios::out);
    fp.seekg(0,ios::beg);
    while(fp.read((char*)&bk,sizeof(book)))
    {
        if(strcmpi(bk.retbno(),n)!=0)  
        {
            fp2.write((char*)&bk,sizeof(book));
        }
    }
        
    fp2.close();
        fp.close();
        remove("book.dat");
        rename("Temp.dat","book.dat");
        cout<<"\n\n\tRecord Deleted ..";
        getch();
}



//***************************************************************
//        function to display all students list
//****************************************************************

void display_alls()
{
    clrscr();
         fp.open("student.dat",ios::in);
         if(!fp)
         {
               cout<<"ERROR!!! FILE COULD NOT BE OPEN ";
               getch();
               return;
         }

    cout<<"\n\n\t\tSTUDENT LIST\n\n";
    cout<<"==================================================================\n";
    cout<<"\tAdmission No."<<setw(10)<<"Name"<<setw(20)<<"Book Issued\n";
    cout<<"==================================================================\n";

    while(fp.read((char*)&st,sizeof(student)))
    {
        st.report();
    }
         
    fp.close();
    getch();
}


//***************************************************************
//        function to display Books list
//****************************************************************

void display_allb()
{
    clrscr();
    fp.open("book.dat",ios::in);
    if(!fp)
    {
        cout<<"ERROR!!! FILE COULD NOT BE OPEN ";
               getch();
               return;
         }

    cout<<"\n\n\t\tBook LIST\n\n";
    cout<<"=========================================================================\n";
    cout<<"Book Number"<<setw(20)<<"Book Name"<<setw(25)<<"Author\n";
    cout<<"=========================================================================\n";

    while(fp.read((char*)&bk,sizeof(book)))
    {
        bk.report();
    }
         fp.close();
         getch();
}



//***************************************************************
//        function to issue book
//****************************************************************

void book_issue()
{
    char sn[6],bn[6];
    int found=0,flag=0;
    clrscr();
    cout<<"\n\nBOOK ISSUE ...";
    cout<<"\n\n\tEnter The student's admission no.";
    cin>>sn;
    fp.open("student.dat",ios::in|ios::out);
        fp1.open("book.dat",ios::in|ios::out);
        while(fp.read((char*)&st,sizeof(student)) && found==0)
           {
        if(strcmpi(st.retadmno(),sn)==0)
        {
            found=1;
            if(st.rettoken()==0)
            {
                      cout<<"\n\n\tEnter the book no. ";
                cin>>bn;
                while(fp1.read((char*)&bk,sizeof(book))&& flag==0)
                {
                       if(strcmpi(bk.retbno(),bn)==0)
                    {
                        bk.show_book();
                        flag=1;
                        st.addtoken();
                        st.getstbno(bk.retbno());
                               int pos=-1*sizeof(st);
                        fp.seekp(pos,ios::cur);
                        fp.write((char*)&st,sizeof(student));
                        cout<<"\n\n\t Book issued successfully\n\nPlease Note: Write the current date                         in backside of your book and submit within 15 days fine Rs. 1 for each day                             after 15 days period";
                    }
                    }
                  if(flag==0)
                        cout<<"Book no does not exist";
            }
                else
                  cout<<"You have not returned the last book ";

        }
    }
          if(found==0)
        cout<<"Student record not exist...";
    getch();
      fp.close();
      fp1.close();
}

//***************************************************************
//        function to deposit book
//****************************************************************

void book_deposit()
{
    char sn[6],bn[6];
    int found=0,flag=0,day,fine;
    clrscr();
    cout<<"\n\nBOOK DEPOSIT ...";
    cout<<"\n\n\tEnter The student’s admission no.";
    cin>>sn;
    fp.open("student.dat",ios::in|ios::out);
    fp1.open("book.dat",ios::in|ios::out);
    while(fp.read((char*)&st,sizeof(student)) && found==0)
       {
        if(strcmpi(st.retadmno(),sn)==0)
        {
            found=1;
            if(st.rettoken()==1)
            {
            while(fp1.read((char*)&bk,sizeof(book))&& flag==0)
            {
               if(strcmpi(bk.retbno(),st.retstbno())==0)
            {
                bk.show_book();
                flag=1;
                cout<<"\n\nBook deposited in no. of days";
                cin>>day;
                if(day>15)
                {
                   fine=(day-15)*1;
                   cout<<"\n\nFine has to deposited Rs. "<<fine;
                }
                    st.resettoken();
                    int pos=-1*sizeof(st);
                    fp.seekp(pos,ios::cur);
                    fp.write((char*)&st,sizeof(student));
                    cout<<"\n\n\t Book deposited successfully";
            }
            }
          if(flag==0)
            cout<<"Book no does not exist";
              }
         else
            cout<<"No book is issued..please check!!";
        }
       }
      if(found==0)
    cout<<"Student record not exist...";
    getch();
  fp.close();
  fp1.close();
  }




//***************************************************************
//        INTRODUCTION FUNCTION
//****************************************************************

void intro()
{
    clrscr();
    gotoxy(35,11);
    cout<<"LIBRARY";
    gotoxy(35,14);
    cout<<"MANAGEMENT";
    gotoxy(35,17);
    cout<<"SYSTEM";
    cout<<"\n\nMADE BY : YOUR NAME";
    cout<<"\n\nSCHOOL : SCHOOL NAME";
    getch();
}



//***************************************************************
//        ADMINISTRATOR MENU FUNCTION
//****************************************************************

void admin_menu()
{
    clrscr();
    int ch2;
    cout<<"\n\n\n\tADMINISTRATOR MENU";
    cout<<"\n\n\t1.CREATE STUDENT RECORD";
    cout<<"\n\n\t2.DISPLAY ALL STUDENTS RECORD";
    cout<<"\n\n\t3.DISPLAY SPECIFIC STUDENT RECORD ";
    cout<<"\n\n\t4.MODIFY STUDENT RECORD";
    cout<<"\n\n\t5.DELETE STUDENT RECORD";
    cout<<"\n\n\t6.CREATE BOOK ";
    cout<<"\n\n\t7.DISPLAY ALL BOOKS ";
    cout<<"\n\n\t8.DISPLAY SPECIFIC BOOK ";
    cout<<"\n\n\t9.MODIFY BOOK ";
    cout<<"\n\n\t10.DELETE BOOK ";
    cout<<"\n\n\t11.BACK TO MAIN MENU";
    cout<<"\n\n\tPlease Enter Your Choice (1-11) ";
    cin>>ch2;
    switch(ch2)
    {
            case 1: clrscr();
                write_student();break;
            case 2: display_alls();break;
            case 3:
                   char num[6];
                   clrscr();
                   cout<<"\n\n\tPlease Enter The Admission No. ";
                   cin>>num;
                   display_sps(num);
                   break;
              case 4: modify_student();break;
              case 5: delete_student();break;
        case 6: clrscr();
            write_book();break;
        case 7: display_allb();break;
        case 8: {
                   char num[6];
                   clrscr();
                   cout<<"\n\n\tPlease Enter The book No. ";
                   cin>>num;
                   display_spb(num);
                   break;
            }
              case 9: modify_book();break;
              case 10: delete_book();break;
             case 11: return;
              default:cout<<"\a";
       }
       admin_menu();
}


//***************************************************************
//        THE MAIN FUNCTION OF PROGRAM
//****************************************************************


main()
{
    char ch;
    intro();
    do
    {
        clrscr();
        cout<<"\n\n\n\tMAIN MENU";
        cout<<"\n\n\t01. BOOK ISSUE";
        cout<<"\n\n\t02. BOOK DEPOSIT";
          cout<<"\n\n\t03. ADMINISTRATOR MENU";
          cout<<"\n\n\t04. EXIT";
          cout<<"\n\n\tPlease Select Your Option (1-4) ";
          ch=getche();
          switch(ch)
          {
            case '1':clrscr();
                 book_issue();
                    break;
              case '2':book_deposit();
                     break;
              case '3':admin_menu();
                 break;
              case '4':exit(0);
              default :cout<<"\a";
        }
        }while(ch!='4');
}

//***************************************************************
//                END OF PROJECT
//***************************************************************