Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Db-customer  /  Querycustomer   Login nu   Login
blank.gif
««« Se kilde koden
blank.gif
tl.gif Cms tr.gif tl.gif Component tr.gif tl.gif Db tr.gif tl.gif Db-basket tr.gif tl.gif Db-login tr.gif tls.gif     Db-customer  trs.gif tl.gif Db-select tr.gif tl.gif Jquery tr.gif tl.gif Form-elements tr.gif tl.gif Menu-fisheye tr.gif tl.gif Template tr.gif tl.gif Tree-node tr.gif tl.gif Validator tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  
  • <?php
       
    require_once(HTML_DB_CUSTOMER_QUERY_PATH.'/QueryCustomer.php');
       
    $sql QueryCustomer::get('demo_customer');
    ?>
  • <?// Which now contains the following SQL:
    $sql SELECT  `demo_customer_id`,
     
    demo_customer.`demo_session_id`,
     
    demo_customer.`email` as `Email`,
     
    demo_customer.`contact_person` as `Kontakt person`,
     
    demo_customer.`company_name` as `Firmanavn`,
     
    demo_customer.`address` as `Adresse`,
     
    demo_customer.`zip` as `Postnr`,
     
    demo_customer.`city` as `By`,
     
    demo_customer.`private_phone` as `Privat telefon`,
     
    demo_customer.`mobile_phone` as `Mobil telefon`,
     
    demo_customer.`business_phone` as `Firma telefon`,
     
    demo_customer.`ean` as `EANFROM `demo_customerWHERE 
    demo_customer
    .`demo_session_id`='5cb3a39002cf9566f2ba763dbce8ef96' LIMIT 400
    ?>
Tilbage

Skjul: Navn

QueryCustomer.php


Vis: Sample code, tutorial

QueryCustomer, Sample code, tutorial

Sådan benyttes komponenten QueryCustomer klassen

Først skal du inkludere den fil der beskriver komponenten, som en klasse fil

  • <?
    require_once(HTML_PACKAGE_PATH.'/QueryCustomer.php');
    ?>

Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):

  • <?
    QueryCustomer
    ::display($param1$param2$param3, ...);
    ?>

eller du kan lave en instance af komponenten og benytte metoderne direkte:

  • <?
    $object 
    = new QueryCustomer($param1$param2$param3, ...);
    print 
    $object->getHtml();
    ?>

Skjul: Sådan vises komponenten

QueryCustomer, Sådan vises komponenten

Sådan vises komponenten QueryCustomer klassen

Der er ikke fundet noget

Vis: PHP source code

QueryCustomer, PHP source code

Den fulde PHP kildekode for QueryCustomer klassen

<?php
/**
 * @package db-customer
 * @see HTML_DB_CUSTOMER_QUERY_PATH.'/QueryCustomer.php'
 * @copyright (c) http://Finn-Rasmussen.com
 * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
 * @author http://Finn-Rasmussen.com
 * @version 1.11
 * @since 27-nov-2009
 */

/**
 * The required files
 */
require_once(HTML_DB_QUERY_PATH.'/Query.php');

/**
 * The Query object, which will supply all the sql for the Customer
 * <code>
 * Usage:
 *   $query = new QueryCustomer($table, $id, $sid, $translate, $orderby, $sort, 
 *                      $skip, $show, $condition, $groupby, $having, $subtotal);
 *   $sql = $query->get();
 * Or
 *   $sql = QueryCustomer::get($table, $id, $sid, $translate, $orderby, $sort, 
 *                      $skip, $show, $condition, $groupby, $having, $subtotal);
 * </code>
 * @package db-customer
 */

class QueryCustomer extends Query {
    
/**
     * Constructor
     * @param  String  $table     The table to use
     * @param  int     $id        The  ID used in the where clause
     * @param  String  $sid       The SID used in the where clause
     * @param  boolean $translate The query is translated to language (true)
     * @param  String  $orderby   The Order By to use
     * @param  String  $sorted    The sorted asc/desc (together with order by)
     * @param  String  $skip      The skip number of lines
     * @param  String  $show      The number to show
     * @param  String  $condition The id and sid are ignored and this condition is used instead
     * @param  String  $groupby   The group by
     * @param  String  $having    The having (together with group by)
     * @param  boolean $subtotal  The query has a subtotal
     */
    
function __construct($table$id=''$sid=''$translate=true$orderby=''$sort=''$skip=''$show=''$condition=''$groupby=''$having=''$subtotal=false) {
        
parent::__construct($table$id$sid$translate$orderby$sort$skip$show$condition$groupby$having$subtotal);
    }

    
/**
     * Return the column array as part of the query
     * @return array The requested array of columns
     */
    
protected function getColumn() {
        return 
VIEW_COLUMN_CUSTOMER;
    }

    
/**
     * Return the SELECT part of the query
     * @return String The requested query
     */
    
protected function select() {
        return 
$this->columns(VIEW_COLUMN_CUSTOMER_NAMEVIEW_COLUMN_CUSTOMER_DEFAULT);
    }

    
/**
     * Return the query specified
     * @static
     * @param  String  $table     The table to use
     * @param  String  $id        The primary key to use
     * @param  String  $sid       The foreign key to use
     * @param  boolean $translate The query is translated to language (true)
     * @param  String  $orderby   The Order By to use
     * @param  String  $sort      The sort order asc/desc
     * @param  String  $skip      The skip number of lines
     * @param  String  $show      The number to show
     * @param  String  $condition The id and sid are ignored and this condition is used instead
     * @param  String  $groupby   The group by
     * @param  String  $having    The having (together with group by)
     * @param  boolean $subtotal  The query has a subtotal
     * @return String The requested query
     */
    
public static function get($table$id=''$sid=''$translate=true$orderby=''$sort=''$skip=''$show=''$condition=''$groupby=''$having=''$subtotal=false) {
        
$query = new QueryCustomer($table$id$sid$translate$orderby$sort$skip$show$condition$groupby$having$subtotal);
        return 
$query->getSql();
    }
}
?>

Vis: HTML source code

QueryCustomer, HTML source code

Den fulde HTML kildekode for QueryCustomer klassen

<?
Der er ikke fundet noget
?>

Vis: Class methods

QueryCustomer, Class methods

Her er 'klasse metoderne' for QueryCustomer klassen:

  • __construct
  • get
  • setTranslate
  • columns
  • subtotal
  • from
  • where
  • orderby
  • groupby
  • having
  • limit
  • getClassName
  • getSql
  • getCount

Vis: Object vars

QueryCustomer, Object vars

Her er 'objekt variable' for QueryCustomer klassen:


MenuRight 
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


 
blank.gif
MenuBottom 
triangle.gif Copyright @ 1999-2010 www.Finn-Rasmussen.com Powered by myPHP Version (5.3.3-7+squeeze9) 1.11
blank.gif