Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

php

VIEWS: 4 PAGES: 6

									       MIT Arts, Commerce & Science College, Alandi, Pune
                   Practical Assignment of PHP

Assignments 1
Slot 1 Part A
    1. Consider the following entities and their relationships
       Doctor (doc_no, doc_name, address, city, area)
       Hospital (hosp_no, hosp_name, hosp_city)

      Doctor and Hospital are related with many-many relationship
      Create a RDB in 3 NF for the above and solve following

      Using above database, write a PHP script which accepts hospital name
   and print information about doctors visiting / working in that hospital in
   tabular format.

   2.Consider the following entities and their relationships
      Emp(emp_no,emp_name,address,phone,salary)
      Dept(dept_no,dept_name,location)
   Emp_Dept are related with one-many relationship
   Cretae a RDB in 3NF for the above and solve following

   Using above databases write a PHP script which will
   a) Insert employee records & department records into the respective tables.
   b) Print a salary statement in the format given below, for a given department
      (Accept department name from the user).

Maximum Salary              Minimum Salary               Sum Salary



Slot 2 : Part B

   3. Consider the following entities and their relationships
      Movie (movie_no, movie_name, release_year)
      Actor( actor_no, name)

      Relationship between movie and actor is many – many with attribute rate
      in Rs. Create a RDB in 3 NF for the above and solve following

   Using above database , write PHP scripts for the following:
   a). Accept actor name and display all movie names in which he has acted,
   b) Insert a new movie information.
   c) Update the release year of a movie .( accept the movie name from the
       user)
4. Consider the following entities and their relationships
  Student(Stud_id,name,class)
 Competition(c_no,c_name,type)

Relationship between student and competition is many-many with attribute rank
and year. Create a RDB in 3NF for the above and solve the following

Using above database write a script in PHP to accept a competition name from
user and display information of student who has secured 1st rank in that
competition.

Assignment 2 - Graphics

1)     Write PHP script




2) Write PHP script for following




3) write PHP script for following




2)     4) Write PHP script to print the string vertically

3)     Write PHP script to
4)     Write php script for following




5)      Write php script for following




6)     Do wtaer mark image copy Q7 on Q5

7) Create a image file php.jpg as shown in example 1 below and smoothly scales it down
to one-quarter of its size, yielding the image in example 2.




Resulting 1/4-sized image

Dividing the height and the width by 4 instead of 2 produces the output shown below.


                Resulting 1/16-sized image
   8) Cretae a form to accept the following information

Create image


Width                      Height :

Text Color        Red                 Green                 Blue


Text String

X co-ordinate :                                  y co-ordinate

Shape :

              Draw Image




Assignment 3 – XML

Q1 ) Create a XML file which gives details of books available in “ ABC Bookstore”
from following categories 1) Technical
              2) Cooking
             3) YOGA
1) Create a DomDocument object and load this XML file.
 2) Get the output of this Document to the browser
3) Save this [. XML] document in another format i.e. in [.doc]
4) Write a XML programme to print Names of the books available in books.xml file.
Q2 ) Link Rajashree.xml document to the CSS style sheet and get well formatted output.
  Details of Rajashree .xml are:
<Rajashree Productions>
          <Movie>
          <MovieName>……….</MovieName>
         <Actor Name>…………</ActorName>
         <ReleaseYear>…………</ReleaseYear>
         </Movie>
</RajashreeProductions>
Store details of at least 5 movies which got released during 1990-2010.
1) MovieName : Color
                    Font Name, Font Size, Font- weight
  2) ActorName and ReleaseYear: Color,
                   Font Name, Font size, Font weight.
Q3 ) Write a PHP script to parse XML file and display different types of information
from it.
      <? xml version = “1.0” ?>
      <library>
                <book>
                      <title> Programming PHP </title>
                      <authors>
                             <author> Rasmus Lerdof </author>
                             <author> Kevin Tartoe </author>
                      </authors>
                      <comment> A greater book </comment>
                </book>
                <book>
                      <title> PHP Pocket Reference </title>
                      <authors>
                             <author> Rasmus Lerdof </author>
                      </authors>
                      <comment> It really does fit in your pocket </comment>
                </book>
      </library>
      Output should be like this

      My Library – Netscape                                                X
      File Edit View Go Communicator Help

           Programming PHP           Rasmus Lerdof, Kevin Tertoe
           PHP Pocket Reference      Rasmus Lerdof




  4) Write a PHP script to generate an XML in the following format
  <?xml version=”1.0”?>
<BookStore>
<Books>
<Php>
   <Title>Programming PHP</Title>
   <publication>o’Relly</publication>
</php>
<Php>
   <Title>Beginners PHP</Title>
   <publication>WROX</publication>
</php>
</Books>
</BookStore>

5) Cretae an application that reads “Book.xml” file into simple XML object. Display
   attributes and elements(Hint: use simple_xml_load_file() function)

								
To top