function userDefineExecuteStatus_Value($fieldvalue, $fields, $i) { global $db; global $tablename, $html_etc, $common_html; $CustomerID = $fields['value'][$i]['CustomerID']; $sql = "select * from {$tablename} where CustomerID='{$CustomerID}'"; $rs = $db->Execute($sql); $rs_a = $rs->GetArray(); $FilterArray = array('CommunicationNeeds' => "需求沟通", 'AuthorProgramme' => "方案撰写", 'StylePagesPhase1' => "风格页阶段", 'ContractNegotiations' => "合同洽谈", 'ContractConfirmation' => "合同确认", 'WebsiteAllDesign' => "网站整体设计", 'RecordTransmitted' => "文案执行", 'ProgrameExecute' => "全案执行", 'WebsiteDesign' => "网站制作", 'WebsiteDevelopment' => "网站开发", 'InternalInspection' => "内部验收", 'CustomerAcceptance' => "客户验收", 'WebsiteReleased' => "网站发布"); $FilterKeys = array_keys($FilterArray); $array_combine = array_combine($FilterKeys); $returnColorArray = returnColorArrayTableFilter(); for ($k = 0; $k < sizeof($FilterKeys); $k++) { $KeyElement = $FilterKeys[$k]; if ($rs_a[0][$KeyElement] != "") { $fieldvalue = $FilterArray[$KeyElement]; $KeyElement2 = $FilterKeys[$k + 1]; //得到色彩值 $Index = $array_combine[$KeyElement]; $colorIndex = $Index % 8; $colorValue = $returnColorArray[$colorIndex]; if ($FilterArray[$KeyElement2] == "") { $MarkMEMO = "已经是最后一步:" . $FilterArray[$KeyElement]; } else { $MarkMEMO = "下一步:" . $FilterArray[$KeyElement2]; } } } //更新数据 $sql = "update crm_customer set ExecuteStatus = '" . $fieldvalue . "' where CustomerID='{$CustomerID}'"; $db->Execute($sql); //print $sql; $fieldvalue = "<font color={$colorValue} title='{$MarkMEMO}'>{$fieldvalue}</font>"; return $fieldvalue; }
function returntablefieldGroup($tablename, $what, $value, $return, $groupfield = '', $groupvalue = '') { $return2 = ''; global $db; if ($groupfield != "" && $groupvalue != "") { $sql = "select distinct {$return},{$what} from {$tablename} where {$groupfield}='{$groupvalue}'"; $TEMP_TAR = 1; } else { $sql = "select distinct {$return},{$what} from {$tablename}"; $TEMP_TAR = 0; } //print $sql; $rs = $db->CacheExecute(30, $sql); $rs_a = $rs->GetArray(); for ($i = 0; $i < sizeof($rs_a); $i++) { $updateValue = $rs_a[$i][$what]; if ($updateValue == $value) { $returnColorArray = returnColorArrayTableFilter(); $colorIndex = $i % 8; $colorValue = $returnColorArray[$colorIndex]; $return2 = "<font color={$colorValue}>" . $rs_a[$i][$return] . "</font>"; } else { //$return2 = ""; } } //if($TEMP_TAR == 1) print_R($return2); return $return2; }