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

PHP getLoggedMemberID函数代码示例

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

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



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

示例1: symptoms_form

function symptoms_form($selected_id = "", $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0)
{
    // function to return an editable form for a table records
    // and fill it with data of record whose ID is $selected_id. If $selected_id
    // is empty, an empty form is shown, with only an 'Add New'
    // button displayed.
    global $Translation;
    // mm: get table permissions
    $arrPerm = getTablePermissions('symptoms');
    if (!$arrPerm[1] && $selected_id == "") {
        return "";
    }
    if ($selected_id) {
        // mm: check member permissions
        if (!$arrPerm[2]) {
            return "";
        }
        // mm: who is the owner?
        $ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='symptoms' and pkValue='" . makeSafe($selected_id) . "'");
        $ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='symptoms' and pkValue='" . makeSafe($selected_id) . "'");
        if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
            return "";
        }
        if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
            return "";
        }
        // can edit?
        if ($arrPerm[3] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[3] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[3] == 3) {
            $AllowUpdate = 1;
        } else {
            $AllowUpdate = 0;
        }
        $res = sql("select * from `symptoms` where `id`='" . makeSafe($selected_id) . "'");
        $row = mysql_fetch_array($res);
    } else {
    }
    // code for template based detail view forms
    // open the detail view template
    if (($_POST['dvprint_x'] != '' || $_GET['dvprint_x'] != '') && $selected_id) {
        $templateCode = @implode('', @file('./templates/symptoms_templateDVP.html'));
        $dvprint = true;
    } else {
        $templateCode = @implode('', @file('./templates/symptoms_templateDV.html'));
        $dvprint = false;
    }
    // process form title
    $templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Symptom details', $templateCode);
    // unique random identifier
    $rnd1 = $dvprint ? rand(1000000, 9999999) : '';
    $templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);
    // process buttons
    if ($arrPerm[1] && !$selected_id) {
        // allow insert and no record selected?
        $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<input type="image" src="insert.gif" name="insert" alt="' . $Translation['add new record'] . '" onclick="return validateData();">', $templateCode);
    } else {
        $templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);
    }
    if ($selected_id) {
        $templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<input type="image" src="print.gif" vspace="1" name="dvprint" id="dvprint" alt="' . $Translation['printer friendly view'] . '" onclick="document.myform.reset(); return true;" style="margin-bottom: 20px;">', $templateCode);
        if ($AllowUpdate) {
            $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<input type="image" src="update.gif" vspace="1" name="update" alt="' . $Translation['update record'] . '" onclick="return validateData();">', $templateCode);
        } else {
            $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);
            // set records to read only if user can't insert new records
            if (!$arrPerm[1]) {
                $jsReadOnly .= "\n\n\tif(document.getElementsByName('id').length){ document.getElementsByName('id')[0].readOnly=true; }\n";
                $jsReadOnly .= "\n\n\tif(document.getElementsByName('name').length){ document.getElementsByName('name')[0].readOnly=true; }\n";
                $noUploads = true;
            }
        }
        if ($arrPerm[4] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[4] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[4] == 3) {
            // allow delete?
            $templateCode = str_replace('<%%DELETE_BUTTON%%>', '<input type="image" src="delete.gif" vspace="1" name="delete" alt="' . $Translation['delete record'] . '" onClick="return confirm(\'' . $Translation['are you sure?'] . '\');">', $templateCode);
        } else {
            $templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);
        }
        $templateCode = str_replace('<%%DESELECT_BUTTON%%>', "<input type=image src=deselect.gif vspace=1 name=deselect alt=\"" . $Translation['deselect record'] . "\" onclick=\"document.myform.reset(); return true;\">", $templateCode);
    } else {
        $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);
        $templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);
        $templateCode = str_replace('<%%DESELECT_BUTTON%%>', $ShowCancel ? "<input type=image src=cancel.gif vspace=1 name=deselect alt=\"" . $Translation['deselect record'] . "\" onclick=\"document.myform.reset(); return true;\">" : '', $templateCode);
    }
    // process combos
    // process foreign key links
    if ($selected_id) {
    }
    // process images
    $templateCode = str_replace('<%%UPLOADFILE(id)%%>', '', $templateCode);
    $templateCode = str_replace('<%%UPLOADFILE(name)%%>', '', $templateCode);
    $templateCode = str_replace('<%%UPLOADFILE(description)%%>', '', $templateCode);
    $templateCode = str_replace('<%%UPLOADFILE(comments)%%>', '', $templateCode);
    // process values
    if ($selected_id) {
        $templateCode = str_replace('<%%VALUE(id)%%>', htmlspecialchars($row['id'], ENT_QUOTES), $templateCode);
        $templateCode = str_replace('<%%VALUE(name)%%>', htmlspecialchars($row['name'], ENT_QUOTES), $templateCode);
        if ($AllowUpdate || $AllowInsert) {
            $templateCode = str_replace('<%%HTMLAREA(description)%%>', '<textarea name="description" id="description" cols="50" rows="5" class="TextBox">' . htmlspecialchars($row['description'], ENT_QUOTES) . '</textarea>', $templateCode);
        } else {
            $templateCode = str_replace('<%%HTMLAREA(description)%%>', $row['description'], $templateCode);
        }
//.........这里部分代码省略.........
开发者ID:bigprof,项目名称:Symptoms-and-diseases-database,代码行数:101,代码来源:symptoms_dml.php


示例2: entries_form


//.........这里部分代码省略.........
    $combo_intentionality->RadiosPerLine = 1;
    if (is_file(dirname(__FILE__) . '/hooks/entries.intentionality.csv')) {
        $intentionality_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/entries.intentionality.csv')));
        $combo_intentionality->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($intentionality_data)));
        $combo_intentionality->ListData = $combo_intentionality->ListItem;
    } else {
        $combo_intentionality->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("1;;2;;3;;4;;5")));
        $combo_intentionality->ListData = $combo_intentionality->ListItem;
    }
    $combo_intentionality->SelectName = 'intentionality';
    // combobox: equivalence
    $combo_equivalence = new Combo();
    $combo_equivalence->ListType = 0;
    $combo_equivalence->MultipleSeparator = ', ';
    $combo_equivalence->ListBoxHeight = 10;
    $combo_equivalence->RadiosPerLine = 1;
    if (is_file(dirname(__FILE__) . '/hooks/entries.equivalence.csv')) {
        $equivalence_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/entries.equivalence.csv')));
        $combo_equivalence->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($equivalence_data)));
        $combo_equivalence->ListData = $combo_equivalence->ListItem;
    } else {
        $combo_equivalence->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("1;;2;;3;;4;;5")));
        $combo_equivalence->ListData = $combo_equivalence->ListItem;
    }
    $combo_equivalence->SelectName = 'equivalence';
    if ($selected_id) {
        // mm: check member permissions
        if (!$arrPerm[2]) {
            return "";
        }
        // mm: who is the owner?
        $ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='entries' and pkValue='" . makeSafe($selected_id) . "'");
        $ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='entries' and pkValue='" . makeSafe($selected_id) . "'");
        if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
            return "";
        }
        if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
            return "";
        }
        // can edit?
        if ($arrPerm[3] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[3] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[3] == 3) {
            $AllowUpdate = 1;
        } else {
            $AllowUpdate = 0;
        }
        $res = sql("select * from `entries` where `entry_id`='" . makeSafe($selected_id) . "'", $eo);
        $row = mysql_fetch_array($res);
        $urow = $row;
        /* unsanitized data */
        $hc = new CI_Input();
        $row = $hc->xss_clean($row);
        /* sanitize data */
        $combo_created->DefaultDate = $row['created'];
        $combo_report->SelectedData = $row['report'];
        $combo_outcome->SelectedData = $row['outcome'];
        $combo_indicator->SelectedData = $row['indicator'];
        $combo_beneficiary_group->SelectedData = $row['beneficiary_group'];
        $combo_beneficiary_group_relevance->SelectedData = $row['beneficiary_group_relevance'];
        $combo_reliability->SelectedData = $row['reliability'];
        $combo_intentionality->SelectedData = $row['intentionality'];
        $combo_equivalence->SelectedData = $row['equivalence'];
    } else {
        $combo_report->SelectedData = $filterer_report;
        $combo_outcome->SelectedData = $filterer_outcome;
        $combo_indicator->SelectedData = $filterer_indicator;
        $combo_beneficiary_group->SelectedData = $filterer_beneficiary_group;
开发者ID:centaurustech,项目名称:git-SID,代码行数:67,代码来源:entries_dml.php


示例3: array

$x->ColFieldName = array('code', 'activity');
$x->ColNumber = array(2, 3);
$x->Template = 'templates/sic_templateTV.html';
$x->SelectedTemplate = 'templates/sic_templateTVS.html';
$x->ShowTableHeader = 1;
$x->ShowRecordSlots = 0;
$x->HighlightColor = '#FFF0C2';
// mm: build the query based on current member's permissions
$DisplayRecords = $_REQUEST['DisplayRecords'];
if (!in_array($DisplayRecords, array('user', 'group'))) {
    $DisplayRecords = 'all';
}
if ($perm[2] == 1 || $perm[2] > 1 && $DisplayRecords == 'user' && !$_REQUEST['NoFilter_x']) {
    // view owner only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `sic`.`sic_id`=membership_userrecords.pkValue and membership_userrecords.tableName='sic' and lcase(membership_userrecords.memberID)='" . getLoggedMemberID() . "'";
} elseif ($perm[2] == 2 || $perm[2] > 2 && $DisplayRecords == 'group' && !$_REQUEST['NoFilter_x']) {
    // view group only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `sic`.`sic_id`=membership_userrecords.pkValue and membership_userrecords.tableName='sic' and membership_userrecords.groupID='" . getLoggedGroupID() . "'";
} elseif ($perm[2] == 3) {
    // view all
    // no further action
} elseif ($perm[2] == 0) {
    // view none
    $x->QueryFields = array("Not enough permissions" => "NEP");
    $x->QueryFrom = '`sic`';
    $x->QueryWhere = '';
    $x->DefaultSortField = '';
}
// hook: sic_init
开发者ID:centaurustech,项目名称:git-SID,代码行数:31,代码来源:sic_view.php


示例4: categories_form

function categories_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0)
{
    // function to return an editable form for a table records
    // and fill it with data of record whose ID is $selected_id. If $selected_id
    // is empty, an empty form is shown, with only an 'Add New'
    // button displayed.
    global $Translation;
    // mm: get table permissions
    $arrPerm = getTablePermissions('categories');
    if (!$arrPerm[1] && $selected_id == '') {
        return '';
    }
    $AllowInsert = $arrPerm[1] ? true : false;
    // print preview?
    $dvprint = false;
    if ($selected_id && $_REQUEST['dvprint_x'] != '') {
        $dvprint = true;
    }
    // populate filterers, starting from children to grand-parents
    // unique random identifier
    $rnd1 = $dvprint ? rand(1000000, 9999999) : '';
    if ($selected_id) {
        // mm: check member permissions
        if (!$arrPerm[2]) {
            return "";
        }
        // mm: who is the owner?
        $ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='categories' and pkValue='" . makeSafe($selected_id) . "'");
        $ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='categories' and pkValue='" . makeSafe($selected_id) . "'");
        if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
            return "";
        }
        if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
            return "";
        }
        // can edit?
        if ($arrPerm[3] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[3] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[3] == 3) {
            $AllowUpdate = 1;
        } else {
            $AllowUpdate = 0;
        }
        $res = sql("select * from `categories` where `CategoryID`='" . makeSafe($selected_id) . "'", $eo);
        if (!($row = db_fetch_array($res))) {
            return error_message($Translation['No records found']);
        }
        $urow = $row;
        /* unsanitized data */
        $hc = new CI_Input();
        $row = $hc->xss_clean($row);
        /* sanitize data */
    } else {
    }
    ob_start();
    ?>

	<script>
		// initial lookup values

		jQuery(function() {
		});
	</script>
	<?php 
    $lookups = str_replace('__RAND__', $rnd1, ob_get_contents());
    ob_end_clean();
    // code for template based detail view forms
    // open the detail view template
    if ($dvprint) {
        $templateCode = @file_get_contents('./templates/categories_templateDVP.html');
    } else {
        $templateCode = @file_get_contents('./templates/categories_templateDV.html');
    }
    // process form title
    $templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Add/Edit Product Categories', $templateCode);
    $templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);
    $templateCode = str_replace('<%%EMBEDDED%%>', $_REQUEST['Embedded'] ? 'Embedded=1' : '', $templateCode);
    // process buttons
    if ($arrPerm[1] && !$selected_id) {
        // allow insert and no record selected?
        if (!$selected_id) {
            $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type="submit" class="btn btn-success" id="insert" name="insert_x" value="1" onclick="return categories_validateData();"><i class="glyphicon glyphicon-plus-sign"></i> ' . $Translation['Save New'] . '</button>', $templateCode);
        }
        $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type="submit" class="btn btn-default" id="insert" name="insert_x" value="1" onclick="return categories_validateData();"><i class="glyphicon glyphicon-plus-sign"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);
    } else {
        $templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);
    }
    // 'Back' button action
    if ($_REQUEST['Embedded']) {
        $backAction = 'window.parent.jQuery(\'.modal\').modal(\'hide\'); return false;';
    } else {
        $backAction = '$$(\'form\')[0].writeAttribute(\'novalidate\', \'novalidate\'); document.myform.reset(); return true;';
    }
    if ($selected_id) {
        if (!$_REQUEST['Embedded']) {
            $templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<button type="submit" class="btn btn-default" id="dvprint" name="dvprint_x" value="1" onclick="$$(\'form\')[0].writeAttribute(\'novalidate\', \'novalidate\'); document.myform.reset(); return true;"><i class="glyphicon glyphicon-print"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);
        }
        if ($AllowUpdate) {
            $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<button type="submit" class="btn btn-success btn-lg" id="update" name="update_x" value="1" onclick="return categories_validateData();"><i class="glyphicon glyphicon-ok"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);
        } else {
            $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);
        }
