Faculty of Physical Sciences - University of Nigeria, …been using Socialtext wiki software for a...
Transcript of Faculty of Physical Sciences - University of Nigeria, …been using Socialtext wiki software for a...
1
Ukekwe Emmanuel C PG/M.Sc/52449
Development of a Wiki for an Academic Department
Faculty of Physical Sciences
Department of Computer Science
Nwamarah Uche
Digitally Signed by: Content manager’s Name DN : CN = Weabmaster’s name O= University of Nigeria, Nsukka
OU = Innovation Centre
2
Title Page
Development of a Wiki for an Academic
Department
By
Ukekwe Emmanuel .C
PG/MSC/10/52449
Development of a Wiki for an Academic
Department
Being an MSc project report submitted in partial fulfillment of the
requirements for the award of a Master of Science degree in
Computer Science of the University of Nigeria.
Supervisor: Dr. G.A.M Ikekeonwu
Department of Computer Sciene
University of Nigeria, Nsukka
April, 2013
3
CHAPTER ONE
INTRODUCTION
1.0 Introduction
An academic department is a mixture of academic and administrative
beehive of activities. Common administrative activities include meeting
schedule, memos and information dissemination. In most academic departments
it is a common practice to use manual mail boxes as a medium through which
information and memos could be passed across to academic staff members of
the department. This method works perfectly well if staff members are all
physically present and are ready to frequent their mail boxes for mails and
memos. However, in another scenario where a staff member is absent from the
department, it becomes impossible for the staff to keep abreast of issues.
A better approach is to make this mail boxes available to all academic
staff at all times and in all places. A departmental Wiki site makes it possible
for all staff members to read their memo and get informed on administrative and
academic issues of the department. Rodrigo (2007) defines Wiki as a website
whose users can add, modify, or delete its content via a web browser using a
simplified markup language or a rich-text editor. This definition means that staff
members could either modify or contribute to the affairs of the department
whether they are there or not.
In this work, a Wiki site is developed which allows the head of
Department and academic staff members to add content, modify or delete
contents from it. The idea is to present each academic staff’s mail box online
and accessible at all times and to present a major source for academic research
and information exchange for the department.
1.1 Statement of Problem
In an academic system, meetings could be fixed at odd hours, memos
could be released without seeking the opinion of the concerned staff members
4
and meetings are constantly postponed because the concerned representatives
are normally absent, students do not receive a hint on possible project Topics
and research areas before choosing one, Imagine a situation where the H.o.d of
a department could issue a memo calling for a meeting and the invitees could
suggest a better date, time and venue convenient to them before the final release
of the memo. This would be just fine. This project uses a Wiki approach to
solve such academic problems and challenges inherent in every academic
department.
1.2 Objectives
The objectives of this work are;
a. to allow concerned staff members of an academic department to make
input to impromptu and wrongly scheduled meeting memos,
b. to make it possible for academic staff members to edit memos either for
corrective or additive reasons,
c. to give guidelines to students on choice of project research topics,
1.3 Scope of the study
This research work was specifically developed for the academic
department of Computer Science of the University of Nigeria, Nsukka. It could
still be used on any other academic department with slight modifications.
1.4 Significance of the study
Since the site generally allows contributions from the users, the final
output is improved and constantly updated. The department reaches out to its
members either for communication, collaboration, team work or information
update. Again, the site demonstrates how Ajax, could be used to interact with a
database using Msql. Lastly, the work shows that a site could be hosted (without
charge) to serve the basic needs of an academic department.
5
1.5 Limitations of the Study
The developed system requires every academic staff to constantly check
for new memos or information. There is no means to alert them when a new
memo is released. The size of the database is limited based on the subscription
made available for it.
1.4 Literature Review
In the past, Wikis have been developed for academic use. The Wikidot
For Education is a popular Wiki used in education. According to Curtin (2012),
“Wikidot has been an incredibly valuable resource in the classroom - I can use it
for taking notes on my white board, and the students can go home and access
them on their own! I've also got a student-wiki project going (which may or
may not come to fruition…) which helps students connect their work to the
world outside the classroom”. Wikidot For Education uses the most powerful
Wiki syntax and engine and gives you all necessary tools for better education.
Augar & Zhou (2004) avows that Wikis could be used to facilitate
computer supported collaborative learning. This implies that Wiki users could
interact and exchange ideas for group work. Wikis could be used to address a
wide range of situations due their flexibility. Rusu (2011) states that basically, a
wiki could be used whenever you want to use a flexible platform to centralize
information and share it with other people. Lombardo (2008) maintains that
Wikis have been found useful for collaboration work, grant writing, strategic
planning, departmental documentation, and committee work. An article
published by Ecucause (2005), writes “Wikis might be the easiest and most
effective Web-based collaboration tool in any instructional portfolio”. The Wiki
platform provides students with direct and immediate access to a site’s content,
which is crucial in group editing or other collaborative project activities.
Another area where Wikis play a major role in education is in Knowledge
6
management. Sheehy (2009), a teacher writes, “To succeed, an environment
conducive to knowledge sharing is a must-a culture of trust where incentives
and rewards exist for sharing knowledge instead of hoarding it”.
The famous Wikipedia site developed by Jimmy Wales is another
example of academic Wiki. According to Goodnoe (2005), “Thousands of
people police the Wikipedia site (or at least those areas in which they have
expertise), fact-checking and editing as necessary, so the quality of the content
generally remains high”. Similarly, other academic Wiki sites such as The
Library Success Wiki exist which are founded on the same preset as others.
Knowledge management efforts in education should therefore spread into
all parts of the education system and its existing organizational structures, so
that an environment where sharing within the daily routine could be encouraged
and nurtured. Collaborative learning exercises enable students to share authority
and empower themselves with the responsibility of building on their
foundational knowledge (Myers, 1991).
Wikis have been applied to other aspects of life, in Business, Nokia has
been using Socialtext wiki software for a year and a half to facilitate
information exchange within its Insight & Foresight group (Goodnoe, 2005).
Yahoo uses Twiki software to help its development team overcome the
problems associated with working from a variety of separate locations. Michelin
China also uses Twiki as a knowledge management tool . Simonnet (2005),
from the company's IT department, writes, "Our purpose was to share all the
information, procedures, setup documents, so that we were less dependent on a
particular staff member knowledge, so that nobody in the team has any
document left in a personal directory".
Wikis could also be applied in academic management and administration.
Wikis could be used to disseminate memoranda and share administrative
information within an academic department. A memorandum is a relatively
short, written document which is meant to address specific people or groups for
7
the purpose of recording an agreement, transmitting information, making a case,
or enabling action. According to Fendley (2012), a well-written management
memo can communicate important information to a group of employees, ensure
a consistent message to the audience, and save time and money for the firm.
Every management memo that is circulated is aimed at proffering or finding a
solution to a specific problem that borders on the concerns of the organization.
As such, if it is a memo that requires a meeting, it is highly pertinent that every
member or stake holder of that organization should be represented during the
discuss.
Unfortunately, in the academic administrative system, memo schedule is
done without making sure that everybody will be represented. For instance, the
head of a department may wish to convene a meeting by releasing a memo.
Normally, the date of the meeting and the time is decided and fixed by the
originator of the memo (in this case, the head). During the meeting, issues
concerning the department will be discussed; solutions to problems proffered
and suggestions also will be made. If for one reason or the other, the turn out to
such meeting is low, then most decisions will be left pending. Hence, turn out to
such meeting should be improved if the head of the department could use a
Wiki to accept people’s input on the appropriate schedule that could suit most of
the invitees. This is one problem a Wiki could solve. After all, the primary
purpose of a briefing note (memo) is to support decision making, to aid (or
sometimes influence) a decision-maker to make a better decision in a particular
problem situation than he might otherwise have made without analysis and
proper assessment.
8
CHAPTER TWO
THEORETICAL BACKGROUND
2.1 What is a Wiki?
The term "Wiki", is an Hawaiian word meaning "fast" or "quick"
(Mauimapp, 2008). Wiki could be defined from different perspectives. The
definition derives from the meaning of the term. Cunningham (2002), the
developer of the first Wiki software, WikiWikiWeb, originally described it as
"the simplest online database that could possibly work. Similarly, Rodrigo
(2007) defines Wiki as a programming language pattern enabling people not
only to access the data of a Web site but also to change it.
A common feature in these definitions is the ability to edit information
for a common use. Simply put, a Wiki could be defined as a website whose
users can add, modify, or delete its content via a web browser using a simplified
markup language or a rich-text editor. The overriding goal of a wiki is to
become a shared repository of knowledge with the knowledge base growing
over time (Godwin-Jones, 2003).
The first Wiki was called WikiWikiWeb and it was designed by Ward
Cunningham in 1995. Westerdal (2007) stated that the WikiWikiweb is a
foundation on which many other Wiki sites are based. The name
‘WikiWikiWeb’ was conceived by Ward Cunningham in 1994 at a Honolulu
international airport when an airport counter employee casually made a remark
about him taking a "Wiki Wiki Shuttle" bus that runs between the airport's
terminals. Cunningham borrowed the Hawaiian word Wiki to develop the
WikiWikiWeb, which allows users to edit the contents of the site (Cunningham,
2002),( Cunningham, 2007) . Wikis have been defined from different
perspectives. In business, Goodnoe (2005) defines a Wiki as a “medium through
which the company’s intranet could be updated by web folks”. Several large
enterprises have successfully deployed Wikis in their business.
9
Wiki pages are known to support a lot of search engines that enables the
user to quickly locate information in the site. Information in a Wiki site could be
maintained in a database. As such, the site could be a good base for a quick
search and easy retrieval of facts. Most Wikis offer at least a title search, and
sometimes a full-text search. This is dependent on how the database is
structured. Indexed database access is necessary for high speed searches on
large Wikis. Alternatively, external search engines such as Google Search can
sometimes be used on Wikis with limited searching functions in order to obtain
more precise results.
Wikis have a lot of things in common with Blogs or Weblogs. According
to Schwartz, Clark, Cossarin, & Rudolph (2003), “Blogs, or weblogs, are
chronological online journals written mainly by individuals (although group
blogs exist), to which readers post comments”. The main differences between
the two approaches lies on the approach of notification when there is a new
content, editing format and
structure. Blogs typically use RSS (Really Simple Syndication) feeds to sort
information and alert users to new content. Wikis usually use e-mail
notification. For students, an advantage of blogs is the use of ‘What You See Is
What You Get’ (WYSIWYG) editing. On the other hand, Wikis usually employ
a simplified markup formatting (although there are also WYSIWYG wikis.)
Furthermore, Blogs are arranged chronologically, while wiki structure
can be based on hierarchical subject divisions through new page creation and
internal and external hyperlinking. These features make Wikis highly
suitable for educational use. Blogs are more structured but Wikis are more
flexible. Most Wikis include a search feature while many blogs do not. Once a
blog addition is posted, it often cannot be edited.
2.2 How Wikis work
Wikis have two different writing modes, or styles of usage. The first is
known as document mode. When used in document mode contributors create
10
collaborative documents written in the third person. Authors leave their
additions to the wiki document unsigned (Augar & Zhou 2004). As time passes,
multiple authors edit and update the content of the document and gradually the
content becomes a representation of the shared knowledge or beliefs of the
contributors (Leuf & Cunningham, 2001). The second wiki writing mode is
thread mode. Contributors carry out discussions in the wiki environment by
posting signed messages. Others respond leaving the original messages intact
and eventually a group of threaded messages evolves (Leuf etal, 2001). This
two writing modes form the basis of the Academic Wiki software developed in
this work. The memo issued out by the Head of Department progressively
receives contributions and amendments until it is published.
2.3 Construction Technologies
The following technologies were employed in constructing the Wiki
software for an academic department:
2.3.1 Asynchronous Java script and Xml support (Ajax)
The important thing about AJAX is that one can load nearly any kind of
data in the background without disturbing the user. Furthermore you can reload
parts of your site without reloading everything. There are many possible ways
of integrating AJAX technology into a wiki, the most used in this work is in
retrieving memo from the tables without reloading the web pages.
2.3.2 Web Browser Support
The software is designed to run on the internet therefore, a web browser
was used. It runs smoothly on Internet explorer and Firefox.
2.3.3 Text Editor Support
TinyMCE is a Open Source platform independent web based Javascript
HTML editor. TinyMCE provided an editor platform for editing retrieved
11
memos, comments and content was also employed. The TinyMCE text editor is
a rich java script library that provides numerous tools for editing support. Text
could be formatted, edited, or inserted depending on the user’s needs. The
TinyMCE text editor library was imported and used asynchronously with Ajax,
PHP and MSQL to provide editing support in the software.
2.3.4 Markup language support (HTML)
With the aid of HTML language support, the software was made to be
viewed by anyone else connected to the internet. HTML codes were mostly
used together with PHP codes to display information in the software.
2.3.5 Scripting language support (PHP)
PHP programming language was used in connecting all the other
technologies employed to produce the desired output.
2.3.6 Database support (MSQL)
The database component of the software was implemented using MSQL.
A total of six (6) tables were used. The description is as follows:
� tbl_memo :- holds the memos created by the head of Department
� tbl_edit :- holds the individual edits on the created memos
� wiki_users:- holds information about the authorized staff members of the
department
� tbl_content:- holds other contents for research such as project topics and
details
� tbl_admin:- holds information about the head of department
� tbl_publish:- holds the published memos which cannot be edited further
� tbl_students;- holds information about authorized students of the
department
12
CHAPTER THREE
SYSTEM ANALYSIS AND DESIGN
3.1 System Methodology
The proposed system will make use of object oriented programming and
a Unified Modeling language (UML) approach to carefully model the different
components required in the system.
Ambler (2009), states that “object-oriented (OO) paradigm is a
development strategy based on the concept that systems should be built from a
collection of reusable components called objects”.
3.2 System Analysis
The existing system makes use of manual mail boxes usually located
within the general office of the department. Each academic staff has a personal
mail box through which he/she receives mails and memos. In most cases, these
personal mail boxes are actually not personal because other people could easily
have access to such personal mail boxes. Furthermore, the mail boxes are only
useful when one is located within the academic department. It becomes useless
immediately one leaves the vicinity.
The Wiki software makes use of the following objects namely;
head of department, academic staff members and students. Therefore, using an
object oriented design approach and using a Unified Modeling language (UML)
as a tool for modeling the objects, we shall show how these system objects
collaborate with one another to produce the Wiki software. Collaboration
between these objects could involve editing of memo and other content.
3.3 UML Diagrams for the Design
3.3.1 Use case Diagram
In the Use case diagram in figure 1, we have identified three major actors
which are students, staff and H.O.D. A student can interact with a Staff either
by creating knowledge content, editing content or viewing an existing content.
13
A staff interacts with a student and interacts with the H.O.D as well. The H.O.D
is responsible for creating memos which the staff edits. The H.O.D is also
responsible for publishing memos and creating new users to the Wiki software.
Figure 1: use case diagram
3.3.2 Class diagram
Having identified the various actors in the system and how they interact,
the next important step is to show the classes of the system, their inter-
relationships, and the operations and attributes of the classes.
Figure 2 shows a class diagram with five classes. The classes are
� the student class
� the content class
� the staff class
� the H.O.D class
� the memo class.
Create Knowledge Content
Edit Knowledge Content
View Knowledge Content
Comment on Memo
Create Memo
Publish Memo
Create Users
<Student> <Staff>
<H.O.D>
14
The attributes peculiar to each class are also shown. For instance, the ‘student’
class has attributes such as ‘Surname’ and ‘Password’ while the ‘Content’ class
has its attributes as ‘ContentID’, ‘ContentTitle’ ‘Content’ and ‘ContentDate’.
Similarly, the operations performed on each class are also shown under the
class. The ‘Student’ class supports operations like ‘Create’, ‘Edit’ and ‘Delete’
while other classes support different operations. The Associations between
classes are depicted as lines between them. The ‘Student-Content’ class has an
association with a multiplicity of 1 or more (i.e. 1..*) to zero or more (i.e.
0..*). This means that we can have at least one student who may not contribute
to the content of the Wiki. In such manner, the association and multiplicity are
shown for other classes.
figure 2: Class diagram
1..* 0..* 0..* 1..* 1..* 1..* 0..* 0..*
Student *Surname: String *Password:String *Create Student *Edit Student *Delete Student
Content
*ContentID: Int *ContentTitle:string *Content: String *ContentDate:Date *Create Content *Edit Content *Delete Content *View Content
Staff *Surname: String *Password: String *Create Staff *Edit Staff *Delete Staff
H.O.D *Surname: String *Password:String *Create H.O.D *Edit H.O.D *Delete H.O.D
Memo
*MemoID: Int *MemoTitle:String *MemoDate: Date *Memo:String *Create Memo *Edit Memo *Delete Memo *Publish Memo
*View Content
Manage Content
Manage Content
Input To memo Manage Memo
15
3.3.3 Activity diagram Using an Activity diagram, we have represented the system workflows in
a graphical way in figure 3.The first activity requires the user to login using the
surname and password. Once these are verified, the Home page is displayed. In
Home page, possible activities for the user include Content management, memo
management, Research and Log out. The user selects any of the activities and
proceeds.
Figure 3: Activity diagram
Error
Enter Surname & Password
Correct ?
Yes
Display Home Page
No
Memo management Academic Programmes Project Topics Log out Research
16
CHAPTER FOUR
SYSTEM IMPLEMENTATION
4.1 System Achitecture
The system architecture is shown in figure 4, figure 5, figure 6, figure 7,
figure 8, figure 9, figure 10, figure 11, figure 12 and figure 13.
Figure 4 memo page
Figure 4:Memo page
Screenshot 1: Index Page
A user can log in as a H.O.D, Staff or Student. Once the user supplies the username
and password, they are sent to a file on the server (checklogin.php) for verification.
Once the user is authenticated, the Homepage is displayed using the homepage.php
User logs in
create memo edit memo revise memo publish memo
Index Page
Staff Log in Student Log in H.O.D Log in
17
file. The Homepage has the following links, create memo, edit memo, revise memo
and publish memo. The Create memo link calls up the create.php file to perform the
actions in figure 5.
Figure 4: memopage
Figure 5: create memo
The edit memo link calls up the selectmemo.php file which uses Ajax to update
recent memo additions and display it in a combo for the user to select. If a
memo is selected, Ajax sends the selected memo to memoget.php file which
searches for a one to one correspondence memo from tbl_memo and retrieves
all the memos that match the search criteria. At this stage, the user could easily
select the actual memo from a list of matching memo from different
contributors. Once the actual memo is selected, it opens in an editing mode
using the editor.php file. The sequence of actions are summarized in figure 6
Figure 6: edit memo
*Create memo *Open a text editor for typing memo *Save typed memo in tbl_memo
*edit memo *display a list of existing memo from tbl_memo for selection *send a query to tbl_edit using memoid as search parameter *display content, contributors and time of all memos having the same id *select from the list the actual memo for editing *send a query to tbl_edit using memoid as parameter *retrieve selected memo *display retrieved memo in a text area of a text editor *edit/format the memo *add memo to tbl_edit
18
Screenshot 2: Homepage
Screen shot 3: Select memo
19
Screen shot 4: Selected memo displayed
Screen shot 5: Memo in Editor mode
20
Similarly, the revise memo link calls up the Revise.php file which displays the current
memo contributions. The objective is to glance through the contributions and select
the most appropriate among them which could be revised and saved to await more
contributions. The Revise.php sends the user selection to editrevise.php which opens
the selected memo in a text editor using the file editorrevise.php. The sequence of
actions is also shown in Figure 7.
Figure 7: revise memo
Again, if the Publish memo link is activated, the publish.php file retrieves all existing
memos from tbl_memo so that the user could select the intended memo for publishing.
The selected memo is sent to editpublish.php file also on the server which narrows the
search down to only contributions made to the specific selected memo. The selected
memo opens for further editing if necessary. It could now be published. When a memo
is published, it is automatically deleted from tbl_memo and tbl_edit so that no further
occurrences of such memo could be seen. Figure 8 shows the steps.
*revise memo *display a list of existing memo from tbl_memo for selection *send a query to tbl_edit using memoid as search parameter *display content, contributors and time of all memos having the same id *select from the list the actual memo for revision *send a query to tbl_edit using memoid as parameter *retrieve selected memo *display retrieved memo in a text area of a text editor *edit/format the memo
*replace old memo with new memo
21
Figure 8: Publish memo
When a memo is published, it cannot be edited again but it can be read. Figure 9
summarizes the sequence of actions to read a published memo
Figure 8: publish memo
Figure 9: read published memo
Figure 10: content page
*publish memo *display a list of existing memo from tbl_memo for selection *send a query to tbl_edit using memoid as search parameter *display content, contributors, and time of all memos having the same id *select from the list the actual memo to publish *send a query to tbl_edit using memoid as parameter *retrieve selected memo *display retrieved memo in a text area of a text editor *edit/format the memo if need be *add memo to tbl_publish *delete memo from tbl_memo and tbl_edit
*read published memo *display a list of published memo from tbl_publish for selection *send a query to tbl_publish using memoid as search parameter *retrieve and display published memo in a read only mode
User logs in
create content view content Delete content
22
From the homepage, a user can also access the content page by clicking on the
research link. The user has the options of creating a new content, viewing existing
content or deleting existing content depending on the log in rights. Figures 11, 12 and
13 describes the sequence of actions for each respectively.
Figure 11: create content
Figure 12: view content
Figure 13: create memo
*Create content *Open a text editor for typing content
*Save typed content in tbl_content
*view content *display a list of content from tbl_content for selection *send a query to tbl_content using memoid as search parameter *retrieve and display content in a read only mode
*delete content *display a list of content from tbl_content for selection *send a query to tbl_content using memoid as search parameter *retrieve and display content *delete content
23
CHAPTER FIVE
SUMMARY AND CONCLUSION
In order to aid an academic department to function smoothly on academic and
administrative issues, an online academic Wiki has been developed. This Wiki ensures
that academic staff of a department could promptly contribute to the affairs of the
department, be well informed on critical developments in the department without
having to be physically present. An academic head of department could initiate a
memo online thereby allowing other academic staff members to contribute to the
memo. Through this medium, a Wiki is initiated. Users could then modify, edit,
contribute to memos from wherever they are.
The Wiki software developed in this work employs such technologies as Ajax,
TinyMce text editor, Msql database, Html markup language and PHP as a
programming support. The Ajax technology quickly retrieves memos from the
database without page reload, the text editor presents the retrieved memos in an text
area for editing, the memos are returned to the database after editing. The Html and
PHP provide a complimentary support for graphics and other objects which are tools
for the users.
The Wiki software developed in this work provides an interacting medium
between academic staff of a department but it does not provide an instant notification
when a new memo arrives. The work could be developed further by introducing such
mechanisms that alerts users of the Wiki when a new memo arrives.
24
References
Ambler, Scott. (2009). Introduction to Object-Orientation and the UML. Retrieved http://www.agiledata.org/:
Augar, N., Raitman, R. & Zhou, W. (2004). Beyond the comfort zone. Proceedings of the 21st ASCILITE Conference. Teaching and learning online with wikis.
Cunningham, Ward, (2002). What is a Wiki, WikiWikiWeb. Retrieved June, 27, 2002 :http://www.wiki.org/wiki.cgi.
Cunningham, Ward. (2007). Wiki Wiki Hyper Card, WikiWikiWeb. Retreived July 26, 2007: http://c2.com/cgi/wiki?WikiWikiHyperCard.
Curtin John (2012) “Wikidot In Education” http://www.wikidot.com/learnmore:education
Educause (2005). Advanced learning through IT innovation. Retreived July, 2005: http://net.educause.edu/ir/library/pdf/ELI7004.pdf.
Fendley, Liz. (2012). How to Write a Management Memo. http://www.ehow.com/how_7148692_write-management-memo.html.
Godwin-jones, B. (2003). Blogs and wikis: Environments for on-line collaboration. [Electronic version]. Language, Learning and Technology, 7(2), 12-16. Retrieved December 4, 2004 from http://llt.msu.edu/vol9num1/emerging/default.html. Goodnoe, Ezra. (2005). How to use Wikis for business. Retreived August 8, 2005: http://www.informationweek.com/news/167600331. Leuf, B. & Cunningham, W. (2001). The Wiki way: Quick collaboration on the
Web. Upper Saddle River, NJ, USA: Addison Wesley.
Lombardo N.T.(2008). Putting Wikis to Work in Libraries: 27, Medical Reference Services Quarterly, pp. 129–145, Retreived June, 2008: http://www.tandfonline.com/action/doSearch?stemming=yes&searchText=Putting+Wikis+to+Work+in+Libraries.
25
Mauimapp (2008). Hawaiian Words; Hawaiian to English. Retreived September 19, 2008: from Mauimapp website: http://www.mauimapp.com/moolelo/hwnwdshw.htm.
Myers, J. (1991). Cooperative learning in heterogeneous classes. Cooperative Learning, 11(4).
Rodrigo B.A, (2007). On the Evolution of Wikipedia: Computer Science Department. Los Angeles – USA and ICWSM 2007 Boulder, Colorado,USA
Rusu, Silvia (2011). What is a wiki and what can it be used for?. Retreved December,
2011: http://enterprise.xwiki.org/xwiki/bin/view/GettingStarted/WhatIsAWiki.
Schwartz, L. Clark, S. Cossarin, M. & Rudolph, J.(2003). Educational Wikis:
features and selection criteria. Retrived November, 2003: Athabasca University, Centre for distance education.
Sheehy (2009). The wiki as knowledge repository: Using a wiki in a community of practice to strengthen K-12 education . Retreived February, 2009:
http://ateacherswrites.wordpress.com/2009/02/02/the-wiki-as-knowledge-repository-using-a-wiki-in-a-community-of-practice-to-strengthen-k-12-education/.
Simonne, JeanNoel (2004). TWiki Success Story of Michelin China. Retreved Dec, 2004: http://twiki.org/cgi-bin/view/Main/TWikiSuccessStoryOfMichelinChina.
Westerdal, Jay (2007). “Ward Cunningham the Father of Wiki becomes CTO of AboutUs.org. Retreived May, 2007: http://blog.domaintools.com/2007/05/ward-cunningham-the-father-of-wiki-becomes-cto-of-aboutusorg/.
26
Appendices
Appendix 1: Index Page <!DOCTYPE html PUBLIC ""> <html> <head> <script type="text/javascript"> function clear_session() { <?php session_destroy();?>} </head> <body onload="clear_session()"> </script> <title>Wikidemic: Home Page</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </head> <body> <div align="center" class="style7"> <div align="center"><font face="Times New Roman"> <font size="5" color="#008000">DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF NIGERIA, NSUKKA</font></a><br /> </font> <table width="80%" border="0" cellpadding="0" cellspacing="0" bgcolor="#009966"> <tr> <td> <p align="center"><b><font face="Times New Roman" color="#F0F936"> <marquee>WELCOME TO WIKIDEMIC SITE</marquee></font></b></td> </tr> <tr> <td> </tr> </table> <p align="center"><b><font face="Times New Roman" size="3" color="#F0F936"> <span style="background-color: #009966"> <p align="center"><span style="background-color: #009966"><b> <span style="background-color: #FFFFFF"><b> <font color="red" face="Times New Roman" size="4"> </div> <!-- BEGIN PAGE WRAPPER --> <div id="page"> <!-- BEGIN PAGE HEADER --> <div id="header">
27
<center><h2>Wikidemic HomePage                                                         <a class="" href="http://csdept.me.pn/studentlogin.php">Student Login|<a> <a class="" href="http://csdept.me.pn/userlogin.php">Staff Login|<a><a class="" href="http://csdept.me.pn/Adminlogin.php">H.O.D Login</a></h2></h2> <ul class="menu" id="main_menu"> </div> <!-- END PAGE HEADER --> <!--starting page content--> <div id="content"> <!-- Header ID generation took 0.001234 seconds --><img src="http://csdept.me.pn/images/wiki_logo.jpg" alt="wiki logo" title="Wiki site" /><br /><br /><hr /> <div class="floatl"><h5 id="get"></a></h5> <h5>Get academic Research Topics on related field of study with short abstract for a guide. You can also create your own content <br /></div></a></h5> <h5>View a list of approved, assigned or written Projects in the department and at the same time add your own topic to the list</a><h5>.<hr /> <div class="floatr"><h5 id="memo"></a></h5> <h5>Get updated with current administrative memos. What is more! You can edit or contribute to such Memos, exchange ideas with other staff members and lots more!.</a>!</div><h3 id=""></a></h5> <br />Get information on the academic programme schedule of the department and the courses available for registration.</a></a><br /> </div><!--closing page content--> <!-- BEGIN PAGE FOOTER --> <div id="footer"> <ul class="menu" id="options_menu"> </div> <!-- END PAGE FOOTER --> <!-- BEGIN SYSTEM INFO --> <!--Page was generated in 0.1732 seconds--> </div> <!-- END PAGE WRAPPER --> </body> </html> Appendix 2: Admin Login
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Wikidemic: Login Page</title> <base href="http://csdept.me.pn" /> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" />
28
<meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light1.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </head> <body> <!-- BEGIN PAGE WRAPPER --> <div id="page"> <div id="header"> <br /> <br /> <p align="center"><b><font face="Times New Roman"> <marquee>Login with Your Username and Password</marquee></font></b></td> </div> <!-- END PAGE HEADER --> <!--starting page content--> <form action="adminchecklogin.php" method="post" form name="form1"> <input type="hidden" name="myusername" value="myusername" /> <center><table width="100" bgcolor="#AAAAAA" style="background-color: #ffffff"> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">Username</span></td> <td bgcolor="#AAAAAA"> </br> <input style="width: 150px" name="myusername" type="text" value="" size="20"/></td> </tr> </br> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">Password</span></td> <td bgcolor="#AAAAAA"> </br> <input style="width: 150px" name="mypassword" type="password" size="20"/></td> </tr> <tr><td bgcolor="#AAAAAA"> </td> <td bgcolor="#AAAAAA"><input type="submit" value="Login" /></td> </tr> </table> </form> <center><h4><a href=index.php>[Cancel Login]</a> <!-- END PAGE FOOTER --> <!-- BEGIN SYSTEM INFO --> <!-- END PAGE WRAPPER --> </body> </html> Appendix 3: Admin Checklogin <?php
29
$host="fdb2.freehostingeu.com"; // Host name $username="1111045_wiki"; // Mysql username $password="shapiro4all"; // Mysql password $db_name="1111045_wiki"; // Database name $tbl_name="tbl_admin"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE surname='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:Homepage.php"); } else { echo "Wrong Name or Password"; } ?> <html> <Head> <li><h4><a class="" href="http://csdept.me.pn/index.php">Retry</a></h4> .<html/> Appendix 4: Home Page <?php session_set_cookie_params(0); session_start(); $username = $_SESSION['myusername']; $myusername = $username; $myusername = strtoupper(stripslashes($myusername)); ?>
30
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Wikidemic: Welcome To Wikidemic</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </head> <body> <div align="center" class="style7"> <div align="center"><font face="Times New Roman"> <font size="5" color="#008000">DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF NIGERIA, NSUKKA</font></a><br /> </font> <table width="80%" border="0" cellpadding="0" cellspacing="0" bgcolor="#009966"> <tr> <td> <p align="center"><b><font face="Times New Roman" color="#F0F936"> <marquee><?php echo "WELCOME ".$myusername; echo ", YOU HAVE SUCCESSFULLY LOGGED IN.";?></marquee></font></b></td> </tr> <tr> <td> </tr> </table> <p align="center"><b><font face="Times New Roman" size="3" color="#F0F936"> <span style="background-color: #009966"> <p align="center"><span style="background-color: #009966"><b> <span style="background-color: #FFFFFF"><b> <font color="red" face="Times New Roman" size="4"> </div> <!-- BEGIN PAGE WRAPPER --> <div id="page"> <!-- BEGIN PAGE HEADER --> <div id="header"> <ul class="menu" id="main_menu">
31
<li><li><h2><a class="" href="http://csdept.me.pn/memopage.php">Memos</a></h2> </li> <li><li><li><h2><a class=""http://csdept.me.pn/">Project Topics</a></h2> </li> <li><li><li><h2><a class="" href="http://csdept.me.pn/Researchpage.php">Research</a></h2> </li> <li><li><li><h2><a class=""http://csdept.me.pn/">Academic Programmes</a></h2> </li> <li><li><li><h2><a class="" href="http://csdept.me.pn/settings.php">User Settings</a></h2> </li> <li><li><li><h2><a class="" href="http://csdept.me.pn/logout.php">Logout</a></h2> </li> </ul> </div> <!-- END PAGE HEADER --> <!--starting page content--> <div id="content"> <!-- Header ID generation took 0.001234 seconds --><img src="http://csdept.me.pn/images/wiki_logo.jpg" alt="wiki logo" title="Wiki site" /><br /><br /><hr /> <div class="floatl"><h5 id="get"></a></h5> <h5>Get academic Research Topics on related field of study with short abstract for a guide. You can also create your own content <br /></div></a></h5> <h5>View a list of approved, assigned or written Projects in the department and at the same time add your own topic to the list</a><h5>.<hr /> <div class="floatr"><h5 id="memo"></a></h5> <h5>Get updated with current administrative memos. What is more! You can edit or contribute to such Memos, exchange ideas with other staff members and lots more!.</a>!</div><h3 id=""></a></h5> <br />Get information on the academic programme schedule of the department and the courses available for registration.</a></a><br /> </div><!--closing page content--> <!-- BEGIN PAGE FOOTER --> <div id="footer"> <ul class="menu" id="options_menu"> </div> <!-- END PAGE FOOTER --> <!-- BEGIN SYSTEM INFO --> <!--Page was generated in 0.1732 seconds--> </div> <!-- END PAGE WRAPPER --> </body> </html> Appendix 5: Memo Page
<?php session_start(); $username = $_SESSION['myusername'];
32
$myusername = $username; $myusername = strtoupper(stripslashes($myusername)); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Wikidemic: Welcome To Wikidemic</title> <meta name="generator" content="csdept" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </head> <body> <div align="center" class="style7"> <div align="center"><font face="Times New Roman"> <font size="5" color="#008000">DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF NIGERIA, NSUKKA</font></a><br /> </font> <table width="80%" border="0" cellpadding="0" cellspacing="0" bgcolor="#009966"> <tr> <td> <p align="center"><b><font face="Times New Roman" color="#F0F936"> <marquee><?php echo "WELCOME ".$myusername; echo ", YOU HAVE SUCCESSFULLY LOGGED IN.";?></marquee></font></b></td> </tr> <tr> <td> </tr> </table> <p align="center"><b><font face="Times New Roman" size="3" color="#F0F936"> <span style="background-color: #009966"> <p align="center"><span style="background-color: #009966"><b> <span style="background-color: #FFFFFF"><b> <font color="red" face="Times New Roman" size="4"> </div> <!-- BEGIN PAGE WRAPPER --> <div id="page"> <!-- BEGIN PAGE HEADER --> <div id="header"> <ul class="menu" id="main_menu"> <li><h4><a class="" href="http://csdept.me.pn/create.php">[Create Memo]</a></h4>
33
<li><li><h4><a class="" href="http://csdept.me.pn/selectmemo.php">[Edit Memo]</a></h4> <li><li><h4><a class="" href="http://csdept.me.pn/Revise.php">[Revise Memo]</a></h4> <li><li><h4><a class="" href="http://csdept.me.pn/Publish.php">[Publish Memo]</a></h4> <li><li><h4><a class="" href="http://csdept.me.pn/readpublishmemo.php">[Read Published Memo]</a></h4> <li><li><h4><a class="" href="http://csdept.me.pn/logout.php">[Logout]</a></h4> </li> </ul> </div> <!-- END PAGE HEADER --> <!--starting page content--> <div id="content"> <!-- Header ID generation took 0.001234 seconds --><img src="http://csdept.me.pn/images/wiki_logo.jpg" alt="wiki logo" title="Wiki site" /><br /><br /><hr /> <div class="floatl"><h5 id="get"></a></h5> <h5>Get academic Research Topics on related field of study with short abstract for a guide. You can also create your own content <br /></div></a></h5> <h5>View a list of approved, assigned or written Projects in the department and at the same time add your own topic to the list</a><h5>.<hr /> <div class="floatr"><h5 id="memo"></a></h5> <h5>Get updated with current administrative memos. What is more! You can edit or contribute to such Memos, exchange ideas with other staff members and lots more!.</a>!</div><h3 id=""></a></h5> <br />Get information on the academic programme schedule of the department and the courses available for registration.</a></a><br /> </div><!--closing page content--> <!-- BEGIN PAGE FOOTER --> <div id="footer"> "<center><h4><a href=Homepage.php>Homepage</a> | <a href="">Project Topics</a> | <a href=Researchpage.php>Research</a> | <a href="">Academic Programme</a> | <a href=logout.php>Logout</a> <ul class="menu" id="options_menu"> </div> <!-- END PAGE FOOTER --> <!-- BEGIN SYSTEM INFO --> <!--Page was generated in 0.1732 seconds--> </div> <!-- END PAGE WRAPPER --> </body> </html>
Appendix 6: Select memo
<?php session_start(); $username = $_SESSION['myusername']; $myusername = $username; if(isset($_POST['save'])) {
34
print "<pre>"; print_r($_POST); print "</pre>"; } echo "<center><h4><a href=Homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href=>Project Topics</a> | <a href=Researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </li><li> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>select memo</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" />
35
<link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </li><li> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4./jquery.min.js"></script> <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","memoget.php?q="+str,true); xmlhttp.send(); } </script> <!-- /TinyMCE --> </head> <body> <h3><center>Select Memo to view Recent Contributions<h3> <form><center> <select name="users" onchange="showUser(this.value)"> <option selected="selected"></option> <?php
36
include('checklogin1.php'); $sql=mysql_query("select Title, Dated, memoid, Timed, link from tbl_memo"); while($row=mysql_fetch_array($sql)) { $id=$row['memoid']; $Title=$row['Title']; $Dated=$row['Dated']; $Timed=$row['Timed']; $link=$row['link']; echo '<option value='.$link.'>'.$Title.'><'.$Dated.'></option>'; } ?> </select> </form> <br /> <div id="txtHint"><b>Memo Details will Display here.</b></div> </body> </html> Appendix 7: Memo Get <?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } ?> </head> <body> <?php $q=$_GET["q"]; $link = $q; $con = mysql_connect('fdb2.freehostingeu.com', '1111045_wiki', 'shapiro4all'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("1111045_wiki", $con); $sql="SELECT * FROM tbl_edit WHERE link = '".$q."'"; $result = mysql_query($sql); echo "<table border='1' bgcolor='#CCCCCC'>
37
<tr> <th>Title</th> <th>Content</th> <th>Contributor</th> <th>Time</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Title'] . "</td>"; echo "<td>" . $row['content'] . "</td>"; echo "<td>" . $row['user'] . "</td>"; echo "<td>" . $row['Timed'] . "</td>"; echo "</tr>"; } echo "</table>"; ?> <form action="editmemoget.php" method="post" form name="form1"> <input name="link" type="hidden" id="link" size="12" value="<?php echo $link; ?>" <input type="submit" name="save" value="Submit" /> <input type="submit" name="Save" value="Edit The Memo" /> </body> </html
Appendix 8: Edit memo Get <?php session_start(); $username = $_SESSION['myusername']; $myusername = $username; if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } echo "<center><h4><a href=Homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href=>Project Topics</a> | <a href=researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a>"; ?>
38
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </li><li> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>select memo</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" />
39
</li><li> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4./jquery.min.js"></script> <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","memoget2.php?q="+str,true); xmlhttp.send(); } </script> <!-- /TinyMCE --> </head> <body> <h3><center>Select Memo to Edit<h3> <form><center> <select name="users" onchange="showUser(this.value)"> <option selected="selected"></option> <?php include('checklogin1.php'); $link=$_POST['link']; $sql="SELECT * FROM tbl_edit WHERE link = '$link'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $id=$row['memoid'];
40
$user=$row['user']; $Timed=$row['Timed']; $Dated=$row['Dated']; $Title=$row['Title']; $content=$row['content']; echo '<option value='.$id.'>'.$Title.'<>'.$user.'><'.$Timed.'><'.$Dated.'></option>'; } ?> </select> </form> <br /> <div id="txtHint"><b></b></div> </body> </html> Appendix 9: Memo get 2 <?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } ?> </head> <body> <?php $q=$_GET["q"]; $con = mysql_connect('fdb2.freehostingeu.com', '1111045_wiki', 'shapiro4all'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("1111045_wiki", $con); $sql="SELECT * FROM tbl_edit WHERE memoid = '".$q."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { "<tr>"; "<td>" . $row['Title'] . "</td>"; "<td>" . $row['content'] . "</td>"; "<td>" . $row['user'] . "</td>"; "<td>" . $row['Timed'] . "</td>";
41
"</tr>"; } $memoid = $q; ?> <form action="editormemoget.php" method="post" form name="form1"> <input name="memoid" type="hidden" id="memoid" size="5" value="<?php echo $memoid; ?>" <input type="submit" name="save" value="Submit" /> <input type="submit" name="Save" value="Continue" /> </body> </html Appendix 10: Editor memoget
<?php session_start(); $username = $_SESSION['myusername']; $myusername = $username; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Edit Memo</title> <meta name="generator" content="Wikidemic" />
42
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <center><h4><a href=homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href=>Project Topics</a> | <a href=researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a> </li><li> <!-- TinyMCE --> <script type="text/javascript" src="http://csdept.me.pn/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script > <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount", // Theme options
43
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <?php $memoid=$_POST['memoid']; $con = mysql_connect("fdb2.freehostingeu.com","1111045_wiki","shapiro4all"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("1111045_wiki"); $query = "SELECT * FROM tbl_edit where memoid=$memoid"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); $contents = $row['content']; $Title = $row['Title']; $Dated = $row['Dated']; $link = $row['link'];
44
?> <form method="post" action="insertforupdate.php"> <div> <h2><center>Edit your memo and Click on Submit button when done.</h2> </li> <a><h2> </a></h2> <a><h2> </a></h2> </p> <?php $Dated=date('d-m-Y'); ?> <label for="title"><strong>Memo Title </label> <input name="Title" type="text" id="title" size="77" value="<?php echo $Title; ?>" <label for="Dated"><strong>Date:[DD-MM-YYYY] </label> <input name="Dated" type="text" id="Dated" size="12" value="<?php echo $Dated; ?>" <div> <textarea id="elm1" name="elm1" rows="25" cols="80" style="width: 80%"> <?php echo $contents; ?> </textarea> </div> </div> <!-- Some integration calls --> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Make Content Bold]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a> <form action="editormemoget.php" method="post" form name="form1">
45
<input name="memoid" type="hidden" id="memoid" size="5" value="<?php echo $memoid; ?>" <input type="submit" name="save" value="Submit" /> <input type="reset" name="reset" value="Reset"/> <input type="submit" name="save" value="Submit" /> </div> <?php echo "Contributor name is " .$myusername; ?> <input name="link" type="hidden" id="link" size="5" value="<?php echo $link; ?>" </form </body> </html> Appendix 11: Insertforupdate
<?php session_start(); $myusername = $_SESSION['myusername']; ?> <?php $con = mysql_connect("fdb2.freehostingeu.com","1111045_wiki","shapiro4all"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("1111045_wiki"); $elm1=$_POST['elm1']; $Dated=$_POST['Dated']; $Title=$_POST['Title']; $link=$_POST['link']; date_default_timezone_set('Africa/Lagos'); $Timed = date('h:i:s a', time()); $sql="INSERT INTO tbl_edit(Title, Dated, Content, user, Timed, link) values('$Title', '$Dated', '$_POST[elm1]', '$myusername', '$Timed', '$link')"; if (!mysql_query($sql,$con)) {
46
die('Error: ' . mysql_error()); } date_default_timezone_set('Africa/Lagos'); $Timed = date('h:i:s a', time()); echo "Hello " .$myusername; echo " Your Input was suceesfully added at exactly ".$Timed; ?> <html> <Head> <li><h4><a class="" href="http://csdept.me.pn/Homepage.php">Homepage</a></h4> .<html/> Appendix 12: Publish memo
<?php session_start(); $username = $_SESSION['myusername']; $myusername = $username; if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } echo "<center><h4><a href=homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href=>Project Topics</a> | <a href=researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </li><li> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>select memo</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </li><li> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4./jquery.min.js"></script> <script type="text/javascript"> function showUser(str) {
47
if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getpublish1.php?q="+str,true); xmlhttp.send(); } </script> <!-- /TinyMCE --> </head> <body> <h3><center>Select Memo to view Recent Contributions<h3> <form><center> <select name="users" onchange="showUser(this.value)"> <option selected="selected"></option> <?php include('checklogin1.php'); $sql=mysql_query("select Title, Dated, memoid, Timed, link from tbl_memo"); while($row=mysql_fetch_array($sql)) { $id=$row['memoid']; $Title=$row['Title']; $Dated=$row['Dated']; $Timed=$row['Timed']; $link=$row['link']; echo '<option value='.$link.'>'.$Title.'><'.$Dated.'></option>'; } ?> </select> </form> <br /> <div id="txtHint"><b>Memo Details will Display here.</b></div> </body> </html>
48
Appendix 13: Insert memo
<?PHP $Title=$_POST['Title']; $Dated=$_POST['Dated']; $elm1=$_POST['elm1']; $link=$_POST['link']; $user = 'H.O.D'; if ($Title == "") { header("location:create.php"); exit(); } $user_name = "1111045_wiki"; $password = "shapiro4all"; $database = "1111045_wiki"; $server = "fdb2.freehostingeu.com"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); date_default_timezone_set('Africa/Lagos'); $Timed = date('h:i:s a', time()); if ($db_found) { $SQL = "INSERT INTO tbl_memo (Title, Dated, content, Timed, link) VALUES ('$Title', '$Dated','$elm1','$Timed', '$link')"; $result = mysql_query($SQL); $SQL = "INSERT INTO tbl_edit (Title, Dated, content,user, Timed, link) VALUES ('$Title', '$Dated','$elm1','$user','$Timed','$link')"; $result = mysql_query($SQL); mysql_close($db_handle); Echo "Memo successfully Created"; } else { print "Database NOT Found "; mysql_close($db_handle); } ?> <html> <Head> <li><h4><a class="" href="http://csdept.me.pn/Homepage.php">Homepage</a></h4> .<html/> Appendix 14: Insert Publish
<?php session_start(); $username = $_SESSION['myusername']; $myusername = $username; ?>
49
<?php $con = mysql_connect("fdb2.freehostingeu.com","1111045_wiki","shapiro4all"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("1111045_wiki"); $memoid=$_POST['memoid']; $elm1=$_POST['elm1']; $Dated=$_POST['Dated']; $Title=$_POST['Title']; $link=$_POST['link']; date_default_timezone_set('Africa/Lagos'); $Timed = date('h:i:s a', time()); $sql="INSERT INTO publish(Title, Dated, Content, user) values('$Title', '$Dated', '$_POST[elm1]', '$myusername')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } $Timed = date('H:ia'); mysql_query("DELETE FROM tbl_memo WHERE link='$link'"); mysql_query("DELETE FROM tbl_edit WHERE link='$link'"); echo "Hello " .$myusername; echo " Your Input was suceesfully added at exactly ".$Timed; ?> <html> <Head> <li><h4><a class="" href="http://csdept.me.pn/Homepage.php">Homepage</a></h4> .<html/> Appendix 15: Insert Revise <?php session_start(); $username = $_SESSION['myusername']; $myusername = $username; ?> <?php $con = mysql_connect("fdb2.freehostingeu.com","1111045_wiki","shapiro4all"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("1111045_wiki"); $memoid=$_POST['memoid']; $elm1=$_POST['elm1']; $Dated=$_POST['Dated']; $Title=$_POST['Title']; $link=$_POST['link']; date_default_timezone_set('Africa/Lagos');
50
$Timed = date('h:i:s a', time()); $sql="UPDATE tbl_edit SET Title =('$Title'),content=('$_POST[elm1]'), Dated = ('$Dated'), Timed=('$Timed'), link=('$link') WHERE memoid='$memoid'"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } date_default_timezone_set('Africa/Lagos'); $Timed = date('h:i:s a', time()); echo "Hello " .$myusername" "; echo " Your Input was suceesfully added at exactly ".$Timed; ?> <html> <Head> <li><h4><a class="" href="http://csdept.me.pn/Homepage.php">Homepage</a></h4> .<html/> Appendix 16: Addcontent <?php session_start(); $myusername = $_SESSION['myusername']; if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Add Content</title> <center>"<a href=Homepage.php>Homepage</a> | <a href="memopage.php">Memos</a> | <a href="">Project Topics</a> | <a href=Researchpage.php>Research</a>| <a href="">Academic Programme</a> | <a href=logout.php>Logout</a>"; <!-- TinyMCE --> <script type="text/javascript" src="http://localhost/Wikidemic/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script > <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount", // Theme options
51
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <!-- /TinyMCE --> </head> <body> <form method="post" action="insertcontent.php"> <div> <a><h2><center>Add Content using an Editor platform. Click on Submit button when done<center></a></h2> </li> <a><h2> </a></h2> <a><h2> </a></h2> </p> <div>
52
<div> <?php $Dated=date('d-m-Y'); ?> <label for="title"><strong>Content Title </label> <input id="title" type="text" name="Title" size="77"/> <label for="Dated"><strong>Date:</label> <input name="Dated" type="text" id="Dated" size="12" value="<?php echo $Dated; ?>" </p> <div> <center><textarea id="elm1" name="elm1" rows="25" cols="80" style="width: 65%"</center> <a><h2><center><strong>Abstract<strong><center></a></h2> </textarea> </div> <!-- Some integration calls --> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Make Content Bold]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a> <input type="submit" name="save" value="Submit" /> <input type="reset" name="reset" value="Reset" /> </div> </form> </body> </html> Appendix 17: Adduser
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
53
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Wikidemic: Welcome To Wikidemic</title> <meta name="generator" content="csdept" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" />
54
</head> <body> <div align="center" class="style7"> <table width="80%" border="0" cellpadding="0" cellspacing="0" bgcolor="#009966"> <tr> <td> <p align="center"><b><font face="Times New Roman" color="#F0F936"> <marquee><?php echo "SELECT USER CATEGORY";?></marquee></font></b></td> </tr> <tr> <td> </tr> </table> <p align="center"><b><font face="Times New Roman" size="3" color="#F0F936"> <span style="background-color: #009966"> <p align="center"><span style="background-color: #009966"><b> <span style="background-color: #FFFFFF"><b> <font color="red" face="Times New Roman" size="4"> </div> <body> <center><form method="post" action="userselect.php"><center> <br/> <select name="category"> <option value="Select">Select user category here</option> <option value="Student">******Student******</option> <option value="Staff">********Staff********</option></select><br /> <br> <input type="submit" value="submit" name="submit"> </form> Appendix 18: Change
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
55
<title>Wikidemic: Change Page</title> <base href="http://localhost/Wikidemic" /> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light1.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </head> <body> <!-- BEGIN PAGE WRAPPER --> <div id="page"> <div id="header"> <br /> <br /> <p align="center"><b><font face="Times New Roman"> <marquee>Enter the old Username and Password</marquee></font></b></td> </div> <!-- END PAGE HEADER --> <!--starting page content--> <form action="hodchecklogin.php" method="post" form name="form1"> <input type="hidden" name="myusername" value="myusername" /> <center><table width="100" bgcolor="#AAAAAA" style="background-color: #ffffff"> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">Old Username</span></td> <td bgcolor="#AAAAAA"> </br> <input style="width: 150px" name="myusername" type="text" value="" size="20"/></td> </tr> </br> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">Old Password</span></td> <td bgcolor="#AAAAAA"> </br>
56
<input style="width: 150px" name="mypassword" type="password" size="20"/></td> </tr> <tr><td bgcolor="#AAAAAA"> </td> <td bgcolor="#AAAAAA"><input type="submit" value="" /></td> <td><Enter new></td> </tr> </table> <input type="hidden" name="newmyusername" value="newmyusername" /> <center><table width="100" bgcolor="#AAAAAA" style="background-color: #ffffff"> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">New Username</span></td> <td bgcolor="#AAAAAA"> </br> <input style="width: 150px" name="newmyusername" type="text" value="" size="20"/></td> </tr> </br> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">New Password</span></td> <td bgcolor="#AAAAAA"> </br> <input style="width: 150px" name="newmypassword" type="password" size="20"/></td> </tr> <tr><td bgcolor="#AAAAAA"> </td> <td bgcolor="#AAAAAA"><input type="submit" value="Change" /></td> </tr> </table> </form> <center><h4><a href=settings.php>[Cancel Login]</a> <!-- END PAGE FOOTER --> <!-- BEGIN SYSTEM INFO --> <!-- END PAGE WRAPPER -->
57
</body> </html> Appendix 19: Create
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Create Memo</title> <center>"<a href=homepage.php>Homepage</a> | <a href=>Project Topics</a> | <a href=researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a>"; <!-- TinyMCE --> <script type="text/javascript" src="http://localhost/Wikidemic/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script > <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js",
58
external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <!-- /TinyMCE --> </head> <body> <form method="post" action="insert.php"> <div> <a><h2><center>Create Memo using an Editor platform. Click on Submit button when done<center></a></h2> </li> <a><h2> </a></h2> <a><h2> </a></h2> </p> <div> <div> <?php $Dated=date('d-m-Y'); $con = mysql_connect('localhost', 'root', ''); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("wikidemic1", $con); $query="select link from tbl_memo"; $result=mysql_query($query); while($row=mysql_fetch_array($result)){ $link=$row['link']; $link = $link + 1; } ?> <label for="title"><strong>Memo Title </label> <input id="title" type="text" name="Title" size="77"/> <label for="Dated"><strong>Date:</label> <input name="Dated" type="text" id="Dated" size="12" value="<?php echo $Dated; ?>" readonly="readonly"
59
</p> <div> <center><textarea id="elm1" name="elm1" rows="25" cols="80" style="width: 65%"</center> </textarea> </div> <!-- Some integration calls --> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Make Content Bold]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a> <input type="submit" name="save" value="Submit" /> <input type="reset" name="reset" value="Reset" /> </div> <label for="link"><strong></label> <input name="link" type="hidden" id="link" size="12" value="<?php echo $link; ?>" </form> </body> </html> Appendix 20: Delete Content
<?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } echo "<center><h4><a href=Homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href=>Project Topics</a> | <a href=Researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a>"; ?>
60
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </li><li> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Delete content</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" />
61
</li><li> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4./jquery.min.js"></script> <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getdelete.php?q="+str,true); xmlhttp.send(); } </script> <!-- /TinyMCE --> </head> <body> <form><center> <select name="users" onchange="showUser(this.value)"> <option selected="selected"></option> <?php include('checklogin1.php'); $sql=mysql_query("select Title, Dated,contentid from tbl_content"); while($row=mysql_fetch_array($sql)) { $id=$row['contentid']; $Title=$row['Title'];
62
$Dated=$row['Dated']; echo '<option value='.$id.'>'.$Title.'><'.$Dated.'></option>'; } ?> </select> </form> <br /> <div id="txtHint"><b>Content Details will Display here.</b></div> </body> </html> Appendix 21: Display
<?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Create Memo</title> <!-- TinyMCE --> <script type="text/javascript" src="http://localhost/Wikidemic/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script > <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquo
63
te,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <!-- /TinyMCE --> </head> <body> <form method="post" action="insertforupdate.php"> <div> <p> </p> <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded --> <div> <center><textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 65%"</center> <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'root', ''); if (!$con)
64
{ die('Could not connect: ' . mysql_error()); } mysql_select_db("wikidemic1", $con); $sql="SELECT * FROM tbl_memo WHERE memoid = '".$q."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo $row['content']; } ?> </textarea> </div> <!-- Some integration calls --> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Make Content Bold]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a> <input type="submit" name="save" value="Submit" /> <input type="reset" name="reset" value="Reset" /> </div> </form> </body> </html>
65
Appendix 22: Editor <?php session_start(); $myusername = $_SESSION['myusername']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Edit Memo</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" />
66
<link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <center><h4><a href=homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href=>Project Topics</a> | <a href=researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a> </li><li> <!-- TinyMCE --> <script type="text/javascript" src="http://localhost/Wikidemic/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script > <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs
67
template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <?php $memoid=$_POST['memoid']; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("wikidemic1"); $query = "SELECT * FROM tbl_memo where memoid=$memoid"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); $contents = $row['content']; $Title = $row['Title']; $Dated = $row['Dated']; $link = $row['link']; ?> <form method="post" action="insertforupdate.php"> <div> <h2><center>Edit your memo and Click on Submit button when done.</h2> </li> <a><h2> </a></h2> <a><h2> </a></h2> </p> <label for="title"><strong>Memo Title </label> <input name="Title" type="text" id="title" size="77" value="<?php echo $Title; ?>" <label for="Dated"><strong>Date:[DD-MM-YYYY] </label> <input name="Dated" type="text" id="Dated" size="12" readonly="readonly" value="<?php echo $Dated; ?>" <div> <textarea id="elm1" name="elm1" rows="25" cols="80" style="width: 80%"> <?php echo $contents; ?>
68
</textarea> </div> </div> <!-- Some integration calls --> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Make Content Bold]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a> <form action="editor.php" method="post" form name="form1"> <input name="memoid" type="hidden" id="memoid" size="5" value="<?php echo $memoid; ?>" <input type="submit" name="save" value="Submit"/ > <input type="reset" name="reset" value="Reset"/> <input type="submit" name="Save" value="Submit" /> </div> <?php echo "Contributor name is " .$myusername; ?> <label for="link"><strong></label> <input name="link" type="hidden" id="link" size="12" value="<?php echo $link; ?>" </form </body> </html>
Appendix 23: Editor Revise <?php session_start(); $username = $_SESSION['myusername']; $myusername = $username;
69
?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Edit Memo</title> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" />
70
<link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <center><h4><a href=homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href="">Project Topics</a> | <a href=researchpage.php>Research</a>| <a href="">Academic Programme</a> | <a href=logout.php>Logout</a> </li><li> <!-- TinyMCE --> <script type="text/javascript" src="http://localhost/Wikidemic/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script > <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js",
71
// Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <?php $memoid=$_POST['memoid']; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("wikidemic1"); $query = "SELECT * FROM tbl_edit where memoid=$memoid"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); $contents = $row['content']; $Title = $row['Title']; $Dated = $row['Dated']; $link = $row['link']; ?> <form method="post" action="insertrevise.php"> <div> <h2><center>Edit your memo and Click on Submit button when done.</h2> </li> <a><h2> </a></h2> <a><h2> </a></h2> </p> <?php $Dated=date('d-m-Y'); ?> <label for="title"><strong>Memo Title </label> <input name="Title" type="text" id="title" size="77" value="<?php echo $Title; ?>" <label for="Dated"><strong>Date:[DD-MM-YYYY] </label> <input name="Dated" type="text" id="Dated" size="12" value="<?php echo $Dated; ?>" <div> <textarea id="elm1" name="elm1" rows="25" cols="80" style="width: 80%"> <?php echo $contents; ?>
72
</textarea> </div> </div> <!-- Some integration calls --> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide menu]</a> <a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Make Content Bold]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a> <a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a> <form action="editorrevise.php" method="post" form name="form1"> <input name="memoid" type="hidden" id="memoid" size="5" value="<?php echo $memoid; ?>" <input type="submit" name="save" value="Submit" /> <input type="reset" name="reset" value="Reset"/> <input type="submit" name="save" value="Submit" /> </div> <?php echo "Contributor name is " .$myusername; ?> <input name="link" type="hidden" id="link" size="5" value="<?php echo $link; ?>" </form </body> </html> Appendix 24: Getmemo <?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST);
73
print "</pre>"; } ?> </head> <body> <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'root', ''); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("wikidemic1", $con); $sql="SELECT * FROM tbl_memo WHERE memoid = '".$q."'"; $result = mysql_query($sql); echo "<table border='1' bgcolor='#CCCCCC'> <tr> <th>Title</th> <th>Date</th> <th>Content</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Title'] . "</td>"; echo "<td>" . $row['Dated'] . "</td>"; echo "<td>" . $row['content'] . "</td>"; echo "</tr>"; } echo "</table>"; $memoid = $q; ?> <form action="editor.php" method="post" form name="form1">
74
<input name="memoid" type="hidden" id="memoid" size="5" value="<?php echo $memoid; ?>" <input type="submit" name="save" value="Submit" /> <input type="submit" name="Save" value="Edit The Memo" /> </body> </html Appendix 25: Getrevise
<?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } ?> </head> <body> <?php $q=$_GET["q"]; $link = $q; $con = mysql_connect('localhost', 'root', ''); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("wikidemic1", $con); $sql="SELECT * FROM tbl_edit WHERE link = '".$q."'"; $result = mysql_query($sql); echo "<table border='1' bgcolor='#CCCCCC'> <tr> <th>Title</th> <th>Content</th> <th>Contributor</th> <th>Time</th> </tr>";
75
while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Title'] . "</td>"; echo "<td>" . $row['content'] . "</td>"; echo "<td>" . $row['user'] . "</td>"; echo "<td>" . $row['Timed'] . "</td>"; echo "</tr>"; } echo "</table>"; ?> <form action="editrevise.php" method="post" form name="form1"> <input name="link" type="hidden" id="link" size="12" value="<?php echo $link; ?>" <input type="submit" name="save" value="Submit" /> <input type="submit" name="Save" value="Click to Revise a Memo" /> </body> </html Appendix 26: Hodchecklogin
<?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="root"; // Database name $tbl_name="tbl_admin"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $newmyusername=$_POST['newmyusername']; $newmypassword=$_POST['newmypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword);
76
$sql="SELECT * FROM $tbl_name WHERE surname='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("root"); mysql_query("UPDATE tbl_admin SET surname =('$newmyusername'),password=('$newmypassword') WHERE password='$mypassword'"); echo"You have suceesfully changed your user name and password"; echo "<h4><a href=settings.php>Continue</a>"; } else { echo "Wrong Name or Password"; echo "<h4><a href=change.php>Retry</a>"; } ?> Appendix 27: Insert Content
<?PHP session_start(); $myusername = $_SESSION['myusername']; ?> <?php $Title=$_POST['Title']; $Dated=$_POST['Dated']; $elm1=$_POST['elm1']; if ($Title == "") { header("location:addcontent.php"); exit(); } $user_name = "root"; $password = ""; $database = "wikidemic1"; $server = "localhost"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle);
77
if ($db_found) { $SQL = "INSERT INTO tbl_content (Title, Dated, content, user) VALUES ('$Title', '$Dated','$elm1', '$myusername')"; $result = mysql_query($SQL); mysql_close($db_handle); Echo "Content successfully Added"; } else { print "Database NOT Found "; mysql_close($db_handle); } ?> <html> <Head> <li><h4><a class="" href="http://localhost/Wikidemic/Homepage.php">Homepage</a></h4> .<html/> Appendix 28: Read Publish memo
<?php if(isset($_POST['save'])) { print "<pre>"; print_r($_POST); print "</pre>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </li><li> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>select memo</title>
78
<meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <center><h4><a href=Homepage.php>Homepage</a> | <a href=memopage.php>Memos</a> |<a href="">Project Topics</a> | <a href=Researchpage.php>Research</a>| <a href=>Academic Programme</a> | <a href=logout.php>Logout</a> </li><li> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4./jquery.min.js"></script> <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return;
79
} if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getpublishmemo.php?q="+str,true); xmlhttp.send(); } </script> <!-- /TinyMCE --> </head> <body> <form><center> <select name="users" onchange="showUser(this.value)"> <option selected="selected"></option> <?php include('checklogin1.php'); $sql=mysql_query("select Title, Dated, memoid from publish"); while($row=mysql_fetch_array($sql)) { $id=$row['memoid']; $Title=$row['Title']; $Dated=$row['Dated']; echo '<option value='.$id.'>'.$Title.'><'.$Dated.'></option>'; } ?> </select> </form> <br /> <div id="txtHint"><b>Memo Details will Display here.</b></div> </body> </html>
80
Appendix 28: Settings <?php session_start(); $username = $_SESSION['myusername']; $myusername = $username; $myusername = strtoupper(stripslashes($myusername)); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Wikidemic: Welcome To Wikidemic</title> <meta name="generator" content="csdept" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" />
81
<link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </head> <body> <div align="center" class="style7"> <div align="center"><font face="Times New Roman"> <font size="5" color="#008000">DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF NIGERIA, NSUKKA</font></a><br /> </font> <table width="80%" border="0" cellpadding="0" cellspacing="0" bgcolor="#009966"> <tr> <td> <p align="center"><b><font face="Times New Roman" color="#F0F936"> <marquee><?php echo "WELCOME ".$myusername; echo ", YOU HAVE SUCCESSFULLY LOGGED IN.";?></marquee></font></b></td> </tr> <tr> <td> </tr> </table> <p align="center"><b><font face="Times New Roman" size="3" color="#F0F936"> <span style="background-color: #009966"> <p align="center"><span style="background-color: #009966"><b> <span style="background-color: #FFFFFF"><b> <font color="red" face="Times New Roman" size="4"> </div> <!-- BEGIN PAGE WRAPPER -->
82
<div id="page"> <!-- BEGIN PAGE HEADER --> <div id="header"> <ul class="menu" id="main_menu"> <li><h4><a class="" href="http://localhost/Wikidemic/adduser.php">[Add User]</a></h4> <li><li><h4><a class="" href="http://localhost/Wikidemic/deleteuser.php">[Delete User]</a></h4> <li><li><h4><a class="" href="http://localhost/Wikidemic/viewusers.php">[View Users]</a></h4> <li><li><h4><a class="" href="http://localhost/Wikidemic/change.php">[Change H.O.D Password]</a></h4> <li><li><h4><a class="" href="http://localhost/Wikidemic/logout.php">[Logout]</a></h4> </li> </ul> </div>
83
<!-- END PAGE HEADER --> <!--starting page content--> <div id="content"> <!-- Header ID generation took 0.001234 seconds --><img src="http://localhost/Wikidemic/images/wiki_logo.jpg" alt="wiki logo" title="Wiki site" /><br /><br /><hr /> <div class="floatl"><h5 id="get"></a></h5> <h5>Get academic Research Topics on related field of study with short abstract for a guide. You can also create your own content <br /></div></a></h5> <h5>View a list of approved, assigned or written Projects in the department and at the same time add your own topic to the list</a><h5>.<hr /> <div class="floatr"><h5 id="memo"></a></h5> <h5>Get updated with current administrative memos. What is more! You can edit or contribute to such Memos, exchange ideas with other staff members and lots more!.</a>!</div><h3 id=""></a></h5> <br />Get information on the academic programme schedule of the department and the courses available for registration.</a></a><br /> </div><!--closing page content-->
84
<!-- BEGIN PAGE FOOTER --> <div id="footer"> "<center><h4><a href=Homepage.php>Homepage</a> | <a href="">Project Topics</a> | <a href=Researchpage.php>Research</a> | <a href="">Academic Programme</a> | <a href=logout.php>Logout</a> <ul class="menu" id="options_menu"> </div> <!-- END PAGE FOOTER --> <!-- BEGIN SYSTEM INFO --> <!--Page was generated in 0.1732 seconds--> </div> <!-- END PAGE WRAPPER -->
85
</body> </html> Appendix 30: Staff
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Wikidemic: Staff Add Page</title> <base href="http://localhost/Wikidemic" /> <meta name="generator" content="Wikidemic" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link rel="stylesheet" type="text/css" href="templates/light/css/light1.css?4625d" /> <link rel="stylesheet" type="text/css" href="templates/light/css/print.css" media="print" /> <link rel="icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="templates/light/images/favicon.ico" type="image/x-icon" /> </head> <body> <!-- BEGIN PAGE WRAPPER --> <div id="page"> <div id="header"> <br /> <br /> <p align="center"><b><font face="Times New Roman"> <marquee>Enter the Staff's Names and the Staff Id</marquee></font></b></td> </div> <!-- END PAGE HEADER --> <!--starting page content--> <form action="staffcheck.php" method="post" form name="form1"> <input type="hidden" name="myusername" value="myusername" />
86
<center><table width="100" bgcolor="#AAAAAA" style="background-color: #ffffff"> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">Fullnames</span></td> <td bgcolor="#AAAAAA"> </br> <input style="width: 150px" name="myusername" type="text" value="" size="20"/></td> </tr> </br> <tr><td align="left" bgcolor="#AAAAAA"><span class="style7">Staff ID</span></td> <td bgcolor="#AAAAAA"> </br> <input style="width: 150px" name="mypassword" type="password" size="20"/></td> </tr> <tr><td bgcolor="#AAAAAA"> </td> <td bgcolor="#AAAAAA"><input type="submit" value="Add Staff" /></td> </tr> </table> </form> <center><h4><a href=Homepage.php>[Cancel]</a> <!-- END PAGE FOOTER --> <!-- BEGIN SYSTEM INFO --> <!-- END PAGE WRAPPER --> </body> </html> Appendix 31: Staff Check
<?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="wikidemic1"; // Database name $tbl_name="wiki_users"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername'];
87
$mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE surname='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ echo "User already exists"; echo "<h4><a href=staff.php>try another</a>"; } else { $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("root"); $sql="INSERT INTO wiki_users(surname, password) values('$myusername', '$mypassword')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Staff successfully added"; echo "<h4><a href=Homepage.php>Homepage</a>"; } ?> Appendix 32: Logout
<?php session_start(); session_unset(); session_destroy(); // Logged out, return home. Header("Location: index.php"); ?>
88
Sample outputs Output 1: Selected Memo Displayed for viewing
Output 2: Selected Memo Displayed for editing