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

PHP mysql__select_assoc函数代码示例

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

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



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

示例1: updateRecTitles

/**
* updateRecTitles : updates the constructed record titles following modification of data values (details)
*
* @param mixed $data
*/
function updateRecTitles($recIDs)
{
    if (!is_array($recIDs)) {
        if (is_numeric($recIDs)) {
            $recIDs = array($recIDs);
        } else {
            return false;
        }
    }
    $res = mysql_query("select rec_ID, rec_Title, rec_RecTypeID from Records" . " where ! rec_FlagTemporary and rec_ID in (" . join(",", $recIDs) . ") order by rand()");
    $recs = array();
    while ($row = mysql_fetch_assoc($res)) {
        $recs[$row['rec_ID']] = $row;
    }
    $masks = mysql__select_assoc('defRecTypes', 'rty_ID', 'rty_TitleMask', '1');
    foreach ($recIDs as $recID) {
        $rtyID = $recs[$recID]['rec_RecTypeID'];
        $new_title = fill_title_mask($masks[$rtyID], $recID, $rtyID);
        mysql_query("update Records set rec_Title = '" . addslashes($new_title) . "'where rec_ID = {$recID}");
    }
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:26,代码来源:actionMethods.php


示例2: reltype_inverse

/**
 * determine the inverse of a relationship term
 * @global    array llokup of term inverses by trmID to inverseTrmID
 * @param     int $relTermID reltionship trmID
 * @return    int inverse trmID
 * @todo      modify to retrun -1 in case not inverse defined
 */
function reltype_inverse($relTermID)
{
    //saw Enum change - find inverse as an id instead of a string
    global $inverses;
    if (!$relTermID) {
        return;
    }
    if (!$inverses) {
        $inverses = mysql__select_assoc("defTerms A left join defTerms B on B.trm_ID=A.trm_InverseTermID", "A.trm_ID", "B.trm_ID", "A.trm_Label is not null and B.trm_Label is not null");
    }
    $inverse = @$inverses[$relTermID];
    if (!$inverse) {
        $inverse = array_search($relTermID, $inverses);
    }
    //do an inverse search and return key.
    if (!$inverse) {
        $inverse = 'Inverse of ' . $relTermID;
    }
    //FIXME: This should be -1 indicating no inverse found.
    return $inverse;
}
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:28,代码来源:getRecordInfoLibrary.php


示例3: findFuzzyMatches

/**
* util to find like records
*
* @author      Tom Murtagh
* @author      Stephen White   <[email protected]>
* @copyright   (C) 2005-2013 University of Sydney
* @link        http://Sydney.edu.au/Heurist
* @version     3.1.0
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package     Heurist academic knowledge management system
* @subpackage  Records/Util
*/
function findFuzzyMatches($fields, $rec_types, $rec_id = NULL, $fuzziness = NULL)
{
    if (!$fuzziness) {
        $fuzziness = 0.5;
    }
    // Get some data about the matching data for the given record type
    $types = mysql__select_assoc('defRecStructure left join defDetailTypes on rst_DetailTypeID=dty_ID', 'dty_ID', 'dty_Type', 'rst_RecTypeID=' . $rec_types[0] . ' and rst_RecordMatchOrder or rst_DetailTypeID=' . DT_NAME);
    $fuzzyFields = array();
    $strictFields = array();
    foreach ($fields as $key => $vals) {
        if (!preg_match('/^t:(\\d+)/', $key, $matches)) {
            continue;
        }
        $rdt_id = $matches[1];
        if (!@$types[$rdt_id]) {
            continue;
        }
        if (!$vals) {
            continue;
        }
        switch ($types[$rdt_id]) {
            case "blocktext":
            case "freetext":
            case "urlinclude":
                foreach ($vals as $val) {
                    if (trim($val)) {
                        array_push($fuzzyFields, array($rdt_id, trim($val)));
                    }
                }
                break;
            case "integer":
            case "float":
            case "date":
            case "year":
            case "file":
            case "enum":
            case "boolean":
            case "urlinclude":
            case "relationtype":
            case "resource":
                foreach ($vals as $val) {
                    if (trim($val)) {
                        array_push($strictFields, array($rdt_id, trim($val)));
                    }
                }
                break;
            case "separator":
                // this should never happen since separators are not saved as details, skip if it does
            // this should never happen since separators are not saved as details, skip if it does
            case "relmarker":
                // saw seems like relmarkers are external to the record and should not be part of matching
            // saw seems like relmarkers are external to the record and should not be part of matching
            case "fieldsetmarker":
            case "calculated":
            default:
                continue;
        }
    }
    if (count($fuzzyFields) == 0 && count($strictFields) == 0) {
        return;
    }
    $groups = get_group_ids();
    if (!is_array($groups)) {
        $groups = array();
    }
    if (is_logged_in()) {
        array_push($groups, get_user_id());
        array_push($groups, 0);
    }
    $groupPred = count($groups) > 0 ? "rec_OwnerUGrpID in (" . join(",", $groups) . ") or " : "";
    $tables = "records";
    $predicates = "rec_RecTypeID={$rec_types['0']} and ! rec_FlagTemporary and ({$groupPred} not rec_NonOwnerVisibility='hidden')" . ($rec_id ? " and rec_ID != {$rec_id}" : "");
    $N = 0;
    foreach ($fuzzyFields as $field) {
        list($rdt_id, $val) = $field;
        $threshold = intval((strlen($val) + 1) * $fuzziness);
        ++$N;
        $tables .= ", recDetails bd{$N}";
        $predicates .= " and (bd{$N}.dtl_RecID=rec_ID and bd{$N}.dtl_DetailTypeID={$rdt_id} and limited_levenshtein(bd{$N}.dtl_Value, '" . addslashes($val) . "', {$threshold}) is not null)";
    }
    foreach ($strictFields as $field) {
        list($rdt_id, $val) = $field;
        ++$N;
        $tables .= ", recDetails bd{$N}";
        $predicates .= " and (bd{$N}.dtl_RecID=rec_ID and bd{$N}.dtl_DetailTypeID={$rdt_id} and bd{$N}.dtl_Value = '" . addslashes($val) . "')";
    }
    $matches = array();
    $res = mysql_query("select rec_ID as id, rec_Title as title, rec_Hash as hhash from {$tables} where {$predicates} order by rec_Title limit 100");
//.........这里部分代码省略.........
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:101,代码来源:findFuzzyRecordMatches.php


示例4: doTagInsertion

function doTagInsertion($bkm_ID)
{
    global $usrID;
    //translate bmkID to record IT
    $res = mysql_query("select bkm_recID from usrBookmarks where bkm_ID={$bkm_ID}");
    $rec_id = mysql_fetch_row($res);
    $rec_id = $rec_id[0] ? $rec_id[0] : null;
    if (!$rec_id) {
        return "";
    }
    $tags = mysql__select_array("usrRecTagLinks, usrTags", "tag_Text", "rtl_RecID={$rec_id} and tag_ID=rtl_TagID and tag_UGrpID={$usrID} order by rtl_Order, rtl_ID");
    $tagString = join(",", $tags);
    // if the tags to insert is the same as the existing tags (in order) Nothing to do
    if (mb_strtolower(trim($_POST["tagString"]), 'UTF-8') == mb_strtolower(trim($tagString), 'UTF-8')) {
        return;
    }
    // create array of tags to be linked
    $tags = array_filter(array_map("trim", explode(",", str_replace("\\", "/", $_POST["tagString"]))));
    // replace backslashes with forwardslashes
    //create a map of this user's personal tags to tagIDs
    $kwd_map = mysql__select_assoc("usrTags", "trim(lower(tag_Text))", "tag_ID", "tag_UGrpID={$usrID} and tag_Text in (\"" . join("\",\"", array_map("mysql_real_escape_string", $tags)) . "\")");
    $tag_ids = array();
    foreach ($tags as $tag) {
        $tag = preg_replace('/\\s+/', ' ', trim($tag));
        $tag = mb_strtolower($tag, 'UTF-8');
        if (@$kwd_map[$tag]) {
            // tag exist get it's id
            $tag_id = $kwd_map[$tag];
        } else {
            // no existing tag so add it and get it's id
            $query = "insert into usrTags (tag_Text, tag_UGrpID) values (\"" . mysql_real_escape_string($tag) . "\", {$usrID})";
            mysql_query($query);
            $tag_id = mysql_insert_id();
        }
        array_push($tag_ids, $tag_id);
    }
    // Delete all personal tags for this bookmark's record
    mysql_query("delete usrRecTagLinks from usrRecTagLinks, usrTags where rtl_RecID = {$rec_id} and tag_ID=rtl_TagID and tag_UGrpID = {$usrID}");
    if (count($tag_ids) > 0) {
        $query = "";
        for ($i = 0; $i < count($tag_ids); ++$i) {
            if ($query) {
                $query .= ", ";
            }
            $query .= "({$rec_id}, " . ($i + 1) . ", " . $tag_ids[$i] . ")";
        }
        $query = "insert into usrRecTagLinks (rtl_RecID, rtl_Order, rtl_TagID) values " . $query;
        mysql_query($query);
    }
    // return new tag string
    $tags = mysql__select_array("usrRecTagLinks, usrTags", "tag_Text", "rtl_RecID = {$rec_id} and tag_ID=rtl_TagID and tag_UGrpID={$usrID} order by rtl_Order, rtl_ID");
    return join(",", $tags);
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:53,代码来源:saveBookmarkData.php


示例5: createRecordLookup

/**
 * creates an xForms select lookup list using the rectitles and heurist record ids
 *
 * given a list of recType IDs this function create a select list of Record Titles (alphabetical order)
 * with HEURIST record ids as the lookup value.
 * @param        array [$rtIDs] array of record Type identifiers for which a resource pointer is constrained to.
 * @return       string formatted as a XForm select lookup item list
 * @todo         need to accept a filter for reducing the recordset, currently you get all records of every type in the input list
 */
function createRecordLookup($rtIDs)
{
    $emptyLookup = "<item>\n" . "<label>\"no records found for rectypes '{$rtIDs}'\"</label>\n" . "<value>0</value>\n" . "</item>\n";
    $recs = mysql__select_assoc("Records", "rec_ID", "rec_Title", "rec_RecTypeID in ({$rtIDs}) order by rec_Title");
    if (!count($recs)) {
        return $emptyLookup;
    }
    $ret = "";
    foreach ($recs as $recID => $recTitle) {
        if ($recTitle && $recTitle != "") {
            $ret = $ret . "<item>\n" . "<label>\"{$recTitle}\"</label>\n" . "<value>{$recID}</value>\n" . "</item>\n";
        }
    }
    return $ret;
}
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:24,代码来源:rectypeXFormLibrary.php


示例6: dirname

 */
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
require_once dirname(__FILE__) . '/../../common/php/dbMySqlWrappers.php';
if (isForAdminOnly("to rebuild titles")) {
    return;
}
set_time_limit(0);
mysql_connection_overwrite(DATABASE);
require_once dirname(__FILE__) . '/../../common/php/utilsTitleMask.php';
//?db='.HEURIST_DBNAME);
$res = mysql_query('select rec_ID, rec_Title, rec_RecTypeID from Records where !rec_FlagTemporary order by rand()');
$recs = array();
while ($row = mysql_fetch_assoc($res)) {
    $recs[$row['rec_ID']] = $row;
}
$masks = mysql__select_assoc('defRecTypes', 'rty_ID', 'rty_TitleMask', '1');
$updates = array();
$blank_count = 0;
$repair_count = 0;
$processed_count = 0;
ob_start();
?>

<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <script type="text/javascript">
            function update_counts(processed, blank, repair, changed) {
                if(changed==null || changed==undefined){
                    changed = 0;
                }
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:recalcTitlesAllRecords.php


示例7: detailsReplace

 /**
  * Replace detail value for given set of records and detail type and values
  */
 public function detailsReplace()
 {
     if (!(@$this->data['sVal'] && @$this->data['rVal'])) {
         $this->system->addError(HEURIST_INVALID_REQUEST, "Insufficent data passed");
         return false;
     }
     if (!$this->_validateParamsAndCounts()) {
         return false;
     } else {
         if (count(@$this->recIDs) == 0) {
             return $this->result_data;
         }
     }
     $dtyID = $this->data['dtyID'];
     $dtyName = @$this->data['dtyName'] ? "'" . $this->data['dtyName'] . "'" : "id:" . $this->data['dtyID'];
     $mysqli = $this->system->get_mysqli();
     $basetype = mysql__select_value($mysqli, 'select dty_Type from defDetailTypes where dty_ID = ' . $dtyID);
     switch ($basetype) {
         case "freetext":
         case "blocktext":
             $searchClause = "dtl_Value like \"%" . $mysqli->real_escape_string($this->data['sVal']) . "%\"";
             $partialReplace = true;
             break;
         case "enum":
         case "relationtype":
         case "float":
         case "integer":
         case "resource":
         case "date":
             $searchClause = "dtl_Value = \"" . $mysqli->real_escape_string($this->data['sVal']) . "\"";
             $partialReplace = false;
             break;
         default:
             $this->system->addError(HEURIST_INVALID_REQUEST, "{$basetype} fields are not supported by value-replace service");
             return false;
     }
     $undefinedFieldsRecIDs = array();
     //value not found
     $processedRecIDs = array();
     //success
     $sqlErrors = array();
     $now = date('Y-m-d H:i:s');
     $dtl = array('dtl_Modified' => $now);
     $rec_update = array('rec_ID' => 'to-be-filled', 'rec_Modified' => $now);
     $baseTag = "~replace field {$dtyName} {$now}";
     foreach ($this->recIDs as $recID) {
         //get matching detail value for record if there is one
         $valuesToBeReplaced = mysql__select_assoc($mysqli, "recDetails", "dtl_ID", "dtl_Value", "dtl_RecID = {$recID} and dtl_DetailTypeID = {$dtyID} and {$searchClause}");
         if ($mysqli->error != null || $mysqli->error != '') {
             $sqlErrors[$recID] = $mysqli->error;
             continue;
         } else {
             if ($valuesToBeReplaced == null || count($valuesToBeReplaced) == 0) {
                 //not found
                 array_push($undefinedFieldsRecIDs, $recID);
                 continue;
             }
         }
         //update the details
         $recDetailWasUpdated = false;
         foreach ($valuesToBeReplaced as $dtlID => $dtlVal) {
             if ($partialReplace) {
                 // need to replace sVal with rVal
                 $newVal = preg_replace("/" . $this->data['sVal'] . "/", $this->data['rVal'], $dtlVal);
             } else {
                 $newVal = $this->data['rVal'];
             }
             $newVal = $mysqli->real_escape_string($newVal);
             $dtl['dtl_ID'] = $dtlID;
             $dtl['dtl_Value'] = $newVal;
             $ret = mysql__insertupdate($mysqli, 'recDetails', 'dtl', $dtl);
             if (!is_numeric($ret)) {
                 $sqlErrors[$recID] = $ret;
                 continue;
             }
             $recDetailWasUpdated = true;
         }
         if ($recDetailWasUpdated) {
             //only put in processed if a detail was processed,
             // obscure case when record has multiple details we record in error array also
             array_push($processedRecIDs, $recID);
             //update record edit date
             $rec_update['rec_ID'] = $recID;
             $ret = mysql__insertupdate($mysqli, 'Records', 'rec', $rec_update);
             if (!is_numeric($ret)) {
                 $sqlErrors[$recID] = 'Cannot update modify date. ' . $ret;
             }
         }
     }
     //for recors
     //assign special system tags
     $this->_assignTagsAndReport('processed', $processedRecIDs, $baseTag);
     $this->_assignTagsAndReport('undefined', $undefinedFieldsRecIDs, $baseTag);
     $this->_assignTagsAndReport('errors', $sqlErrors, $baseTag);
     return $this->result_data;
 }
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:99,代码来源:DbRecDetails.php


示例8: getAllRectypeStructures

        </div>
<?php 
print "<form id='startform' name='startform' action='exportFAIMS.php' method='get'>";
print "<input id='rt_selected' name='rt' type='hidden'>";
print "<input name='step' value='1' type='hidden'>";
print "<input name='db' value='" . HEURIST_DBNAME . "' type='hidden'>";
print "<div><div class='lbl_form'>Module name</div><input name='projname' value='" . ($projname ? $projname : HEURIST_DBNAME) . "' size='25'></div>";
// List of record types for export
print "<div id='selectedRectypes' style='width:100%;color:black;'></div>";
$rtStructs = getAllRectypeStructures(false);
$int_rt_dt_type = $rtStructs['typedefs']['dtFieldNamesToIndex']["dty_Type"];
$rt_geoenabled = array();
$rt_invalid_masks = array();
if ($rt_toexport && count($rt_toexport) > 0) {
    //validate title masks
    $rtIDs = mysql__select_assoc("defRecTypes", "rty_ID", "rty_Name", " rty_ID in (" . implode(",", $rt_toexport) . ") order by rty_ID");
    foreach ($rtIDs as $rtID => $rtName) {
        $mask = mysql__select_array("defRecTypes", "rty_TitleMask", "rty_ID={$rtID}");
        $mask = $mask[0];
        $res = titlemask_make($mask, $rtID, 2, null, _ERR_REP_MSG);
        //get human readable
        if (is_array($res)) {
            //invalid mask
            array_push($rt_invalid_masks, $rtName);
        }
        $details = $rtStructs['typedefs'][$rtID]['dtFields'];
        if (!$details) {
            print "<p style='color:red'>No details defined for record type #" . $rtName . ". Edit record type structure.</p>";
            $invalid = true;
        } else {
            //check if rectype is geoenabled
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:exportFAIMS.php


示例9: _title_mask__get_rec_types

function _title_mask__get_rec_types($rt)
{
    static $rct;
    if (!$rct) {
        $cond = $rt ? 'rty_ID=' . $rt : '1';
        $rct = mysql__select_assoc('defRecTypes', 'rty_ID', 'rty_Name', $cond);
        /*****DEBUG****/
        //error_log("rt ".print_r($rct,true));
    }
    return $rct;
}
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:11,代码来源:utilsTitleMask.php


示例10: keypress

			<span>contains</span>
            </div>
            <div id="ft-enum-container" style="display:none;width: 202px;"></div>
            <div id="ft-input-container" style="display:inline-block; width: 202px;"><input id="field" name="field" onChange="update(this);" onKeyPress="return keypress(event);" style="width: 200px;"></div>
			<span><button type="button" style="visibility:visible; float: right;" onClick="add_to_search('field');" class="button" title="Add to Search">Add</button></span>
		</div>

<!--
		<div class="advanced-search-row">
			<label for="notes">Notes:</label>
			<input id=notes name=notes onChange="update(this);" onKeyPress="return keypress(event);">
		</div>
-->

		<?php 
$groups = mysql__select_assoc(USERS_DATABASE . "." . USER_GROUPS_TABLE . " left join " . USERS_DATABASE . "." . GROUPS_TABLE . " on " . USER_GROUPS_GROUP_ID_FIELD . "=" . GROUPS_ID_FIELD, GROUPS_ID_FIELD, GROUPS_NAME_FIELD, USER_GROUPS_USER_ID_FIELD . "=" . get_user_id() . " and " . GROUPS_TYPE_FIELD . "='workgroup' order by " . GROUPS_NAME_FIELD);
if ($groups && count($groups) > 0) {
    ?>
		<div class="advanced-search-row">
				<label for="user">Owned&nbsp;by:</label>
				<select name="owner" id="owner" onChange="update(this);" style="width:200px;">
					<option value="" selected="selected">(any owner or ownergroup)</option>
					<option value="&quot;<?php 
    echo get_user_username();
    ?>
&quot;"><?php 
    echo get_user_name();
    ?>
</option>
					<?php 
    foreach ($groups as $id => $name) {
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:31,代码来源:queryBuilderPopup.php


示例11: inputOK

 function inputOK($postVal, $dtyID, $rtyID)
 {
     if (!@$labelToID) {
         $labelToID = mysql__select_assoc("defTerms", "trm_Label", "trm_ID", "1");
     }
     // if value is term label
     if (!is_numeric($postVal) && array_key_exists($postVal, $labelToID)) {
         $postVal = $labelToID[$postVal];
     }
     return $postVal ? isValidID($postVal, $dtyID, $rtyID) : false;
 }
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:11,代码来源:saveRecordDetails.php


示例12: handle_notification

function handle_notification()
{
    function getInt($strInt)
    {
        return intval(preg_replace("/[\"']/", "", $strInt));
    }
    $bib_ids = array_map("getInt", explode(',', $_REQUEST['bib_ids']));
    if (!count($bib_ids)) {
        return '<div style="color: red; font-weight: bold; padding: 5px;">(you must select at least one bookmark)</div>';
    }
    $bibIDList = join(',', $bib_ids);
    $notification_link = HEURIST_BASE_URL . '?db=' . HEURIST_DBNAME . '&w=all&q=ids:' . $bibIDList;
    $bib_titles = mysql__select_assoc('Records', 'rec_ID', 'rec_Title', 'rec_ID in (' . $bibIDList . ')');
    $title_list = "Id      Title\n" . "------  ---------\n";
    foreach ($bib_titles as $rec_id => $rec_title) {
        $title_list .= str_pad("{$rec_id}", 8) . $rec_title . "\n";
    }
    $msg = '';
    if ($_REQUEST['notify_message'] && $_REQUEST['notify_message'] != '(enter message here)') {
        $msg = '"' . $_REQUEST['notify_message'] . '"' . "\n\n";
    }
    $res = mysql_query('select ' . USERS_EMAIL_FIELD . ' from ' . USERS_DATABASE . '.' . USERS_TABLE . ' where ' . USERS_ID_FIELD . ' = ' . get_user_id());
    $row = mysql_fetch_row($res);
    if ($row) {
        $user_email = $row[0];
    }
    mysql_connection_overwrite(DATABASE);
    $email_subject = 'Email from ' . get_user_name();
    if (count($bib_ids) == 1) {
        $email_subject .= ' (one reference)';
    } else {
        $email_subject .= ' (' . count($bib_ids) . ' references)';
    }
    $email_headers = 'From: ' . get_user_name() . ' <no-reply@' . HEURIST_SERVER_NAME . '>';
    if ($user_email) {
        $email_headers .= "\r\nCc: " . get_user_name() . ' <' . $user_email . '>';
        $email_headers .= "\r\nReply-To: " . get_user_name() . ' <' . $user_email . '>';
    }
    $email_text = get_user_name() . " would like to draw some records to your attention, with the following note:\n\n" . $msg . "Access them and add them (if desired) to your Heurist records at: \n\n" . $notification_link . "\n\n" . "To add records, either click on the unfilled star left of the title\n" . "or select the ones you wish to add and then Selected > Bookmark\n\n" . $title_list;
    if ($_REQUEST['notify_group']) {
        $email_headers = preg_replace('/Cc:[^\\r\\n]*\\r\\n/', '', $email_headers);
        $res = mysql_query('select ' . GROUPS_NAME_FIELD . ' from ' . USERS_DATABASE . '.' . GROUPS_TBALE . ' where ' . GROUPS_ID_FIELD . '=' . intval($_REQUEST['notify_group']));
        $row = mysql_fetch_assoc($res);
        $grpname = $row[GROUPS_NAME_FIELD];
        $res = mysql_query('select ' . USERS_EMAIL_FIELD . '
				from ' . USERS_DATABASE . '.' . USERS_TABLE . ' left join ' . USERS_DATABASE . '.' . USER_GROUPS_TABLE . ' on ' . USER_GROUPS_USER_ID_FIELD . '=' . USERS_ID_FIELD . '
				where ' . USER_GROUPS_GROUP_ID_FIELD . '=' . intval($_REQUEST['notify_group']));
        $count = mysql_num_rows($res);
        while ($row = mysql_fetch_assoc($res)) {
            $email_headers .= "\r\nBcc: " . $row[USERS_EMAIL_FIELD];
        }
        $rv = sendEMail(get_user_name() . ' <' . $user_email . '>', $email_subject, $email_text, $email_headers, true);
        return $rv == "ok" ? 'Notification email sent to group ' . $grpname . ' (' . $count . ' members)' : $rv;
    } else {
        if ($_REQUEST['notify_person']) {
            $res = mysql_query('select ' . USERS_EMAIL_FIELD . ', concat(' . USERS_FIRSTNAME_FIELD . '," ",' . USERS_LASTNAME_FIELD . ') as fullname from ' . USERS_DATABASE . '.' . USERS_TABLE . ' where ' . USERS_ID_FIELD . '=' . $_REQUEST['notify_person']);
            $psn = mysql_fetch_assoc($res);
            $rv = sendEMail($psn[USERS_EMAIL_FIELD], $email_subject, $email_text, $email_headers, true);
            return $rv == "ok" ? 'Notification email sent to ' . addslashes($psn['fullname']) : $rv;
        } else {
            if ($_REQUEST['notify_email']) {
                $rv = sendEMail($_REQUEST['notify_email'], $email_subject, $email_text, $email_headers, true);
                return $rv == "ok" ? 'Notification email sent to ' . addslashes($_REQUEST['notify_email']) : $rv;
            } else {
                return '<div style="color: red; font-weight: bold; padding: 5px;">(you must select a group, person, or enter an email address)</div>';
            }
        }
    }
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:69,代码来源:sendNotificationsPopup.php


示例13: if

    }
    /*
    $bkmk_insert_count = 0;
    if (bookmark_insert(@$_REQUEST['link'][$linkno], @$_REQUEST['title'][$linkno], $kwd, $rec_id)){
    	++$bkmk_insert_count;
    }
    if (@$bkmk_insert_count == 1){
    	$success = 'Added one bookmark';
    }else if (@$bkmk_insert_count > 1){
    	$success = 'Added ' . $bkmk_insert_count . ' bookmarks';
    }
    */
}
// filter the URLs (get rid of the ones already bookmarked)
if (@$urls) {
    $bkmk_urls = mysql__select_assoc('usrBookmarks left join Records on rec_ID = bkm_recID', 'rec_URL', '1', 'bkm_UGrpID=' . get_user_id());
    $ignore = array();
    foreach ($urls as $url => $title) {
        if (@$bkmk_urls[$url]) {
            $ignore[$url] = 1;
        }
    }
}
?>
<html>
<head>
	<title>Import Hyperlinks</title>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
	<link rel="stylesheet" type="text/css" href="<?php 
echo HEURIST_BASE_URL;
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:importHyperlinks.php


示例14: reltype_inverse

/**
* saw Enum change - find inverse as an id instead of a string
*
* @param mixed $relTermID
* @return mixed
*/
function reltype_inverse($relTermID)
{
    global $inverses;
    if (!$relTermID) {
        return;
    }
    if (!$inverses) {
        //		$inverses = mysql__select_assoc("defTerms A left join defTerms B on B.trm_ID=A.trm_InverseTermID", "A.trm_Label", "B.trm_Label", "A.rdl_rdt_id=200 and A.trm_Label is not null");
        $inverses = mysql__select_assoc("defTerms A left join defTerms B on B.trm_ID=A.trm_InverseTermID", "A.trm_ID", "B.trm_ID", "A.trm_Label is not null and B.trm_Label is not null");
    }
    $inverse = @$inverses[$relTermID];
    if (!$inverse) {
        $inverse = array_search($relTermID, $inverses);
    }
    if (!$inverse) {
        $inverse = 'Inverse of ' . $relTermID;
    }
    return $inverse;
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:25,代码来源:getRelationshipRecords.php


示例15: type

    return;
}
if (@$_REQUEST['recTypeIDs']) {
    $recTypeIds = $_REQUEST['recTypeIDs'];
} else {
    print "You must specify a record type (?recTypeIDs=55) or a set of record types (?recTypeIDs=55,174,175) to use this page.";
}
require_once dirname(__FILE__) . '/../../common/php/utilsTitleMask.php';
mysql_connection_overwrite(DATABASE);
$res = mysql_query("select rec_ID, rec_Title, rec_RecTypeID from Records where ! rec_FlagTemporary and rec_RecTypeID in ({$recTypeIds}) order by rand()");
$recs = array();
while ($row = mysql_fetch_assoc($res)) {
    $recs[$row['rec_ID']] = $row;
}
$rt_names = mysql__select_assoc('defRecTypes', 'rty_ID', 'rty_Name', 'rty_ID in (' . $recTypeIds . ')');
$masks = mysql__select_assoc('defRecTypes', 'rty_ID', 'rty_TitleMask', 'rty_ID in (' . $recTypeIds . ')');
$updates = array();
$blank_count = 0;
$repair_count = 0;
$processed_count = 0;
?>

<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>Recalculation of composite record titles</title>
        <link rel="stylesheet" type="text/css" href="../../common/css/global.css">
    </head>

    <body class="popup">
        <p>
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:recalcTitlesSpecifiedRectypes.php


示例16: insert_tags

function insert_tags(&$entry, $tag_map = array())
{
    // automatic tag insertion for the bookmark associated with this entry
    // easy one first: see if there is a workgroup tag to be added, and that we have access to that workgroup
    $wgKwd = $entry->getWorkgroupTag();
    if ($wgKwd) {
        $res = mysql_query("select * from usrTags, " . USERS_DATABASE . ".sysUsrGrpLinks where tag_UGrpID=ugl_GroupID and ugl_UserID=" . get_user_id() . " and tag_ID=" . $wgKwd);
        if (mysql_num_rows($res) != 1) {
            $wgKwd = 0;
        }
        // saw CHECK SPEC: can there be more than 1 , this code ingnores if 0 or more than 1
    }
    if (!$entry->getTags()) {
        return;
    }
    $tag_select_clause = '';
    foreach ($entry->getTags() as $tag) {
        $tag = str_replace('\\', '/', $tag);
        if (array_key_exists(strtolower(trim($tag)), $tag_map)) {
            $tag = $tag_map[strtolower(trim($tag))];
        }
        if ($tag_select_clause) {
            $tag_select_clause .= ',';
        }
        $tag_select_clause .= '"' . mysql_real_escape_string($tag) . '"';
    }
    // create user specific tagText to tagID lookup
    $res = mysql_query('select tag_ID, lower(trim(tag_Text)) from usrTags where tag_Text in (' . $tag_select_clause . ')' . ' and tag_UGrpID= ' . get_user_id());
    $tags = array();
    while ($row = mysql_fetch_row($res)) {
        $tags[$row[1]] = $row[0];
    }
    //now let's add in all the wgTags for this user's workgroups
    $all_wgTags = mysql__select_assoc('usrTags, ' . USERS_DATABASE . '.sysUsrGrpLinks, ' . USERS_DATABASE . '.sysUGrps grp', 'lower(concat(grp.ugr_Name, "\\\\", tag_Text))', 'tag_ID', 'tag_UGrpID=ugl_GroupID and ugl_GroupID=grp.ugr_ID and ugl_UserID=' . get_user_id());
    //saw CHECK SPEC: is it correct to import wgTags with a slash
    foreach ($all_wgTags as $tag => $id) {
        $tags[$tag] = $id;
    }
    $entry_tag_ids = array();
    foreach ($entry->getTags() as $tag) {
        if (preg_match('/^(.*?)\\s*\\\\\\s*(.*)$/', $tag, $matches)) {
            $tag = $matches[1] . '\\' . $matches[2];
            $wg_tag = true;
        } else {
            $wg_tag = false;
        }
        $tag_id = @$tags[strtolower(trim($tag))];
        if ($tag_id) {
            array_push($entry_tag_ids, $tag_id);
        } else {
            if (!$wg_tag) {
                // do not insert new workgroup tags
                mysql_query('insert into usrTags (tag_UGrpID, tag_Text) ' . ' values (' . get_user_id() . ', "' . mysql_real_escape_string($tag) . '")');
                $tag_id = mysql_insert_id();
                array_push($entry_tag_ids, $tag_id);
                $tags[strtolower(trim($tag))] = $tag_id;
            }
        }
    }
    $kwi_insert_stmt = '';
    if ($wgKwd) {
        $kwi_insert_stmt .= '(' . $entry->getBiblioID() . ', ' . $wgKwd . ', 1)';
    }
    foreach ($entry_tag_ids as $tag_id) {
        if ($kwi_insert_stmt) {
            $kwi_insert_stmt .= ',';
        }
        $kwi_insert_stmt .= '(' . $entry->getBiblioID() . ', ' . $tag_id . ', 1)';
        //FIXME getBookmarkID and getBiblioID return empty string
    }
    mysql_query('insert ignore into usrRecTagLinks (rtl_RecID, rtl_TagID, rtl_AddedByImport) values ' . $kwi_insert_stmt);
}
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:72,代码来源:importerFramework.php


示例17: doWgTagInsertion

function doWgTagInsertion($recordID, $wgTagIDs)
{
    if ($wgTagIDs != "" && !preg_match("/^\\d+(?:,\\d+)*\$/", $wgTagIDs)) {
        return;
    }
    if ($wgTagIDs) {
        mysql_query("delete usrRecTagLinks from usrRecTagLinks, usrTags, " . USERS_DATABASE . ".sysUsrGrpLinks where rtl_RecID={$recordID} and rtl_TagID=tag_ID and tag_UGrpID=ugl_GroupID and ugl_UserID=" . get_user_id() . " and tag_ID not in ({$wgTagIDs})");
        if (mysql_error()) {
            jsonError("database error - " . mysql_error());
        }
    } else {
        mysql_query("delete usrRecTagLinks from usrRecTagLinks, usrTags, " . USERS_DATABASE . ".sysUsrGrpLinks where rtl_RecID={$recordID} and rtl_TagID=tag_ID and tag_UGrpID=ugl_GroupID and ugl_UserID=" . get_user_id());
        if (mysql_error()) {
            jsonError("database error - " . mysql_error());
        }
        return;
    }
    $existingKeywordIDs = mysql__select_assoc("usrRecTagLinks, usrTags, " . USERS_DATABASE . ".sysUsrGrpLinks", "rtl_TagID", "1", "rtl_RecID={$recordID} and rtl_TagID=tag_ID and tag_UGrpID=ugl_GroupID and ugl_UserID=" . get_user_id());
    $newKeywordIDs = array();
    foreach (explode(",", $wgTagIDs) as $kwdID) {
        if (!@$existingKeywordIDs[$kwdID]) {
            array_push($newKeywordIDs, $kwdID);
        }
    }
    if ($newKeywordIDs) {
        mysql_query("insert into usrRecTagLinks (rtl_TagID, rtl_RecID) select tag_ID, {$recordID} from usrTags, " . USERS_DATABASE . ".sysUsrGrpLinks where tag_UGrpID=ugl_GroupID and ugl_UserID=" . get_user_id() . " and tag_ID in (" . join(",", $newKeywordIDs) . ")");
        if (mysql_error()) {
            jsonError("database error - " . mysql_error());
        }
    }
}
开发者ID:beoutsports,项目名称:heurist-v3-1,代码行数:31,代码来源:saveRecord.php


示例18: defined

$isbnDT = defined('DT_ISBN') ? DT_ISBN : 0;
$issnDT = defined('DT_ISSN') ? DT_ISSN : 0;
$titleDT = defined('DT_NAME') ? DT_NAME : 0;
$relTypDT = defined('DT_RELATION_TYPE') ? DT_RELATION_TYPE : 0;
$relSrcDT = defined('DT_PRIMARY_RESOURCE') ? DT_PRIMARY_RESOURCE : 0;
$relTrgDT = defined('DT_TARGET_RESOURCE') ? DT_TARGET_RESOURCE : 0;
/* arrive with a new (un-bookmarked) URL to process */
if (!@$_REQUEST['_submit'] && @$_REQUEST['bkmrk_bkmk_url']) {
    if (!@$rec_id && !@$force_new) {
        /* look up the records table, see if the requested URL is already in the database; if not, add it */
        $res = mysql_query('select * from Records where rec_URL = "' . mysql_real_escape_string($url) . '" ' . 'and (rec_OwnerUGrpID in (0' . (get_user_id() ? ',' . get_user_id() : '') . ')' . ' or not rec_NonOwnerVisibility="hidden")');
        if ($row = mysql_fetch_assoc($res)) {
            // found record
            $rec_id = intval($row['rec_ID']);
            $fav = $_REQUEST["f"];
            $bd = mysql__select_assoc('recDetails', 'concat(dtl_DetailTypeID, ".", dtl_Value)', '1', 'dtl_RecID=' . $rec_id . ' and ((dtl_DetailTypeID = ' . $doiDT . ' and dtl_Value in ("' . join('","', array_map("mysql_real_escape_string", $dois)) . '"))' . ' or  (dtl_DetailTypeID = ' . $webIconDT . ' and dtl_Value = "' . mysql_real_escape_string($fav) . '"))' . ' or  (dtl_DetailTypeID = ' . $issnDT . ' and dtl_Value in ("' . join('","', array_map("mysql_real_escape_string", $issns)) . '"))' . ' or  (dtl_DetailTypeID = ' . $isbnDT . ' and dtl_Value in ("' . join('","', array_map("mysql_real_escape_string", $isbns)) . '")))');
            $inserts = array();
            foreach ($dois as $doi) {
                if (!$bd["{$doiDT}.{$doi}"]) {
                    array_push($inserts, "({$rec_id}, {$doiDT}, '" . mysql_real_escape_string($doi) . "')");
                }
            }
            if ($fav && !$bd["{$webIconDT}.{$fav}"]) {
                array_push($inserts, "({$rec_id}, {$webIconDT}, '" . mysql_real_escape_string($fav) . "')");
            }
            foreach ($isbns as $isbn) {
                if (!$bd["{$isbnDT}.{$isbn}"]) {
                    array_push($inserts, "({$rec_id}, {$isbnDT}, '" . mysql_real_escape_string($isbn) . "')");
                }
            }
            foreach ($issns as $issn) {
开发者ID:HeuristNetwork,项目名称:heurist,代码行数:31,代码来源:addRecord.php


示例19: array

                <input type="button" value="Close window" onClick="closewin()">
        </div -->
        <div style="margin-bottom:30px">
<?php 
//get list of files
$dim = 120;
//always show icons  ($mode!=1) ?16 :64;
$lib_dir = HEURIST_FILESTORE_DIR . 'term-images/';
$files = array();
foreach ($ids as $id) {
    $filename = $lib_dir . $id . '.png';
    if (file_exists($filename)) {
        array_push($files, $id);
    }
}
if (count($files) > 0) {
    $term_labels = mysql__select_assoc('defTerms', 'trm_ID', 'trm_Label', 'trm_ID in (' . implode(',', $files) . ')');
    foreach ($files as $id) {
        print '<div class="itemlist" style="">';
        print '<a href="#" onclick="onImageSelect(' . $id . ')">';
        // height="'.$dim.'" max-height:'.$dim.';
        print '<img class="itemimage" style="background 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP mysql_affected_rows函数代码示例发布时间:2022-05-15
下一篇:
PHP mysql__select_array函数代码示例发布时间: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