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


PHP Lead::fetch_all方法代码示例

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


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

示例1: loadBox

 /**
  * Load data into info_box_contents array to show array later.
  *
  * @param int $max of records to load
  *
  * @return void
  */
 public function loadBox($max = 5)
 {
     global $conf, $user, $langs, $db;
     $this->max = $max;
     dol_include_once('/lead/class/lead.class.php');
     $lead = new Lead($db);
     $lead->fetch_all('DESC', 't.date_closure', $max, 0, array('t.date_closure<' => dol_now()));
     $text = $langs->trans("LeadLate", $max);
     $this->info_box_head = array('text' => $text, 'limit' => dol_strlen($text));
     $i = 0;
     foreach ($lead->lines as $line) {
         // FIXME: line is an array, not an object
         $line->fetch_thirdparty();
         // Ref
         $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
         $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $line->ref, 'url' => dol_buildpath('/lead/lead/card.php', 1) . '?id=' . $line->id);
         $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', 'logo' => 'company', 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
         $this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => dol_trunc($line->thirdparty->name, 40), 'url' => DOL_URL_ROOT . "/comm/fiche.php?socid=" . $line->fk_soc);
         // Amount Guess
         $this->info_box_contents[$i][4] = array('td' => 'align="left"', 'text' => price($line->amount_prosp, 'HTML') . $langs->getCurrencySymbol($conf->currency));
         // Amount real
         $this->info_box_contents[$i][5] = array('td' => 'align="left"', 'text' => $line->getRealAmount() . $langs->getCurrencySymbol($conf->currency));
         $i++;
     }
 }
开发者ID:ndrosis,项目名称:lead,代码行数:32,代码来源:box_lead.php

