function fahuodanrefer_value($fieldvalue, $fields, $i) { $value = $fieldvalue; $color = setColorByName($value); $outtype = returntablefield("fahuodan", "billid", $fields['value'][$i]['billid'], "outtype"); if ($outtype == "销售出库") { $billinfo = returntablefield("sellplanmain", "billid", $fieldvalue, "billtype,zhuti"); $billtype = $billinfo['billtype']; $title = $billinfo['zhuti']; if ($billtype == '1') { $url = "sellcontract_newai.php"; } else { if ($billtype == '2') { $url = "sellplanmain_newai.php"; } else { if ($billtype == '3') { $url = "sellonemain_newai.php"; } } } $fieldvalue = "<a style='color:{$color}' href='{$url}?" . base64_encode("action=view_default&billid=" . $fieldvalue) . "' target='_blank'>" . $title . "</a>"; } else { if ($outtype == '返厂出库') { $title = returntablefield("buyplanmain", "billid", $fieldvalue, "zhuti"); $fieldvalue = "<a style='color:{$color}' href='buyplanmain_newai.php?" . base64_encode("action=view_default&billid={$fieldvalue}") . "' target='_blank'>{$title}</a>"; } } return $fieldvalue; }
function stockinrefer_value($fieldvalue, $fields, $i) { $color = setColorByName($fieldvalue); if (stristr($fields['value'][$i]['intype'], "采购入库")) { $title = returntablefield("buyplanmain", "billid", $fieldvalue, "zhuti"); $fieldvalue = "<a style='color:{$color}' href='buyplanmain_newai.php?" . base64_encode("action=view_default&billid=" . $fieldvalue) . "' target='_blank'>" . $title . "</a>"; } else { if (stristr($fields['value'][$i]['intype'], "退货入库")) { $title = returntablefield("sellplanmain", "billid", $fieldvalue, "zhuti"); $fieldvalue = "<a style='color:{$color}' href='sellonemain_newai.php?" . base64_encode("action=view_default&billid=" . $fieldvalue) . "' target='_blank'>" . $title . "</a>"; } } return $fieldvalue; }
function relatePrice_value($fieldvalue, $fields, $i) { global $db; $sql = "select fieldname,chinese from systemlang where tablename='product' and fieldname='{$fieldvalue}'"; $rs = $db->Execute($sql); $rs_a = $rs->GetArray(); if (sizeof($rs_a) == 1) { $colorValue = setColorByName($rs_a[0]['chinese']); $fieldvalue = "<font color={$colorValue}>" . $rs_a[0]['chinese'] . "</font>"; } else { $fieldvalue = ""; } return $fieldvalue; }
function fahuodansupply_value($fieldvalue, $fields, $i) { $value = $fieldvalue; $color = setColorByName($value); $fahuoinfo = returntablefield("fahuodan", "billid", $fields['value'][$i]['billid'], "outtype,customerid"); $outtype = $fahuoinfo['outtype']; $customerid = $fahuoinfo['customerid']; if ($outtype == "销售出库") { $supplyname = returntablefield("customer", "rowid", $customerid, "supplyname"); $color = setColorByName($supplyname); $fieldvalue = "<a style='color:{$color}' href='customer_newai.php?" . base64_encode("action=view_default&ROWID=" . $customerid) . "' target='_blank'>" . $supplyname . "</a>"; } else { if ($outtype == '返厂出库') { $supplyname = returntablefield("supply", "rowid", $customerid, "supplyname"); $color = setColorByName($supplyname); $fieldvalue = "<a style='color:{$color}' href='supply_newai.php?" . base64_encode("action=view_default&ROWID=" . $customerid) . "' target='_blank'>" . $supplyname . "</a>"; } } return $fieldvalue; }
function accessbank_value($fieldvalue, $fields, $i) { $id = $fields['value'][$i]['编号']; $opertype = returntablefield("accessbank", "id", $id, "opertype"); $parent = returntablefield("accesstype", "name", $opertype, "parent"); $parentname = returntablefield("accesstype", "id", $parent, "name"); $colorValue = setColorByName($fieldvalue); if ($parentname == '货款') { if ($opertype == '货款支付') { $billinfo = returntablefield("buyplanmain", "billid", $fieldvalue, "zhuti,billid"); $fieldvalue = "<a href='buyplanmain_newai.php?action=view_default&billid=" . $billinfo['billid'] . "' target='_blank'><font color={$colorValue}>" . $billinfo['zhuti'] . "</font></a>"; } else { $billinfo = returntablefield("sellplanmain", "billid", $fieldvalue, "zhuti,billid"); $fieldvalue = "<a href='sellplanmain_newai.php?action=view_default&billid=" . $billinfo['billid'] . "' target='_blank'><font color={$colorValue}>" . $billinfo['zhuti'] . "</font></a>"; } } else { if ($parentname == '预收预付') { if ($opertype == '预收货款') { $fieldvalue = "<a href='accesspreshou_newai.php?action=view_default&id=" . $fieldvalue . "' target='_blank'><font color={$colorValue}>" . $opertype . "-" . $fieldvalue . "</font></a>"; } else { $fieldvalue = "<a href='accessprepay_newai.php?action=view_default&id=" . $fieldvalue . "' target='_blank'><font color={$colorValue}>" . $opertype . "-" . $fieldvalue . "</font></a>"; } } else { if ($opertype == '其他收入') { $fieldvalue = "<a href='v_shoururecord_newai.php?action=view_default&billid=" . $fieldvalue . "' target='_blank'><font color={$colorValue}>" . $opertype . "-" . $fieldvalue . "</font></a>"; } else { if ($opertype == '费用支出') { $fieldvalue = "<a href='v_feiyongrecord_newai.php?action=view_default&billid=" . $fieldvalue . "' target='_blank'><font color={$colorValue}>" . $opertype . "-" . $fieldvalue . "</font></a>"; } else { if ($opertype == '资金注入' || $opertype == '资金抽取') { $fieldvalue = "<a href='bankzhuru_newai.php?action=view_default&billid=" . $fieldvalue . "' target='_blank'><font color={$colorValue}>" . $opertype . "-" . $fieldvalue . "</font></a>"; } else { $fieldvalue = $parentname . "单-" . $fieldvalue; } } } } } return $fieldvalue; }
function callchuli_value($fieldvalue, $fields, $i) { $uniturl = ''; $colorValue = setColorByName($fieldvalue); if ($fields['value'][$i]['callertype'] == '客户') { $uniturl = "<a href='customer_newai.php?" . base64_encode("action=view_default&ROWID=" . $fields['value'][$i]['customerid']) . "' target='_blank'><font color={$colorValue}>{$fieldvalue}</font></a>"; } else { if ($fields['value'][$i]['callertype'] == '供应商') { $uniturl = "<a href='supply_newai.php?" . base64_encode("action=view_default&ROWID=" . $fields['value'][$i]['customerid']) . "' target='_blank'><font color={$colorValue}>{$fieldvalue}</font></a>"; } else { $customerid = returntablefield("customer", "supplyname", $fieldvalue, "rowid"); if ($customerid != '') { $uniturl = "<a href='customer_newai.php?" . base64_encode("action=view_default&ROWID=" . $customerid) . "' target='_blank'><font color={$colorValue}>{$fieldvalue}</font></a>"; } } } if ($uniturl != '') { $fieldvalue = $uniturl; } else { $tel = returntablefield("callchuli", "id", $fields['value'][$i]['id'], "tel"); $fieldvalue .= " <a href='customer_newai.php?" . base64_encode("action=add_default&supplyname=" . $fieldvalue . "&phone=" . $tel) . "' target='_blank'><img src='../Framework/images/notify_new.gif' title='创建客户'></a>"; } return $fieldvalue; }
function returntablefieldColorFilterGray($tablename, $what, $value, $return, $groupfield = '', $groupvalue = '', $字段名称 = '', $hascolor = false) { /* global $return_sql_line; $where_sql = $return_sql_line['where_sql'];; $where_sql_array = explode("where",$where_sql); if(trim($where_sql_array[1])!=""&&$字段名称!="") { $ADD_SQL_WHERE_TEXT = " and $return in (select distinct $字段名称 $where_sql)"; } else { $ADD_SQL_WHERE_TEXT = ""; } */ global $db; if ($value == '') { return; } if ($groupfield != "" && $groupvalue != "") { $sql = "select {$return},{$what} from {$tablename} where {$what}='{$value}' and {$groupfield}='{$groupvalue}' {$ADD_SQL_WHERE_TEXT}"; $TEMP_TAR = 1; } else { $sql = "select {$return},{$what} from {$tablename} where {$what}='{$value}' {$ADD_SQL_WHERE_TEXT}"; $TEMP_TAR = 0; } $return2 = ''; $rs = $db->CacheExecute(15, $sql); $rs_a = $rs->GetArray(); if (sizeof($rs_a) == 0 || $rs_a[0][$return] == "") { //如果返回值为空,则用传入值替代 $return2 = "<font color=gray title='在" . $tablename . "表关联信息中,找不到与本值对应的信息.'>{$value}</font>"; } else { //进行着色处理 $cutvalue = cutStr($rs_a[0][$return], 13); $tip = ''; if ($rs_a[0][$return] != $cutvalue) { $tip = "title='" . $rs_a[0][$return] . "'"; $rs_a[0][$return] = $cutvalue . ".."; } $colorValue = setColorByName($value); if ($value == "是") { $colorValue = "green"; } else { if ($value == "否") { $colorValue = "red"; } } //print "".strval($value)."";exit; //print_r($rs_a);exit; if ($tablename == 'customer') { $id = $rs_a[0][$what]; $return2 = "<a target='_blank' {$tip} href='../JXC/customer_newai.php?" . base64_encode("action=view_default&ROWID=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'supply') { $id = $rs_a[0][$what]; $return2 = "<a target='_blank' {$tip} href='../JXC/supply_newai.php?" . base64_encode("action=view_default&ROWID=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'linkman') { //$id = isset($rs_a[0]['ROWID'])?$rs_a[0]['ROWID']:$value; if (isset($rs_a[0]['ROWID'])) { $id = $rs_a[0]['ROWID']; $qq = returntablefield("linkman", "rowid", $id, "fax"); $return2 = "<a target='_blank' {$tip} href='../JXC/linkman_newai.php?" . base64_encode("action=view_default&ROWID=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } else { $return2 = $rs_a[0][$return]; } } elseif ($tablename == 'supplylinkman') { //$id = isset($rs_a[0]['ROWID'])?$rs_a[0]['ROWID']:$value; if (isset($rs_a[0]['ROWID'])) { $id = $rs_a[0]['ROWID']; } else { $sql = "select ROWID from {$tablename} where supplyname='" . $value . "'"; $rowid_rs = $db->CacheExecute(15, $sql); $rowid = $rowid_rs->GetArray(); $id = $rowid[0]['ROWID']; } $return2 = "<a target='_blank' {$tip} href='../JXC/supplylinkman_newai.php?" . base64_encode("action=view_default&ROWID=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'user') { if (isset($rs_a[0]['ROWID'])) { $id = $rs_a[0]['ROWID']; } else { $sql = "select UID from {$tablename} where USER_ID='" . $value . "'"; $rowid_rs = $db->CacheExecute(15, $sql); $rowid = $rowid_rs->GetArray(); $id = $rowid[0]['UID']; } $return2 = "<a target='_blank' {$tip} href='../Framework/user_newai.php?" . base64_encode("action=view_default&UID=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'crm_chance') { if (isset($rs_a[0]['编号'])) { $id = $rs_a[0]['编号']; } else { $sql = "select 编号 from {$tablename} where 机会主题='" . $value . "'"; $rowid_rs = $db->CacheExecute(15, $sql); $rowid = $rowid_rs->GetArray(); $id = $rowid[0]['编号']; } $return2 = "<a target='_blank' {$tip} href='../JXC/crm_chance_newai.php?" . base64_encode("action=view_default&编号=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'product') { $return2 = "<a target='_blank' {$tip} href='../JXC/product_newai.php?" . base64_encode("action=view_default&productid=" . $value) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'sellplanmain') { $id = $rs_a[0]['billid']; $billtype = returntablefield($tablename, "billid", $id, "billtype"); if ($billtype == 1) { $urlName = "sellcontract"; } else { if ($billtype == 2) { $urlName = "sellplanmain"; } else { if ($billtype == 3) { $urlName = "sellonemain"; } } } $return2 = "<a target='_blank' {$tip} href='../JXC/" . $urlName . "_newai.php?" . base64_encode("action=view_default&billid=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'buyplanmain') { $id = $rs_a[0]['billid']; $return2 = "<a target='_blank' {$tip} href='../JXC/buyplanmain_newai.php?" . base64_encode("action=view_default&billid=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'stock') { $id = $rs_a[0]['ROWID']; $return2 = "<a target='_blank' {$tip} href='../JXC/store_product_newai.php?" . base64_encode("action=init_default&storeid=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'bank') { $id = $rs_a[0][$what]; $return2 = "<a target='_blank' {$tip} href='../JXC/v_accessbank_newai.php?" . base64_encode("action=init_default&银行账户=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'fahuotype') { $id = $rs_a[0]['id']; $return2 = "<a target='_blank' {$tip} href='../JXC/fahuodan_newai.php?" . base64_encode("action=init_default&fahuotype=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'customerproduct') { $id = $rs_a[0]['ROWID']; $return2 = "<a target='_blank' {$tip} href='../JXC/customerproduct_newai.php?" . base64_encode("action=view_default&ROWID=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'customer_xuqiu') { $id = $rs_a[0][$what]; $return2 = "<a target='_blank' {$tip} href='../JXC/customer_xuqiu_newai.php?" . base64_encode("action=view_default&{$what}=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'crm_shenqingbaobei') { $id = $rs_a[0][$what]; $return2 = "<a target='_blank' {$tip} href='../JXC/crm_shenqingbaobei_newai.php?" . base64_encode("action=view_default&{$what}=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } elseif ($tablename == 'workplanmain') { $id = $rs_a[0][$what]; $return2 = "<a target='_blank' {$tip} href='../CRM/workplanmain_newai.php?" . base64_encode("action=view_default&{$what}=" . $id) . "'><font color={$colorValue}>" . $rs_a[0][$return] . "</font></a>"; } else { if ($hascolor) { $return2 = "<span {$tip}><font color={$colorValue}>" . $rs_a[0][$return] . "</font></span>"; } else { $return2 = "<span {$tip}>" . $rs_a[0][$return] . "</span>"; } } } //print $return2;print $value;print "<BR>"; //if($value=="50001") exit; //print $return2;exit; //if($TEMP_TAR == 1) print_R($return2); return $return2; }