//.........这里部分代码省略.........
开发者ID:bigprof,项目名称:appgini-mssql,代码行数:101,代码来源:categories_dml.php


示例5: array

$x->ColFieldName = array('OrderID', 'ProductID', 'Category', 'UnitPrice', 'Quantity', 'Discount');
$x->ColNumber = array(2, 3, 4, 5, 6, 7);
$x->Template = 'templates/order_details_templateTV.html';
$x->SelectedTemplate = 'templates/order_details_templateTVS.html';
$x->ShowTableHeader = 1;
$x->ShowRecordSlots = 0;
$x->HighlightColor = '#FFF0C2';
// mm: build the query based on current member's permissions
$DisplayRecords = $_REQUEST['DisplayRecords'];
if (!in_array($DisplayRecords, array('user', 'group'))) {
    $DisplayRecords = 'all';
}
if ($perm[2] == 1 || $perm[2] > 1 && $DisplayRecords == 'user' && !$_REQUEST['NoFilter_x']) {
    // view owner only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `order_details`.`odID`=membership_userrecords.pkValue and membership_userrecords.tableName='order_details' and lcase(membership_userrecords.memberID)='" . getLoggedMemberID() . "'";
} elseif ($perm[2] == 2 || $perm[2] > 2 && $DisplayRecords == 'group' && !$_REQUEST['NoFilter_x']) {
    // view group only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `order_details`.`odID`=membership_userrecords.pkValue and membership_userrecords.tableName='order_details' and membership_userrecords.groupID='" . getLoggedGroupID() . "'";
} elseif ($perm[2] == 3) {
    // view all
    // no further action
} elseif ($perm[2] == 0) {
    // view none
    $x->QueryFields = array("Not enough permissions" => "NEP");
    $x->QueryFrom = '`order_details`';
    $x->QueryWhere = '';
    $x->DefaultSortField = '';
}
// hook: order_details_init
开发者ID:ahmedandroid1980,项目名称:appgini,代码行数:31,代码来源:order_details_view.php


示例6: array

$x->ColFieldName = array('CompanyName', 'Phone');
$x->ColNumber = array(2, 3);
$x->Template = 'templates/shippers_templateTV.html';
$x->SelectedTemplate = 'templates/shippers_templateTVS.html';
$x->ShowTableHeader = 1;
$x->ShowRecordSlots = 0;
$x->HighlightColor = '#FFF0C2';
// mm: build the query based on current member's permissions
$DisplayRecords = $_REQUEST['DisplayRecords'];
if (!in_array($DisplayRecords, array('user', 'group'))) {
    $DisplayRecords = 'all';
}
if ($perm[2] == 1 || $perm[2] > 1 && $DisplayRecords == 'user' && !$_REQUEST['NoFilter_x']) {
    // view owner only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `shippers`.`ShipperID`=membership_userrecords.pkValue and membership_userrecords.tableName='shippers' and lcase(membership_userrecords.memberID)='" . getLoggedMemberID() . "'";
} elseif ($perm[2] == 2 || $perm[2] > 2 && $DisplayRecords == 'group' && !$_REQUEST['NoFilter_x']) {
    // view group only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `shippers`.`ShipperID`=membership_userrecords.pkValue and membership_userrecords.tableName='shippers' and membership_userrecords.groupID='" . getLoggedGroupID() . "'";
} elseif ($perm[2] == 3) {
    // view all
    // no further action
} elseif ($perm[2] == 0) {
    // view none
    $x->QueryFields = array("Not enough permissions" => "NEP");
    $x->QueryFrom = '`shippers`';
    $x->QueryWhere = '';
    $x->DefaultSortField = '';
}
// hook: shippers_init
开发者ID:TokaMElTorkey,项目名称:northwind,代码行数:31,代码来源:shippers_view.php


