269
269
$html_output = '';
270
270
if (is_array($foreignData['disp_row'])) {
271
271
$html_output .= '<select name="criteriaValues[' . $column_index . ']"'
272
. ' id="' . $column_id . $column_index .'">';
272
. ' id="' . $column_id . $column_index . '">';
273
273
$html_output .= PMA_foreignDropdown(
274
274
$foreignData['disp_row'], $foreignData['foreign_field'],
275
275
$foreignData['foreign_display'], '', $foreignMaxLimit
280
280
$html_output .= '<input type="text" id="' . $column_id
281
281
. $column_index . '"'
282
282
. ' name="criteriaValues[' . $column_index . ']" id="field_'
283
. md5($column_name) . '[' . $column_index .']" class="textfield"'
283
. md5($column_name) . '[' . $column_index . ']" class="textfield"'
284
284
. (isset($criteriaValues[$column_index])
285
285
&& is_string($criteriaValues[$column_index])
286
286
? (' value="' . $criteriaValues[$column_index] . '"')
334
334
|| (strncasecmp($column_type, 'set', 3) && $in_zoom_search_edit)
336
336
$html_output .= '<select name="criteriaValues[' . ($column_index)
337
. ']" id="' . $column_id . $column_index .'">';
337
. ']" id="' . $column_id . $column_index . '">';
339
339
$html_output .= '<select name="criteriaValues[' . $column_index . ']"'
340
340
. ' id="' . $column_id . $column_index . '" multiple="multiple"'
420
420
$str .= '<input type="text" name="criteriaValues[' . $column_index . ']"'
421
.' size="40" class="' . $the_class . '" id="'
421
. ' size="40" class="' . $the_class . '" id="'
422
422
. $column_id . $column_index . '"'
423
423
. (isset($criteriaValues[$column_index])
424
424
&& is_string($criteriaValues[$column_index])
579
578
$criteriaValues = '^' . $criteriaValues . '$';
582
if ('IN (...)' == $func_type
583
|| 'NOT IN (...)' == $func_type
584
|| 'BETWEEN' == $func_type
585
|| 'NOT BETWEEN' == $func_type
581
if ('IN (...)' != $func_type
582
&& 'NOT IN (...)' != $func_type
583
&& 'BETWEEN' != $func_type
584
&& 'NOT BETWEEN' != $func_type
587
$func_type = str_replace(' (...)', '', $func_type);
589
//Don't explode if this is already an array
590
//(Case for (NOT) IN/BETWEEN.)
591
if (is_array($criteriaValues)) {
592
$values = $criteriaValues;
594
$values = explode(',', $criteriaValues);
596
// quote values one by one
598
foreach ($values as $key => &$value) {
604
$value = $quot . PMA_Util::sqlAddSlashes(trim($value))
608
if ('BETWEEN' == $func_type || 'NOT BETWEEN' == $func_type) {
609
$where = $backquoted_name . ' ' . $func_type . ' '
610
. (isset($values[0]) ? $values[0] : '')
611
. ' AND ' . (isset($values[1]) ? $values[1] : '');
613
if (false !== $emptyKey) {
614
unset($values[$emptyKey]);
617
if (!empty($values)) {
618
$wheres[] = $backquoted_name . ' ' . $func_type
619
. ' (' . implode(',', $values) . ')';
621
if (false !== $emptyKey) {
622
$wheres[] = $backquoted_name . ' IS NULL';
624
$where = implode(' OR ', $wheres);
625
if (1 < count($wheres)) {
626
$where = '(' . $where . ')';
630
586
if ($func_type == 'LIKE %...%' || $func_type == 'LIKE') {
631
587
$where = $backquoted_name . ' ' . $func_type . ' ' . $quot
632
588
. PMA_Util::sqlAddSlashes($criteriaValues, true) . $quot;
634
590
$where = $backquoted_name . ' ' . $func_type . ' ' . $quot
635
591
. PMA_Util::sqlAddSlashes($criteriaValues) . $quot;
595
$func_type = str_replace(' (...)', '', $func_type);
597
//Don't explode if this is already an array
598
//(Case for (NOT) IN/BETWEEN.)
599
if (is_array($criteriaValues)) {
600
$values = $criteriaValues;
602
$values = explode(',', $criteriaValues);
604
// quote values one by one
606
foreach ($values as $key => &$value) {
612
$value = $quot . PMA_Util::sqlAddSlashes(trim($value))
616
if ('BETWEEN' == $func_type || 'NOT BETWEEN' == $func_type) {
617
$where = $backquoted_name . ' ' . $func_type . ' '
618
. (isset($values[0]) ? $values[0] : '')
619
. ' AND ' . (isset($values[1]) ? $values[1] : '');
621
if (false !== $emptyKey) {
622
unset($values[$emptyKey]);
625
if (!empty($values)) {
626
$wheres[] = $backquoted_name . ' ' . $func_type
627
. ' (' . implode(',', $values) . ')';
629
if (false !== $emptyKey) {
630
$wheres[] = $backquoted_name . ' IS NULL';
632
$where = implode(' OR ', $wheres);
633
if (1 < count($wheres)) {
634
$where = '(' . $where . ')';
879
878
. __("Use this column to label each point") . '</label></td>';
880
879
$html_output .= '<td><select name="dataLabel" id="dataLabel" >'
881
880
. '<option value = "">' . __('None') . '</option>';
882
for ($j = 0; $j < count($this->_columnNames); $j++) {
881
for ($j = 0, $nb = count($this->_columnNames); $j < $nb; $j++) {
883
882
if (isset($dataLabel)
884
883
&& $dataLabel == htmlspecialchars($this->_columnNames[$j])
970
969
$html_output = '';
971
970
// for every column present in table
974
$column_index < count($this->_columnNames);
972
$column_index = 0, $nb = count($this->_columnNames);
977
976
$html_output .= '<tr class="noclick '
1039
1038
. 'tableid_' . $i . '" >';
1040
1039
$html_output .= '<option value="' . 'pma_null' . '">' . __('None')
1042
for ($j = 0 ; $j < count($this->_columnNames); $j++) {
1041
for ($j = 0, $nb = count($this->_columnNames); $j < $nb; $j++) {
1043
1042
if (isset($_POST['criteriaColumnNames'][$i])
1044
1043
&& $_POST['criteriaColumnNames'][$i] == htmlspecialchars($this->_columnNames[$j])
1288
1287
$html_output .= '<tbody>';
1289
1288
$odd_row = true;
1292
$column_index < count($this->_columnNames);
1290
$column_index = 0, $nb = count($this->_columnNames);
1291
$column_index < $nb;
1293
1292
$column_index++
1295
1294
$fieldpopup = $this->_columnNames[$column_index];
1344
1343
. '<input type="text" value="" name="replaceWith" required />';
1346
1345
$htmlOutput .= __('Column:') . '<select name="columnIndex">';
1347
for ($i = 0; $i < count($this->_columnNames); $i++) {
1346
for ($i = 0, $nb = count($this->_columnNames); $i < $nb; $i++) {
1348
1347
$type = preg_replace('@\(.*@s', '', $this->_columnTypes[$i]);
1349
1348
if ($GLOBALS['PMA_Types']->getTypeClass($type) == 'CHAR') {
1350
1349
$column = $this->_columnNames[$i];
1384
1383
$sql_query .= " GROUP BY " . PMA_Util::backquote($column)
1385
1384
. " ORDER BY " . PMA_Util::backquote($column) . " ASC";
1387
$rs = $GLOBALS['dbi']->query(
1386
$resultSet = $GLOBALS['dbi']->query(
1388
1387
$sql_query, null, PMA_DatabaseInterface::QUERY_STORE