This topic is locked

Custom Button on Menu.php

5/2/2012 3:54:15 PM
PHPRunner General questions
cyberjas2001 author

Hello people.

Im working on an Online Inventory for my company, which handles our equipment.

On my menu.php I had add a button. See below for a sample:



What I want to do is the following, when you hit Express that will change that specific Container Condition from Parked to Reserved, also refresh my counter and menu.php
After that an Express Ticket Number is generated, which is valid just for 1 hour. If that container stays on my Inventory after that time, the ticket number will expire and the Condition of that container will change back to Parked.
I hope somebody can help me.

Thanks

C
cgphp 5/2/2012

You can refresh the page with the location.href statement, in the "Client after" section, to update values on the page.

cyberjas2001 author 5/3/2012



You can refresh the page with the location.href statement, in the "Client after" section, to update values on the page.


Do you have a sample that I can relate to?

Thanks for your help

C
cgphp 5/3/2012

Provide before your existing button code and we will work on it.

cyberjas2001 author 5/3/2012



Provide before your existing button code and we will work on it.


Ok, here's the code on my button:
Client Before:

params["txt"] = "Container was succesfully Reserved";

ctrl.setMessage("Sending request to server...");
Server:

global $conn;

$strUpdate = "UPDATE container SET Condition = 'Reserved' ";

CustomQuery($strUpdate);

$result["txt"] = "Records were updated.";
Client After:

var message = result["txt"] + " !!!";

ctrl.setMessage(message);
When I click my button, it doesnt do anything, any idea?

C
cgphp 5/3/2012

Your query update all records. Anyway, check if the fields names are correct and check firebug for errors as well.

cyberjas2001 author 5/3/2012



Your query update all records. Anyway, check if the fields names are correct and check firebug for errors as well.


It doesn't update any records. That's what I want to fix. Also I dont know how to pick that individual record to update it.
Also when I use Firebug I get this:
JSON.parse

[Break On This Error]
throw new SyntaxError('JSON.parse');};}}());

Sergey Kornilov admin 5/3/2012

If you have a valid support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. Someone will be glad to help you with this.

cyberjas2001 author 5/4/2012



If you have a valid support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. Someone will be glad to help you with this.


My contract expired few months ago, I just need help with this issue. Anyway I keep looking, thanks

Sergey Kornilov admin 5/4/2012

Post it to Demo Account anyway, hopefully this is something minor and we'll be able to help you.

cyberjas2001 author 5/4/2012

I changed my Server event to:
foreach($keys as $idx=>$val)

{

$sql = "update container set Condition='Reserved' where Unit=" .$val["Unit"];

CustomQuery($sql);

}

$result["txt"] = "Container was Reserved";
It does reload my page now, I add the necessary code on my Client After:

window.location.reload();
It just reloads the page, and doesn't update the Condition on it

cyberjas2001 author 5/4/2012

I just posted it on the Demo Accout,

Thanks for your help

Sergey Kornilov admin 5/4/2012

Make sure to open a ticket sending Demo Account URL and providing detailed instructions on reproducing the issue.

cyberjas2001 author 5/4/2012



Make sure to open a ticket sending Demo Account URL and providing detailed instructions on reproducing the issue.


I just did, ticket 260357

Thanks