本文整理汇总了PHP中mysql__select_array函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql__select_array函数的具体用法?PHP mysql__select_array怎么用?PHP mysql__select_array使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql__select_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWritableChunks
function getWritableChunks($wootId = NULL, $restrictToCurrent = false)
{
/* Given a wootId to which the user has write-access,
* return the ids of the chunks to which the user can write.
* If restrictToCurrent is true, then the chunks should be restricted
* to those which have not been superseded by newer versions.
* If the wootId is omitted, then the chunks may be sourced from any woot.
*/
$restriction = is_admin() ? "1 " : "(wprm_UGrpID=" . get_user_id() . " or wprm_GroupID in (" . join(",", get_group_ids()) . ",-1)) and wprm_Type='RW' ";
if (!$restrictToCurrent) {
return mysql__select_array(PERMISSION_TABLE, "wprm_ChunkID", $restriction . ($wootId ? " and chunk_WootID={$wootId}" : ""));
} else {
return mysql__select_array(CHUNK_TABLE . " left join " . PERMISSION_TABLE . " on chunk_ID=wprm_ChunkID", "wprm_ChunkID", "{$restriction} and chunk_IsLatest" . ($wootId ? " and chunk_WootID={$wootId}" : "") . " and wprm_ChunkID is not null");
}
}
示例2: print_biblio
function print_biblio($bib)
{
global $rectype;
$output = '';
$output .= print_bib_details($bib['rec_ID'], $bib['rec_RecTypeID'], array());
if ($bib['rec_URL']) {
$output .= '%U ' . $bib['rec_URL'] . "\n";
}
$kwds = mysql__select_array('usrBookmarks left join usrRecTagLinks on rtl_RecID = bkm_RecID
left join usrTags on tag_ID = rtl_TagID', 'tag_Text', 'bkm_recID = ' . $bib['rec_ID'] . ' and bkm_UGrpID = ' . get_user_id() . ' and tag_Text != "" and tag_Text is not null');
if (count($kwds)) {
$output .= '%K ' . join(', ', $kwds) . "\n";
}
/*
if ($bib['rec_ScratchPad'])
$output .= '%Z ' . preg_replace("/\n\n+/s", "\n", str_replace('%', '', $bib['rec_ScratchPad'])) . "\n";
*/
if (strlen($output)) {
print '%0 ' . $rectype[$bib['rec_RecTypeID']] . "\n" . $output . "\n";
}
}
示例3: getAllRectypeStructures
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
foreach ($details as $dtid => $detail) {
$dt_type = $detail[$int_rt_dt_type];
示例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);
}
示例5: get_rt_usage
function get_rt_usage($rt_id)
{
$res = mysql__select_array("Records", "count(*)", "rec_RecTypeID=" . $rt_id);
return $res[0];
}
示例6: loadUserDependentData
function loadUserDependentData(&$record)
{
$recID = $record["rec_ID"];
$res = mysql_query("select bkm_ID,\n\t\t\tbkm_Rating\n\t\t\tfrom usrBookmarks\n\t\t\twhere bkm_recID = {$recID}\n\t\t\tand bkm_UGrpID = " . get_user_id());
if ($res && mysql_num_rows($res) > 0) {
$row = mysql_fetch_assoc($res);
$record = array_merge($record, $row);
}
$res = mysql_query("select rem_RecID,\n\t\t\trem_ID,\n\t\t\trem_ToWorkgroupID,\n\t\t\trem_ToUserID,\n\t\t\trem_Email,\n\t\t\trem_Message,\n\t\t\trem_StartDate,\n\t\t\trem_Freq\n\t\t\tfrom usrReminders\n\t\t\twhere rem_RecID = {$recID}\n\t\t\tand rem_OwnerUGrpID=" . get_user_id());
$reminders = array();
while ($res && ($rem = mysql_fetch_row($res))) {
$rec_id = array_shift($rem);
array_push($reminders, $rem);
}
$res = mysql_query("select cmt_ID,\n\t\t\tcmt_ParentCmtID,\n\t\t\tcmt_Added,\n\t\t\tcmt_Modified,\n\t\t\tcmt_Text,\n\t\t\tcmt_OwnerUgrpID,\n\t\t\tcmt_Deleted\n\t\t\tfrom recThreadedComments\n\t\t\twhere cmt_RecID = {$recID}\n\t\t\torder by cmt_ID");
$comments = array();
while ($cmt = mysql_fetch_row($res)) {
$cmt[1] = intval($cmt[1]);
$cmt[6] = intval($cmt[6]);
if ($cmt[6]) {
// comment has been deleted, just leave a stub
$cmt = array($cmt[0], $cmt[1], NULL, NULL, NULL, NULL, 1);
}
array_push($comments, $cmt);
}
$record["tags"] = mysql__select_array("usrRecTagLinks, usrTags", "tag_Text", "tag_ID = rtl_TagID and\n\t\t\ttag_UGrpID= " . get_user_id() . " and\n\t\t\trtl_RecID = {$recID}\n\t\t\torder by rtl_Order");
$record["wgTags"] = mysql__select_array("usrRecTagLinks, usrTags, " . USERS_DATABASE . ".sysUsrGrpLinks", "rtl_TagID", "tag_ID = rtl_TagID and\n\t\t\ttag_UGrpID = ugl_GroupID and\n\t\t\tugl_UserID = " . get_user_id() . " and\n\t\t\trtl_RecID = {$recID}\n\t\t\torder by rtl_Order");
$record["notifies"] = $reminders;
$record["comments"] = $comments;
}
示例7: htmlspecialchars
</link>
<?php
if ($creator != null) {
// this is email - not creator's rectitle
//print "\n <author><![CDATA[".$creator."]]></author>";
}
}
if ($tagString) {
print "\n\t<media:keywords>" . $tagString . "</media:keywords>";
}
if ($thubURL) {
//width=\"120\" height=\"80\"
print "\n\t<media:thumbnail url=\"" . htmlspecialchars($thubURL) . "\"/>";
}
//geo rss
$geos = mysql__select_array("recDetails", "if(a.dtl_Geo is null, null, asText(a.dtl_Geo)) as dtl_Geo", "a.dtl_RecID=" . $row[0] . " and a.dtl_Geo is not null");
if (count($geos) > 0) {
$wkt = $geos[0];
$geom = geoPHP::load($wkt, 'wkt');
$gml = $geom->out('georss');
if ($gml) {
$gml = "<georss:" . substr($gml, 1);
$gml = str_replace("</", "</georss:", $gml);
print "\n\t" . $gml;
}
}
print $isAtom ? '</entry>' : '</item>';
}
//while wkt records
}
if ($isAtom) {
示例8: validateImport
function validateImport($params)
{
global $system;
//get rectype to import
$rty_ID = @$params['sa_rectype'];
$currentSeqIndex = @$params['seq_index'];
if (intval($rty_ID) < 1) {
$system->addError(HEURIST_INVALID_REQUEST, 'Record type not defined or wrong value');
return false;
}
$imp_session = getImportSession($params['imp_ID']);
if (is_bool($imp_session) && !$imp_session) {
return false;
//error - can not get import session
}
//add result of validation to session
$imp_session['validation'] = array("count_update" => 0, "count_insert" => 0, "count_update_rows" => 0, "count_insert_rows" => 0, "count_error" => 0, "error" => array(), "recs_insert" => array(), "recs_update" => array());
//get rectype to import
$id_field = @$params['recid_field'];
//record ID field is always defined explicitly
$ignore_insert = @$params['ignore_insert'] == 1;
//ignore new records
if (@$imp_session['columns'][substr($id_field, 6)] == null) {
$system->addError(HEURIST_INVALID_REQUEST, 'Identification field is not defined');
return false;
}
$import_table = $imp_session['import_table'];
$cnt_update_rows = 0;
$cnt_insert_rows = 0;
$mapping_params = @$params['mapping'];
$mapping = array();
// fieldtype => fieldname in import table
$sel_query = array();
if (is_array($mapping_params) && count($mapping_params) > 0) {
foreach ($mapping_params as $index => $field_type) {
$field_name = "field_" . $index;
$mapping[$field_type] = $field_name;
$imp_session['validation']['mapped_fields'][$field_name] = $field_type;
//all mapped fields - they will be used in validation query
array_push($sel_query, $field_name);
}
} else {
$system->addError(HEURIST_INVALID_REQUEST, 'Mapping is not defined');
return false;
}
$mysqli = $system->get_mysqli();
$cnt_recs_insert_nonexist_id = 0;
// validate selected record ID field
// in case id field is not created on match step (it is from original set of columns)
// we have to verify that its values are valid
if (FALSE && !@$imp_session['indexes'][$id_field]) {
//find recid with different rectype
$query = "select imp_id, " . implode(",", $sel_query) . ", " . $id_field . " from " . $import_table . " left join Records on rec_ID=" . $id_field . " where rec_RecTypeID<>" . $rty_ID;
// TODO: I'm not sure whether message below has been correctly interpreted
$wrong_records = getWrongRecords($query, $imp_session, "Your input data contain record IDs in the selected ID column for existing records which are not numeric IDs. " . "The import cannot proceed until this is corrected.", "Incorrect record types", $id_field);
if (is_array($wrong_records) && count($wrong_records) > 0) {
$wrong_records['validation']['mapped_fields'][$id_field] = 'id';
$imp_session = $wrong_records;
} else {
if ($wrong_records === false) {
return $wrong_records;
}
}
if (!$ignore_insert) {
//WARNING - it ignores possible multivalue index field
//find record ID that do not exist in HDB - to insert
$query = "select count(imp_id) " . " from " . $import_table . " left join Records on rec_ID=" . $id_field . " where " . $id_field . ">0 and rec_ID is null";
$row = mysql__select_array($mysqli, $query);
if ($row && $row[0] > 0) {
$cnt_recs_insert_nonexist_id = $row[0];
}
}
}
// find records to update
$select_query = "SELECT count(DISTINCT " . $id_field . ") FROM " . $import_table . " left join Records on rec_ID=" . $id_field . " WHERE rec_ID is not null and " . $id_field . ">0";
$cnt = mysql__select_value($mysqli, $select_query);
if ($cnt > 0) {
$imp_session['validation']['count_update'] = $cnt;
$imp_session['validation']['count_update_rows'] = $cnt;
/*
//find first 100 records to preview
$select_query = "SELECT ".$id_field.", imp_id, ".implode(",",$sel_query)
." FROM ".$import_table
." left join Records on rec_ID=".$id_field
." WHERE rec_ID is not null and ".$id_field.">0"
." ORDER BY ".$id_field." LIMIT 5000";
$imp_session['validation']['recs_update'] = mysql__select_all($mysqli, $select_query, false);
*/
$imp_session['validation']['recs_update'] = array();
}
if (!$ignore_insert) {
// find records to insert
$select_query = "SELECT count(DISTINCT " . $id_field . ") FROM " . $import_table . " WHERE " . $id_field . "<0";
//$id_field." is null OR ".
$cnt1 = mysql__select_value($mysqli, $select_query);
$select_query = "SELECT count(*) FROM " . $import_table . ' WHERE ' . $id_field . ' IS NULL';
//$id_field." is null OR ".
$cnt2 = mysql__select_value($mysqli, $select_query);
if ($cnt1 + $cnt2 > 0) {
$imp_session['validation']['count_insert'] = $cnt1 + $cnt2;
//.........这里部分代码省略.........
示例9: print_relation_details
function print_relation_details($bib)
{
global $relRT, $relSrcDT, $relTrgDT, $ACCESSABLE_OWNER_IDS, $is_map_popup, $rectypesStructure;
$from_res = mysql_query('select recDetails.*
from recDetails
left join Records on rec_ID = dtl_RecID
where dtl_DetailTypeID = ' . $relSrcDT . ' and rec_RecTypeID = ' . $relRT . ' and dtl_Value = ' . $bib['rec_ID']);
//primary resource
$to_res = mysql_query('select recDetails.*
from recDetails
left join Records on rec_ID = dtl_RecID
where dtl_DetailTypeID = ' . $relTrgDT . ' and rec_RecTypeID = ' . $relRT . ' and dtl_Value = ' . $bib['rec_ID']);
//linked resource
if (mysql_num_rows($from_res) <= 0 && mysql_num_rows($to_res) <= 0) {
return;
}
if ($is_map_popup) {
print '<div>';
} else {
print '<div class=detailRowHeader>Related';
}
$accessCondition = (count($ACCESSABLE_OWNER_IDS) > 0 ? '(rec_OwnerUGrpID in (' . join(',', $ACCESSABLE_OWNER_IDS) . ') ' : '(0 ') . (is_logged_in() ? 'OR NOT rec_NonOwnerVisibility = "hidden")' : 'OR rec_NonOwnerVisibility = "public")');
while ($reln = mysql_fetch_assoc($from_res)) {
$bd = fetch_relation_details($reln['dtl_RecID'], true);
// check related record
if (!@$bd['RelatedRecID'] || !array_key_exists('rec_ID', $bd['RelatedRecID'])) {
continue;
}
$relatedRecID = $bd['RelatedRecID']['rec_ID'];
if (count(mysql__select_array("Records", "rec_ID", "rec_ID = {$relatedRecID} and {$accessCondition}")) == 0) {
//related is not accessable
continue;
}
print '<div class=detailRow>';
// print '<span class=label>' . htmlspecialchars($bd['RelationType']) . '</span>'; //saw Enum change
if (array_key_exists('RelTerm', $bd)) {
print '<div class=detailType>' . htmlspecialchars($bd['RelTerm']) . '</div>';
// fetch now returns the enum string also
}
print '<div class=detail>';
if (@$bd['RelatedRecID']) {
if (true || $is_map_popup) {
print '<img class="rft" style="background-image:url(' . HEURIST_ICON_URL . $bd['RelatedRecID']['rec_RecTypeID'] . '.png)" title="' . $rectypesStructure['names'][$bd['RelatedRecID']['rec_RecTypeID']] . '" src="' . HEURIST_BASE_URL . 'common/images/16x16.gif"> ';
}
print '<a target=_new href="' . HEURIST_BASE_URL . 'records/view/renderRecordData.php?db=' . HEURIST_DBNAME . '&recID=' . $bd['RelatedRecID']['rec_ID'] . (defined('use_alt_db') ? '&alt' : '') . '" onclick="return link_open(this);">' . htmlspecialchars($bd['RelatedRecID']['rec_Title']) . '</a>';
} else {
print htmlspecialchars($bd['Title']);
}
print ' ';
if (@$bd['StartDate']) {
print htmlspecialchars(temporalToHumanReadableString($bd['StartDate']));
}
if (@$bd['EndDate']) {
print ' until ' . htmlspecialchars(temporalToHumanReadableString($bd['EndDate']));
}
print '</div></div>';
}
while ($reln = mysql_fetch_assoc($to_res)) {
$bd = fetch_relation_details($reln['dtl_RecID'], false);
// check related record
if (!@$bd['RelatedRecID'] || !array_key_exists('rec_ID', $bd['RelatedRecID'])) {
continue;
}
$relatedRecID = $bd['RelatedRecID']['rec_ID'];
if (count(mysql__select_array("Records", "rec_ID", "rec_ID = {$relatedRecID} and {$accessCondition}")) == 0) {
//related is not accessable
continue;
}
print '<div class=detailRow>';
// print '<span class=label>' . htmlspecialchars($bd['RelationType']) . '</span>'; //saw Enum change
if (array_key_exists('RelTerm', $bd)) {
print '<div class=detailType>' . htmlspecialchars($bd['RelTerm']) . '</div>';
}
print '<div class=detail>';
if (@$bd['RelatedRecID']) {
if (true || $is_map_popup) {
print '<img class="rft" style="background-image:url(' . HEURIST_ICON_URL . $bd['RelatedRecID']['rec_RecTypeID'] . '.png)" title="' . $rectypesStructure['names'][$bd['RelatedRecID']['rec_RecTypeID']] . '" src="' . HEURIST_BASE_URL . 'common/images/16x16.gif"> ';
}
print '<a target=_new href="' . HEURIST_BASE_URL . 'records/view/renderRecordData.php?db=' . HEURIST_DBNAME . '&recID=' . $bd['RelatedRecID']['rec_ID'] . (defined('use_alt_db') ? '&alt' : '') . '" onclick="return link_open(this);">' . htmlspecialchars($bd['RelatedRecID']['rec_Title']) . '</a>';
} else {
print htmlspecialchars($bd['Title']);
}
print ' ';
if (@$bd['StartDate']) {
print htmlspecialchars($bd['StartDate']);
}
if (@$bd['EndDate']) {
print ' until ' . htmlspecialchars($bd['EndDate']);
}
print '</div></div>';
}
}
示例10: mode_crosswalking
//.........这里部分代码省略.........
?>
">Download errors</a></td>
</tr>
<?php
}
?>
<tr><td>Total records:</td><td><b><?php
echo intval(count($out_entries) + count($no_rectype_entries) + count($data_error_entries));
?>
</b></td><td> </td></tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
<hr>
<?php
}
if ($out_entries) {
print_tag_stuff($out_entries);
?>
<p style="margin-left: 15px;">
<p>Specify tags to add to all imported records:</p>
<div class="smallgr" style="padding-left: 10ex; margin-left: 10px;white-space:nowrap;">
Add: <a href="#" target="_ignore" onClick="add_tag('Favourites'); return false;">Favourites</a>
<a href="#" target="_ignore" onClick="add_tag('To Read'); return false;">To Read</a>
</div>
<?php
$top_tags = mysql__select_array('usrRecTagLinks left join usrTags on rtl_TagID=tag_ID', 'tag_Text, count(tag_ID) as count', 'tag_UGrpID=' . get_user_id() . ' group by tag_ID order by count desc limit 5');
if ($top_tags) {
?>
<div class="smallgr" style="padding-left: 10ex; margin-left: 10px;white-space:nowrap;">
Top:
<?php
foreach ($top_tags as $tag) {
$tag = htmlspecialchars($tag);
?>
<a href="#" target="_ignore" onClick="add_tag('<?php
echo $tag;
?>
'); return false;"><?php
echo $tag;
?>
</a> <?php
}
?>
</div>
<?php
}
?>
<?php
$recent_tags = mysql__select_array('usrRecTagLinks left join usrTags on rtl_TagID=tag_ID', 'distinct(tag_Text)', 'tag_UGrpID=' . get_user_id() . ' order by rtl_ID desc limit 5');
if ($recent_tags) {
?>
<div class="smallgr" style="padding-left: 10ex; margin-left: 10px; padding-bottom: 5px;white-space:nowrap;">
Recent:
<?php
foreach ($recent_tags as $tag) {
$tag = htmlspecialchars($tag);
?>
示例11: mysql_connection_select
} else {
$password = "";
}
$needcrypt = false;
} else {
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$needcrypt = true;
//(array_key_exists('mode', $_REQUEST) && $_REQUEST['mode']=='2');
}
mysql_connection_select($db_prefix . $sourcedbname);
$res = mysql_query('select * from ' . USERS_TABLE . ' where ' . USERS_USERNAME_FIELD . ' = "' . addslashes($username) . '"');
$user = mysql_fetch_assoc($res);
if ($user && $user[USERS_ACTIVE_FIELD] == 'y' && ($needcrypt && crypt($password, $user[USERS_PASSWORD_FIELD]) == $user[USERS_PASSWORD_FIELD] || !$needcrypt && $password == $user[USERS_PASSWORD_FIELD])) {
$user_id_insource = $user[USERS_ID_FIELD];
$user_workgroups = mysql__select_array('sysUsrGrpLinks left join sysUGrps grp on grp.ugr_ID=ugl_GroupID', 'ugl_GroupID', 'ugl_UserID=' . $user_id_insource . ' and grp.ugr_Type != "User" order by ugl_GroupID');
} else {
header('Location: ' . HEURIST_BASE_URL . 'import/direct/getRecordsFromDB.php?loginerror=1&db=' . HEURIST_DBNAME);
exit;
}
mysql_connection_overwrite(DATABASE);
}
if (@$_REQUEST['mode'] == '2') {
createMappingForm(null);
} else {
// ---- visit #3 - SAVE SETTINGS -----------------------------------------------------------------
if (@$_REQUEST['mode'] == '3') {
saveSettings();
} else {
// ---- visit #4 - LOAD SETTINGS -----------------------------------------------------------------
if (@$_REQUEST['mode'] == '4') {
示例12: is_admin
}
function is_admin()
{
return false;
}
function is_logged_in()
{
return false;
}
$ss_id = 0;
} else {
// loggin required entry
$ss_id = 0;
require_once dirname(__FILE__) . '/../../common/connect/applyCredentials.php';
}
$ACCESSABLE_OWNER_IDS = mysql__select_array('sysUsrGrpLinks left join sysUGrps grp on grp.ugr_ID=ugl_GroupID', 'ugl_GroupID', 'ugl_UserID=' . get_user_id() . ' and grp.ugr_Type != "user" order by ugl_GroupID');
if (is_logged_in()) {
array_push($ACCESSABLE_OWNER_IDS, get_user_id());
if (!in_array(0, $ACCESSABLE_OWNER_IDS)) {
array_push($ACCESSABLE_OWNER_IDS, 0);
}
}
//----------------------------------------------------------------------------//
// Traversal functions
// The aim here is to bundle all the queries for each level of relationships
// into one query, rather than doing them all recursively.
//----------------------------------------------------------------------------//
/**
* findPointers - Helper function that finds recIDs of record pointer details for all records in a given set of recIDs
* which can be filtered to a set of rectypes
* @author Stephen White derived from original work by Kim Jackson
示例13: array_push
break;
case "urlinclude":
$row[3] = "urlinclude";
break;
case "integer":
case "float":
$row[3] = "numeric";
break;
default:
$row[3] = "literal";
}
array_push($detailTypes, $row);
}
// detailRequirements is an array of [recordTypeID, detailTypeID, requiremence, repeatable, name, prompt, match, size, order, default] values
$detailRequirements = array();
$rec_types = mysql__select_array("defRecTypes", "distinct rty_ID", "1 order by rty_ID");
//$rec_types = mysql__select_array("defRecStructure left join defDetailType on dty_ID = rst_DetailTypeID",
// "distinct rst_RecTypeID", "1 order by rst_RecTypeID");
// rdr = [ rst_DetailTypeID => [
// 0-rst_DisplayName
// 1-rst_DisplayHelpText
// 2-rst_DisplayExtendedDescription
// 3-rst_DefaultValue
// 4-rst_RequirementType
// 5-rst_MaxValues
// 6-rst_MinValues
// 7-rst_DisplayWidth
// 8-rst_RecordMatchOrder
// 9-rst_DisplayOrder
//10-rst_DisplayDetailTypeGroupID
//11-rst_FilteredJsonTermIDTree
示例14: mysql__select_value
/**
* return the first column of first row
*
* @param mixed $mysqli
* @param mixed $query
*/
function mysql__select_value($mysqli, $query)
{
$row = mysql__select_array($mysqli, $query);
if ($row && @$row[0]) {
$result = $row[0];
} else {
$result = null;
}
return $result;
}
示例15: while
$first = true;
while ($row = mysql_fetch_row($res)) {
if (!$first) {
print ",";
}
print " ";
$first = false;
print "\"" . addslashes($row[0]) . "\"";
}
?>
];
top.HEURIST.user.workgroups = [<?php
if (is_array(@$_SESSION[HEURIST_SESSION_DB_PREFIX . 'heurist']['user_access'])) {
$query = "grp.ugr_ID in (" . join(",", array_keys($_SESSION[HEURIST_SESSION_DB_PREFIX . 'heurist']['user_access'])) . ") and grp.ugr_Type !='user' order by grp.ugr_Name";
$workgroups = mysql__select_array(USERS_DATABASE . ".sysUGrps grp", "grp.ugr_ID", $query);
if (is_array($workgroups)) {
print join(", ", $workgroups);
}
}
?>
];
top.HEURIST.user.workgroupSavedSearches = <?php
$ws = array();
if (@$workgroups) {
$res = mysql_query("select svs_UGrpID, svs_ID, svs_Name, svs_Query from usrSavedSearches left join " . USERS_DATABASE . ".sysUGrps grp on grp.ugr_ID = svs_UGrpID where svs_UGrpID in (" . join(",", $workgroups) . ") order by grp.ugr_Name, svs_Name");
while ($row = mysql_fetch_assoc($res)) {
json_decode($row['svs_Query']);
if (json_last_error() == JSON_ERROR_NONE) {
continue;