示例7: orders_form

function orders_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0)
{
    // function to return an editable form for a table records
    // and fill it with data of record whose ID is $selected_id. If $selected_id
    // is empty, an empty form is shown, with only an 'Add New'
    // button displayed.
    global $Translation;
    // mm: get table permissions
    $arrPerm = getTablePermissions('orders');
    if (!$arrPerm[1] && $selected_id == '') {
        return '';
    }
    $AllowInsert = $arrPerm[1] ? true : false;
    // print preview?
    $dvprint = false;
    if ($selected_id && $_REQUEST['dvprint_x'] != '') {
        $dvprint = true;
    }
    $filterer_CustomerID = thisOr(undo_magic_quotes($_REQUEST['filterer_CustomerID']), '');
    $filterer_EmployeeID = thisOr(undo_magic_quotes($_REQUEST['filterer_EmployeeID']), '');
    $filterer_ShipVia = thisOr(undo_magic_quotes($_REQUEST['filterer_ShipVia']), '');
    // populate filterers, starting from children to grand-parents
    // unique random identifier
    $rnd1 = $dvprint ? rand(1000000, 9999999) : '';
    // combobox: CustomerID
    $combo_CustomerID = new DataCombo();
    // combobox: EmployeeID
    $combo_EmployeeID = new DataCombo();
    // combobox: OrderDate
    $combo_OrderDate = new DateCombo();
    $combo_OrderDate->DateFormat = "mdy";
    $combo_OrderDate->MinYear = 1900;
    $combo_OrderDate->MaxYear = 2100;
    $combo_OrderDate->DefaultDate = parseMySQLDate('1', '1');
    $combo_OrderDate->MonthNames = $Translation['month names'];
    $combo_OrderDate->NamePrefix = 'OrderDate';
    // combobox: RequiredDate
    $combo_RequiredDate = new DateCombo();
    $combo_RequiredDate->DateFormat = "mdy";
    $combo_RequiredDate->MinYear = 1900;
    $combo_RequiredDate->MaxYear = 2100;
    $combo_RequiredDate->DefaultDate = parseMySQLDate('1', '1');
    $combo_RequiredDate->MonthNames = $Translation['month names'];
    $combo_RequiredDate->NamePrefix = 'RequiredDate';
    // combobox: ShippedDate
    $combo_ShippedDate = new DateCombo();
    $combo_ShippedDate->DateFormat = "mdy";
    $combo_ShippedDate->MinYear = 1900;
    $combo_ShippedDate->MaxYear = 2100;
    $combo_ShippedDate->DefaultDate = parseMySQLDate('', '');
    $combo_ShippedDate->MonthNames = $Translation['month names'];
    $combo_ShippedDate->NamePrefix = 'ShippedDate';
    // combobox: ShipVia
    $combo_ShipVia = new DataCombo();
    if ($selected_id) {
        // mm: check member permissions
        if (!$arrPerm[2]) {
            return "";
        }
        // mm: who is the owner?
        $ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='orders' and pkValue='" . makeSafe($selected_id) . "'");
        $ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='orders' and pkValue='" . makeSafe($selected_id) . "'");
        if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
            return "";
        }
        if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
            return "";
        }
        // can edit?
        if ($arrPerm[3] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[3] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[3] == 3) {
            $AllowUpdate = 1;
        } else {
            $AllowUpdate = 0;
        }
        $res = sql("select * from `orders` where `OrderID`='" . makeSafe($selected_id) . "'", $eo);
        if (!($row = db_fetch_array($res))) {
            return error_message($Translation['No records found']);
        }
        $urow = $row;
        /* unsanitized data */
        $hc = new CI_Input();
        $row = $hc->xss_clean($row);
        /* sanitize data */
        $combo_CustomerID->SelectedData = $row['CustomerID'];
        $combo_EmployeeID->SelectedData = $row['EmployeeID'];
        $combo_OrderDate->DefaultDate = $row['OrderDate'];
        $combo_RequiredDate->DefaultDate = $row['RequiredDate'];
        $combo_ShippedDate->DefaultDate = $row['ShippedDate'];
        $combo_ShipVia->SelectedData = $row['ShipVia'];
    } else {
        $combo_CustomerID->SelectedData = $filterer_CustomerID;
        $combo_EmployeeID->SelectedData = $filterer_EmployeeID;
        $combo_ShipVia->SelectedData = $filterer_ShipVia;
    }
    $combo_CustomerID->HTML = '<span id="CustomerID-container' . $rnd1 . '"></span><input type="hidden" name="CustomerID" id="CustomerID' . $rnd1 . '" value="' . htmlspecialchars($combo_CustomerID->SelectedData, ENT_QUOTES, 'iso-8859-1') . '">';
    $combo_CustomerID->MatchText = '<span id="CustomerID-container-readonly' . $rnd1 . '"></span><input type="hidden" name="CustomerID" id="CustomerID' . $rnd1 . '" value="' . htmlspecialchars($combo_CustomerID->SelectedData, ENT_QUOTES, 'iso-8859-1') . '">';
    $combo_EmployeeID->HTML = '<span id="EmployeeID-container' . $rnd1 . '"></span><input type="hidden" name="EmployeeID" id="EmployeeID' . $rnd1 . '" value="' . htmlspecialchars($combo_EmployeeID->SelectedData, ENT_QUOTES, 'iso-8859-1') . '">';
    $combo_EmployeeID->MatchText = '<span id="EmployeeID-container-readonly' . $rnd1 . '"></span><input type="hidden" name="EmployeeID" id="EmployeeID' . $rnd1 . '" value="' . htmlspecialchars($combo_EmployeeID->SelectedData, ENT_QUOTES, 'iso-8859-1') . '">';
    $combo_ShipVia->HTML = '<span id="ShipVia-container' . $rnd1 . '"></span><input type="hidden" name="ShipVia" id="ShipVia' . $rnd1 . '" value="' . htmlspecialchars($combo_ShipVia->SelectedData, ENT_QUOTES, 'iso-8859-1') . '">';
    $combo_ShipVia->MatchText = '<span id="ShipVia-container-readonly' . $rnd1 . '"></span><input type="hidden" name="ShipVia" id="ShipVia' . $rnd1 . '" value="' . htmlspecialchars($combo_ShipVia->SelectedData, ENT_QUOTES, 'iso-8859-1') . '">';