示例2: Societe

    $sortfield = "t.date_closure";
}
$title = $langs->trans('LeadList');
llxHeader('', $title);
if (!empty($socid)) {
    require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
    require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
    $soc = new Societe($db);
    $soc->fetch($socid);
    $head = societe_prepare_head($soc);
    dol_fiche_head($head, 'tabLead', $langs->trans("Module103111Name"), 0, dol_buildpath('/lead/img/object_lead.png', 1), 1);
}
// Count total nb of records
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
    $nbtotalofrecords = $object->fetch_all($sortorder, $sortfield, 0, 0, $filter);
}
$resql = $object->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
if ($resql != -1) {
    $num = $resql;
    print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $option, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
    print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="search_form">' . "\n";
    if (!empty($sortfield)) {
        print '<input type="hidden" name="sortfield" value="' . $sortfield . '"/>';
    }
    if (!empty($sortorder)) {
        print '<input type="hidden" name="sortorder" value="' . $sortorder . '"/>';
    }
    if (!empty($page)) {
        print '<input type="hidden" name="page" value="' . $page . '"/>';
    }
开发者ID:ndrosis,项目名称:lead,代码行数:31,代码来源:list.php

示例3: addMoreActionsButtons

 /**
  * addMoreActionsButtons Method Hook Call
  *
  * @param string[] $parameters parameters
  * @param CommonObject $object Object to use hooks on
  * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
  * @param HookManager $hookmanager class instance
  * @return void
  */
 function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
 {
     global $langs, $conf, $user, $db, $bc;
     $current_context = explode(':', $parameters['context']);
     if (in_array('commcard', $current_context)) {
         $langs->load("lead@lead");
         if ($user->rights->lead->write) {
             $html = '<div class="inline-block divButAction"><a class="butAction" href="' . dol_buildpath('/lead/lead/card.php', 1) . '?action=create&socid=' . $object->id . '">' . $langs->trans('LeadCreate') . '</a></div>';
         } else {
             $html = '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('LeadCreate') . '</a></div>';
         }
         $html = str_replace('"', '\\"', $html);
         print '<script type="text/javascript">jQuery(document).ready(function () {jQuery(function() {jQuery(".tabsAction").append("' . $html . '");});});</script>';
         if ($user->rights->lead->read) {
             require_once 'lead.class.php';
             $lead = new Lead($db);
             $filter['so.rowid'] = $object->id;
             $resql = $lead->fetch_all('DESC', 't.date_closure', 0, 0, $filter);
             if ($resql == -1) {
                 setEventMessages(null, $object->errors, 'errors');
             }
             $total_lead = count($lead->lines);
             // $filter['so.rowid'] = $object->id;
             $resql = $lead->fetch_all('DESC', 't.date_closure', 4, 0, $filter);
             if ($resql == -1) {
                 setEventMessages(null, $object->errors, 'errors');
             }
             $num = count($lead->lines);
             $html = '<table class="noborder" width="100%">';
             $html .= '<tr class="liste_titre">';
             $html .= '<td colspan="6">';
             $html .= '<table width="100%" class="nobordernopadding"><tr><td>' . $langs->trans("LeadLastLeadUpdated", $num <= 4 ? $num : 4) . '</td><td align="right"><a href="' . dol_buildpath('/lead/lead/list.php', 1) . '?socid=' . $object->id . '">' . $langs->trans("LeadList") . ' (' . $total_lead . ')</a></td>';
             $html .= '<td width="20px" align="right"><a href="' . dol_buildpath('/lead/index.php', 1) . '">' . img_picto($langs->trans("Statistics"), 'stats') . '</a></td>';
             $html .= '</tr></table></td>';
             $html .= '</tr>';
             foreach ($lead->lines as $lead_line) {
                 $var = !$var;
                 $html .= '<tr ' . $bc[$var] . '>';
                 $html .= '<td>' . $lead_line->getNomUrl(1) . '</td>';
                 $html .= '<td>' . $lead_line->ref_int . '</td>';
                 $html .= '<td>' . $lead_line->type_label . '</td>';
                 $html .= '<td>' . price($lead_line->amount_prosp) . ' ' . $langs->getCurrencySymbol($conf->currency) . '</td>';
                 $html .= '<td>' . dol_print_date($lead_line->date_closure, 'daytextshort') . '</td>';
                 $html .= '<td>' . $lead_line->getLibStatut(2) . '</td>';
                 $html .= '</tr>';
             }
             $html .= '</table>';
             $html = str_replace('"', '\\"', $html);
             print '<script type="text/javascript">jQuery(document).ready(function () {jQuery(function() {jQuery(".ficheaddleft").append("' . $html . '");});});</script>';
         }
     }
     if (in_array('propalcard', $current_context)) {
         require_once 'lead.class.php';
         $lead = new Lead($db);
         $ret = $lead->fetchLeadLink($object->rowid ? $id = $object->rowid : $object->id, $object->table_element);
         if ($ret < 0) {
             setEventMessages(null, $lead->errors, 'errors');
         }
         if (count($lead->doclines) == 0) {
             $langs->load("lead@lead");
             if ($user->rights->lead->write) {
                 $html = '<div class="inline-block divButAction"><a class="butAction" href="' . dol_buildpath('/lead/lead/card.php', 1) . '?action=create&amp;socid=' . $object->socid . '&amp;amount_guess=' . $object->total_ht . '&amp;propalid=' . $object->id . '">' . $langs->trans('LeadCreate') . '</a></div>';
             } else {
                 $html = '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('LeadCreate') . '</a></div>';
             }
             $html = str_replace('"', '\\"', $html);
             print '<script type="text/javascript">jQuery(document).ready(function () {jQuery(function() {jQuery(".tabsAction").append("' . $html . '");});});</script>';
         }
     }
 }
开发者ID:BebZ,项目名称:lead,代码行数:79,代码来源:actions_lead.class.php

示例4: array

 /**
  * Return combo list of differents type
  *
  * @param string $selected Value
  * @param string $htmlname Name of the component
  * @param int $showempty Row
  * @param array $filter Filter results
  *
  * @return string HTML select
  */
 function select_lead($selected = '', $htmlname = 'leadid', $showempty = 1, $filter = array())
 {
     $lead_array = array();
     require_once 'lead.class.php';
     $lead = new Lead($this->db);
     $result = $lead->fetch_all('DESC', 't.ref', 0, 0, $filter);
     if ($result < 0) {
         setEventMessages(null, $lead->errors, 'errors');
     }
     foreach ($lead->lines as $line) {
         $lead_array[$line->id] = $line->ref . '-' . $line->ref_int . ' (' . $line->status_label . '-' . $line->type_label . ')';
     }
     if (count($lead_array) > 0) {
         return $this->selectarray($htmlname, $lead_array, $selected, $showempty);
     }
     return null;
 }
开发者ID:ndrosis,项目名称:lead,代码行数:27,代码来源:html.formlead.class.php


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