Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, March 28, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Custom button code question

phpMyEdit Configuration     Custom button code question
Post new topic   Reply to topic   Goto page 1, 2, 3 ... 40, 41, 42  Next  
 
jtzako     Joined: 12 Jan 2017   Posts: 16  
Post Posted: 2017-01-13 18:37
Back to top  Reply with quote     

I'm trying to create a custom button that will open a new URL (php file) with some information passed to it.

I can make it create the custom button this way and it will open the new URL:

$opts['buttons']['L']['up'] = array('<<','<','add','change','copy','>','>>','goto','goto_combo',array(
'name' => 'Email' , 'value' => 'Email', 'code' => '<a href="requestemail.php class="button" target="_BLANK">Email</a>')
);

However, I need to pass to that URL the value of one of my fields for the selected record.

I tried the code below but it isnt working. It stops at the <?php $key; ?> and doesnt populate that, and the class/target and text dont get done either.

$opts['buttons']['L']['up'] = array('<<','<','add','change','copy','>','>>','goto','goto_combo',array(
'name' => 'Email' , 'value' => 'Email', 'code' => '<a href="requestemail.php?PME_sys_rec="<?php $key; ?>" class="button" target="_BLANK">Email</a>')
);

What I need is for when I click that button it gets the currently selected record info to pass to the new php file.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2017-01-13 22:13
Back to top  Reply with quote     

Search in the forum for CONCAT which you can use to create the URL, optionally as a new dummy field in VLF modes or else within the field of the unique identifier.

// Pass the field named `primary_domain_name` in a link to another form such that
// the passed `primary_domain_name` is used as a filter in the other form's List mode.

$opts['fdd']['dummy2'] = array (
'name' => 'Edit',
'sql|VLF' => 'if(primary_domain_name <> "",
CONCAT("<a href=\"data.php?s=22&PME_sys_fl=1&PME_sys_fm=0&PME_sys_sfn[0]=1&PME_sys_qf1=", primary_domain_name, "\" target=\"_blank\">Edit</a>"),
"")',
'options' => 'VLF',
'input' => 'R',
'escape' => false,
'sort' => false
);

 
jtzako     Joined: 12 Jan 2017   Posts: 16  
Post Posted: 2017-01-13 23:41
Back to top  Reply with quote     

I've looked extensively at the forum including the CONCAT entries but it does not look like CONCAT can be used with a custom button.

I would only want this button on List mode, it would need to get the value of the record via the selector bullet point similar to how "Change" or "Copy" do currently.

I would want the button to either show up to the left of each row like the graphic buttons do, or up in the row of buttons along with the Add, Change etc.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2017-01-14 02:12
Back to top  Reply with quote     

You'll need a virtual (dummy) field to pass the View link, client_id is the unique identifier in this example. You can make this the first column but it would take a week to determine how to make it appear directly next to the icons for the four functions View, Change, coPy, Delete.

$opts['fdd']['dummy1'] = array (
'sql|VLF' => 'if(client_id <> "",
CONCAT("<a href=\"contacts.php?PME_sys_fl=1&amp;PME_sys_fm=10&amp;PME_sys_sfn[0]=1&amp;sn=2&amp;PME_sys_operation=PME_op_View&amp;PME_sys_rec=",
client_id, \" target=\"_blank\">Client</a>"), "")',
'options' => 'VLF',
'input' => 'R',
'escape' => false,
'sort' => false
);

 
jtzako     Joined: 12 Jan 2017   Posts: 16  
Post Posted: 2017-01-17 16:50
Back to top  Reply with quote     

Edit: Found an extra \ that caused the SQL error.

Edit2: Found the problem with undefined index also.


Thanks for the info, this should work nicely.

 
LouieAustin     Joined: 14 Nov 2020   Posts: 1  
Post Posted: 2020-11-21 13:29
Back to top  Reply with quote     

Open source platforms are the most used platforms. Open source is the platform to get help with java homework where you will be able to get the right of doing whatever you want to love. There is no restriction on you that you can write this content or that.

 
laakea     Joined: 20 Apr 2021   Posts: 1104  
Post Posted: 2021-05-30 13:16
Back to top  Reply with quote     

definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! saunas supremesauna.com

 
laakea     Joined: 20 Apr 2021   Posts: 1104  
Post Posted: 2021-06-15 14:18
Back to top  Reply with quote     

Your blog has chock-a-block of useful information. I liked your blog's content as well as its look. In my opinion, this is a perfect blog in all aspects. EMF Protection

 
laakea     Joined: 20 Apr 2021   Posts: 1104  
Post Posted: 2021-06-16 14:49
Back to top  Reply with quote     

I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading. I had to go show it to my friend and he ejoyed it as well! custom mc patches

 
alexzender     Joined: 09 Aug 2020   Posts: 648  
Post Posted: 2021-06-19 21:04
Back to top  Reply with quote     

Dubai Fix Appliance is a team of experts that provide Home Appliance Repair in Dubai, Abu Dhabi & Sharjah. Contact 24/7, +971 525 859817. Call Your Service Now! Appliance Repair Service and Support

 
alexzender     Joined: 09 Aug 2020   Posts: 648  
Post Posted: 2021-06-26 15:04
Back to top  Reply with quote     

https://mhcsandiego.com Our clinicians only utilize the very latest in therapeutic techniques to help you or your loved one. mental health disorders

 
laakea     Joined: 20 Apr 2021   Posts: 1104  
Post Posted: 2021-07-29 08:02
Back to top  Reply with quote     

Your post is very helpful to get some effective tips to reduce weight properly. You have shared various nice photos of the same. I would like to thank you for sharing these tips. Surely I will try this at home. Keep updating more simple tips like this. &#47673;&#53888;&#44160;&#51613;

 
mark_847     Joined: 02 Aug 2021   Posts: 1  
Post Posted: 2021-08-02 06:49
Back to top  Reply with quote     

Thanks for sharing such great information, the post you published have some great information which is quite beneficial for me. MyLowesLife

 
ffw347x9xf     Joined: 01 Aug 2021   Posts: 38  
Post Posted: 2021-08-09 13:18
Back to top  Reply with quote     

Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. partfield

 
ffw347x9xf     Joined: 01 Aug 2021   Posts: 38  
Post Posted: 2021-08-10 11:10
Back to top  Reply with quote     

Your work is very good and I appreciate you and hopping for some more informative posts. Thank you for sharing great information to us. &#3626;&#3621;&#3655;&#3629;&#3605; &#3648;&#3588;&#3619;&#3604;&#3636;&#3605;&#3615;&#3619;&#3637; 100 &#3652;&#3617;&#3656;&#3605;&#3657;&#3629;&#3591;&#3613;&#3634;&#3585;

 
Post new topic   Reply to topic   Goto page 1, 2, 3 ... 40, 41, 42  Next  

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