Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  checkboxes for values from another table

phpMyEdit General     checkboxes for values from another table
Post new topic   Reply to topic    
 
dutchak     Joined: 12 Nov 2011   Posts: 1  
Post Posted: 2011-11-12 09:32
Back to top  Reply with quote     

Hi all,
Maybe I'm missing something, but I have tried all founded solutions on this forum an no results unfortunatelly.
The task is seems to be simple:
Code:

$opts['fdd']['price_id'] = array(
'name'     => 'Fixed price:',
'select'   => 'C');
$opts['fdd']['price_id']['values']['table'] = 'services';
$opts['fdd']['price_id']['values']['column'] = 'service_id';
$opts['fdd']['price_id']['values']['description'] = 'service_name';
$opts['fdd']['price_id']['values']['filters'] = 'service_group_id in (7)';

There should be checkboxes, but system forceing me to use Dropdown list only.
I'll appreciate any help on this.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2011-11-12 17:42
Back to top  Reply with quote     

Set 'select' to M for multiple-select. Checkboxes are not an option.

 
trister     Joined: 01 Dec 2010   Posts: 15  
Post Posted: 2011-11-17 10:03
Back to top  Reply with quote     

A solution I did for the checkbox problem was this :

main file :
Code:
$opts['fdd']['assign_to_notify_only'] = array(
  'name'     => 'assign to name',
  'select'   => 'T',
  'select|CA'   => 'C', // Multiple Selection only under EDIT (C) and Add (A) 
  'sort'     => true
);
//The Following line includes some PHP code that creates a [values2] entry.
include "trister/query_values2_multiselect.php";

Included file :
query_values2_multiselect.php

Code:
<?php
//To DO use better mysql connect
$db_link = mysql_connect($opts['hn'],$opts['un'],$opts['pw']);
mysql_select_db($opts['db'],$db_link);
/* SET NAMES 'utf-8' COLLATE 'collation_name' */
@mysql_query("SET NAMES 'utf8'",$db_link);   

$array_names='';
$query='SELECT name FROM assign_names';
  $name_templist = '';
  $res = mysql_query($query,$db_link);
  while ($row = @mysql_fetch_array($res)) {
      $name_temp = $row['name'];
      $array_names[$name_temp]=$name_temp;
  }
  mysql_close($db_link);
 
$opts['fdd']['assign_to_notify_only']['values2']=$array_names;
  ?>


It is a workarround that works ok for me.
I hope this helps people.
Any suggestions /corrections are welcome.
Note: I am using this with the latest CVS version.

 
trister     Joined: 01 Dec 2010   Posts: 15  
Post Posted: 2011-11-28 11:23
Back to top  Reply with quote     

Fix to checkbox Filtering problem.
The solution I posted had a problem during filtering.

My solution was to hack phpMyEdit.class.php and
replace this line :
Code:
= array('oper'  => 'IN', 'value' => '('.join(',', $ids).')');

With this

Code:
=array('oper' => 'LIKE', 'value' => "'$afilter'");


I haven't tried to see if this breaks anything else but It have solved the checkbox add/edit/filter search problem[/code]

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy