ACCPRIN Assignment for Thursday

July 6, 2017 | Author: Kioshi Na | Category: Html, Php, Hypertext, Software Engineering, World Wide Web
Share Embed Donate


Short Description

Download ACCPRIN Assignment for Thursday...

Description

ACCPRIN Assignment for Thursday (August 4,2011) Last week’s exercise was on Dennis Magno’s video and photography business for wedding recerptions, birthdays, reunions and other parties and fucntions. He decided to call his business as PV Express. Below are the transactions that he incurred for the month of November 2006: November 10 – service revenue of 20,000 was earned by providing services to wedding reception. Payment would be received in 15 days. November 15 – mr. magno withdrew 8,000 for personal use. November 20 – he deposited 3,000 in the company’s bank account. November 25 – customer paid 20000 November 29 – paid wages amounting to 3000 for services rendered during the month of november November 30 – a telephone bill totaling 800 was received. Payment was required by december 7 Supposing that the equipment he bought uses the straight line depreciation and its estimated useful life is 5 years. Required: Create a chart of accounts for PV express Record the following journal entries Prepare the ledger Prepare the adjusted trial balance and trial balance for November Prepare a set of financial statements

Note: Although experienced coders might find some useful information in this tutorial, this tutorial is designed to be easily understood and comprehended by total beginners. Introduction: Whether you have a small or a huge website, you know how much hassle and time it takes to upgrade your web site pages. The upgrade process becomes even more irritating when you make a change that needs to be upgraded on every page of your website; a good example of such a change is adding a button to the header or changing the copy right information in the footer of your website. In this tutorial I will show you how PHP comes to the rescue with only few lines of code. You can use this tutorial to be the basis to make your website easier to maintain and upgrade. Requirements: Server/Hosting capable of running php scripts. No knowledge of php necessary! The Tutorial

     