//.........这里部分代码省略.........
开发者ID:bigprof,项目名称:appgini-mssql,代码行数:101,代码来源:orders_dml.php


示例8: residence_and_rental_history_form

function residence_and_rental_history_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0)
{
    // function to return an editable form for a table records
    // and fill it with data of record whose ID is $selected_id. If $selected_id
    // is empty, an empty form is shown, with only an 'Add New'
    // button displayed.
    global $Translation;
    // mm: get table permissions
    $arrPerm = getTablePermissions('residence_and_rental_history');
    if (!$arrPerm[1] && $selected_id == '') {
        return '';
    }
    $AllowInsert = $arrPerm[1] ? true : false;
    // print preview?
    $dvprint = false;
    if ($selected_id && $_REQUEST['dvprint_x'] != '') {
        $dvprint = true;
    }
    $filterer_tenant = thisOr(undo_magic_quotes($_REQUEST['filterer_tenant']), '');
    // populate filterers, starting from children to grand-parents
    // unique random identifier
    $rnd1 = $dvprint ? rand(1000000, 9999999) : '';
    // combobox: tenant
    $combo_tenant = new DataCombo();
    // combobox: duration_of_residency_from
    $combo_duration_of_residency_from = new DateCombo();
    $combo_duration_of_residency_from->DateFormat = "mdy";
    $combo_duration_of_residency_from->MinYear = 1900;
    $combo_duration_of_residency_from->MaxYear = 2100;
    $combo_duration_of_residency_from->DefaultDate = parseMySQLDate('', '');
    $combo_duration_of_residency_from->MonthNames = $Translation['month names'];
    $combo_duration_of_residency_from->NamePrefix = 'duration_of_residency_from';
    // combobox: to
    $combo_to = new DateCombo();
    $combo_to->DateFormat = "mdy";
    $combo_to->MinYear = 1900;
    $combo_to->MaxYear = 2100;
    $combo_to->DefaultDate = parseMySQLDate('', '');
    $combo_to->MonthNames = $Translation['month names'];
    $combo_to->NamePrefix = 'to';
    if ($selected_id) {
        // mm: check member permissions
        if (!$arrPerm[2]) {
            return "";
        }
        // mm: who is the owner?
        $ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='residence_and_rental_history' and pkValue='" . makeSafe($selected_id) . "'");
        $ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='residence_and_rental_history' and pkValue='" . makeSafe($selected_id) . "'");
        if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
            return "";
        }
        if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
            return "";
        }
        // can edit?
        if ($arrPerm[3] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[3] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[3] == 3) {
            $AllowUpdate = 1;
        } else {
            $AllowUpdate = 0;
        }
        $res = sql("select * from `residence_and_rental_history` where `id`='" . makeSafe($selected_id) . "'", $eo);
        if (!($row = db_fetch_array($res))) {
            return error_message($Translation['No records found']);
        }
        $urow = $row;
        /* unsanitized data */
        $hc = new CI_Input();
        $row = $hc->xss_clean($row);
        /* sanitize data */
        $combo_tenant->SelectedData = $row['tenant'];
        $combo_duration_of_residency_from->DefaultDate = $row['duration_of_residency_from'];
        $combo_to->DefaultDate = $row['to'];
    } else {
        $combo_tenant->SelectedData = $filterer_tenant;
    }
    $combo_tenant->HTML = '<span id="tenant-container' . $rnd1 . '"></span><input type="hidden" name="tenant" id="tenant' . $rnd1 . '">';
    $combo_tenant->MatchText = '<span id="tenant-container-readonly' . $rnd1 . '"></span><input type="hidden" name="tenant" id="tenant' . $rnd1 . '">';
    ob_start();
    ?>

	<script>
		// initial lookup values
		var current_tenant__RAND__ = { text: "", value: "<?php 
    echo addslashes($selected_id ? $urow['tenant'] : $filterer_tenant);
    ?>
"};

		jQuery(function() {
			tenant_reload__RAND__();
		});
		function tenant_reload__RAND__(){
		<?php 
    if (($AllowUpdate || $AllowInsert) && !$dvprint) {
        ?>

			jQuery("#tenant-container__RAND__").select2({
				/* initial default value */
				initSelection: function(e, c){
					jQuery.ajax({
						url: 'ajax_combo.php',
//.........这里部分代码省略.........
开发者ID:vishwanathhsinhaa,项目名称:tieuthuong-org,代码行数:101,代码来源:residence_and_rental_history_dml.php


示例9: submitlog_form

function submitlog_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0)
{
    // function to return an editable form for a table records
    // and fill it with data of record whose ID is $selected_id. If $selected_id
    // is empty, an empty form is shown, with only an 'Add New'
    // button displayed.
    global $Translation;
    // mm: get table permissions
    $arrPerm = getTablePermissions('submitlog');
    if (!$arrPerm[1] && $selected_id == '') {
        return '';
    }
    $AllowInsert = $arrPerm[1] ? true : false;
    // print preview?
    $dvprint = false;
    if ($selected_id && $_REQUEST['dvprint_x'] != '') {
        $dvprint = true;
    }
    // populate filterers, starting from children to grand-parents
    // unique random identifier
    $rnd1 = $dvprint ? rand(1000000, 9999999) : '';
    // combobox: pdate
    $combo_pdate = new DateCombo();
    $combo_pdate->DateFormat = "mdy";
    $combo_pdate->MinYear = 1900;
    $combo_pdate->MaxYear = 2100;
    $combo_pdate->DefaultDate = parseMySQLDate('', '');
    $combo_pdate->MonthNames = $Translation['month names'];
    $combo_pdate->NamePrefix = 'pdate';
    if ($selected_id) {
        // mm: check member permissions
        if (!$arrPerm[2]) {
            return "";
        }
        // mm: who is the owner?
        $ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='submitlog' and pkValue='" . makeSafe($selected_id) . "'");
        $ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='submitlog' and pkValue='" . makeSafe($selected_id) . "'");
        if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
            return "";
        }
        if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
            return "";
        }
        // can edit?
        if ($arrPerm[3] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[3] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[3] == 3) {
            $AllowUpdate = 1;
        } else {
            $AllowUpdate = 0;
        }
        $res = sql("select * from `submitlog` where `submid`='" . makeSafe($selected_id) . "'", $eo);
        if (!($row = db_fetch_array($res))) {
            return error_message($Translation['No records found']);
        }
        $urow = $row;
        /* unsanitized data */
        $hc = new CI_Input();
        $row = $hc->xss_clean($row);
        /* sanitize data */
        $combo_pdate->DefaultDate = $row['pdate'];
    } else {
    }
    // code for template based detail view forms
    // open the detail view template
    $templateCode = @file_get_contents('./templates/submitlog_templateDV.html');
    // process form title
    $templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Filtered Submissions', $templateCode);
    $templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);
    $templateCode = str_replace('<%%EMBEDDED%%>', $_REQUEST['Embedded'] ? 'Embedded=1' : '', $templateCode);
    // process buttons
    if ($arrPerm[1] && !$selected_id) {
        // allow insert and no record selected?
        if (!$selected_id) {
            $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type="submit" class="btn btn-success" id="insert" name="insert_x" value="1" onclick="return submitlog_validateData();"><i class="glyphicon glyphicon-plus-sign"></i> ' . $Translation['Save New'] . '</button>', $templateCode);
        }
        $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type="submit" class="btn btn-default" id="insert" name="insert_x" value="1" onclick="return submitlog_validateData();"><i class="glyphicon glyphicon-plus-sign"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);
    } else {
        $templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);
    }
    // 'Back' button action
    if ($_REQUEST['Embedded']) {
        $backAction = 'window.parent.jQuery(\'.modal\').modal(\'hide\'); return false;';
    } else {
        $backAction = '$$(\'form\')[0].writeAttribute(\'novalidate\', \'novalidate\'); document.myform.reset(); return true;';
    }
    if ($selected_id) {
        if ($AllowUpdate) {
            $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<button type="submit" class="btn btn-success btn-lg" id="update" name="update_x" value="1" onclick="return submitlog_validateData();"><i class="glyphicon glyphicon-ok"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);
        } else {
            $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);
        }
        if ($arrPerm[4] == 1 && $ownerMemberID == getLoggedMemberID() || $arrPerm[4] == 2 && $ownerGroupID == getLoggedGroupID() || $arrPerm[4] == 3) {
            // allow delete?
            $templateCode = str_replace('<%%DELETE_BUTTON%%>', '<button type="submit" class="btn btn-danger" id="delete" name="delete_x" value="1" onclick="return confirm(\'' . $Translation['are you sure?'] . '\');"><i class="glyphicon glyphicon-trash"></i> ' . $Translation['Delete'] . '</button>', $templateCode);
        } else {
            $templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);
        }
        $templateCode = str_replace('<%%DESELECT_BUTTON%%>', '<button type="submit" class="btn btn-default" id="deselect" name="deselect_x" value="1" onclick="' . $backAction . '"><i class="glyphicon glyphicon-chevron-left"></i> ' . $Translation['Back'] . '</button>', $templateCode);
    } else {
        $templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);
        $templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);
//.........这里部分代码省略.........
开发者ID:WebxOne,项目名称:swldbav0.6,代码行数:101,代码来源:submitlog_dml.php


示例10: array

$x->PrimaryKey = "`diseases`.`id`";
$x->DefaultSortField = '1';
$x->DefaultSortDirection = 'desc';
$x->ColWidth = array(150, 150, 400);
$x->ColCaption = array("Short name", "Latin name", "Description");
$x->ColNumber = array(2, 3, 4);
$x->Template = 'templates/diseases_templateTV.html';
$x->SelectedTemplate = 'templates/diseases_templateTVS.html';
$x->ShowTableHeader = 1;
$x->ShowRecordSlots = 0;
$x->HighlightColor = '#FFF0C2';
// mm: build the query based on current member's permissions
if ($perm[2] == 1) {
    // view owner only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `diseases`.`id`=membership_userrecords.pkValue and membership_userrecords.tableName='diseases' and lcase(membership_userrecords.memberID)='" . getLoggedMemberID() . "'";
} elseif ($perm[2] == 2) {
    // view group only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `diseases`.`id`=membership_userrecords.pkValue and membership_userrecords.tableName='diseases' and membership_userrecords.groupID='" . getLoggedGroupID() . "'";
} elseif ($perm[2] == 3) {
    // view all
    // no further action
} elseif ($perm[2] == 0) {
    // view none
    $x->QueryFields = array("Not enough permissions" => "NEP");
    $x->QueryFrom = '`diseases`';
    $x->QueryWhere = '';
    $x->DefaultSortField = '';
}
// handle date sorting correctly
开发者ID:bigprof,项目名称:Symptoms-and-diseases-database,代码行数:31,代码来源:diseases_view.php


