当前位置: 首页>>代码示例>>PHP>>正文


PHP Commande::query方法代码示例

本文整理汇总了PHP中Commande::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Commande::query方法的具体用法?PHP Commande::query怎么用?PHP Commande::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Commande的用法示例。


在下文中一共展示了Commande::query方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getList

 public function getList($order, $critere, $debut, $nbres)
 {
     $query = $this->getRequest('list', $order, $critere, $debut, $nbres);
     $resul = $this->query($query);
     $retour = array();
     while ($resul && ($row = $this->fetch_object($resul))) {
         $thisClient = array();
         $thisClient['ref'] = $row->ref;
         $thisClient['entreprise'] = $row->entreprise;
         $thisClient['nom'] = $row->nom;
         $thisClient['prenom'] = $row->prenom;
         $thisClient['email'] = $row->email;
         $commande = new Commande();
         $devise = new Devise();
         $querycom = "SELECT id FROM {$commande->table} WHERE client={$row->id} AND statut NOT IN(" . Commande::NONPAYE . "," . Commande::ANNULE . ") ORDER BY date DESC LIMIT 0,1";
         $resulcom = $commande->query($querycom);
         if ($commande->num_rows($resulcom) > 0) {
             $idcom = $commande->get_result($resulcom, 0, "id");
             $commande->charger($idcom);
             $devise->charger($commande->devise);
             $thisClient['date'] = strftime("%d/%m/%Y %H:%M:%S", strtotime($commande->date));
             $thisClient['somme'] = formatter_somme($commande->total(true, true)) . ' ' . $devise->symbole;
         } else {
             $thisClient['date'] = '';
             $thisClient['somme'] = '';
         }
         $retour[] = $thisClient;
     }
     return $retour;
 }
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:30,代码来源:ClientAdmin.class.php

示例2: liste_clients

function liste_clients($order, $critere, $debut)
{
    $i = 0;
    $client = new Client();
    $query = "select * from {$client->table} order by {$critere} {$order} limit {$debut},20";
    $resul = $client->query($query);
    while ($resul && ($row = $client->fetch_object($resul))) {
        $fond = "ligne_" . ($i++ % 2 ? "claire" : "fonce") . "_rub";
        $commande = new Commande();
        $devise = new Devise();
        $querycom = "select id from {$commande->table} where client={$row->id} and statut not in(" . Commande::NONPAYE . "," . Commande::ANNULE . ") order by date DESC limit 0,1";
        $resulcom = $commande->query($querycom);
        $existe = 0;
        if ($commande->num_rows($resulcom) > 0) {
            $existe = 1;
            $idcom = $commande->get_result($resulcom, 0, "id");
            $commande->charger($idcom);
            $devise->charger($commande->devise);
            $date = strftime("%d/%m/%y %H:%M:%S", strtotime($commande->date));
        }
        $creation = strftime("%d/%m/%y %H:%M:%S", strtotime($row->datecrea));
        ?>
<ul class="<?php 
        echo $fond;
        ?>
">
	<li style="width:122px;"><?php 
        echo $row->ref;
        ?>
</li>
	<li style="width:110px;"><?php 
        echo $creation;
        ?>
</li>
	<li style="width:143px;"><?php 
        echo $row->entreprise;
        ?>
</li>
	<li style="width:243px;"><?php 
        echo $row->nom;
        ?>
 <?php 
        echo $row->prenom;
        ?>
</li>
	<li style="width:110px;"><?php 
        if ($existe) {
            echo $date;
        }
        ?>
</li>
	<li style="width:63px;"><?php 
        if ($existe) {
            echo formatter_somme($commande->total(true, true)) . ' ' . $devise->symbole;
        }
        ?>
</li>
	<li style="width:40px;"><a href="client_visualiser.php?ref=<?php 
        echo $row->ref;
        ?>
" class="txt_vert_11"><?php 
        echo trad('editer', 'admin');
        ?>
</a></li>
	<li style="width:25px; text-align:center;"><a href="#" onclick="confirmSupp('<?php 
        echo $row->ref;
        ?>
')"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></li>
</ul>
<?php 
    }
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:72,代码来源:client.php

示例3: trad

                                <th><?php 
echo trad('MONTANT_euro', 'admin');
?>
</th>
                                <th><?php 
echo trad('STATUT', 'admin');
?>
</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
<?php 
$commande = new Commande();
$query = "SELECT * FROM " . Commande::TABLE . " WHERE client='" . $client->id . "' ORDER BY date DESC";
$resul = $commande->query($query);
while ($resul && ($cmd = $commande->fetch_object($resul, 'Commande'))) {
    $statutdesc = new Statutdesc();
    $statutdesc->charger($cmd->statut);
    switch ($cmd->statut) {
        case '1':
            $trClass = 'warning';
            break;
        case '4':
            $trClass = 'success';
            break;
        case '5':
            $trClass = 'error';
            break;
        default:
            $trClass = 'info';
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:31,代码来源:client_visualiser.php

示例4: lister_commandes

function lister_commandes($critere, $order, $debut, $nbres, $search = '')
{
    $commande = new Commande();
    $i = 0;
    $query = "select * from {$commande->table} where 1 {$search} order by {$critere} {$order} limit {$debut},{$nbres}";
    $resul = $commande->query($query);
    while ($resul && ($row = $commande->fetch_object($resul, 'Commande'))) {
        $client = new Client();
        $client->charger_id($row->client);
        $statutdesc = new Statutdesc();
        $statutdesc->charger($row->statut);
        $devise = new Devise();
        $devise->charger($row->devise);
        $total = formatter_somme($row->total(true, true));
        $date = strftime("%d/%m/%y %H:%M:%S", strtotime($row->date));
        $fond = "ligne_" . ($i++ % 2 ? "claire" : "fonce") . "_rub";
        ?>

<ul class="<?php 
        echo $fond;
        ?>
">
	<li style="width:142px;"><?php 
        echo $row->ref;
        ?>
</li>
	<li style="width:104px;"><?php 
        echo $date;
        ?>
</li>
	<li style="width:200px;"><?php 
        echo $client->entreprise;
        ?>
</li>
	<li style="width:200px;"><a href="client_visualiser.php?ref=<?php 
        echo $client->ref;
        ?>
"><?php 
        echo $client->nom . " " . $client->prenom;
        ?>
</a></li>
	<li style="width:59px;"><?php 
        echo $total;
        ?>
 <?php 
        echo $devise->symbole;
        ?>
</li>
	<li style="width:70px;"><?php 
        echo $statutdesc->titre;
        ?>
</li>
	<li style="width:40px;"><a href="commande_details.php?ref=<?php 
        echo $row->ref;
        ?>
">éditer</a></li>
	<?php 
        if ($row->statut != Commande::ANNULE) {
            ?>
		<li style="width:35px; text-align:center;"><a href="#" onclick="supprimer('<?php 
            echo $row->id;
            ?>
'); return false;"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></li>
	<?php 
        }
        ?>
</ul>
		<?php 
    }
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:70,代码来源:commande.php

示例5: nbcommandes

 function nbcommandes()
 {
     $commande = new Commande();
     $query = "select * from {$commande->table} where statut>1 and statut<>5 and client=\"" . $this->id . "\" and statut<>5";
     $resul = $commande->query($query);
     return $commande->num_rows($resul);
 }
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:7,代码来源:Client.class.php


注:本文中的Commande::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。