本文整理汇总了PHP中getLoggedGroupID函数的典型用法代码示例。如果您正苦于以下问题:PHP getLoggedGroupID函数的具体用法?PHP getLoggedGroupID怎么用?PHP getLoggedGroupID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLoggedGroupID函数的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: properties_form
function properties_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('properties');
if (!$arrPerm[1] && $selected_id == '') {
return '';
}
$AllowInsert = $arrPerm[1] ? true : false;
// print preview?
$dvprint = false;
if ($selected_id && $_REQUEST['dvprint_x'] != '') {
$dvprint = true;
}
$filterer_owner = thisOr(undo_magic_quotes($_REQUEST['filterer_owner']), '');
// populate filterers, starting from children to grand-parents
// unique random identifier
$rnd1 = $dvprint ? rand(1000000, 9999999) : '';
// combobox: type
$combo_type = new Combo();
$combo_type->ListType = 2;
$combo_type->MultipleSeparator = ', ';
$combo_type->ListBoxHeight = 10;
$combo_type->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/properties.type.csv')) {
$type_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/properties.type.csv')));
$combo_type->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($type_data)));
$combo_type->ListData = $combo_type->ListItem;
} else {
$combo_type->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Residential;;Commercial;;Condo/Townhome;;Multi-Family;;Single-Family;;stores;;office;;shops")));
$combo_type->ListData = $combo_type->ListItem;
}
$combo_type->SelectName = 'type';
$combo_type->AllowNull = false;
// combobox: owner
$combo_owner = new DataCombo();
// combobox: operating_account
$combo_operating_account = new Combo();
$combo_operating_account->ListType = 0;
$combo_operating_account->MultipleSeparator = ', ';
$combo_operating_account->ListBoxHeight = 10;
$combo_operating_account->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/properties.operating_account.csv')) {
$operating_account_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/properties.operating_account.csv')));
$combo_operating_account->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($operating_account_data)));
$combo_operating_account->ListData = $combo_operating_account->ListItem;
} else {
$combo_operating_account->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Operating bank account;;Security deposit bank account")));
$combo_operating_account->ListData = $combo_operating_account->ListItem;
}
$combo_operating_account->SelectName = 'operating_account';
// combobox: country
$combo_country = new Combo();
$combo_country->ListType = 0;
$combo_country->MultipleSeparator = ', ';
$combo_country->ListBoxHeight = 10;
$combo_country->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/properties.country.csv')) {
$country_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/properties.country.csv')));
$combo_country->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($country_data)));
$combo_country->ListData = $combo_country->ListItem;
} else {
$combo_country->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Afghanistan;;Albania;;Algeria;;American Samoa;;Andorra;;Angola;;Anguilla;;Antarctica;;Antigua, Barbuda;;Argentina;;Armenia;;Aruba;;Australia;;Austria;;Azerbaijan;;Bahamas;;Bahrain;;Bangladesh;;Barbados;;Belarus;;Belgium;;Belize;;Benin;;Bermuda;;Bhutan;;Bolivia;;Bosnia, Herzegovina;;Botswana;;Bouvet Is.;;Brazil;;Brunei Darussalam;;Bulgaria;;Burkina Faso;;Burundi;;Cambodia;;Cameroon;;Canada;;Canary Is.;;Cape Verde;;Cayman Is.;;Central African Rep.;;Chad;;Channel Islands;;Chile;;China;;Christmas Is.;;Cocos Is.;;Colombia;;Comoros;;Congo, D.R. Of;;Congo;;Cook Is.;;Costa Rica;;Croatia;;Cuba;;Cyprus;;Czech Republic;;Denmark;;Djibouti;;Dominica;;Dominican Republic;;Ecuador;;Egypt;;El Salvador;;Equatorial Guinea;;Eritrea;;Estonia;;Ethiopia;;Falkland Is.;;Faroe Is.;;Fiji;;Finland;;France;;French Guiana;;French Polynesia;;French Territories;;Gabon;;Gambia;;Georgia;;Germany;;Ghana;;Gibraltar;;Greece;;Greenland;;Grenada;;Guadeloupe;;Guam;;Guatemala;;Guernsey;;Guinea-bissau;;Guinea;;Guyana;;Haiti;;Heard, Mcdonald Is.;;Honduras;;Hong Kong;;Hungary;;Iceland;;India;;Indonesia;;Iran;;Iraq;;Ireland;;Israel;;Italy;;Ivory Coast;;Jamaica;;Japan;;Jersey;;Jordan;;Kazakhstan;;Kenya;;Kiribati;;Korea, D.P.R Of;;Korea, Rep. Of;;Kuwait;;Kyrgyzstan;;Lao Peoples D.R.;;Latvia;;Lebanon;;Lesotho;;Liberia;;Libyan Arab Jamahiriya;;Liechtenstein;;Lithuania;;Luxembourg;;Macao;;Macedonia, F.Y.R Of;;Madagascar;;Malawi;;Malaysia;;Maldives;;Mali;;Malta;;Mariana Islands;;Marshall Islands;;Martinique;;Mauritania;;Mauritius;;Mayotte;;Mexico;;Micronesia;;Moldova;;Monaco;;Mongolia;;Montserrat;;Morocco;;Mozambique;;Myanmar;;Namibia;;Nauru;;Nepal;;Netherlands Antilles;;Netherlands;;New Caledonia;;New Zealand;;Nicaragua;;Niger;;Nigeria;;Niue;;Norfolk Island;;Norway;;Oman;;Pakistan;;Palau;;Palestinian Terr.;;Panama;;Papua New Guinea;;Paraguay;;Peru;;Philippines;;Pitcairn;;Poland;;Portugal;;Puerto Rico;;Qatar;;Reunion;;Romania;;Russian Federation;;Rwanda;;Samoa;;San Marino;;Sao Tome, Principe;;Saudi Arabia;;Senegal;;Seychelles;;Sierra Leone;;Singapore;;Slovakia;;Slovenia;;Solomon Is.;;Somalia;;South Africa;;South Georgia;;South Sandwich Is.;;Spain;;Sri Lanka;;St. Helena;;St. Kitts, Nevis;;St. Lucia;;St. Pierre, Miquelon;;St. Vincent, Grenadines;;Sudan;;Suriname;;Svalbard, Jan Mayen;;Swaziland;;Sweden;;Switzerland;;Syrian Arab Republic;;Taiwan;;Tajikistan;;Tanzania;;Thailand;;Timor-leste;;Togo;;Tokelau;;Tonga;;Trinidad, Tobago;;Tunisia;;Turkey;;Turkmenistan;;Turks, Caicoss;;Tuvalu;;Uganda;;Ukraine;;United Arab Emirates;;United Kingdom;;United States;;Uruguay;;Uzbekistan;;Vanuatu;;Vatican City;;Venezuela;;Viet Nam;;Virgin Is. British;;Virgin Is. U.S.;;Wallis, Futuna;;Western Sahara;;Yemen;;Yugoslavia;;Zambia;;Zimbabwe")));
$combo_country->ListData = $combo_country->ListItem;
}
$combo_country->SelectName = 'country';
// combobox: State
$combo_State = new Combo();
$combo_State->ListType = 0;
$combo_State->MultipleSeparator = ', ';
$combo_State->ListBoxHeight = 10;
$combo_State->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/properties.State.csv')) {
$State_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/properties.State.csv')));
$combo_State->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($State_data)));
$combo_State->ListData = $combo_State->ListItem;
} else {
$combo_State->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("AL;;AK;;AS;;AZ;;AR;;CA;;CO;;CT;;DE;;DC;;FM;;FL;;GA;;GU;;HI;;ID;;IL;;IN;;IA;;KS;;KY;;LA;;ME;;MH;;MD;;MA;;MI;;MN;;MS;;MO;;MT;;NE;;NV;;NH;;NJ;;NM;;NY;;NC;;ND;;MP;;OH;;OK;;OR;;PW;;PA;;PR;;RI;;SC;;SD;;TN;;TX;;UT;;VT;;VI;;VA;;WA;;WV;;WI;;WY")));
$combo_State->ListData = $combo_State->ListItem;
}
$combo_State->SelectName = 'State';
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='properties' and pkValue='" . makeSafe($selected_id) . "'");
$ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='properties' and pkValue='" . makeSafe($selected_id) . "'");
if ($arrPerm[2] == 1 && getLoggedMemberID() != $ownerMemberID) {
return "";
}
if ($arrPerm[2] == 2 && getLoggedGroupID() != $ownerGroupID) {
return "";
}
// can edit?
//.........这里部分代码省略.........
开发者ID:vishwanathhsinhaa,项目名称:tieuthuong-org,代码行数:101,代码来源:properties_dml.php
示例3: lcase
$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
$render = TRUE;
if (function_exists('sic_init')) {
$args = array();
$render = sic_init($x, getMemberInfo(), $args);
开发者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: lcase
$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
$render = TRUE;
if (function_exists('order_details_init')) {
$args = array();
$render = order_details_init($x, getMemberInfo(), $args);
开发者ID:ahmedandroid1980,项目名称:appgini,代码行数:31,代码来源:order_details_view.php
示例6: lcase
$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
$render = TRUE;
if (function_exists('shippers_init')) {
$args = array();
$render = shippers_init($x, getMemberInfo(), $args);
开发者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->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
// end of date sorting handler
// hook: diseases_init
$render = TRUE;
if (function_exists('diseases_init')) {
开发者ID:bigprof,项目名称:Symptoms-and-diseases-database,代码行数:31,代码来源:diseases_view.php
示例11: lcase
$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 `companies`.`company_id`=membership_userrecords.pkValue and membership_userrecords.tableName='companies' 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 `companies`.`company_id`=membership_userrecords.pkValue and membership_userrecords.tableName='companies' 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 = '`companies`';
$x->QueryWhere = '';
$x->DefaultSortField = '';
}
// hook: companies_init
$render = TRUE;
if (function_exists('companies_init')) {
$args = array();
$render = companies_init($x, getMemberInfo(), $args);
开发者ID:centaurustech,项目名称:git-SID,代码行数:31,代码来源:companies_view.php
示例12: getLoggedGroupID
function getLoggedGroupID()
{
if ($_SESSION['memberGroupID'] != '') {
return $_SESSION['memberGroupID'];
} else {
setAnonymousAccess();
return getLoggedGroupID();
}
}
开发者ID:bigprof,项目名称:Symptoms-and-diseases-database,代码行数:9,代码来源:incCommon.php
-
vant的使用我开始是npm导入,然后import,使用不了。找了各种方法,最后还是下载文件
阅读:537|2022-07-18
-
bradtraversy/iweather: Ionic 3 mobile weather app
阅读:1650|2022-08-30
-
joaomh/curso-de-matlab
阅读:1211|2022-08-17
-
魔兽世界怀旧服已经开启两个多月了,但作为一个猎人玩家,抓到“断牙”,已经成为了一
阅读:1066|2022-11-06
-
rugk/mastodon-simplified-federation: Simplifies following and interacting with r
阅读:1133|2022-08-17
-
写了这么长时间的代码,一直认为调试程序比写程序要重要,上次有人问俺,如何调
阅读:822|2022-07-18
-
amp;amp;lt;HTMLamp;amp;gt;amp;amp;lt;HEADamp;amp;gt;amp;amp;lt;TITLEamp;amp;gt;
阅读:727|2022-07-18
-
Gallagher Controller 6000 is vulnerable to a Denial of Service attack via confli
阅读:653|2022-07-08
-
Tangshitao/Dense-Scene-Matching: Learning Camera Localization via Dense Scene Ma
阅读:821|2022-08-16
-
相信不少果粉在对自己的设备进行某些操作时,都会碰到Respring,但这个 Respring 到底
阅读:388|2022-11-06
|
请发表评论