Step 1 Create a folder on your server and name it "design". Step 2 Create the following files in the design folder: 'header.html', 'footer.html', 'right_column.html', 'left_column.html' Step 3 Create another folder and name it "pages" Step 4 In the "pages" directory, create a page and give it the name: 'main.html' Step 5 Now in the root directory create a file and give it the 'index.php' Step 6 Add the following code to your 'index.php' file (don't worry, it will be explained later!):



Step 7 Go to your 'main.html' and design it as you would like your website layout to look at the end, only here, instead of adding the complete header design, add !!HEADER!! and then go to the 'header.html' file that you created in the "design" folder. Now in the 'header.html', design the main header of your website. This design will be the header of all your pages at the end. Now do the same thing for the other designs, that is: put !!FOOTER!! and design 'footer.html', !!RIGHT_COLUMN!! and design 'right_column.html', put !!LEFT_COLUMN!! and design 'left_column.html' respectively. Or simply copy the following pre-made design: 'main.html' Main Page - PHP Simple Templating System By Zeronese !!COMMON_TAGS!! !!HEADER!! !!LEFT_COLUMN!! !!RIGHT_COLUMN!! !!FOOTER!! 'header.html' Welcome To The PHP Simple Templating System

'footer.html' PHP Simple Templating System is a Copy Right of Zeronese.net

'right_column.html'

Advertisement Zeronese.net offers professional web design templates for both web designers and end users. Save time and money and still get a high quality professional web site for business, ecommerce or personal use. Learn More...

'left_column.html' Home Tutorial Page Tutorial Sub Page Visit Zeronese.net

and to add a little touch to our design, we create a 'styles.css' file in the design folder and add the following code: body{ background-color:#003399; color:#FFFFFF; } a{ color:#FFFFFF; font-weight:bold; text-decoration:none; } a:hover{ text-decoration:underline; } .column{ background-color:#3366CC; vertical-align:top; } .header{ background-color:#336699; } .footer{ background-color:#336699; }

Now give it a test drive spin! Try and test your design by using the browser to go to: main_folder_of_files/index.php?page=main.html

Code Explanation & How it Works: Of course you can tell that the 'index.php' file is doing all the work. The design is base on creating a default page and a default folder to store pages. if (isset($_REQUEST['page'])) This php code will check to see if a page is requested. if($_REQUEST['page'] !="") Of course, to eliminate errors, make sure a page is entered and it is not a blank argument. if(file_exists("pages/".$_REQUEST['page'].".html")) A page is requested and the page argument is not blank. Now we check to see if it exists in the default folder; in our case it is the pages folder. Note that we have included the '.html' extension here so we do not need to enter it when we request the page. By using this method, we also benefit from using standard html designs for the pages. Hint: You can change the extension of the pages as you wish. Further more if you want to use different extensions for different pages, just delete the .".html" from the statement. Do not forget that in this case, when requesting the page you will have to provide the extension. $page_content = file_get_contents($_REQUEST['page'].".html"); If every thing is alright, assign the contents of that page to a variable: $page_content. Note that the file_get_content function will not execute any code. That is: putting php code in your pages will not work. If you need to use any php code, either add it to your 'index.php' or to separate files and then include it in the 'index.php'. Hint: You can still add java code since this is executed on the client's side! else if (file_exists($_REQUEST['page'].".html")) $page_content = file_get_contents($_REQUEST['page'].".html"); These lines will extend and go further than the default folder. You can use it to request pages in deeper folders in your website. For example, you can design pages in a sub-directory and request it in a similar way to requesting pages in the default folder using the following command in your browser: main_folder_of_files/index.php?page=sub-directory/page.html Actually, we could have came straight to this statement with out adding the default folder option, but a default folder is more convenient and you don't have to enter the folder name every time you request it in the browser. Also, it is good for the tutorial purposes so you can practice more options and extend based on this! else echo "Page:".$_REQUEST['page']." does not exist! Please check the url and try again!"; We looked for the requested page in the default folder, in the sub-directory requested but we did not find it....then it does not exist. Print an error statement!!! else $page_content = file_get_contents("pages/main.html"); If no page is requested at all, go to a default page. In our case here to the main page. This could be your error page, but it is convenient to go to the main page in this case because that is how the index file is translated on servers. It is the main page! $page_content = str_replace("!!HEADER!!", file_get_contents("design/header.html"),$page_content); $page_content = str_replace("!!LEFT_COLUMN!!", file_get_contents("design/left_column.html"),$page_content); $page_content = str_replace("!!RIGHT_COLUMN!!", file_get_contents("design/right_column.html"),$page_content); $page_content = str_replace("!!FOOTER!!", file_get_contents("design/footer.html"),$page_content); This is the fun part! Our $page_content variable now holds the design and the content of the page requested. We simply use the str_replace function to replace our tag holders with our predesigned pages. $page_content = str_replace("!!COMMON_TAGS!!", file_get_contents("design/common_tags.html"),$page_content); Added to demonstrate how you can add any file and create your own files and place holders. The '!!COMMON_TAGS!!' place holder in this case has the link to the styles sheet that we created in the design folder. This becomes handful if you want to add any content that you want to change more often. For example, you can create a text file and put inside it your add sense code, create a place holder for it, add a similar line of code to this one, then add your place holder to the right or left column to see it on all pages instantly.

echo $page_content; Now show our design. Voala.... simple!!

Extending Functionality and Usability: To make this even greater, we can make our links static and search engine safe. Create a .htaccess file in the root folder and the following lines of code: RewriteEngine on Options +FollowSymLinks RewriteRule (.*).html ?page=$1 Save the .htaccess file and instead of having to write main_folder_of_files/index.php?page=main.html to go to your main page, you simply can now go there by typing: main_folder_of_files/main.html Also, typing main_folder_of_files/ will take you to the default page!!! Don't worry, it also works with sub directories too, try: main_folder_of_files//sub-directory/page.html Also you can extend by adding static variables that rarely is changed but you want them to change on all the pages once changed. For example, let's say you want to transfer your design to another domain name, and you want to change the links to the domain name instantly. This can be a hard task if you have to change it page by page. To easily do this, make it a variable, and this is how it is done: Add the following code to your 'index.php' file just after the opening statement of your code, that is: after the
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF