Saturday, 30 March 2013

Thursday, 21 March 2013

Essential Link

http://mahtonu.wordpress.com/tag/ajax/

http://prototypejs.org/doc/latest/ajax/Ajax/Request/

For Zend - http://mahtonu.wordpress.com/category/php/zend-framewrk/

Zend Video - http://www.zendcasts.com/ajaxify-your-zend_form-validation-with-jquery/2010/04/

viewHelper - http://stackoverflow.com/questions/1616857/best-way-to-start-using-jquery-in-a-zend-framework-1-9-application

zend slide - http://www.slideshare.net/dennisdc/introduction-to-zendx-jquery-3531425

zend Nice Tute - http://zendgeek.blogspot.in/2009/07/zend-framework-and-jquery-jquery-date.html



Best For Admin Panel - http://blog.luisfreitas.pt/2010/11/06/how-to-build-a-complete-zend-framework-application/

http://www.phpriot.com/articles/fetch-data-with-zend-db

http://devzone.zend.com/1240/decorators-with-zend_form/
http://zendgeek.blogspot.in/2009/07/zend-framework-and-jquery-jquery-date.html
http://stuntcoders.com/tag/zend-framework/


http://freemp3x.com/english-guru-spoken-english-course-mp3-download.html

http://www.programming-free.com/2013/02/image-zoom-plus-fancybox-feature-using.html#.UYeLVkpj8Tg

http://www.javascriptsource.com/miscellaneous/popup-div.html#

Wednesday, 20 March 2013

Paginating Records in Zend

Source : http://e-university.wisdomjobs.com/zend/

Applications can contain hundreds and even millions of records. Members of a site, artist information, a list of images.all these items can be displayed. If the application contained hundreds of records and displayed the content to the user all at once, the user would be overwhelmed with too much data at a single time. The user also might become frustrated by the time it takes for the content to load because the query would fetch all the records at once.

You can solve the dilemma by using pagination, which allows applications to fetch smaller result sets there by displaying content in manageable and faster loading portions. The result sets are usually broken up into numbered pages. For example, if you have 1,000 records and applied pagination, you can display the content in a set 10 pages, each page containing 100 records. As the user continues to click on the next page, the application retrieves the next set of data. 

To add pagination to any application, you can use the Zend_Paginator library, which has the capability to paginate any collection of data in an array as well as result sets from a database using the Zend_Db_Select object. It also allows you to apply any type of view to render the content.

Using the Zend_Paginator

The Zend_Paginator can be used by loading the Zend_Paginator class into a PHP file.
After the class is loaded, you can instantiate a Zend_Paginator object using its constructor and supply it with a Zend_Paginator_Adaptor object. The supported adaptors are the following:
  • Zend_Paginator_Adaptor_Array
  • Zend_Db_Select
  • Zend_Db_Table_Select
  • . Iterator
Depending on the type of data you want to paginate, use the required adaptor. If you want to paginate data for an array, use the Zend_Paginator_Adaptor_Array class. To use database result sets, you can create either a Zend_Db_Select object or a Zend_Db_Table_Select object. You can also allow Zend_Paginator to automatically create the adaptor for you by using the Zend_ Paginator :: factory() method and pass in an array or the object you want to use.

The Zend_Paginator provides additional functionality to manipulate the data presented to the user. These methods are shown in Table.



Aside from providing helpful methods, Zend_Paginator requires interaction by the user. The user must click a given page number to inform the Zend_Paginator what set of records it needs to fetch. Depending on the current page the user is on, a different set of records will be displayed. To determine which page the user is requesting, you need to use a query to pass in the data. Retrieving the page number is then something the PHP file must capture using the Request object.

Using the table, lets work on a small example that will use the methods and the factory() method. What youll need is an action and a view. Open the ArtistController.php file and create listAction(). The action will contain the pagination example shown in Listing.

Listing ArtistController.php: listAction()
/**
  * Display all the Artists in the  system.
  */

  public function listAction(){

  //Create a sample array of artist
  $artist = array("Underworld", "Groove Armada",  "Daft Punk",
  "Paul Oakenfold", "MC Chris",     
  "Ramones",
  "The Beatles", "The Mamas and the Papas",
  "Jimi Hendrix");

//Initialize the Zend_Paginator
  $paginator =  Zend_Paginator::factory($artist);
  $currentPage = 1;
//Check if the user is not on page 1
  $i =  $this->_request->getQuery('i');
  if(!empty($i)){ //Where i is the current page
  $currentPage = $this->_request->getQuery('i');
  }

//Set the properties for the pagination
  $paginator->setItemCountPerPage(2);
  $paginator->setPageRange(3);
  $paginator->setCurrentPageNumber($currentPage);
  $this->view->paginator =  $paginator;
}
 
Listing demonstrates the new listAction(). The method begins by initializing the data youll paginate through. Its a set of nine electronic music artists, all contained in an $artist array. Once initialized, you create a Zend_Paginator object and use its factory method to pass in the data to paginate. Because youre using an array, this will become a Zend _Paginator _Adaptor _Array object behind the scenes.

You now need to determine what page the user is on. To do this, pass a query value using the URL. The query value is represented by the variable i, and the URL will look like this:. If the variable i is not set, you know that the user is in the initial page, and you can use the default value you set as 1. Finally, set the total number of artists to display in a single page, 2; set the number of pages to display in the paginator control, 3; and set the page the user is currently loading for this request.

Create a new file in the views/scripts/artist directory and call it list.phtml. The view will render the records. Copy the code shown in Listing into the list.phtml file.
 
Listing list.phtml
<?php echo $this->doctype('XHTML1_STRICT'); ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
<?php echo $this->headTitle('LoudBite.com - Artist Listing'); ?>
 </head>
 <body>
<?php echo $this->render("includes/header.phtml")?>
<table border='0' width='600'>
<?php
          if ($this->paginator)
          {
               foreach($this->paginator as $item)
              {
                    echo "<tr><td>".$item."</td></tr>";
              }
         }
        else{?> <tr>
<td>There were no artists present in the system. Add one now!</td></tr> <?php } ?> </table> </body>
 </html>

Listing builds on the example shown in Listing. Unlike the previous example, you append the call to render the paginator’s control. You use the paginationControl() method to do so and pass in three parameters. The initial parameter is the object you created in the listAction: $paginator. The second parameter is the scrolling style from Table. The third parameter is the location of the pagination control view; in the example, it’s in the includes folder. the resulting pagination controller and the list of artists, as shown below.



 
 




Monday, 18 March 2013

How to Install Zend Framework



Create 3 directory in your project directory i.e.  application, library and public

after that follow the following steps -

1. download the latest library file for zend and paste the library's zend folder in library section.
2. create the following folder in the application folder -
                configs, controllers, models, views, forms, layouts

3. create a index.php in the public folder and paste the following code
 --------------------------------Start Index.php ------------------------------------------------------------
<?php
// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();


------------------------------------------- End of Index.php---------------------------------------------


4. create a .htaccess file in the public folder

------------------  .htaccess --------------------------

SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

---------------------- End of file ---------------------------------------


5.       create a Bootstrap.php file in the application folder

--------------  Bootstrap.php -----------------

<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{


}

------------------- End of file ----------------


6. create a application.ini file in the configs folder

-----------------------  application.ini -------------------

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
phpSettings.date.timezone = "Europe/London"
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.db.adapter = PDO_MYSQL
resources.db.params.host = localhost
resources.db.params.username = root
resources.db.params.password = root
resources.db.params.dbname = zf-tutorial
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view.doctype = "XHTML1_STRICT"

resources.db.params.profiler.enabled    = true
resources.db.params.profiler.class      = Zend_Db_Profiler_Firebug

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
phpSettings.error_reporting = -9



free css-template

For finding awesome free css template visit the following link

http://www.free-css.com/free-css-templates/page1

Tuesday, 12 March 2013

The Difference Between DNS and Name Servers



The DNS (Domain Name System) is a massive network of servers that comprises the largest digital database on the planet. This database is maintained, managed and regulated by several internet authorities, including the IANA (Internet Assigned Numbers Authority) and ICANN (Internet Corporation for Assigned Names and Numbers). 
Many people confuse the various terms associated with the DNS and mistakenly refer to them as either the same thing or completely separate entities. In truth, they are neither separate nor are they the same thing; rather, they are integral pieces to the puzzle that is the world wide web.
If you're interested in learning the difference between a DNS and a name server, then you may want to consider the following information.
What is the DNS?
Contrary to a seemingly popular misconception, DNS does not stand for Domain Name Server or Domain Name Software. DNS is an abbreviation for the aforementioned system that catalogs every domain and IP address on the internet, including registration information, as well as their relation to other domains and web hosts. The DNS is the central database of the internet, and without it, the internet would cease to exist as we know it.
Before the domain name system was devised, computers would connect to each other via IP addresses, which are strings of segmented numbers separated by dots. An example of an IP address would be 127.0.0.1 (a common IP address for a local router). The domain name system attaches a name to this number so that site visitors can easily remember and return to web addresses.
What is DNS Software?
DNS software is a program that is installed on a web server and used to facilitate the transference of data related to the domain name system. Technically, any web server can have DNS software installed on it, making the server a name server; however, some web hosts will not allow you to install or configure software within your hosting control panel, especially in shared hosting plans.
If you’re interested in installing DNS software on a web server to create a custom nameserver, you'll either need a VPS or dedicated hosting plan, unless you'd like to invest several thousand dollars in a private web server.
What is a Name Server?
A name server is a web server that has DNS software installed on it, particularly a server that is managed by a web host that is specifically designated for managing the domain names that are associated with all of the hosting provider's accounts.
Name servers are often called DSN servers as well, and this is likely the origin of all of the confusion associated with name servers and the DNS.
Every web site has two name servers to which it is pointed, and this process must be done by the webmaster upon purchasing a domain and a hosting account. If you have more questions about domain name pointing and your web hosting name servers, it is recommended that you contact your web hosting provider.

Thursday, 7 March 2013

PHP manual installation

Following link is useful for manual installation of PHP in Windows

http://www.premiumwebbloghosting.com/2012/03/how-to-install-php-on-windows-7.html

Apache Manual installation


Follow the following link to install apache manually

http://www.premiumwebbloghosting.com/2013/02/manually-installing-apache-server-on-windows-7.html

making-a-oscommerce-template-all-the-progress-step-by-step


Follow the folling link -

http://multimixer.gr/16/05/2011/making-a-oscommerce-template-all-the-progress-step-by-step/