本文整理汇总了PHP中getAccountName函数的典型用法代码示例。如果您正苦于以下问题:PHP getAccountName函数的具体用法?PHP getAccountName怎么用?PHP getAccountName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getAccountName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContact
function getContact($idContact)
{
//Realiza el query en la base de datos
$mysqli = makeSqlConnection();
$sql = "SELECT * FROM contacts a LEFT JOIN contacts_cstm ac ON a.id = ac.id_c WHERE id = '{$idContact}'";
$res = $mysqli->query($sql);
$rows = array();
while ($r = mysqli_fetch_assoc($res)) {
$obj = (object) $r;
$obj->email_address = getEmail($idContact);
$obj->idAccount = getAccountId($idContact);
$obj->nameAccount = getAccountName($obj->idAccount);
$obj->reports_to_name = getContactName($obj->reports_to_id);
$obj->created_by_name = getUserName($obj->created_by);
$obj->modified_user_name = getUserName($obj->modified_user_id);
$obj->assigned_user_name = getUserName($obj->user_id_c);
$obj->nameCampaign = getCampaignName($obj->campaign_id);
$a = (array) $obj;
$rows[] = $a;
}
if (empty($rows)) {
return '{"results" :[]}';
} else {
//Convierte el arreglo en json y lo retorna
$temp = json_encode(utf8ize($rows));
return '{"results" :' . $temp . '}';
}
}
示例2: getOutputHtml
//.........这里部分代码省略.........
global $noof_group_rows;
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
//Security Checks
if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$result = get_current_user_access_groups($module_name);
} else {
$result = get_group_options();
}
if ($result) {
$nameArray = $adb->fetch_array($result);
}
$assigned_user_id = empty($value) ? $current_user->id : $value;
if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
} else {
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
}
if ($noof_group_rows != 0) {
if ($fieldname == 'assigned_user_id' && $is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0)) {
$groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $assigned_user_id, 'private'), $assigned_user_id);
} else {
$groups_combo = get_select_options_array(get_group_array(FALSE, "Active", $assigned_user_id), $assigned_user_id);
}
}
$fieldvalue[] = $users_combo;
$fieldvalue[] = $groups_combo;
} elseif ($uitype == 51 || $uitype == 50 || $uitype == 73) {
if (!isset($_REQUEST['convertmode']) || $_REQUEST['convertmode'] != 'update_quote_val' && $_REQUEST['convertmode'] != 'update_so_val') {
if (isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '') {
$value = vtlib_purify($_REQUEST['account_id']);
}
}
if ($value != '') {
$account_name = getAccountName($value);
}
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldvalue[] = $account_name;
$fieldvalue[] = $value;
} elseif ($uitype == 54) {
$options = array();
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$pick_query = "select * from vtiger_groups";
$pickListResult = $adb->pquery($pick_query, array());
$noofpickrows = $adb->num_rows($pickListResult);
for ($j = 0; $j < $noofpickrows; $j++) {
$pickListValue = $adb->query_result($pickListResult, $j, "name");
if ($value == $pickListValue) {
$chk_val = "selected";
} else {
$chk_val = '';
}
$options[] = array($pickListValue => $chk_val);
}
$fieldvalue[] = $options;
} elseif ($uitype == 55 || $uitype == 255) {
require_once 'modules/PickList/PickListUtils.php';
if ($uitype == 255) {
$fieldpermission = getFieldVisibilityPermission($module_name, $current_user->id, 'firstname', 'readwrite');
}
if ($uitype == 255 && $fieldpermission == '0') {
$fieldvalue[] = '';
} else {
$fieldpermission = getFieldVisibilityPermission($module_name, $current_user->id, 'salutationtype', 'readwrite');
if ($fieldpermission == '0') {
$roleid = $current_user->roleid;
$picklistValues = getAssignedPicklistValues('salutationtype', $roleid, $adb);
示例3: getNPCName
}
if ($npcid != '' && $npcid != 'ID' && $editor != 'altcur' && $editor != 'qglobal') {
$breadcrumbs .= " >> " . getNPCName($npcid) . " ({$npcid})";
}
if ($fid != '') {
$breadcrumbs .= " >> " . getFactionName($fid);
}
if ($tskid != '') {
$breadcrumbs .= " >> " . getTaskTitle($tskid);
}
if ($ts != '') {
$breadcrumbs .= " >> " . "<a href='index.php?editor=" . $editor . "&ts=" . $ts . "'>" . $tradeskills[$ts] . "</a>";
}
if ($rec != '0') {
$breadcrumbs .= " >> " . getRecipeName($rec);
}
if ($spellset != '') {
$breadcrumbs .= " >> " . getSpellsetName($spellset);
}
if ($playerid != '' && $playerid != 'Player ID') {
$breadcrumbs .= " >> <a href='index.php?editor=" . $editor . "&playerid=" . $playerid . "'>" . getPlayerName($playerid) . " ({$playerid})</a>";
}
if ($acctid != '') {
$breadcrumbs .= " >> " . getAccountName($acctid) . " ({$acctid})";
}
if ($guildid != '') {
$breadcrumbs .= " >> " . getGuildName($guildid) . " ({$guildid})";
}
if ($aaid != '') {
$breadcrumbs .= " >> " . getAAName($aaid) . " ({$aaid})";
}
示例4: getValue
function getValue($field_result, $list_result, $fieldname, $focus, $module, $entity_id, $list_result_count, $mode, $popuptype, $returnset = '', $viewid = '')
{
global $log, $listview_max_textlength, $app_strings, $current_language, $currentModule;
$log->debug("Entering getValue(" . $field_result . "," . $list_result . "," . $fieldname . "," . get_class($focus) . "," . $module . "," . $entity_id . "," . $list_result_count . "," . $mode . "," . $popuptype . "," . $returnset . "," . $viewid . ") method ...");
global $adb, $current_user, $default_charset;
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
$tabname = getParentTab();
$tabid = getTabid($module);
$current_module_strings = return_module_language($current_language, $module);
$uicolarr = $field_result[$fieldname];
foreach ($uicolarr as $key => $value) {
$uitype = $key;
$colname = $value;
}
//added for getting event status in Custom view - Jaguar
if ($module == 'Calendar' && ($colname == "status" || $colname == "eventstatus")) {
$colname = "activitystatus";
}
//Ends
$field_val = $adb->query_result($list_result, $list_result_count, $colname);
if (stristr(html_entity_decode($field_val), "<a href") === false && $uitype != 8) {
$temp_val = textlength_check($field_val);
} elseif ($uitype != 8) {
$temp_val = html_entity_decode($field_val, ENT_QUOTES);
} else {
$temp_val = $field_val;
}
// vtlib customization: New uitype to handle relation between modules
if ($uitype == '10') {
$parent_id = $field_val;
if (!empty($parent_id)) {
$parent_module = getSalesEntityType($parent_id);
$valueTitle = $parent_module;
if ($app_strings[$valueTitle]) {
$valueTitle = $app_strings[$valueTitle];
}
$displayValueArray = getEntityName($parent_module, $parent_id);
if (!empty($displayValueArray)) {
foreach ($displayValueArray as $key => $value) {
$displayValue = $value;
}
}
$value = "<a href='index.php?module={$parent_module}&action=DetailView&record={$parent_id}' title='{$valueTitle}'>{$displayValue}</a>";
} else {
$value = '';
}
} else {
if ($uitype == 53) {
$value = textlength_check($adb->query_result($list_result, $list_result_count, 'user_name'));
// When Assigned To field is used in Popup window
if ($value == '') {
$user_id = $adb->query_result($list_result, $list_result_count, 'smownerid');
if ($user_id != null && $user_id != '') {
$value = getOwnerName($user_id);
}
}
} elseif ($uitype == 52) {
$value = getUserName($adb->query_result($list_result, $list_result_count, $colname));
} elseif ($uitype == 51) {
$parentid = $adb->query_result($list_result, $list_result_count, "parentid");
if ($module == 'Accounts') {
$entity_name = textlength_check(getAccountName($parentid));
} elseif ($module == 'Products') {
$entity_name = textlength_check(getProductName($parentid));
}
$value = '<a href="index.php?module=' . $module . '&action=DetailView&record=' . $parentid . '&parenttab=' . $tabname . '" style="' . $P_FONT_COLOR . '">' . $entity_name . '</a>';
} elseif ($uitype == 77) {
$value = getUserName($adb->query_result($list_result, $list_result_count, 'inventorymanager'));
} elseif ($uitype == 5 || $uitype == 6 || $uitype == 23 || $uitype == 70) {
if ($temp_val != '' && $temp_val != '0000-00-00') {
$value = getDisplayDate($temp_val);
} elseif ($temp_val == '0000-00-00') {
$value = '';
} else {
$value = $temp_val;
}
} elseif ($uitype == 15 || $uitype == 55 && $fieldname == "salutationtype") {
$temp_val = decode_html($adb->query_result($list_result, $list_result_count, $colname));
if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $temp_val != '') {
$temp_acttype = $adb->query_result($list_result, $list_result_count, 'activitytype');
if ($temp_acttype != 'Task' && $fieldname == "taskstatus") {
$temptable = "eventstatus";
} else {
$temptable = $fieldname;
}
$roleid = $current_user->roleid;
$roleids = array();
$subrole = getRoleSubordinates($roleid);
if (count($subrole) > 0) {
$roleids = $subrole;
}
array_push($roleids, $roleid);
//here we are checking wheather the table contains the sortorder column .If sortorder is present in the main picklist table, then the role2picklist will be applicable for this table...
$sql = "select * from vtiger_{$temptable} where {$temptable}=?";
$res = $adb->pquery($sql, array(decode_html($temp_val)));
$picklistvalueid = $adb->query_result($res, 0, 'picklist_valueid');
if ($picklistvalueid != null) {
$pick_query = "select * from vtiger_role2picklist where picklistvalueid={$picklistvalueid} and roleid in (" . generateQuestionMarks($roleids) . ")";
$res_val = $adb->pquery($pick_query, array($roleids));
$num_val = $adb->num_rows($res_val);
//.........这里部分代码省略.........
示例5: getDuplicateRecordsArr
//.........这里部分代码省略.........
foreach ($displayValueArray as $key => $field_value) {
$contactname = $field_value;
}
}
}
$result[$col_arr[$k]] = $contactname;
}
if ($ui_type[$fld_arr[$k]] == 15 || $ui_type[$fld_arr[$k]] == 16) {
$result[$col_arr[$k]] = getTranslatedString($result[$col_arr[$k]], $module);
}
if ($ui_type[$fld_arr[$k]] == 33) {
$fieldvalue = explode(' |##| ', $result[$col_arr[$k]]);
$result[$col_arr[$k]] = array();
foreach ($fieldvalue as $picklistValue) {
$result[$col_arr[$k]][] = getTranslatedString($picklistValue, $module);
}
$result[$col_arr[$k]] = implode(', ', $result[$col_arr[$k]]);
}
if ($ui_type[$fld_arr[$k]] == 68) {
$parent_id = $result[$col_arr[$k]];
if ($parent_id != '') {
$parentname = getParentName($parent_id);
}
$result[$col_arr[$k]] = $parentname;
}
if ($ui_type[$fld_arr[$k]] == 53 || $ui_type[$fld_arr[$k]] == 52) {
if ($result[$col_arr[$k]] != '') {
$owner = getOwnerName($result[$col_arr[$k]]);
}
$result[$col_arr[$k]] = $owner;
}
if ($ui_type[$fld_arr[$k]] == 50 or $ui_type[$fld_arr[$k]] == 51) {
if ($module != 'Products') {
$entity_name = getAccountName($result[$col_arr[$k]]);
} else {
$entity_name = getProductName($result[$col_arr[$k]]);
}
if ($entity_name != '') {
$result[$col_arr[$k]] = $entity_name;
} else {
$result[$col_arr[$k]] = '';
}
}
if ($ui_type[$fld_arr[$k]] == 58) {
$campaign_name = getCampaignName($result[$col_arr[$k]]);
if ($campaign_name != '') {
$result[$col_arr[$k]] = $campaign_name;
} else {
$result[$col_arr[$k]] = '';
}
}
if ($ui_type[$fld_arr[$k]] == 59) {
$product_name = getProductName($result[$col_arr[$k]]);
if ($product_name != '') {
$result[$col_arr[$k]] = $product_name;
} else {
$result[$col_arr[$k]] = '';
}
}
/*uitype 10 handling*/
if ($ui_type[$fld_arr[$k]] == 10) {
$result[$col_arr[$k]] = getRecordInfoFromID($result[$col_arr[$k]]);
}
if ($ui_type[$fld_arr[$k]] == 5 || $ui_type[$fld_arr[$k]] == 6 || $ui_type[$fld_arr[$k]] == 23) {
if (${$result}[$col_arr[$k]] != '' && ${$result}[$col_arr[$k]] != '0000-00-00') {
$date = new DateTimeField(${$result}[$col_arr[$k]]);
示例6: vtlib_purify
} else {
$value['repeatMonth_daytype'] = $recurringInfo['repeatmonth_daytype'];
$value['repeatMonth_day'] = $recurringInfo['dayofweek_to_repeat'][0];
}
}
} else {
$value['recurringcheck'] = 'No';
}
} else {
if (isset($_REQUEST['contact_id']) && $_REQUEST['contact_id'] != '') {
$contactId = vtlib_purify($_REQUEST['contact_id']);
$smarty->assign("CONTACTSID", $contactId);
$contact_name = "<option value=" . $contactId . ">" . getContactName($contactId) . "</option>";
$smarty->assign("CONTACTSNAME", $contact_name);
$account_id = vtlib_purify($_REQUEST['account_id']);
$account_name = getAccountName($account_id);
}
}
if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
$focus->mode = '';
}
if (empty($_REQUEST['record']) && $focus->mode != 'edit') {
setObjectValuesFromRequest($focus);
}
$userDetails = getOtherUserName($current_user->id);
$to_email = getUserEmailId('id', $current_user->id);
$smarty->assign("CURRENTUSERID", $current_user->id);
$disp_view = getView($focus->mode);
if ($disp_view == 'edit_view') {
$act_data = getBlocks($tab_type, $disp_view, $mode, $focus->column_fields);
示例7: getListViewEntries2
//.........这里部分代码省略.........
$value = decode_html($value);
$value = textlength_check($value);
}
} elseif ($module == "Products" && $name == "Related to") {
$value = getRelatedTo($module, $list_result, $i - 1);
} elseif ($name == 'Contact Name' && ($module == 'SalesOrder' || $module == 'Quotes' || $module == 'PurchaseOrder')) {
if ($name == 'Contact Name') {
$contact_id = $adb->query_result($list_result, $i - 1, "contactid");
$contact_name = getFullNameFromQResult($list_result, $i - 1, "Contacts");
$value = "";
if ($contact_name != "" && $contact_id != 'NULL') {
$value = "<a href='index.php?module=Contacts&action=DetailView&parenttab=" . $tabname . "&record=" . $contact_id . "' style='" . $P_FONT_COLOR . "'>" . $contact_name . "</a>";
}
}
} elseif ($name == 'Product') {
$product_id = textlength_check($adb->query_result($list_result, $i - 1, "productname"));
$value = $product_id;
} elseif ($name == 'Account Name') {
//modified for vtiger_customview 27/5
if ($module == 'Accounts') {
$account_id = $adb->query_result($list_result, $i - 1, "crmid");
//$account_name = getAccountName($account_id);
$account_name = textlength_check($adb->query_result($list_result, $i - 1, "accountname"));
// Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2
$value = '<a href="index.php?module=Accounts&action=DetailView&record=' . $account_id . '&parenttab=' . $tabname . '" style="' . $P_FONT_COLOR . '">' . $account_name . '</a>';
// Armando Lüscher 05.07.2005 -> §priority -> Desc: inserted style="$P_FONT_COLOR"
} elseif ($module == 'Potentials' || $module == 'Contacts' || $module == 'Invoice' || $module == 'SalesOrder' || $module == 'Quotes') {
//Potential,Contacts,Invoice,SalesOrder & Quotes records sort by Account Name
$accountname = textlength_check($adb->query_result($list_result, $i - 1, "accountname"));
$accountid = $adb->query_result($list_result, $i - 1, "accountid");
$value = '<a href="index.php?module=Accounts&action=DetailView&record=' . $accountid . '&parenttab=' . $tabname . '" style="' . $P_FONT_COLOR . '">' . $accountname . '</a>';
} else {
$account_id = $adb->query_result($list_result, $i - 1, "accountid");
$account_name = getAccountName($account_id);
$acc_name = textlength_check($account_name);
// Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2
$value = '<a href="index.php?module=Accounts&action=DetailView&record=' . $account_id . '&parenttab=' . $tabname . '" style="' . $P_FONT_COLOR . '">' . $acc_name . '</a>';
// Armando Lüscher 05.07.2005 -> §priority -> Desc: inserted style="$P_FONT_COLOR"
}
} elseif (($module == 'HelpDesk' || $module == 'PriceBook' || $module == 'Quotes' || $module == 'PurchaseOrder' || $module == 'Faq') && $name == 'Product Name') {
if ($module == 'HelpDesk' || $module == 'Faq') {
$product_id = $adb->query_result($list_result, $i - 1, "product_id");
} else {
$product_id = $adb->query_result($list_result, $i - 1, "productid");
}
if ($product_id != '') {
$product_name = getProductName($product_id);
} else {
$product_name = '';
}
$value = '<a href="index.php?module=Products&action=DetailView&parenttab=' . $tabname . '&record=' . $product_id . '">' . textlength_check($product_name) . '</a>';
} elseif ($module == 'Quotes' && $name == 'Potential Name' || $module == 'SalesOrder' && $name == 'Potential Name') {
$potential_id = $adb->query_result($list_result, $i - 1, "potentialid");
$potential_name = getPotentialName($potential_id);
$value = '<a href="index.php?module=Potentials&action=DetailView&parenttab=' . $tabname . '&record=' . $potential_id . '">' . textlength_check($potential_name) . '</a>';
} elseif ($module == 'Emails' && $relatedlist != '' && ($name == 'Subject' || $name == 'Date Sent' || $name == 'To')) {
$list_result_count = $i - 1;
$tmp_value = getValue($ui_col_array, $list_result, $fieldname, $focus, $module, $entity_id, $list_result_count, "list", "", $returnset, $oCv->setdefaultviewid);
$value = '<a href="javascript:;" onClick="ShowEmail(\'' . $entity_id . '\');">' . textlength_check($tmp_value) . '</a>';
if ($name == 'Date Sent') {
$sql = "select email_flag from vtiger_emaildetails where emailid=?";
$result = $adb->pquery($sql, array($entity_id));
$email_flag = $adb->query_result($result, 0, "email_flag");
if ($email_flag != 'SAVED') {
$value = getValue($ui_col_array, $list_result, $fieldname, $focus, $module, $entity_id, $list_result_count, "list", "", $returnset, $oCv->setdefaultviewid);
} else {
示例8: createXls
function createXls($accountinfs)
{
$headArr = array('合同订单编号', '状态', '客户名称', '联系人姓名', '签约日期', '合同金额', '产品名称', '产品编码', '数量', '价格', '备注');
$filepath = $this->accountfile;
if (is_array($accountinfs) && count($accountinfs) > 0) {
$objPHPExcel = new PHPExcel();
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Excel5");
$objWorksheet = $objPHPExcel->getActiveSheet();
$rowIndex = 1;
$cellIndex = 0;
$headrows = $headArr;
foreach ($headrows as $headcell) {
$objWorksheet->getCellByColumnAndRow($cellIndex, $rowIndex)->setValue($headcell);
$cellIndex += 1;
}
$rowIndex += 1;
$cellIndex = 0;
$accountrelation = array('subject', 'sostatus', 'account_id', 'contact_id', 'duedate', 'salestotal', 'productname', 'productcode', 'quantity', 'listprice', 'commet');
foreach ($accountinfs as $accountinf) {
foreach ($accountrelation as $pos => $propname) {
$accountval = $accountinf[$propname];
if ($propname == 'account_id') {
$accountval = getAccountName($accountval);
}
if ($propname == 'contact_id') {
$accountval = getContactName($accountval);
}
$objWorksheet->getCellByColumnAndRow($pos, $rowIndex)->setValueExplicit($accountval, PHPExcel_Cell_DataType::TYPE_STRING);
}
$rowIndex += 1;
}
$objWriter->save($filepath);
}
}
示例9: foreach
$result = $adb->getList($query);
foreach ($result as $row) {
$accountid = $row['accountid'];
$NextContactAccount[$accountid] = "<img src=\"themes/softed/images/s1.png\" border=0/> <a href=\"index.php?module=Accounts&action=DetailView&record=" . $row['accountid'] . "\" >" . $row['accountname'] . "</a> " . $row['contact_date'] . " <a href=\"index.php?module=Notes&action=EditView&&return_module=Accounts&return_action=ListView&return_id=" . $row['accountid'] . "\" >新增联系记录</a>";
}
$dashboard_arr['contact']['title'] = "7天内待联系客户(下次联系日期)";
$dashboard_arr['contact']['type'] = "text";
$dashboard_arr['contact']['divid'] = "7_day_contact";
$dashboard_arr['contact']['content'] = $NextContactAccount;
//=========================一月内到期纪念日==================================//
$onemonthlater = date("m-d", strtotime("1 month"));
$query = "select * from ec_memdays where deleted=0 and smownerid='" . $current_user->id . "' and substr(memday946,-5) between '" . date("m-d") . "' and '" . $onemonthlater . "' order by memday946 asc";
$result = $adb->getList($query);
foreach ($result as $row) {
$memdaysid = $row['memdaysid'];
$accountname = getAccountName($row['accountid']);
$OneMonthMemday[$memdaysid] = "<img src=\"themes/softed/images/s1.png\" border=0/> <a href=\"index.php?module=Accounts&action=DetailView&record=" . $row['accountid'] . "\" >" . $accountname . "</a> " . $row['memday938'] . " " . $row['memday946'] . " ";
}
$dashboard_arr['memday']['title'] = "一月内到期纪念日";
$dashboard_arr['memday']['type'] = "text";
$dashboard_arr['memday']['divid'] = "1_month_memday";
$dashboard_arr['memday']['content'] = $OneMonthMemday;
//=========================最近6个月销售情况=====================================//
$date_start = date('Y-m-d', mktime(0, 0, 0, date("m") - 5, date("d"), date("Y")));
$date_end = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d"), date("Y")));
if ($current_user->is_admin === true) {
$soadmin = "";
} else {
$soadmin = " and ec_salesorder.smownerid='" . $current_user->id . "'";
}
$where .= " ec_salesorder.orderdate >= " . db_convert("'" . $date_start . "'", 'date') . " AND ec_salesorder.orderdate <= " . db_convert("'" . $date_end . "'", 'date') . " ";
示例10: getDetailViewOutputHtml
/** This function returns the detail view form ec_field and and its properties in array format.
* Param $uitype - UI type of the ec_field
* Param $fieldname - Form ec_field name
* Param $fieldlabel - Form ec_field label name
* Param $col_fields - array contains the ec_fieldname and values
* Param $generatedtype - Field generated type (default is 1)
* Param $tabid - ec_tab id to which the Field belongs to (default is "")
* Return type is an array
*/
function getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields, $generatedtype, $tabid = '')
{
global $log;
$log->debug("Entering getDetailViewOutputHtml() method ...");
global $adb;
global $mod_strings;
global $app_strings;
global $current_user;
//$fieldlabel = from_html($fieldlabel);
$custfld = '';
$value = '';
$arr_data = array();
$label_fld = array();
$data_fld = array();
if ($generatedtype == 2) {
$mod_strings[$fieldlabel] = $fieldlabel;
}
if (!isset($mod_strings[$fieldlabel])) {
$mod_strings[$fieldlabel] = $fieldlabel;
}
if ($col_fields[$fieldname] == '--None--') {
$col_fields[$fieldname] = '';
}
if ($uitype == 116) {
$label_fld[] = $mod_strings[$fieldlabel];
$label_fld[] = $col_fields[$fieldname];
} elseif ($uitype == 13) {
$label_fld[] = $mod_strings[$fieldlabel];
$temp_val = $col_fields[$fieldname];
$label_fld[] = $temp_val;
$linkvalue = getComposeMailUrl($temp_val);
$label_fld["link"] = $linkvalue;
} elseif ($uitype == 5 || $uitype == 23 || $uitype == 70) {
$label_fld[] = $mod_strings[$fieldlabel];
$cur_date_val = $col_fields[$fieldname];
if (!isValidDate($cur_date_val)) {
$display_val = '';
} else {
$display_val = getDisplayDate($cur_date_val);
}
$label_fld[] = $display_val;
} elseif ($uitype == 15 || $uitype == 16 || $uitype == 115 || $uitype == 111) {
$label_fld[] = $mod_strings[$fieldlabel];
$label_fld[] = $col_fields[$fieldname];
} elseif ($uitype == 10) {
if (isset($app_strings[$fieldlabel])) {
$label_fld[] = $app_strings[$fieldlabel];
} elseif (isset($mod_strings[$fieldlabel])) {
$label_fld[] = $mod_strings[$fieldlabel];
} else {
$label_fld[] = $fieldlabel;
}
$value = $col_fields[$fieldname];
$module_entityname = "";
if ($value != '') {
$query = "SELECT ec_entityname.* FROM ec_crmentityrel inner join ec_entityname on ec_entityname.modulename=ec_crmentityrel.relmodule inner join ec_tab on ec_tab.name=ec_crmentityrel.module WHERE ec_tab.tabid='" . $tabid . "' and ec_entityname.entityidfield='" . $fieldname . "'";
$fldmod_result = $adb->query($query);
$rownum = $adb->num_rows($fldmod_result);
if ($rownum > 0) {
$rel_modulename = $adb->query_result($fldmod_result, 0, 'modulename');
$rel_tablename = $adb->query_result($fldmod_result, 0, 'tablename');
$rel_entityname = $adb->query_result($fldmod_result, 0, 'fieldname');
$rel_entityid = $adb->query_result($fldmod_result, 0, 'entityidfield');
$module_entityname = getEntityNameForTen($rel_tablename, $rel_entityname, $fieldname, $value);
}
}
$label_fld[] = $module_entityname;
$label_fld["secid"] = $value;
$label_fld["link"] = "index.php?module=" . $rel_modulename . "&action=DetailView&record=" . $value;
} elseif ($uitype == 33) {
$label_fld[] = $mod_strings[$fieldlabel];
$label_fld[] = str_ireplace(' |##| ', ', ', $col_fields[$fieldname]);
} elseif ($uitype == 17) {
$label_fld[] = $mod_strings[$fieldlabel];
$label_fld[] = $col_fields[$fieldname];
//$label_fld[] = '<a href="http://'.$col_fields[$fieldname].'" target="_blank">'.$col_fields[$fieldname].'</a>';
} elseif ($uitype == 19) {
//$tmp_value = str_replace("<","<",nl2br($col_fields[$fieldname]));
//$tmp_value = str_replace(">",">",$tmp_value);
//$col_fields[$fieldname]= make_clickable($tmp_value);
$label_fld[] = $mod_strings[$fieldlabel];
$label_fld[] = $col_fields[$fieldname];
} elseif ($uitype == 20 || $uitype == 21 || $uitype == 22 || $uitype == 24) {
//$col_fields[$fieldname]=nl2br($col_fields[$fieldname]);
$label_fld[] = $mod_strings[$fieldlabel];
$label_fld[] = $col_fields[$fieldname];
} elseif ($uitype == 51 || $uitype == 50 || $uitype == 73) {
$account_id = $col_fields[$fieldname];
$account_name = "";
if ($account_id != '') {
$account_name = getAccountName($account_id);
//.........这里部分代码省略.........
示例11: foreach
<td align="right" width="5%"><input type="checkbox" id="all" onChange="toggle_all();" /></td>
</tr>
<?php
$x = 0;
foreach ($accounts as $account => $v) {
?>
<tr bgcolor="#<?php
echo $x % 2 == 0 ? "BBBBBB" : "AAAAAA";
?>
">
<td align="center" width="5%"><?php
echo $v['id'];
?>
</td>
<td align="center" width="15%"><?php
echo getAccountName($v['id']);
?>
</td>
<td align="right"><input type="checkbox" name="id[]" value="<?php
echo $v['id'];
?>
" /></td>
</tr>
<?php
$x++;
}
}
if (!isset($accounts)) {
?>
<tr>
<td align="left" width="100" style="padding: 10px;">No empty accounts</td>
示例12: get_quote_pdf
/**
* Function to generate Quote pdf
*/
function get_quote_pdf()
{
require_once 'include/tcpdf/pdf.php';
require_once 'include/tcpdf/pdfconfig.php';
require_once 'include/database/PearDatabase.php';
require_once 'modules/Quotes/Quotes.php';
global $adb, $app_strings, $current_user;
// would you like and end page? 1 for yes 0 for no
$endpage = "1";
$focus = new Quotes();
$focus->retrieve_entity_info($_REQUEST['record'], "Quotes");
$focus->apply_field_security();
$account_name = getAccountName($focus->column_fields[account_id]);
$quote_no = $focus->column_fields[quote_no];
if ($focus->column_fields["hdnTaxType"] == "individual") {
$product_taxes = 'true';
} else {
$product_taxes = 'false';
}
$sql = "select currency_symbol from vtiger_currency_info where id=?";
$result = $adb->pquery($sql, array($focus->column_fields['currency_id']));
$currency_symbol = $adb->query_result($result, 0, 'currency_symbol');
// **************** BEGIN POPULATE DATA ********************
$account_id = $focus->column_fields[account_id];
$quote_id = $_REQUEST['record'];
// Quote Information
$valid_till = $focus->column_fields["validtill"];
$valid_till = getDisplayDate($valid_till);
$bill_street = $focus->column_fields["bill_street"];
$bill_city = $focus->column_fields["bill_city"];
$bill_state = $focus->column_fields["bill_state"];
$bill_code = $focus->column_fields["bill_code"];
$bill_country = $focus->column_fields["bill_country"];
$contact_name = getContactName($focus->column_fields["contact_id"]);
$ship_street = $focus->column_fields["ship_street"];
$ship_city = $focus->column_fields["ship_city"];
$ship_state = $focus->column_fields["ship_state"];
$ship_code = $focus->column_fields["ship_code"];
$ship_country = $focus->column_fields["ship_country"];
$conditions = from_html($focus->column_fields["terms_conditions"]);
$description = from_html($focus->column_fields["description"]);
$status = $focus->column_fields["quotestage"];
// Company information
$add_query = "select * from vtiger_organizationdetails";
$result = $adb->pquery($add_query, array());
$num_rows = $adb->num_rows($result);
if ($num_rows > 0) {
$org_name = $adb->query_result($result, 0, "organizationname");
$org_address = $adb->query_result($result, 0, "address");
$org_city = $adb->query_result($result, 0, "city");
$org_state = $adb->query_result($result, 0, "state");
$org_country = $adb->query_result($result, 0, "country");
$org_code = $adb->query_result($result, 0, "code");
$org_phone = $adb->query_result($result, 0, "phone");
$org_fax = $adb->query_result($result, 0, "fax");
$org_website = $adb->query_result($result, 0, "website");
$logo_name = $adb->query_result($result, 0, "logoname");
}
//Population of Product Details - Starts
//we can cut and paste the following lines in a file and include that file here is enough. For that we have to put a new common file. we will do this later
//NOTE : Removed currency symbols and added with Grand Total text. it is enough to show the currency symbol in one place
//we can also get the NetTotal, Final Discount Amount/Percent, Adjustment and GrandTotal from the array $associated_products[1]['final_details']
//get the Associated Products for this Invoice
$focus->id = $focus->column_fields["record_id"];
$associated_products = getAssociatedProducts("Quotes", $focus);
$num_products = count($associated_products);
//This $final_details array will contain the final total, discount, Group Tax, S&H charge, S&H taxes and adjustment
$final_details = $associated_products[1]['final_details'];
//getting the Net Total
$price_subtotal = number_format($final_details["hdnSubTotal"], 2, '.', ',');
//Final discount amount/percentage
$discount_amount = $final_details["discount_amount_final"];
$discount_percent = $final_details["discount_percentage_final"];
if ($discount_amount != "") {
$price_discount = number_format($discount_amount, 2, '.', ',');
} else {
if ($discount_percent != "") {
//This will be displayed near Discount label - used in include/fpdf/templates/body.php
$final_price_discount_percent = "(" . number_format($discount_percent, 2, '.', ',') . " %)";
$price_discount = number_format($discount_percent * $final_details["hdnSubTotal"] / 100, 2, '.', ',');
} else {
$price_discount = "0.00";
}
}
//Adjustment
$price_adjustment = number_format($final_details["adjustment"], 2, '.', ',');
//Grand Total
$price_total = number_format($final_details["grandTotal"], 2, '.', ',');
//To calculate the group tax amount
if ($final_details['taxtype'] == 'group') {
$group_tax_total = $final_details['tax_totalamount'];
$price_salestax = number_format($group_tax_total, 2, '.', ',');
$group_total_tax_percent = '0.00';
$group_tax_details = $final_details['taxes'];
for ($i = 0; $i < count($group_tax_details); $i++) {
$group_total_tax_percent = $group_total_tax_percent + $group_tax_details[$i]['percentage'];
}
//.........这里部分代码省略.........
示例13: getRecordValues
/** To get the converted record values which have to be display in duplicates merging tpl*/
function getRecordValues($id_array, $module)
{
global $adb, $current_user;
global $app_strings;
global $mod_strings;
$tabid = getTabid($module);
$query = "select fieldname,fieldlabel from ec_field where tabid=" . $tabid . " and fieldname not in ('createdtime','modifiedtime')";
$result = $adb->query($query);
$no_rows = $adb->num_rows($result);
for ($i = 0; $i < $no_rows; $i++) {
$fld_name = $adb->query_result($result, $i, "fieldname");
if (getFieldVisibilityPermission($module, $current_user->id, $fld_name) == '0') {
$fld_array[] = $fld_name;
}
}
$js_arr = $fld_array;
$focus = new $module();
if (isset($id_array) && $id_array != '') {
foreach ($id_array as $value) {
$focus->id = $value;
$focus->retrieve_entity_info($value, $module);
$field_values[] = $focus->column_fields;
}
}
$tabid = getTabid($module);
$query = "select fieldname,uitype,fieldlabel from ec_field where tabid=" . $tabid . " and fieldname not in ('createdtime','modifiedtime','lastcontacttime')";
$result = $adb->query($query);
$no_rows = $adb->num_rows($result);
$labl_array = array();
$value_pair = array();
$c = 0;
for ($i = 0; $i < $no_rows; $i++) {
$fld_name = $adb->query_result($result, $i, "fieldname");
$fld_label = $adb->query_result($result, $i, "fieldlabel");
if (isset($mod_strings[$fld_label])) {
$fld_label = $mod_strings[$fld_label];
}
$ui_type = $adb->query_result($result, $i, "uitype");
if (getFieldVisibilityPermission($module, $current_user->id, $fld_name) == '0') {
$record_values[$c][$fld_label] = array();
$ui_value[] = $ui_type;
for ($j = 0; $j < count($field_values); $j++) {
if ($ui_type == 56) {
if ($field_values[$j][$fld_name] == 0) {
$value_pair['disp_value'] = $app_strings['no'];
} else {
$value_pair['disp_value'] = $app_strings['yes'];
}
} elseif ($ui_type == 51 || $ui_type == 50) {
$account_id = $field_values[$j][$fld_name];
$account_name = getAccountName($account_id);
$value_pair['disp_value'] = $account_name;
} elseif ($ui_type == 53) {
$user_id = $field_values[$j][$fld_name];
$username = getUserName($user_id);
$group_info = getGroupName($field_values[$j]['record_id'], $module);
$groupname = $group_info[0];
$groupid = $group_info[1];
if ($user_id != 0) {
$value_pair['disp_value'] = $username;
} else {
$value_pair['disp_value'] = $groupname;
}
} elseif ($ui_type == 57) {
$contact_id = $field_values[$j][$fld_name];
if ($contact_id != '') {
$contactname = getContactName($contact_id);
}
$value_pair['disp_value'] = $contactname;
} elseif ($ui_type == 75 || $ui_type == 81) {
$vendor_id = $field_values[$j][$fld_name];
if ($vendor_id != '') {
$vendor_name = getVendorName($vendor_id);
}
$value_pair['disp_value'] = $vendor_name;
} elseif ($ui_type == 52) {
$user_id = $field_values[$j][$fld_name];
$user_name = getUserName($user_id);
$value_pair['disp_value'] = $user_name;
} elseif ($ui_type == 68) {
$parent_id = $field_values[$j][$fld_name];
$value_pair['disp_value'] = getAccountName($parent_id);
if ($value_pair['disp_value'] == '' || $value_pair['disp_value'] == NULL) {
$value_pair['disp_value'] = getContactName($parent_id);
}
} elseif ($ui_type == 59) {
$product_name = getProductName($field_values[$j][$fld_name]);
if ($product_name != '') {
$value_pair['disp_value'] = $product_name;
} else {
$value_pair['disp_value'] = '';
}
} elseif ($ui_type == 58) {
$campaign_name = getCampaignName($field_values[$j][$fld_name]);
if ($campaign_name != '') {
$value_pair['disp_value'] = $campaign_name;
} else {
$value_pair['disp_value'] = '';
}
//.........这里部分代码省略.........
示例14: getPlayerID
<td align="center"><?php
echo $player['id'];
?>
</td>
<td align="center"><a href="index.php?editor=player&playerid=<?php
echo getPlayerID($player['name']);
?>
"><?php
echo $player['name'];
?>
</a></td>
<td align="center"><a href="index.php?editor=account&acctid=<?php
echo $player['account_id'];
?>
"><?php
echo getAccountName($player['account_id']);
?>
</a></td>
<td align="center"><?php
echo $classes[$player['class']];
?>
</td>
<td align="center"><?php
echo $player['level'];
?>
</td>
<td align="right"><a href="index.php?editor=player&playerid=<?php
echo $player['id'];
?>
"><img src="images/view_all.gif" width="13" height="13" border="0" title="View Player"></a></td>
</tr>
示例15: date
//step2: compare timestart and reminder time
//step3: send reminder to smownerid or groupname or inviter
$dateTimeNow = date('Y-m-d H:i:s');
//New Reminder
$query = "select * from ec_reminders where userid ='{$current_user->id}' and isused=0 and remindertime >= '" . $dateTimeNow . "'";
$result = $adb->query($query);
if ($adb->num_rows($result) >= 1) {
while ($result_set = $adb->fetch_array($result)) {
$reminderid = $result_set['reminderid'];
$remindertime = $result_set['remindertime'];
$comments = $result_set['comments'];
$crmid = $result_set['crmid'];
$userid = $result_set['userid'];
$subject = $app_strings["LBL_REMINDER"] . ":<a href=\"index.php?module=CustomReminder&action=PopupReminders\" target=\"_blank\">" . $comments . "</a>," . $remindertime;
if ($crmid != "0" && $crmid != "" && $crmid != NULL) {
$accountname = getAccountName($crmid);
$subject = $subject . "," . $app_strings["Accounts"] . ":<a href=\"index.php?module=Accounts&action=DetaiView&record=" . $crmid . "\" target=\"_blank\">" . $accountname . "</a>";
}
$curr_time = strtotime(date("Y-m-d H:i")) / 60;
$current_date = date('Y-m-d');
$activity_time = strtotime(date("{$remindertime}")) / 60;
$needed_remindertime = $activity_time - $curr_time;
$reminder_time = 60;
//$log->debug("****new remindertime:".$remindertime);
//$log->debug("****new reminder_time:".$reminder_time);
//$log->debug("****new activity_time:".$activity_time);
//$log->debug("****new curr_time:".$curr_time);
//$log->debug("****new needed_remindertime:".$needed_remindertime);
if ($needed_remindertime > 0 && $needed_remindertime <= $reminder_time) {
$upd_query = "UPDATE ec_reminders SET isused=1 where reminderid=" . $reminderid;
$adb->query($upd_query);