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


PHP Contacts::getNumRows方法代码示例

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


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

示例1: map_related_to_contacts

 /**
  * function to map related to (contacts) for potentials while importing
  * checks if the contact exists else adds a new contact
  * @param string $contact_name
  * @return integer idcontacts
  */
 public function map_related_to_contacts($contact_name)
 {
     if (strlen($contact_name) > 2) {
         $contact_name = trim($contact_name);
         $do_contact = new Contacts();
         $qry = "\n\t\t\tselect `idcontacts`\n\t\t\tfrom  `contacts`\n\t\t\twhere `deleted` = 0 \n\t\t\tAND iduser = " . $_SESSION["do_user"]->iduser . "\n\t\t\tAND \n\t\t\t(\n\t\t\t\tconcat(firstname,' ',lastname) = ?\n\t\t\t\tor\n\t\t\t\tconcat(lastname,' ',firstname) = ?\n\t\t\t)\n\t\t\t";
         $do_contact->query($qry, array($contact_name, $contact_name));
         if ($do_contact->getNumRows() > 0) {
             $do_contact->next();
             return $do_contact->idcontacts;
         } else {
             $contact_name_explode = explode(" ", $contact_name);
             $do_contact->insert("contacts", array("firstname" => CommonUtils::purify_input($contact_name_explode[0]), "lastname" => CommonUtils::purify_input($contact_name_explode[1]), "iduser" => $_SESSION["do_user"]->iduser));
             $idcontacts = $do_contact->getInsertId();
             //adding the added_on
             $q_upd = "\n\t\t\t\tupdate `contacts` \n\t\t\t\tset `added_on` = '" . date("Y-m-d H:i:s") . "'\n\t\t\t\twhere `idcontacts` = " . $idcontacts;
             $do_contact->query($q_upd);
             $do_contact->insert("contacts_custom_fld", array("idcontacts" => $idcontacts));
             $do_contact->insert("contacts_address", array("idcontacts" => $idcontacts));
             $do_data_history = new DataHistory();
             $do_data_history->add_history($idcontacts, 4, 'add');
             $do_data_history->free();
             return $idcontacts;
         }
     }
 }
开发者ID:sQcrm,项目名称:sqcrm,代码行数:32,代码来源:PotentialsImport.class.php

示例2: get_value

 /**
  * Function to get the value of the entity 
  * @param integer $value
  * @return string $retval
  */
 public static function get_value($value)
 {
     $retval = '';
     if ((int) $value > 0) {
         $object = new Contacts();
         $retrun_fields = $object->popup_selection_return_field;
         $retrun_field_list = explode(",", $retrun_fields);
         $object->query("select " . $retrun_fields . " from contacts where idcontacts = ?", array($value));
         if ($object->getNumRows() > 0) {
             $object->next();
             $cnt_return_fields = 0;
             foreach ($retrun_field_list as $retrun_fields) {
                 if ($cnt_return_fields > 0) {
                     $retval .= ' ';
                 }
                 $retval .= $object->{$retrun_fields};
                 $cnt_return_fields++;
             }
         }
     }
     return $retval;
 }
开发者ID:sQcrm,项目名称:sqcrm,代码行数:27,代码来源:FieldType142.class.php

示例3: get_conversion_matrix

 /**
  * function to get the complete conversion information
  * @param integer $idleads
  * @return array if data found else false
  */
 public function get_conversion_matrix($idleads)
 {
     $qry = "select * from `leads_conversion_matrix` where `idleads` = ?";
     $this->query($qry, array($idleads));
     if ($this->getNumRows() > 0) {
         $this->next();
         if ((int) $this->idpotentials > 0) {
             $do_potentials = new Potentials();
             $q_p = "\n\t\t\t\tselect `potential_name` \n\t\t\t\tfrom `" . $do_potentials->getTable() . "` \n\t\t\t\twhere `idpotentials` = ?";
             $do_potentials->query($q_p, array($this->idpotentials));
             if ($do_potentials->getNumRows() > 0) {
                 $do_potentials->next();
                 $return_array["potential"] = array("idpotentials" => (int) $this->idpotentials, "potential_name" => $do_potentials->potential_name);
             }
         }
         if ((int) $this->idorganization > 0) {
             $do_organization = new Organization();
             $q_o = "\n\t\t\t\tselect `organization_name` \n\t\t\t\tfrom `" . $do_organization->getTable() . "` \n\t\t\t\twhere `idorganization` = ?";
             $do_organization->query($q_o, array($this->idorganization));
             if ($do_organization->getNumRows() > 0) {
                 $do_organization->next();
                 $return_array["organization"] = array("idorganization" => (int) $this->idorganization, "organization_name" => $do_organization->organization_name);
             }
         }
         if ((int) $this->idcontacts > 0) {
             $do_contacts = new Contacts();
             $q_c = "\n\t\t\t\tselect `firstname`,`lastname` \n\t\t\t\tfrom `" . $do_contacts->getTable() . "` where `idcontacts` = ?";
             $do_contacts->query($q_c, array($this->idcontacts));
             if ($do_contacts->getNumRows() > 0) {
                 $do_contacts->next();
                 $return_array["contact"] = array("idcontacts" => (int) $this->idcontacts, "contact_name" => $do_contacts->firstname . ' ' . $do_contacts->lastname);
             }
         }
         $do_user = new User();
         $do_user->getId((int) $this->iduser);
         $return_array["user"] = array("user_name" => $do_user->user_name, "fullname" => $do_user->firstname . ' ' . $do_user->lastname);
         $return_array["conversion_date"] = array("conversion_date" => i18nDate::i18n_long_date(TimeZoneUtil::convert_to_user_timezone($this->conversion_date, true), true));
         return $return_array;
     } else {
         return false;
     }
 }
开发者ID:sQcrm,项目名称:sqcrm,代码行数:47,代码来源:LeadConversion.class.php


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