public function update()
 {
     $table_fields = getFieldList($this->database_table_name);
     $sql_statement = "UPDATE {$this->database_table_name} SET ";
     for ($i = 1; $i < count($table_fields); $i++) {
         $sql_statement .= $table_fields[$i] . "='" . addslashes($this->{$table_fields}[$i]) . "'";
         if ($i < count($table_fields) - 1) {
             $sql_statement .= ", ";
         }
     }
     $sql_statement .= " WHERE id={$this->id};";
     mysql_do($sql_statement);
     $this->id = mysql_insert_id();
     return TRUE;
 }
Example #2
0
function FormSubmit()
{
    $TableName = '';
    $SplStr = '';
    $S = '';
    $FieldName = '';
    $FieldContent = '';
    $FieldList = '';
    $YZM = '';
    $GLOBALS['conn='] = OpenConn();
    $SplStr = aspSplit(@$_POST[], '&');
    $TableName = Rf('TableName');
    $YZM = aspTrim(Rf('YZM'));
    if ($YZM != '') {
        if (@$_SESSION['YZM'] != $YZM) {
            javascript('返回', '验证码不正确', '');
            die;
        }
    }
    $FieldList = lCase(getFieldList($TableName));
    //Call Echo("FieldList",FieldList)
    //Call Echo("TableName", TableName)
    $RsObj = $GLOBALS['conn']->query('Select * From [' . $TableName . ']');
    foreach ($SplStr as $key => $S) {
        $FieldName = lCase(mid($S, 1, inStr($S, '=') - 1));
        //FieldContent = Mid(S,InStr(S,"=")+1)
        $FieldContent = Rf($FieldName);
        if (inStr(',' . $FieldList . ',', ',' . $FieldName . ',') > 0) {
            $Rs[$FieldName] = $FieldContent;
        }
        //Call Echo(FieldName,FieldContent & "," & unescape(FieldContent))
    }
    //	Call Echo("DialogTitle",Rf("DialogTitle"))
    //Call Die("留言内容")
    javascript('返回', '提交' . Rf('DialogTitle') . '成功', '');
}
Example #3
0
function getHandleFieldList($tableName, $sType)
{
    $s = '';
    if ($GLOBALS['WEB_CACHEContent'] == '') {
        $GLOBALS['WEB_CACHEContent'] = getFText($GLOBALS['WEB_CACHEFile']);
    }
    $s = getConfigContentBlock($GLOBALS['WEB_CACHEContent'], '#' . $tableName . $sType . '#');
    if ($s == '') {
        if ($sType == '字段配置列表') {
            $s = lCase(getFieldConfigList($tableName));
        } else {
            $s = lCase(getFieldList($tableName));
        }
        $GLOBALS['WEB_CACHEContent'] = setConfigFileBlock($GLOBALS['WEB_CACHEFile'], $s, '#' . $tableName . $sType . '#');
        if ($GLOBALS['isCacheTip'] == true) {
            aspEcho('缓冲', $tableName . $sType);
        }
    }
    $getHandleFieldList = $s;
    return @$getHandleFieldList;
}
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ********************************************************************************/
require_once 'include/utils/utils.php';
require_once 'modules/Tooltip/TooltipUtils.php';
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $adb, $currentModule;
global $theme;
$smarty = new vtigerCRM_Smarty();
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$module_name = vtlib_purify($_REQUEST['module_name']);
$field_name = vtlib_purify($_REQUEST['field_name']);
$related_fields = getFieldList($module_name, $field_name);
$fieldlist = array();
$tabid = getTabid($module_name);
$sql = "select * from vtiger_field where fieldname= ? and tabid= ? and vtiger_field.presence in (0,2)";
$result = $adb->pquery($sql, array($field_name, $tabid));
$fieldid = $adb->query_result($result, 0, "fieldid");
$fieldlist[$module_name] = getRelatedFieldslist($fieldid, $related_fields);
if ($_REQUEST['module_name'] != '') {
    $smarty->assign("DEF_MODULE", vtlib_purify($_REQUEST['module_name']));
} else {
    $smarty->assign("DEF_MODULE", 'Accounts');
}
$smarty->assign("FIELDID", $fieldid);
$smarty->assign("FIELD_INFO", $module_name);
$smarty->assign("FIELD_LISTS", $fieldlist);
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));