示例11: getMemberInfo

function getMemberInfo($memberID = '')
{
    global $adminConfig;
    $mi = array();
    if (!$memberID) {
        $memberID = getLoggedMemberID();
    }
    if ($memberID) {
        $res = sql("select * from membership_users where memberID='" . addslashes($memberID) . "'");
        if ($row = mysql_fetch_assoc($res)) {
            $mi['username'] = $memberID;
            $mi['groupID'] = $row['groupID'];
            $mi['group'] = sqlValue("select name from membership_groups where groupID='" . $row['groupID'] . "'");
            $mi['admin'] = $adminConfig['adminUsername'] == $memberID ? TRUE : FALSE;
            $mi['email'] = $row['email'];
            $mi['custom'][0] = $row['custom1'];
            $mi['custom'][1] = $row['custom2'];
            $mi['custom'][2] = $row['custom3'];
            $mi['custom'][3] = $row['custom4'];
            $mi['banned'] = $row['isBanned'] ? TRUE : FALSE;
            $mi['approved'] = $row['isApproved'] ? TRUE : FALSE;
            $mi['signupDate'] = date('n/j/Y', @strtotime($row['signupDate']));
            $mi['comments'] = $row['comments'];
            $mi['IP'] = $_SERVER['REMOTE_ADDR'];
        }
    }
    return $mi;
}
开发者ID:bigprof,项目名称:Symptoms-and-diseases-database,代码行数:28,代码来源:incCommon.php


示例12: array

$x->ColFieldName = array('progid', 'company', 'country', 'website', 'contactname', 'email', 'title', 'version', 'pdate', 'cost', 'ptype', 'status', 'install', 'os', 'languages', 'changeinfo', 'category', 'requirements', 'ksize', 'keywords', 'description', 'descrlarge', 'homepage', 'screenshot', 'icon', 'padfile', 'download', 'dlcount', 'dlipaddr', 'aspnumber', 'affiliate', 'affiliateid', 'siterating', 'clean', 'paderrcount');
$x->ColNumber = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35);
$x->Template = 'templates/paddata_templateTV.html';
$x->SelectedTemplate = 'templates/paddata_templateTVS.html';
$x->ShowTableHeader = 1;
$x->ShowRecordSlots = 0;
$x->HighlightColor = '#FFF0C2';
// mm: build the query based on current member's permissions
$DisplayRecords = $_REQUEST['DisplayRecords'];
if (!in_array($DisplayRecords, array('user', 'group'))) {
    $DisplayRecords = 'all';
}
if ($perm[2] == 1 || $perm[2] > 1 && $DisplayRecords == 'user' && !$_REQUEST['NoFilter_x']) {
    // view owner only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `paddata`.`progid`=membership_userrecords.pkValue and membership_userrecords.tableName='paddata' and lcase(membership_userrecords.memberID)='" . getLoggedMemberID() . "'";
} elseif ($perm[2] == 2 || $perm[2] > 2 && $DisplayRecords == 'group' && !$_REQUEST['NoFilter_x']) {
    // view group only
    $x->QueryFrom .= ', membership_userrecords';
    $x->QueryWhere = "where `paddata`.`progid`=membership_userrecords.pkValue and membership_userrecords.tableName='paddata' and membership_userrecords.groupID='" . getLoggedGroupID() . "'";
} elseif ($perm[2] == 3) {
    // view all
    // no further action
} elseif ($perm[2] == 0) {
    // view none
    $x->QueryFields = array("Not enough permissions" => "NEP");
    $x->QueryFrom = '`paddata`';
    $x->QueryWhere = '';
    $x->DefaultSortField = '';
}
// hook: paddata_init
开发者ID:WebxOne,项目名称:swldbav0.6,代码行数:31,代码来源:paddata_view.php


示例13: permissions_sql

function permissions_sql($table, $level = 'all')
{
    if (!in_array($level, array('user', 'group'))) {
        $level = 'all';
    }
    $perm = getTablePermissions($table);
    $from = '';
    $where = '';
    $pk = getPKFieldName($table);
    if ($perm[2] == 1 || $perm[2] > 1 && $level == 'user') {
        // view owner only
        $from = 'membership_userrecords';
        $where = "(`{$table}`.`{$pk}`=membership_userrecords.pkValue and membership_userrecords.tableName='{$table}' and lcase(membership_userrecords.memberID)='" . getLoggedMemberID() . "')";
    } elseif ($perm[2] == 2 || $perm[2] > 2 && $level == 'group') {
        // view group only
        $from = 'membership_userrecords';
        $where = "(`{$table}`.`{$pk}`=membership_userrecords.pkValue and membership_userrecords.tableName='{$table}' and membership_userrecords.groupID='" . getLoggedGroupID() . "')";
    } elseif ($perm[2] == 3) {
        // view all
        // no further action
    } elseif ($perm[2] == 0) {
        // view none
        return false;
    }
    return array('where' => $where, 'from' => $from, 0 => $where, 1 => $from);
}
开发者ID:centaurustech,项目名称:git-SID,代码行数:26,代码来源:incCommon.php


示例14: array

该文章已有0人参与评论

请发表评论

全部评论

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