• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getFields函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getFields函数的典型用法代码示例。如果您正苦于以下问题:PHP getFields函数的具体用法?PHP getFields怎么用?PHP getFields使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: results

 public function results()
 {
     if (!$this->isAdmin) {
         $this->login();
     }
     $this->check();
     $this->title("Manage " . $this->application);
     $this->CSS("results", "cpanel");
     $this->CSS("pagination");
     $this->js("checkbox");
     $trash = segment(3, isLang()) === "trash" ? TRUE : FALSE;
     $total = $this->CPanel_Model->total($trash);
     $thead = $this->CPanel_Model->thead("checkbox, " . getFields($this->application) . ", Action", FALSE);
     $pagination = $this->CPanel_Model->getPagination($trash);
     $tFoot = getTFoot($trash);
     $this->vars["message"] = !$tFoot ? "Error" : NULL;
     $this->vars["pagination"] = $pagination;
     $this->vars["trash"] = $trash;
     $this->vars["search"] = getSearch();
     $this->vars["table"] = getTable(__(_("Manage " . ucfirst($this->application))), $thead, $tFoot, $total);
     $this->vars["view"] = $this->view("results", TRUE, "cpanel");
     $this->render("content", $this->vars);
 }
开发者ID:no2key,项目名称:MuuCMS,代码行数:23,代码来源:cpanel.php


示例2: thumbnailForm_submit

function thumbnailForm_submit($form, $form_state)
{
    $params = drupal_get_query_parameters();
    // getting the inputted info from the fields
    $fields = array("FID");
    $picData = getFields($fields, $form_state['values']);
    $picData = stripTags($picData, '');
    $oldFID = isset($form_state['oldFID']) ? $form_state['oldFID'] : 0;
    if (isset($params["UID"])) {
        // if updating user's profile picture
        $UID = $params["UID"];
        replacePicture($picData['FID'], $oldFID, 'Users');
        dbUpdate("profiles", $picData, "UID", $UID);
        drupal_goto("viewUser", array('query' => array('UID' => $UID)));
    } else {
        if (isset($params["OID"])) {
            // if editing outreach thumbnail
            $OID = $params["OID"];
            replacePicture($picData['FID'], $oldFID, 'Outreach');
            dbUpdateOutreach($OID, $picData);
            drupal_goto("viewOutreach", array('query' => array('OID' => $OID)));
        } else {
            if (isset($params["TID"])) {
                // if editing team thumbnail
                $TID = $params["TID"];
                replacePicture($picData['FID'], $oldFID, 'Teams');
                dbUpdateTeam($TID, $picData);
                drupal_goto("viewTeam", array('query' => array('TID' => $TID)));
            } else {
                drupal_goto("myDashboard");
            }
        }
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:34,代码来源:editThumbnailForm.php


示例3: notificationForm_submit

function notificationForm_submit($form, $form_state)
{
    global $user;
    $params = drupal_get_query_parameters();
    $OID = $params['OID'];
    // generate the notification
    $notification = getFields(array('dateTargeted', 'message'), $form_state['values']);
    $notification = stripTags($notification);
    // allow some tags
    $notification['dateTargeted'] = dbDatePHP2SQL(strtotime($notification['dateTargeted']));
    $notification['bttnTitle'] = 'View Outreach';
    $notification['bttnLink'] = '?q=viewOutreach&OID=' . $OID;
    $notification['OID'] = $OID;
    $notification['TID'] = dbGetTeamForOutreach($OID);
    $notification['dateCreated'] = dbDatePHP2SQL(time());
    foreach ($form_state['values']['UID'] as $UID) {
        if ($UID != null) {
            $notification['UID'] = $UID;
            $result = dbAddNotification($notification);
        }
    }
    if ($result) {
        drupal_set_message('Notification added!');
        drupal_goto('manageNotifications', array('query' => array('OID' => $OID)));
    } else {
        drupal_set_message('There was an error.', 'error');
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:28,代码来源:notificationForm.php


示例4: usersSearch_submit

function usersSearch_submit($form, $form_state)
{
    $names = array('nameContains');
    $row = getFields($names, $form_state['values']);
    $row = stripTags($row, '');
    drupal_goto('showUsersForTeam', array('query' => array('query' => $row['nameContains'])));
    return;
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:8,代码来源:usersSearch.php


示例5: outreachPageHeader_submit

function outreachPageHeader_submit($form, &$form_state)
{
    $fields = array('team');
    $newTID = getFields($fields, $form_state['values'])['team'];
    setCurrentTeam($newTID);
    $teamNumber = dbGetTeamNumber($newTID);
    drupal_set_message("Now operating under Team {$teamNumber}!");
    drupal_goto('outreach');
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:9,代码来源:viewMiscOutreach.php


示例6: createData

 function createData()
 {
     $sections = array();
     A::$DB->query("SELECT * FROM " . DOMAIN . "_sections WHERE module='shoplite' OR module='catalog' ORDER BY sort");
     while ($row = A::$DB->fetchRow()) {
         $_section = DOMAIN . "_" . $row['lang'] . "_" . $row['name'];
         if (getFields($_section)) {
             $sections[$_section] = $row['caption'];
         }
     }
     A::$DB->free();
     $this->Assign("sections", $sections);
     if (!empty($_GET['section'])) {
         $_section = preg_replace("/[^a-zA-Z0-9_-]/i", "", $_GET['section']);
         if (isset($sections[$_section])) {
             $section = $_section;
             setcookie(STRUCTURE, $_GET['section'], time() + 31104000);
         }
     }
     if (empty($section)) {
         $section = preg_replace("/[^a-zA-Z0-9_-]/i", "", A_Session::get(STRUCTURE, isset($_COOKIE[STRUCTURE]) ? $_COOKIE[STRUCTURE] : key($sections)));
     }
     A_Session::set(STRUCTURE, $section);
     $this->Assign("section", $section);
     if (empty($section)) {
         return;
     }
     $categories = A::$DB->getAll("SELECT id,idker,name FROM {$section}_categories ORDER BY level,sort");
     $this->Assign("categories", $categories);
     $idcat = !empty($_GET['idcat']) ? (int) $_GET['idcat'] : 0;
     $_cfields = getTextOption(STRUCTURE, 'cfields');
     $_cfields = !empty($_cfields) ? unserialize($_cfields) : array();
     if (!isset($_cfields[$section])) {
         $_cfields[$section] = $_cfields;
     }
     $_cfields = !empty($_cfields[$section][$idcat]) ? $_cfields[$section][$idcat] : array();
     $cfields = cfields_getfields($idcat, $section);
     foreach ($cfields as $field => $value) {
         if (in_array($field, $_cfields)) {
             unset($cfields[$field]);
         }
     }
     $fields = array();
     A::$DB->query("SELECT * FROM " . DOMAIN . "_fields WHERE item='{$section}' ORDER BY sort");
     while ($row = A::$DB->fetchRow()) {
         $row['disabled'] = isset($cfields[$row['field']]);
         $row['checked'] = in_array($row['field'], $_cfields) || $row['disabled'];
         $row['caption'] = $row['name_' . LANG];
         $fields[] = $row;
     }
     A::$DB->free();
     $this->Assign("fields", $fields);
 }
开发者ID:procivam,项目名称:s-mir-new,代码行数:53,代码来源:cfields.php


示例7: generateDomainObjects

/**
 * Enter description here...
 *
 * @param unknown_type $ret
 * @return
 */
function generateDomainObjects($ret){
	for($i=0;$i<count($ret);$i++){
		if(!doesTableContainPK($ret[$i])){
			continue;
		}
		$tableName = $ret[$i][0];
		$clazzName = getClazzName($tableName);
		if($clazzName[strlen($clazzName)-1]=='s'){
			$clazzName = substr($clazzName, 0, strlen($clazzName)-1);
		}
		$template = new Template('templates/Domain.tpl');
		$template->set('domain_class_name', $clazzName);
		$template->set('table_name', $tableName);
		$tab = getFields($tableName);
		$fields = "";
		
		$initFields = "";
		$getsetMethods = "\n";
		$toStrFields = "return ''";
		for($j=0;$j<count($tab);$j++) {
			$fieldName = getVarNameWithS($tab[$j][0]);
			$fields .= "\tprivate $".$fieldName.";\n";
			
			$initFields .= "\t\tif (isset(\$fields['".$fieldName."'])) \$this->".$fieldName." = \$fields['".$fieldName."'];\n";
			
			$camelFieldName = $fieldName;
			$camelFieldName[0] = strtoupper($fieldName[0]);
			$getsetMethods .= "\tpublic function get$camelFieldName() {\n\t\treturn \$this->$fieldName;\n\t}\n";
			$getsetMethods .= "\tpublic function set$camelFieldName($".$fieldName.") {\n\t\t\$this->fields['$fieldName'] = $".$fieldName.";\n\t\t\$this->$fieldName = $".$fieldName.";\n\t}\n\n";
			$toStrFields .= ".':'.\$this->".$fieldName;
		}
		$toStrFields .= ";";
		
		$template->set('variables', $fields);
		$template->set('init_variables', $initFields);
		$template->set('getset_methods', $getsetMethods);
		$template->set('tostr_variables', $toStrFields);
		
		$template->set('date', date("Y-m-d H:i"));
		$template->write('generated/'.$clazzName.'.php');
	}
}
开发者ID:ngduc,项目名称:Thin-PHP-Framework,代码行数:48,代码来源:generate.php


示例8: session_start

<?php

// Author : Wisnu
// Email  : -
// Start  : 25 Maret 2009
session_start();
include_once "../dwo.lib.php";
include_once "../db.mysql.php";
include_once "../connectdb.php";
include_once "../parameter.php";
include_once "../cekparam.php";
include_once "../fpdf.php";
$pmbid = $_REQUEST['pmbid'];
$pmb = getFields('pmb', "PMBID", $pmbid, '*');
$ProdiNama = getFields('prodi', "ProdiID", $pmb['ProdiID'], 'Nama');
$pdf = new FPDF('P', 'mm', 'A4');
$pdf->AddPage();
$identitas = GetFields('identitas', 'Kode', KodeID, '*');
$pdf->Image('../img/logo.jpg', 10, 10, 20);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(10, 6, '', 0, 0);
$pdf->Cell(75, 6, 'KARTU TANDA MAHASISWA SEMENTARA', 0, 1, 'C');
$pdf->SetFont('Helvetica', 'B', 15);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(10, 15, '', 0, 0);
$pdf->Cell(75, 6, $identitas['Nama'], 0, 1, 'C');
$pdf->Ln(5);
$pdf->SetFont('Courier', 'B', 18);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(5, 10, '', 0, 0);
$pdf->Cell(50, 10, $pmb['MhswID'], 0, 1);
开发者ID:anggadjava,项目名称:sisfor,代码行数:31,代码来源:mhswbaru.ktm.php


示例9: experimentHasTime

function experimentHasTime($eid)
{
    $fields = getFields($eid);
    if ($fields != NULL) {
        foreach ($fields as $f) {
            // If the type if 7
            if ($f['type_id'] == 7) {
                return $f['type_name'];
            }
        }
    }
    return false;
}
开发者ID:nickavv,项目名称:iSENSE,代码行数:13,代码来源:experiment.php


示例10: teamSummary_submit

function teamSummary_submit($form, &$form_state)
{
    $fields = array('team');
    $newTID = getFields($fields, $form_state['values'])['team'];
    setCurrentTeam($newTID);
    $teamNumber = dbGetTeamNumber($newTID);
    drupal_set_message("Now operating under Team {$teamNumber}!");
    drupal_goto('teamDashboard');
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:9,代码来源:viewTeamInfo.php


示例11: session_start

<?php

// Author : Wisnu
// Email  : -
// Start  : 25 Maret 2009
session_start();
include_once "../dwo.lib.php";
include_once "../db.mysql.php";
include_once "../connectdb.php";
include_once "../parameter.php";
include_once "../cekparam.php";
include_once "../fpdf.php";
$pmbid = $_REQUEST['pmbid'];
$pmb = getFields('pmb', "PMBID", $pmbid, '*');
$pdf = new FPDF('P', 'mm', 'A4');
$pdf->AddPage();
$identitas = GetFields('identitas', 'Kode', KodeID, '*');
$pdf->Image('../img/logo.jpg', 10, 10, 20);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(20, 6, '', 0, 0);
$pdf->Cell(75, 6, 'KARTU TANDA MAHASISWA SEMENTARA', 0, 1, 'C');
$pdf->SetFont('Helvetica', 'B', 15);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(20, 15, '', 0, 0);
$pdf->Cell(75, 15, $identitas['Nama'], 0, 1, 'C');
$pdf->SetFont('Courier', 'B', 18);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(5, 10, '', 0, 0);
$pdf->Cell(50, 10, $pmb['MhswID'], 0, 1);
$pdf->SetFont('Arial', '', 6);
$pdf->Cell(55, 4, 'NOMOR POKOK MAHASISWA', 0, 1);
开发者ID:anggadjava,项目名称:mitra_siakad,代码行数:31,代码来源:mhswbaru.ktm.php


示例12: outreachForm_submit

function outreachForm_submit($form, $form_state)
{
    global $user;
    $UID = $user->uid;
    $TID = $form_state['TID'];
    $outreachFields = array("name", "peopleImpacted", "address", "city", "state", "country", "status", "co_organization", "co_firstName", "co_lastName", "co_email", "co_phoneNumber", "isPublic");
    $outreachData = getFields($outreachFields, $form_state['values']);
    $outreachData = stripTags($outreachData, '');
    // remove all tags
    $outreachData['description'] = stripTags(array($form_state['values']['description']));
    // allow some tags
    $outreachData["TID"] = $TID;
    if ($form_state['new']) {
        $outreachData["UID"] = $UID;
    }
    if (isset($form_state['OID'])) {
        $OID = $form_state['OID'];
        $oldOutreachData = dbGetOutreach($OID);
        if ($outreachData["status"] == "doingWriteUp" && $oldOutreachData["isWriteUpApproved"] == true) {
            $outreachData["writeUpUID"] = null;
            $outreachData["isWriteUpSubmitted"] = 0;
            $outreachData["isWriteUpApproved"] = 0;
        }
    }
    if (!$form_state['new']) {
        // updating existing event
        $OID = $form_state['OID'];
        $result = dbUpdateOutreach($OID, $outreachData);
        if ($result) {
            // if db call was successful
            for ($i = 0; $i < $form_state['numRows']; $i++) {
                // loop through date rows
                $TOID = isset($form_state['fields']['dates']["TOID-{$i}"]) ? $form_state['fields']['dates']["TOID-{$i}"] : 0;
                $timeData['startTime'] = dbDatePHP2SQL(strtotime($form_state['values']["startTime-{$i}"]));
                dpm($timeData['startTime']);
                $timeData['endTime'] = dbDatePHP2SQL(strtotime($form_state['values']["endTime-{$i}"]));
                if ($timeData['startTime'] != null && $timeData['endTime'] != null) {
                    // if row isn't empty
                    if ($TOID != 0) {
                        // update existing record
                        dbUpdateTimesForOutreach($TOID, $timeData);
                    } else {
                        // add a new time record if there wasn't one previously
                        $timeData['OID'] = $OID;
                        dbAddTimesToOutreach($timeData);
                    }
                } else {
                    // remove time record if empty
                    dbRemoveTimeFromOutreach($TOID);
                }
            }
            for ($i = $form_state['numRows']; $i < $form_state['initialNumTimes']; $i++) {
                // executes if times were deleted
                dbRemoveTimeFromOutreach($form_state['fields']['dates']["TOID-{$i}"]);
            }
            $notification = array();
            $userName = dbGetUserName($user->uid);
            $outName = dbGetOutreachName($OID);
            $notification['dateCreated'] = dbDatePHP2SQL(time());
            $notification['dateTargeted'] = dbDatePHP2SQL(time());
            $notification['message'] = "{$userName} has updated outreach {$outName}.";
            $notification['bttnTitle'] = 'View';
            $notification['bttnLink'] = '?q=viewOutreach&OID=' . $OID;
            $notification['TID'] = $TID;
            notifyUsersByRole($notification, 'moderator');
            // handle tags
            if (!empty($form_state['values']['tags'])) {
                $newTags = $form_state['values']['tags'];
                $previous = dbGetTagsForOutreach($OID, true);
                // the "true" means this will return only OTID's
                if ($previous == false) {
                    // if there aren't any tags
                    $previous = array();
                }
                $deleted = array_diff($previous, $newTags);
                $added = array_diff($newTags, $previous);
                foreach ($deleted as $delete) {
                    // $delete is the OTID to be removed from the outreach
                    if (!empty($delete)) {
                        dbRemoveTagFromOutreach($delete, $OID);
                    }
                }
                foreach ($added as $add) {
                    // $add is the OTID to be added to the outreach
                    if (!empty($add)) {
                        dbAddTagToOutreach($add, $OID);
                    }
                }
            }
            drupal_set_message("Outreach updated!");
        } else {
            drupal_set_message("Outreach not updated.");
        }
    } else {
        // adding new event
        $outreachData['logDate'] = dbDatePHP2SQL(time());
        $OID = dbCreateOutreach($outreachData);
        if ($OID != false) {
            dbAddUserAsOwnerOfOutreach($UID, $OID);
            dbAssignUserToOutreach($UID, $OID, 'owner');
//.........这里部分代码省略.........
开发者ID:ChapResearch,项目名称:CROMA,代码行数:101,代码来源:outreachForm.php


示例13: foreach

        // Get experiment Id for each session
        foreach ($sessionIds as $sid) {
            $eid = getSessionExperimentId($sid);
            $data[] = array('experimentId' => $aid != -1 ? $aid : $eid, 'sessionId' => $sid, 'fields' => getFields($eid), 'meta' => array(getSession($sid)), 'data' => getData($eid, $sid));
        }
    } else {
        $eid = getSessionExperimentId($sessionIds[0]);
        $data['id'] = $eid;
        $data['meta'] = getExperiment($eid);
        $data['sessions'] = array();
        foreach ($sessionIds as $sid) {
            $x = array();
            $x['id'] = $sid;
            $x['meta'] = array(getSession($sid));
            $x['data'] = getData($eid, $sid);
            $x['fields'] = getFields($eid);
            $x['visibility'] = true;
            $data['sessions'][] = $x;
        }
    }
} else {
    if (isset($_GET['vsessions'])) {
    }
}
for ($i = 0; $i < count($data[0]['fields']); $i++) {
    if ($data[0]['fields'][$i]['type_id'] == 7) {
        $tf = $i;
    }
}
if (isset($tf)) {
    if (is_numeric($data[0]['data'][0][$tf])) {
开发者ID:nickavv,项目名称:iSENSE,代码行数:31,代码来源:json.php


示例14: safeString

    $state = (int) safeString($_REQUEST['state']);
} else {
    $state = IDENTIFY;
}
if (isset($_POST['timefix'])) {
    $timefix = $_POST['timefix'];
}
if (isset($_POST['columnfix'])) {
    $columnfix = $_POST['columnfix'];
}
if (isset($_REQUEST['id'])) {
    $eid = isset($_POST['id']) ? $_POST['id'] : $_GET['id'];
    if ($meta = getExperiment($eid)) {
        $ownerid = $meta['owner_id'];
        $title = ucwords($meta['name']) . " - Add New Session";
        $fields = getFields($eid);
    }
    //$fields = array_slice($fields, 1);
    $smarty->assign('meta', $meta);
    $smarty->assign('title', $title);
    $smarty->assign('fields', $fields);
    $smarty->assign('field_count', count($fields));
} else {
    array_push($errors, 'Could not find your experiment.');
}
// Check to see if we have started the form process yet
if (isset($_POST['session_create']) && count($errors) == 0) {
    $type = isset($_POST['session_type']) ? safeString($_POST['session_type']) : "file";
    $smarty->assign('session_type', $type);
    // Check to ensure we get all the experiment meta
    $post_data = array('session_name' => "", 'session_description' => "", 'session_street' => "", 'session_citystate' => "", 'session_type' => "");
开发者ID:nickavv,项目名称:iSENSE,代码行数:31,代码来源:upload.php


示例15: hoursForm_submit

function hoursForm_submit($form, $form_state)
{
    global $user;
    // getting value of new from form state
    $new = isset($form_state['new']) ? $form_state['new'] : true;
    $OID = $form_state['OID'];
    // looping through the rows of hours
    for ($i = 0; $i < $form_state['numRows']; $i++) {
        $fields = array("numberOfHours-{$i}", "description-{$i}", "type-{$i}");
        $row = getFields($fields, $form_state['values']);
        // dont allow any html tags
        $row = stripTags($row, '');
        // setting the values which were read in into the row which will go into the database
        $row['numberOfHours'] = $row["numberOfHours-{$i}"];
        $row['description'] = $row["description-{$i}"];
        $row['isApproved'] = 0;
        $row['type'] = $row["type-{$i}"];
        unset($row["type-{$i}"], $row["numberOfHours-{$i}"], $row["description-{$i}"]);
        if (isset($form_state['values']['fields']['UID'])) {
            $UID = $form_state['values']['fields']['UID'];
        } else {
            $UID = $user->uid;
        }
        if ($UID != 0) {
            $row['UID'] = $UID;
        }
        $row['OID'] = $OID;
        // if adding new hours
        if ($new) {
            if (dbLogHours($row) == false) {
                drupal_set_message("Error", 'error');
                break;
            }
        } else {
            // editing old hours
            $row['isApproved'] = 0;
            if (dbUpdateHours($row, $form_state['HID']) == false) {
                drupal_set_message("Error", 'error');
                break;
            }
        }
    }
    // end of for loop
    drupal_set_message("Your hours have been logged!");
    // assigning user to outreach if not new
    if (!$new) {
        dbAssignUserToOutreach($UID, $OID, $row['type']);
        drupal_goto("viewOutreach", array('query' => array("OID" => $OID)));
    } else {
        // notifying appropriate users of changes/addition of hours
        $outreachName = dbGetOutreachName($OID);
        $personName = dbGetUserName($user->uid);
        $notification['message'] = "{$personName} has logged hours for {$outreachName}!";
        $notification['TID'] = dbGetTeamForOutreach($OID);
        $notification['dateTargeted'] = dbDatePHP2SQL(time());
        $notification['dateCreated'] = dbDatePHP2SQL(time());
        notifyUsersByRole($notification, 'moderator');
        notifyOwnerOfOutreach($OID, $notification);
        if ($OID != 0) {
            drupal_goto("viewHours", array('query' => array("OID" => $OID)));
        } else {
            drupal_goto("viewHours", array('query' => array("UID" => $UID)));
        }
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:65,代码来源:hourForm.php


示例16: cfields_ShowBlock

function cfields_ShowBlock($block, $data)
{
    if ($block == 'shoplite_filters') {
        $section = MODULE == 'shoplite' ? SECTION : getSectionByModule('shoplite');
        $idcat = MODULE == 'shoplite' ? A::$MAINFRAME->idcat : 0;
        $fields = getFields($section);
        $_fields = cfields_getfields($idcat, $section);
        $filters = $data['object']->get_template_vars('filters');
        foreach ($filters as $i => $filter) {
            if (isset($fields[$filter['field']]) && !isset($_fields[$filter['field']])) {
                unset($filters[$i]);
            }
        }
        $data['object']->Assign("filters", array_values($filters));
    }
}
开发者ID:procivam,项目名称:s-mir-new,代码行数:16,代码来源:include.php


示例17: profileForm_submit

function profileForm_submit($form, $form_state)
{
    global $user;
    $params = drupal_get_query_parameters();
    if (!isset($params['UID'])) {
        $UID = $user->uid;
    } else {
        $UID = $params['UID'];
    }
    // getting the inputted info from the fields
    $fields = array("firstName", "lastName", "position", "phone", "grade", "gender", "FID", "type");
    $profileData = getFields($fields, $form_state['values']);
    $profileData = stripTags($profileData, '');
    $profileData['UID'] = $UID;
    $profileData['bio'] = stripTags(array($form_state['values']['bio']));
    // allow some tags in the bio only
    if (dbUserHasProfile($profileData['UID']) == false) {
        // if the user doesn't have a profile
        $result = dbCreateProfile($profileData);
        // creating new profile
        if ($result != false) {
            drupal_set_message("Your profile has been created!");
            // if it went through successfully
        } else {
            drupal_set_message("There was an error.");
            // if something "bad" occured during submission
        }
    } else {
        // if the user is simply editing existing profile
        dbUpdate("profiles", $profileData, "UID", $profileData['UID']);
        drupal_set_message("Profile has been updated!");
    }
    if (!empty($form_state['values']['secondaryEmail'])) {
        // user entered value
        if (dbGetSecondaryEmailForUser($profileData['UID']) == false) {
            // the user is adding a new secondary email
            dbAddEmailsToUser($profileData['UID'], array(trim($form_state['values']['secondaryEmail'])));
        } else {
            //  user is updating an old email
            dbUpdate('emailsVsUsers', array('email' => $form_state['values']['secondaryEmail']), "UID", $profileData['UID']);
        }
    } else {
        // user didn't enter value
        dbRemoveEntry('emailsVsUsers', 'UID', $profileData['UID']);
    }
    drupal_goto("viewUser", array('query' => array('UID' => $UID)));
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:47,代码来源:profileForm.php


示例18: parseFile

/**
 * Parses csv file
 *
 * @param string $filename FIle name including path.
 * @return array
 */
function parseFile($filename)
{
    $fields = getFields();
    $field_names = array_keys($fields);
    $result = [];
    $handle = @fopen($filename, "r");
    if ($handle) {
        while (($row = fgetcsv($handle, 20000, ",")) !== false) {
            if (count($row) != 75) {
                continue;
            }
            $result[$row[59]] = processRow($row, $fields, $field_names);
        }
        if (!feof($handle)) {
            echo "Error: unexpected fgets() exception\n";
            exit(1);
        }
        fclose($handle);
    } else {
        echo "Error: file '{$filename}' can not be opened.\n";
        exit(1);
    }
    return $result;
}
开发者ID:E-Poludnie,项目名称:IXP-Manager,代码行数:30,代码来源:member-sync.php


示例19: xydac_tax

    function xydac_tax()
    {
        if (isset($_GET['manage_fields_submit']) || isset($_POST['add_field_submit']) || isset($_GET['field']) || isset($_POST['doaction_submit'])) {
            $not_inserted = false;
            $t_name = $_GET['manage_fields_select'];
            $p_tname = "";
            $p_fname = "";
            $p_flabel = "";
            $p_ftype = "";
            $p_fdesc = "";
            if (isset($_POST['doaction_submit']) && isset($_POST['taxonomy'])) {
                if (isset($_POST['action']) && $_POST['action'] == 'delete') {
                    if (isset($_POST['delete_content_type'])) {
                        foreach ($_POST['delete_content_type'] as $k => $v) {
                            deleteField($v);
                            $message = __('Item Deleted.');
                        }
                    }
                }
                $t_name = $_POST['taxonomy'];
            }
            if (isset($_GET['field']) || isset($_POST['field_id'])) {
                $frow = isset($_GET['field']) ? getFieldrow(intval($_GET['field'])) : getFieldrow(intval($_POST['field_id']));
                $t_name = $frow->tax_name;
                $p_tname = $frow->tax_name;
                $p_fname = $frow->field_name;
                $p_flabel = $frow->field_label;
                $p_ftype = $frow->field_type;
                $p_fdesc = $frow->field_desc;
                $p_fval = $frow->field_val;
                $not_inserted = true;
            }
            if (isset($_POST['edit_field_submit'])) {
                if (isset($_POST["field_name"]) && empty($_POST["field_name"])) {
                    $xydac_error = new WP_Error('err', __("You need to give field name"));
                } elseif (isset($_POST['field_name']) && $_POST['field_name'] != $p_fname) {
                    $xydac_error = new WP_Error('err', __("Changing Field Name is not allowed !!!"));
                } else {
                    $p_fid = $_POST['field_id'];
                    $p_tname = $_POST['tax_name'];
                    $p_fname = sanitize_title_with_dashes($_POST['field_name']);
                    $p_flabel = !empty($_POST['field_label']) ? $_POST['field_label'] : $_POST['field_name'];
                    $p_ftype = $_POST['field_type'];
                    $p_fdesc = $_POST['field_desc'];
                    $p_fval = $_POST['field_val'];
                    if ($p_tname != '' && $p_fname != '' && $p_flabel != '' && $p_ftype != '') {
                        //if(updateField($p_fid,$p_tname,$p_fname,$p_flabel,$p_ftype,$p_fdesc,$p_fval)!=1) $not_inserted=true;else {$message = __('Item Updated.');$not_inserted = false;}
                        updateField($p_fid, $p_tname, $p_fname, $p_flabel, $p_ftype, $p_fdesc, $p_fval);
                        $message = __('Item Updated.');
                        $not_inserted = false;
                    } else {
                        $not_inserted = true;
                    }
                }
            }
            if (isset($_POST['add_field_submit'])) {
                if (isset($_POST["field_name"]) && empty($_POST["field_name"])) {
                    $xydac_error = new WP_Error('err', __("You need to give field name"));
                } elseif (!xydac_field_avail(sanitize_title_with_dashes($_POST['field_name']))) {
                    $xydac_error = new WP_Error('err', __("Field name not available"));
                } else {
                    $t_name = $_POST['tax_name'];
                    //@TODO: check empty post
                    $p_tname = $_POST['tax_name'];
                    $p_fname = sanitize_title_with_dashes($_POST['field_name']);
                    $p_flabel = !empty($_POST['field_label']) ? $_POST['field_label'] : $_POST['field_name'];
                    $p_ftype = $_POST['field_type'];
                    $p_fdesc = $_POST['field_desc'];
                    $p_fval = $_POST['field_val'];
                    if ($p_tname != '' && $p_fname != '' && $p_flabel != '' && $p_ftype != '') {
                        $check = insertField($p_tname, $p_fname, $p_flabel, $p_ftype, $p_fdesc, $p_fval);
                        if ($check == '') {
                            $not_inserted = true;
                        } else {
                            $message = __('Item Added.');
                            $not_inserted = false;
                        }
                    } else {
                        $not_inserted = true;
                    }
                }
            }
            $rows = getFields($t_name);
            ?>
<div class="wrap" id="page_content">
    <?php 
            xydac_heading("fields");
            ?>
    <?php 
            if (isset($xydac_error) && is_wp_error($xydac_error)) {
                ?>
    <div id="message" class="error below-h2"><p><?php 
                echo $xydac_error->get_error_message();
                ?>
</p></div>
    <?php 
            }
            ?>
    <?php 
            if (isset($message)) {
//.........这里部分代码省略.........
开发者ID:niko-lgdcom,项目名称:wp-install,代码行数:101,代码来源:field.php


示例20: __construct

 public function __construct($name, $resp = null)
 {
     global $db;
     global $loggedTables;
     $this->name = $name;
     $this->response = $resp ? $resp : new response($this->name);
     if (!count($this->response->header)) {
         $this->response->header = getFields($this->name);
     }
     $this->header = $this->response->header;
     if (array_key_exists($this->name, $loggedTables)) {
         $this->logging = true;
     }
     $this->db = $db;
     $this->fields = getFieldsAssoc($this->name);
 }
开发者ID:carriercomm,项目名称:Nuance,代码行数:16,代码来源:core.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getFieldsListFromQuery函数代码示例发布时间:2022-05-15
下一篇:
PHP getFieldid函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap