本文整理汇总了PHP中Combo::Render方法的典型用法代码示例。如果您正苦于以下问题:PHP Combo::Render方法的具体用法?PHP Combo::Render怎么用?PHP Combo::Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Combo
的用法示例。
在下文中一共展示了Combo::Render方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Render
function Render()
{
global $Translation;
$eo['silentErrors'] = true;
$result = sql($this->Query . ' limit ' . datalist_auto_complete_size, $eo);
if ($eo['error'] != '') {
$this->HTML = error_message(htmlspecialchars($eo['error']) . "\n\n<!--\n{$Translation['query:']}\n {$this->Query}\n-->\n\n");
return;
}
$this->ItemCount = db_num_rows($result);
$combo = new Combo();
$combo->Class = $this->Class;
$combo->Style = $this->Style;
$combo->SelectName = $this->SelectName;
$combo->SelectedData = $this->SelectedData;
$combo->SelectedText = $this->SelectedText;
$combo->SelectedClass = 'SelectedOption';
$combo->ListType = $this->ListType;
$combo->ListBoxHeight = $this->ListBoxHeight;
$combo->RadiosPerLine = $this->RadiosPerLine;
$combo->AllowNull = $this->ListType == 2 ? 0 : $this->AllowNull;
while ($row = db_fetch_row($result)) {
$combo->ListData[] = htmlspecialchars($row[0], ENT_QUOTES, 'iso-8859-1');
$combo->ListItem[] = $row[1];
}
$combo->Render();
$this->MatchText = $combo->MatchText;
$this->SelectedText = $combo->SelectedText;
$this->SelectedData = $combo->SelectedData;
if ($this->ListType == 2) {
$rnd = rand(100, 999);
$SelectedID = htmlspecialchars(urlencode($this->SelectedData));
$pt_perm = getTablePermissions($this->parent_table);
if ($pt_perm['view'] || $pt_perm['edit']) {
$this->HTML = str_replace(">{$this->MatchText}</label>", ">{$this->MatchText}</label> <button type=\"button\" class=\"btn btn-default view_parent hspacer-lg\" id=\"{$this->parent_table}_view_parent\" title=" . htmlspecialchars($Translation['View']) . "><i class=\"glyphicon glyphicon-eye-open\"></i></button>", $combo->HTML);
}
$this->HTML = str_replace(' type="radio" ', ' type="radio" onclick="' . $this->SelectName . '_changed();" ', $this->HTML);
} else {
$this->HTML = $combo->HTML;
}
}
示例2: Render
function Render()
{
global $Translation;
$eo['silentErrors'] = true;
$result = sql($this->Query . ' limit ' . datalist_auto_complete_size, $eo);
if ($eo['error'] != '') {
$this->HTML = error_message(htmlspecialchars($eo['error']) . "\n\n<!--\n{$Translation['query:']}\n {$this->Query}\n-->\n\n");
return;
}
$this->ItemCount = db_num_rows($result);
$combo = new Combo();
$combo->Class = $this->Class;
$combo->Style = $this->Style;
$combo->SelectName = $this->SelectName;
$combo->SelectedData = $this->SelectedData;
$combo->SelectedText = $this->SelectedText;
$combo->SelectedClass = 'SelectedOption';
$combo->ListType = $this->ListType;
$combo->ListBoxHeight = $this->ListBoxHeight;
$combo->RadiosPerLine = $this->RadiosPerLine;
$combo->AllowNull = $this->ListType == 2 ? 0 : $this->AllowNull;
while ($row = db_fetch_row($result)) {
$combo->ListData[] = htmlspecialchars($row[0], ENT_QUOTES);
$combo->ListItem[] = $row[1];
}
$combo->Render();
$this->MatchText = $combo->MatchText;
$this->SelectedText = $combo->SelectedText;
$this->SelectedData = $combo->SelectedData;
if ($this->ListType == 2) {
$rnd = rand(100, 999);
$SelectedID = htmlspecialchars(urlencode($this->SelectedData));
$this->HTML = str_replace(">{$this->MatchText}</label>", ">{$this->MatchText}</label> <span id=\"{$this->parent_table}_plink{$rnd}\"><a href=\"{$this->parent_table}_view.php?SelectedID={$SelectedID}\" class=\"btn btn-default btn-sm\"><i class=\"glyphicon glyphicon-search\"></i></a></span>", $combo->HTML);
$this->HTML = str_replace(' type="radio" ', ' type="radio" onclick="' . $this->SelectName . '_changed();" ', $this->HTML);
} else {
$this->HTML = $combo->HTML;
}
}
示例3: Combo
<td>Apellido</td>
<td><input type="text" name="lastname" id="lastname" /></td>
</tr>
<tr>
<td>ID Usuario</td>
<td><input type="text" name="login" id="login" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" id="password" /></td>
</tr>
<tr>
<td>Rol</td>
<td>
<?php
$sql = "SELECT idroles,name FROM roles";
$cmb = new Combo();
$cmb->AddItem(0, "Selecciona");
$cmb->FillDB($sql);
$cmb->Render("idroles");
?>
</td>
</tr>
<tr>
<td colspan="2"><div align="center"><input type="submit" value="Guardar" name="Guardar" /></div></td>
</tr>
</table>
</form>
</body>
</html>
示例4: Render
function Render()
{
// get post and get variables
global $Translation;
$adminConfig = config('adminConfig');
$FiltersPerGroup = 4;
$buttonWholeWidth = 136;
$current_view = '';
/* TV, DV, TVDV, TVP, DVP, Filters */
$Embedded = intval($_REQUEST['Embedded']);
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
$SortField = $_GET["SortField"];
$SortDirection = $_GET["SortDirection"];
$FirstRecord = $_GET["FirstRecord"];
$ScrollUp_y = $_GET["ScrollUp_y"];
$ScrollDn_y = $_GET["ScrollDn_y"];
$Previous_x = $_GET["Previous_x"];
$Next_x = $_GET["Next_x"];
$Filter_x = $_GET["Filter_x"];
$SaveFilter_x = $_GET["SaveFilter_x"];
$NoFilter_x = $_GET["NoFilter_x"];
$CancelFilter = $_GET["CancelFilter"];
$ApplyFilter = $_GET["ApplyFilter"];
$Search_x = $_GET["Search_x"];
$SearchString = get_magic_quotes_gpc() ? stripslashes($_GET['SearchString']) : $_GET['SearchString'];
$CSV_x = $_GET["CSV_x"];
$FilterAnd = $_GET["FilterAnd"];
$FilterField = $_GET["FilterField"];
$FilterOperator = $_GET["FilterOperator"];
if (is_array($_GET['FilterValue'])) {
foreach ($_GET['FilterValue'] as $fvi => $fv) {
$FilterValue[$fvi] = get_magic_quotes_gpc() ? stripslashes($fv) : $fv;
}
}
$Print_x = $_GET['Print_x'];
$PrintTV = $_GET['PrintTV'];
$PrintDV = $_GET['PrintDV'];
$SelectedID = get_magic_quotes_gpc() ? stripslashes($_GET['SelectedID']) : $_GET['SelectedID'];
$insert_x = $_GET['insert_x'];
$update_x = $_GET['update_x'];
$delete_x = $_GET['delete_x'];
$SkipChecks = $_GET['confirmed'];
$deselect_x = $_GET['deselect_x'];
$addNew_x = $_GET['addNew_x'];
$dvprint_x = $_GET['dvprint_x'];
$DisplayRecords = in_array($_GET['DisplayRecords'], array('user', 'group')) ? $_GET['DisplayRecords'] : 'all';
} else {
$SortField = $_POST['SortField'];
$SortDirection = $_POST['SortDirection'];
$FirstRecord = $_POST['FirstRecord'];
$ScrollUp_y = $_POST['ScrollUp_y'];
$ScrollDn_y = $_POST['ScrollDn_y'];
$Previous_x = $_POST['Previous_x'];
$Next_x = $_POST['Next_x'];
$Filter_x = $_POST['Filter_x'];
$SaveFilter_x = $_POST['SaveFilter_x'];
$NoFilter_x = $_POST['NoFilter_x'];
$CancelFilter = $_POST['CancelFilter'];
$ApplyFilter = $_POST['ApplyFilter'];
$Search_x = $_POST['Search_x'];
$SearchString = get_magic_quotes_gpc() ? stripslashes($_POST['SearchString']) : $_POST['SearchString'];
$CSV_x = $_POST['CSV_x'];
$FilterAnd = $_POST['FilterAnd'];
$FilterField = $_POST['FilterField'];
$FilterOperator = $_POST['FilterOperator'];
if (is_array($_POST['FilterValue'])) {
foreach ($_POST['FilterValue'] as $fvi => $fv) {
$FilterValue[$fvi] = get_magic_quotes_gpc() ? stripslashes($fv) : $fv;
}
}
$Print_x = $_POST['Print_x'];
$PrintTV = $_POST['PrintTV'];
$PrintDV = $_POST['PrintDV'];
$SelectedID = get_magic_quotes_gpc() ? stripslashes($_POST['SelectedID']) : $_POST['SelectedID'];
$insert_x = $_POST['insert_x'];
$update_x = $_POST['update_x'];
$delete_x = $_POST['delete_x'];
$SkipChecks = $_POST['confirmed'];
$deselect_x = $_POST['deselect_x'];
$addNew_x = $_POST['addNew_x'];
$dvprint_x = $_POST['dvprint_x'];
$DisplayRecords = in_array($_POST['DisplayRecords'], array('user', 'group')) ? $_POST['DisplayRecords'] : 'all';
}
$mi = getMemberInfo();
// insure authenticity of user inputs:
if (is_array($FilterAnd)) {
foreach ($FilterAnd as $i => $f) {
if ($f && !preg_match('/^(and|or)$/i', trim($f))) {
$FilterAnd[$i] = 'and';
}
}
}
if (is_array($FilterOperator)) {
foreach ($FilterOperator as $i => $f) {
if ($f && !in_array(trim($f), array_keys($GLOBALS['filter_operators']))) {
$FilterOperator[$i] = '';
}
}
}
if (!preg_match('/^\\s*[1-9][0-9]*\\s*(asc|desc)?(\\s*,\\s*[1-9][0-9]*\\s*(asc|desc)?)*$/i', $SortField)) {
//.........这里部分代码省略.........
示例5: patients_form
function patients_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('patients');
if (!$arrPerm[1] && $selected_id == "") {
return "";
}
// combobox: gender
$combo_gender = new Combo();
$combo_gender->ListType = 2;
$combo_gender->MultipleSeparator = ', ';
$combo_gender->ListBoxHeight = 10;
$combo_gender->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/patients.gender.csv')) {
$gender_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/patients.gender.csv')));
$combo_gender->ListItem = explode(";;", $gender_data);
$combo_gender->ListData = explode(";;", $gender_data);
} else {
$combo_gender->ListItem = explode(";;", "Male;;Female;;Other;;Unknown");
$combo_gender->ListData = explode(";;", "Male;;Female;;Other;;Unknown");
}
$combo_gender->SelectName = "gender";
$combo_gender->AllowNull = false;
// combobox: birth_date
$combo_birth_date = new DateCombo();
$combo_birth_date->DateFormat = "mdy";
$combo_birth_date->MinYear = 1900;
$combo_birth_date->MaxYear = 2100;
$combo_birth_date->DefaultDate = parseMySQLDate('', '');
$combo_birth_date->MonthNames = $Translation['month names'];
$combo_birth_date->CSSOptionClass = 'Option';
$combo_birth_date->CSSSelectedClass = 'SelectedOption';
$combo_birth_date->NamePrefix = 'birth_date';
// 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/patients.state.csv')) {
$state_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/patients.state.csv')));
$combo_state->ListItem = explode(";;", $state_data);
$combo_state->ListData = explode(";;", $state_data);
} else {
$combo_state->ListItem = explode(";;", "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 = explode(";;", "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->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='patients' and pkValue='" . makeSafe($selected_id) . "'");
$ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='patients' 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 `patients` where `id`='" . makeSafe($selected_id) . "'");
$row = mysql_fetch_array($res);
$combo_gender->SelectedData = $row["gender"];
$combo_birth_date->DefaultDate = $row["birth_date"];
$combo_state->SelectedData = $row["state"];
$row['filed'] = sqlValue("select DATE_FORMAT(`filed`, '%c/%e/%Y %l:%i%p') from `patients` where `id`='" . makeSafe($selected_id) . "'");
$row['last_modified'] = sqlValue("select DATE_FORMAT(`last_modified`, '%c/%e/%Y %l:%i%p') from `patients` where `id`='" . makeSafe($selected_id) . "'");
} else {
$combo_gender->SelectedText = $_REQUEST['FilterField'][1] == '4' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "Unknown";
$combo_state->SelectedText = $_REQUEST['FilterField'][1] == '9' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
}
$combo_gender->Render();
$combo_state->Render();
// 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/patients_templateDVP.html'));
$dvprint = true;
} else {
$templateCode = @implode('', @file('./templates/patients_templateDV.html'));
$dvprint = false;
}
// process form title
$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Patient details', $templateCode);
// unique random identifier
$rnd1 = $dvprint ? rand(1000000, 9999999) : '';
$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);
//.........这里部分代码省略.........
示例6: outcomes_form
function outcomes_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('outcomes');
if (!$arrPerm[1] && $selected_id == '') {
return '';
}
// print preview?
$dvprint = false;
if ($selected_id && $_REQUEST['dvprint_x'] != '') {
$dvprint = true;
}
$filterer_outcome_area = thisOr(undo_magic_quotes($_REQUEST['filterer_outcome_area']), '');
// populate filterers, starting from children to grand-parents
// unique random identifier
$rnd1 = $dvprint ? rand(1000000, 9999999) : '';
// combobox: outcome_area
$combo_outcome_area = new DataCombo();
// combobox: strata
$combo_strata = new Combo();
$combo_strata->ListType = 0;
$combo_strata->MultipleSeparator = ', ';
$combo_strata->ListBoxHeight = 10;
$combo_strata->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/outcomes.strata.csv')) {
$strata_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/outcomes.strata.csv')));
$combo_strata->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($strata_data)));
$combo_strata->ListData = $combo_strata->ListItem;
} else {
$combo_strata->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Individuals;;Community, Sector & Society")));
$combo_strata->ListData = $combo_strata->ListItem;
}
$combo_strata->SelectName = 'strata';
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='outcomes' and pkValue='" . makeSafe($selected_id) . "'");
$ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='outcomes' 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 `outcomes` where `outcome_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_outcome_area->SelectedData = $row['outcome_area'];
$combo_strata->SelectedData = $row['strata'];
} else {
$combo_outcome_area->SelectedData = $filterer_outcome_area;
$combo_strata->SelectedText = $_REQUEST['FilterField'][1] == '4' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
}
$combo_outcome_area->HTML = $combo_outcome_area->MatchText = '<span id="outcome_area-container' . $rnd1 . '"></span><input type="hidden" name="outcome_area" id="outcome_area' . $rnd1 . '">';
$combo_strata->Render();
ob_start();
?>
<script>
// initial lookup values
var current_outcome_area__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['outcome_area'] : $filterer_outcome_area);
?>
"};
jQuery(function() {
outcome_area_reload__RAND__();
});
function outcome_area_reload__RAND__(){
<?php
if (($AllowUpdate || $AllowInsert) && !$dvprint) {
?>
jQuery("#outcome_area-container__RAND__").select2({
/* initial default value */
initSelection: function(e, c){
jQuery.ajax({
url: 'ajax_combo.php',
dataType: 'json',
data: { id: current_outcome_area__RAND__.value, t: 'outcomes', f: 'outcome_area' }
}).done(function(resp){
c({
//.........这里部分代码省略.........
示例7: paddata_form
//.........这里部分代码省略.........
// mm: who is the owner?
$ownerGroupID = sqlValue("select groupID from membership_userrecords where tableName='paddata' and pkValue='" . makeSafe($selected_id) . "'");
$ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='paddata' 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 `paddata` where `progid`='" . 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'];
$combo_status->SelectedData = $row['status'];
$combo_affiliate->SelectedData = $row['affiliate'];
$combo_clean->SelectedData = $row['clean'];
} else {
$combo_status->SelectedText = $_REQUEST['FilterField'][1] == '12' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "0";
$combo_affiliate->SelectedText = $_REQUEST['FilterField'][1] == '31' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_clean->SelectedText = $_REQUEST['FilterField'][1] == '34' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "0";
}
$combo_status->Render();
$combo_affiliate->Render();
$combo_clean->Render();
// code for template based detail view forms
// open the detail view template
if ($dvprint) {
$templateCode = @file_get_contents('./templates/paddata_templateDVP.html');
} else {
$templateCode = @file_get_contents('./templates/paddata_templateDV.html');
}
// process form title
$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'PAD Data', $templateCode);
$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);
$templateCode = str_replace('<%%EMBEDDED%%>', $_REQUEST['Embedded'] ? 'Embedded=1' : '', $templateCode);
// process buttons
if ($AllowInsert) {
if (!$selected_id) {
$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type="submit" class="btn btn-success" id="insert" name="insert_x" value="1" onclick="return paddata_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 paddata_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);
}
示例8: companies_form
//.........这里部分代码省略.........
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 `companies` where `company_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_client->SelectedData = $row['client'];
$combo_industry->SelectedData = $row['industry'];
$combo_country_hq->SelectedData = $row['country_hq'];
$combo_country_operations->SelectedData = $row['country_operations'];
$combo_company_type->SelectedData = $row['company_type'];
$combo_sic_code->SelectedData = $row['sic_code'];
$combo_created->DefaultDate = $row['created'];
} else {
$combo_client->SelectedData = $filterer_client;
$combo_industry->SelectedText = $_REQUEST['FilterField'][1] == '7' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_country_hq->SelectedText = $_REQUEST['FilterField'][1] == '9' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "United Kingdom";
$combo_company_type->SelectedText = $_REQUEST['FilterField'][1] == '12' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_sic_code->SelectedData = $filterer_sic_code;
}
$combo_client->HTML = $combo_client->MatchText = '<span id="client-container' . $rnd1 . '"></span><input type="hidden" name="client" id="client' . $rnd1 . '">';
$combo_industry->Render();
$combo_country_hq->Render();
$combo_country_operations->Render();
$combo_company_type->Render();
$combo_sic_code->HTML = $combo_sic_code->MatchText = '<span id="sic_code-container' . $rnd1 . '"></span><input type="hidden" name="sic_code" id="sic_code' . $rnd1 . '">';
ob_start();
?>
<script>
// initial lookup values
var current_client__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['client'] : $filterer_client);
?>
"};
var current_sic_code__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['sic_code'] : $filterer_sic_code);
?>
"};
jQuery(function() {
client_reload__RAND__();
sic_code_reload__RAND__();
});
function client_reload__RAND__(){
<?php
if (($AllowUpdate || $AllowInsert) && !$dvprint) {
?>
jQuery("#client-container__RAND__").select2({
/* initial default value */
initSelection: function(e, c){
jQuery.ajax({
url: 'ajax_combo.php',
示例9: GetHTML
function GetHTML($readOnly = false)
{
list($xy, $xm, $xd) = explode('-', $this->DefaultDate);
//$y : render years combo
$years = new Combo();
for ($i = $this->MinYear; $i <= $this->MaxYear; $i++) {
$years->ListItem[] = $i;
$years->ListData[] = $i;
}
$years->SelectName = $this->NamePrefix . 'Year';
$years->SelectID = $this->NamePrefix;
$years->SelectedData = $xy;
$years->Class = "{$this->CSSOptionClass} split-date";
$years->SelectedClass = $this->CSSSelectedClass;
$years->ApplySelect2 = false;
$years->Render();
$y = $readOnly ? substr($this->DefaultDate, 0, 4) : $years->HTML;
//$m : render months combo
$months = new Combo();
for ($i = 1; $i <= 12; $i++) {
$months->ListData[] = $i;
}
$months->ListItem = explode(",", $this->MonthNames);
$months->SelectName = $this->NamePrefix . 'Month';
$months->SelectID = $this->NamePrefix . '-mm';
$months->SelectedData = intval($xm);
$months->Class = $this->CSSOptionClass;
$months->SelectedClass = $this->CSSSelectedClass;
$months->ApplySelect2 = false;
$months->Render();
$m = $readOnly ? $xm : $months->HTML;
//$d : render days combo
$days = new Combo();
for ($i = 1; $i <= 31; $i++) {
$days->ListItem[] = $i;
$days->ListData[] = $i;
}
$days->SelectName = $this->NamePrefix . 'Day';
$days->SelectID = $this->NamePrefix . '-dd';
$days->SelectedData = intval($xd);
$days->Class = $this->CSSOptionClass;
$days->SelectedClass = $this->CSSSelectedClass;
$days->ApplySelect2 = false;
$days->Render();
$d = $readOnly ? $xd : $days->HTML;
$df = $this->DateFormat;
// contains date order 'myd', 'dmy' ... etc
$read_only_date = ${$df[0]} . datalist_date_separator . ${$df[1]} . datalist_date_separator . ${$df[2]};
if ($read_only_date == datalist_date_separator . datalist_date_separator) {
$read_only_date = '';
}
//$read_only_date = '<p class="form-control-static">' . $read_only_date . '</p>';
$editable_date = '<div class="row">';
for ($i = 0; $i < 3; $i++) {
switch ($df[$i]) {
case 'd':
$editable_date .= '<div class="col-xs-3 date_combo">' . $d . '</div>';
break;
case 'm':
$editable_date .= '<div class="col-xs-4 date_combo">' . $m . '</div>';
break;
case 'y':
$editable_date .= '<div class="col-xs-3 date_combo">' . $y . '</div>';
break;
}
if ($i == 2) {
$editable_date .= '<div class="col-xs-2"><button class="btn btn-default" id="fd-but-' . $this->NamePrefix . '"><i class="glyphicon glyphicon-th"></i></button></div>';
}
}
$editable_date .= '</div>';
return $readOnly ? $read_only_date : $editable_date;
}
示例10: properties_form
//.........这里部分代码省略.........
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 `properties` 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_type->SelectedData = $row['type'];
$combo_owner->SelectedData = $row['owner'];
$combo_operating_account->SelectedData = $row['operating_account'];
$combo_country->SelectedData = $row['country'];
$combo_State->SelectedData = $row['State'];
} else {
$combo_type->SelectedText = $_REQUEST['FilterField'][1] == '3' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_owner->SelectedData = $filterer_owner;
$combo_operating_account->SelectedText = $_REQUEST['FilterField'][1] == '7' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_country->SelectedText = $_REQUEST['FilterField'][1] == '10' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_State->SelectedText = $_REQUEST['FilterField'][1] == '13' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
}
$combo_type->Render();
$combo_owner->HTML = '<span id="owner-container' . $rnd1 . '"></span><input type="hidden" name="owner" id="owner' . $rnd1 . '">';
$combo_owner->MatchText = '<span id="owner-container-readonly' . $rnd1 . '"></span><input type="hidden" name="owner" id="owner' . $rnd1 . '">';
$combo_operating_account->Render();
$combo_country->Render();
$combo_State->Render();
ob_start();
?>
<script>
// initial lookup values
var current_owner__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['owner'] : $filterer_owner);
?>
"};
jQuery(function() {
owner_reload__RAND__();
});
function owner_reload__RAND__(){
<?php
if (($AllowUpdate || $AllowInsert) && !$dvprint) {
?>
jQuery("#owner-container__RAND__").select2({
/* initial default value */
initSelection: function(e, c){
jQuery.ajax({
url: 'ajax_combo.php',
dataType: 'json',
data: { id: current_owner__RAND__.value, t: 'properties', f: 'owner' }
}).done(function(resp){
c({
示例11: entries_form
//.........这里部分代码省略.........
} 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;
$combo_beneficiary_group_relevance->SelectedText = $_REQUEST['FilterField'][1] == '10' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_reliability->SelectedText = $_REQUEST['FilterField'][1] == '13' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_intentionality->SelectedText = $_REQUEST['FilterField'][1] == '14' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_equivalence->SelectedText = $_REQUEST['FilterField'][1] == '15' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
}
$combo_report->HTML = $combo_report->MatchText = '<span id="report-container' . $rnd1 . '"></span><input type="hidden" name="report" id="report' . $rnd1 . '">';
$combo_outcome->HTML = $combo_outcome->MatchText = '<span id="outcome-container' . $rnd1 . '"></span><input type="hidden" name="outcome" id="outcome' . $rnd1 . '">';
$combo_indicator->HTML = $combo_indicator->MatchText = '<span id="indicator-container' . $rnd1 . '"></span><input type="hidden" name="indicator" id="indicator' . $rnd1 . '">';
$combo_beneficiary_group->HTML = $combo_beneficiary_group->MatchText = '<span id="beneficiary_group-container' . $rnd1 . '"></span><input type="hidden" name="beneficiary_group" id="beneficiary_group' . $rnd1 . '">';
$combo_beneficiary_group_relevance->Render();
$combo_reliability->Render();
$combo_intentionality->Render();
$combo_equivalence->Render();
ob_start();
?>
<script>
// initial lookup values
var current_report__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['report'] : $filterer_report);
?>
"};
var current_outcome__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['outcome'] : $filterer_outcome);
?>
"};
var current_indicator__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['indicator'] : $filterer_indicator);
?>
"};
var current_beneficiary_group__RAND__ = { text: "", value: "<?php
echo addslashes($selected_id ? $urow['beneficiary_group'] : $filterer_beneficiary_group);
?>
"};
jQuery(function() {
report_reload__RAND__();
outcome_reload__RAND__();
<?php
echo !$AllowUpdate || $dvprint ? 'indicator_reload__RAND__(current_outcome__RAND__.value);' : '';
?>
beneficiary_group_reload__RAND__();
示例12: units_form
function units_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('units');
if (!$arrPerm[1] && $selected_id == '') {
return '';
}
$AllowInsert = $arrPerm[1] ? true : false;
// print preview?
$dvprint = false;
if ($selected_id && $_REQUEST['dvprint_x'] != '') {
$dvprint = true;
}
$filterer_property = thisOr(undo_magic_quotes($_REQUEST['filterer_property']), '');
// populate filterers, starting from children to grand-parents
// unique random identifier
$rnd1 = $dvprint ? rand(1000000, 9999999) : '';
// combobox: property
$combo_property = new DataCombo();
// combobox: status
$combo_status = new Combo();
$combo_status->ListType = 2;
$combo_status->MultipleSeparator = ', ';
$combo_status->ListBoxHeight = 10;
$combo_status->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/units.status.csv')) {
$status_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/units.status.csv')));
$combo_status->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($status_data)));
$combo_status->ListData = $combo_status->ListItem;
} else {
$combo_status->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Occupied;;Listed;;Unlisted")));
$combo_status->ListData = $combo_status->ListItem;
}
$combo_status->SelectName = 'status';
$combo_status->AllowNull = false;
// combobox: features
$combo_features = new Combo();
$combo_features->ListType = 3;
$combo_features->MultipleSeparator = ', ';
$combo_features->ListBoxHeight = 10;
$combo_features->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/units.features.csv')) {
$features_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/units.features.csv')));
$combo_features->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($features_data)));
$combo_features->ListData = $combo_features->ListItem;
} else {
$combo_features->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Cable ready;; Micorwave;;Hardwood floors;; High speed internet;;Air conditioning;;Refrigerator;;Dishwasher;;Walk-in closets;;Balcony;;Deck;;Patio;;Garage parking;;Carport;;Fenced yard;;Laundry room / hookups;; Fireplace;;Oven / range;;Heat - electric;; Heat - gas;; Heat - oil")));
$combo_features->ListData = $combo_features->ListItem;
}
$combo_features->SelectName = 'features';
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='units' and pkValue='" . makeSafe($selected_id) . "'");
$ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='units' 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 `units` 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_property->SelectedData = $row['property'];
$combo_status->SelectedData = $row['status'];
$combo_features->SelectedData = $row['features'];
} else {
$combo_property->SelectedData = $filterer_property;
$combo_status->SelectedText = $_REQUEST['FilterField'][1] == '5' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
}
$combo_property->HTML = '<span id="property-container' . $rnd1 . '"></span><input type="hidden" name="property" id="property' . $rnd1 . '">';
$combo_property->MatchText = '<span id="property-container-readonly' . $rnd1 . '"></span><input type="hidden" name="property" id="property' . $rnd1 . '">';
$combo_status->Render();
$combo_features->Render();
ob_start();
?>
<script>
// initial lookup values
//.........这里部分代码省略.........
示例13: Combo
<tr>
<td>Contenido
<textarea cols="80" id="contents" name="contents" rows="10"></textarea></td>
<script>
CKEDITOR.replace( 'contents' );
</script>
</tr>
<tr>
<td>
Tipo
<?php
$cmb = new Combo();
$cmb->AddItem("0", "Selecciona..");
$cmb->FillDB("SELECT * FROM ambits", "idambits");
$cmb->Render("ambit");
?>
</td>
</tr>
<tr>
<td> Fecha
<input id="fddate" name="fddate" type="text" value="mm/dd/aaaa" /></td>
<script> datepick("fddate","option|dateFormat|yyyy-mm-dd"); </script>
</tr>
<tr>
<td align="center" >
<input name="enviar" type="button" onclick="setContentValue(); post('insert/noticias.php?a=ins', 'mensajes','miform'); get('select/noticias.php','content'); $('#mensajes').empty(); $('#mensajes').show(); desaparece('mensajes');" value="Guardar" />
<input name="cancelar" onclick="get('select/noticias.php','content');" type="button" value="Cancelar" /></td>
示例14: applicants_and_tenants_form
function applicants_and_tenants_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('applicants_and_tenants');
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: birth_date
$combo_birth_date = new DateCombo();
$combo_birth_date->DateFormat = "mdy";
$combo_birth_date->MinYear = 1900;
$combo_birth_date->MaxYear = 2100;
$combo_birth_date->DefaultDate = parseMySQLDate('', '');
$combo_birth_date->MonthNames = $Translation['month names'];
$combo_birth_date->NamePrefix = 'birth_date';
// combobox: driver_license_state
$combo_driver_license_state = new Combo();
$combo_driver_license_state->ListType = 0;
$combo_driver_license_state->MultipleSeparator = ', ';
$combo_driver_license_state->ListBoxHeight = 10;
$combo_driver_license_state->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/applicants_and_tenants.driver_license_state.csv')) {
$driver_license_state_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/applicants_and_tenants.driver_license_state.csv')));
$combo_driver_license_state->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($driver_license_state_data)));
$combo_driver_license_state->ListData = $combo_driver_license_state->ListItem;
} else {
$combo_driver_license_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_driver_license_state->ListData = $combo_driver_license_state->ListItem;
}
$combo_driver_license_state->SelectName = 'driver_license_state';
// combobox: status
$combo_status = new Combo();
$combo_status->ListType = 2;
$combo_status->MultipleSeparator = ', ';
$combo_status->ListBoxHeight = 10;
$combo_status->RadiosPerLine = 1;
if (is_file(dirname(__FILE__) . '/hooks/applicants_and_tenants.status.csv')) {
$status_data = addslashes(implode('', @file(dirname(__FILE__) . '/hooks/applicants_and_tenants.status.csv')));
$combo_status->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($status_data)));
$combo_status->ListData = $combo_status->ListItem;
} else {
$combo_status->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions("Applicant;;Tenant;;Previous tenant")));
$combo_status->ListData = $combo_status->ListItem;
}
$combo_status->SelectName = 'status';
$combo_status->AllowNull = false;
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='applicants_and_tenants' and pkValue='" . makeSafe($selected_id) . "'");
$ownerMemberID = sqlValue("select lcase(memberID) from membership_userrecords where tableName='applicants_and_tenants' 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 `applicants_and_tenants` 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_birth_date->DefaultDate = $row['birth_date'];
$combo_driver_license_state->SelectedData = $row['driver_license_state'];
$combo_status->SelectedData = $row['status'];
} else {
$combo_driver_license_state->SelectedText = $_REQUEST['FilterField'][1] == '8' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "";
$combo_status->SelectedText = $_REQUEST['FilterField'][1] == '13' && $_REQUEST['FilterOperator'][1] == '<=>' ? get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1] : "Applicant";
}
$combo_driver_license_state->Render();
$combo_status->Render();
ob_start();
?>
//.........这里部分代码省略.........
示例15: foreach
for ($i = 0; $i < $num_rules; $i++) {
$sfi = $sd = "";
if (isset($orderBy[$i])) {
foreach ($orderBy[$i] as $sfi => $sd) {
}
}
$sortFields->SelectName = "OrderByField{$i}";
$sortFields->SelectID = "OrderByField{$i}";
$sortFields->SelectedData = $sfi;
$sortFields->SelectedText = "";
$sortFields->Render();
$sortDirs->SelectName = "OrderDir{$i}";
$sortDirs->SelectID = "OrderDir{$i}";
$sortDirs->SelectedData = $sd;
$sortDirs->SelectedText = "";
$sortDirs->Render();
$border_style = $i == $num_rules - 1 ? "solid 2px #DDD" : "dotted 1px #DDD";
?>
<!-- sorting rule -->
<div class="row" style="border-bottom: <?php
echo $border_style;
?>
;">
<div class="col-xs-2 vspacer-md hidden-md hidden-lg"><strong><?php
echo $i ? "then by" : "order by";
?>
</strong></div>
<div class="col-md-2 col-md-offset-2 vspacer-md hidden-xs hidden-sm text-right"><strong><?php
echo $i ? "then by" : "order by";
?>
</strong></div>