Quantcast
Channel: ASPRunner forums
Viewing all 2586 articles
Browse latest View live

Change text color or background of a field

$
0
0
Hello from rainy Germany, I need some inspiration again:

In my master table there is a field with the value "status" .
The master table has a detail table, in this table there is a field with the value "Detail-Status". The detail table can have any number of entries.

If all entries in the field "detail status" in the "detail table" have the value "completed", the value "status" in the master table should be marked in color (green). If the values in the detail table are different from "completed", this value should also be colored (red).

Alternatively, the field background could also be changed analogously to the specifications described above.

I have already tried to do this by using scripts in the "after record processed" area, but unfortunately I failed.

[SOLVED] Probelm with getValue() in JS OnLoad event

$
0
0
I want to hide the text field named "Honors" if it is equal to the value "<None>".

I took the following code straight out of manual and placed it in the JS onload event:

var ctrl = Runner.getControl(pageid, "Honors");

if(ctrl.getValue() == "<None>")
{
	pageObj.hideField("Honors");
}




It did not work. If I just left the hideField line in with no condition, it did hide the field. So I tested the value of ctrl.getValue() with an alert:

alert(ctrl.getValue);


Which resulted in the following:

Posted Image

Obviously not what I was expecting. Did I do something wrong?

Custom Button and Email Help

$
0
0
My table has a field called Custodial_Email that contains a valid email address. I am trying to have a custom button at the bottom of the edit page that would allow my staff to send some information on the current record to the email address contained within the Custodial_Email field of the same record. I found the section of the manual that deals with this "Send an email to selected users" and copied the code in the first setup and changed to the fields in red accordingly, but when I build and run it is giving me an error.

Error I receive on Edit Page after build and trying button
Error happened:
File: C:\inetpub\wwwroot\Projects\Requests\output\include\phpfunctions.php
Line: 277
Description: mail(): SMTP server response: 503 5.5.2 Need rcpt command



Server Tab Code of Custom Button

// Place event code here.
// Use "Add Action" button to add code snippets.

// Put your code here.
$emails = array();

while( $data = $button->getNextSelectedRecord() )
{
if( $data["Custodial_Email"] )
$emails[] = $data["Custodial_Email"];
}

// send the email
$email = implode(", ", $emails);
$subject = "Sample subject";
$body = "Your email text here";
$arr = runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $body));

$result["txt"] = "Emails were sent.";

// if error happened print a message on the web page
if( !$arr["mailed"] )
{
$errmsg = "Error happened: <br>";
$errmsg.= "File: " . $arr["errors"][0]["file"] . "<br>";
$errmsg.= "Line: " . $arr["errors"][0]["line"] . "<br>";
$errmsg.= "Description: " . $arr["errors"][0]["description"] . "<br>";
$result["txt"] = $errmsg;
}


Client After Tab of button

// Put your code here.
var message = result["txt"];
ctrl.setMessage(message);

[SOLVED] Master-Detail set up where condition for lookup wizard in detail table

$
0
0
I have a purchase order master-detail relationship. In the master table a have field 'supplier' and in the detail table I a have a field 'item'. I also has a supplier/item relationship table which stores which 'supplier' sells which 'item'. Now I would like to define my 'item' field in the detail table as a lookup wizard field. How should I set the where condition in the lookup wizard so that it only lists the specific supplier's selling items? Thanks.

Fatal error

$
0
0
On uploding 10.3 files to online server it shows error after login, localhost work fine

Fatal error: Uncaught Error: Cannot pass parameter 5 by reference in /home4/xxxxxxxxxxx/public_html/xxxxxxx.xxxxxxxxx.xxx/classes/loginpage.php:713 Stack trace: #0 /home4/xxxxxxxxxxx/public_html/xxxxxxx.xxxxxxxxx.xxx/classes/loginpage.php(278): LoginPage->callBeforeLoginEvent() #1 /home4/xxxxxxxxxxx/public_html/xxxxxxx.xxxxxxxxx.xxx/classes/loginpage.php(185): LoginPage->doLoginRoutine() #2 /home4/xxxxxxxxxxx/public_html/xxxxxxx.xxxxxxxxx.xxx/login.php(43): LoginPage->process() #3 {main} thrown in /home4/xxxxxxxxxxx/public_html/xxxxxxx.xxxxxxxxx.xxx/classes/loginpage.php on line 713

Complete build performed and Uploaded all files in output directory, still same error. I have upgraded project from 10.2 to 10.3

Server config:
Server: Localhost via UNIX socket
Server type: Percona Server
Server connection: SSL is not being used Documentation
Server version: 5.6.41-84.1 - Percona Server (GPL), Release 84.1, Revision b308619
Protocol version: 10
User: XXXXXXXXXX@localhost
Server charset: UTF-8 Unicode (utf8)

cpsrvd 11.78.0.41
Database client version: libmysql - 5.1.73
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 7.2.7


My even in Before login was
global $conn;
$sql = "SELECT * FROM login where username = '".$username."'";
$rs = db_query($sql,$conn);
$data = db_fetch_array($rs);

$data["org_id"]=$_SESSION["org_id"];

// Place event code here.
// Use "Add Action" button to add code snippets.
return true;


After removing the above event from before login works fine, But this error only in the server, not in localhost



What will be the issue, Project 10.2 was working fine

Selecting single checkbox on list page

$
0
0
Hello all,

On my List page, I added the ability to delete rows which created a checkbox for each row (record). I don't really delete the record though. I handle some processing through the "Before record deleted" and "After record deleted" events. But, I only want to do one at a time. I don't want the user to be able to select multiple rows. I want them to be able to select one record and one record only before going on to the next record. They should unselect the selected record and then be able to select the next record to work on. All in random order. How can I make this work?

Lookup Wizard Autofiill not always work

$
0
0
It's me again. I can now control the lookup list for my 'item' field in the detail page (inline add/edit) based on the selected 'supplier' in the master page. I tried to use autofill function in the lookup wizard to automatically fill up the 'unit_price' from the lookup table 'supplier_item'. However, it only worked for one supplier but no other suppliers. Is this a bug and any workaround? I am using version 10.3. Thanks.

Error when exporting project

$
0
0
I get this error during project export. The export completes.

An error occurred while exporting table
Testtable


Error executing query
Table 'test.Testtable doesn't exist



SHOW full columns from'Testtable'

The custom view was deleted previously. It does not display on the datasource tables page, yet export apparently thinks it is still there. Can I manually remove the reference to this non-existent export table? Sync database doesn't resolve issue.

Thanks

Search results color change

$
0
0
Hello All..

I'm using PHP runner 10.2 (build 33576) and earlier this year I changed the Custom CSS for the search on the list page so the search results would be Blue. I just noticed the search results are now
returned in Red, no matter what color is indicated. Here is the custom CSS for the search button:

/* Put your custom CSS code here */

:host {
  color: blue;
}



Any thoughts?

Button in row mastertable for add record in detailtable

$
0
0
Hi together,

i have 2 simple tables stock (master) and stock_bookings (detail) connected over part_id.
In the list view of master is a custom button in each row.
With the click on the button I already get a popup with add page of detail table.
How can I get the part_id from master and transfer it into add page of detail table? :huh:

Posted Image

Best regards
cardman

[SOLVED] MassMailer SQL Query

$
0
0
I have a little question maybe someone can help out with. I am using the MassMailer Template as a notice system. I would like to send out a notice when a lube is due for a truck. I have it all set up pretty good and working as for the main page. My problem is I use Alias as my as my time the lube is done. The SQL Query does not seem to pick up Alias right to send out the notice. Here is my table:

SELECT 
id, 
truck_id, 
truck_number, 
email, 
service, 
`date`, 
done, 
intervals, 
mileage, 
((done + intervals) - mileage) AS due 
FROM truck_lube 
ORDER BY ((done + intervals) - mileage), truck_number 


Then here is my SQL Query I am using on the MassMailer:

 
SELECT * FROM truck_lube HAVING (due) <= 0 


I have tied different ways and all I get is Unknown column errors?

Any help would be great.
Thank You
James

Saving Signature Image into database as blob

$
0
0
Hi,

Referring to this thread: https://asprunner.com/forums/topic/26463-signaturepad-edit-to-store-in-database-blob/page__hl__signature%20pad__fromsearch__1

Background:

I need to do the same, reason being i have 2 same websites on 2 different servers (one is primary and the other secondary site, in case primary is not accessible) ,
they point to the same database, so storing signature images in a folder will not be ideal and i want to minimize the risk of losing the physical signature image files
when updating codes on both sites.

So i need to save the signature images into database so that both sites can access at the same time.

What i did:

I edited the sources and checked output file at:

source at Documents\PHPRunnerPlugins\edit\SignaturePad\EditSignaturePad.php
output \project_folder\signature-to-image.php


EditSignaturePad.php file modification:

		
...
// original codes 
$water_img = imagecreatefrompng($filename);
$water_size = getimagesize($water_img);
imagecopy($img, $water_img, 0, 0, 0, 0, $this->width, $this->height);
imagepng($img, $filename);
...

 // my codes inserted after line 160 to store image into database blob field: "signature"
ob_start();
imagepng($img);
$imagevariable = ob_get_contents();
ob_end_clean();
$output = $imagevariable;

// Create some other pieces of information about the user
//  to confirm the legitimacy of their signature
$created = time();
$ip = $_SERVER['REMOTE_ADDR'];
$data = array();
$data["signature"] = $imagevariable;
$data["date_created"] = $created;
DB::Insert("signatures_test", $data );



The above was inserted successfully with data saved to the "date_created" field,
but the image was not stored in to the field "signature" in the table above, it is empty.

What did i do wrong?

Thanks for helping.

ACP

British Date Format

$
0
0
Has anyone have any advice on how to allow British Date Formats for Date entry? For example to allow a user to enter 30/12/2019 as opposed to 12/30/2019? Any help very much appreciated.

Send E-Mail only if one column is updated

$
0
0
I have an HTML email that is being sent on a record edit - (after record updated event). The e-mail it sends is very nice and is working well, but I have 2 columns that can be edited there, Employee name and Confirmation number. I need one e-mail to go if the employee name changes and a different one to go if the confirmation number changes.

I have tried some if then statements comparing $value and $oldvalue, but I am not getting it to work correctly (bad syntax) can someone help?

What is the function of the following this features

$
0
0
What is the function of the following two features, which are contained in the "table link properties":

1. Hide the link if no child records exist
2. Hide details preview if empty

Posted Image

Thanks for answer.

PHPRunner Build source from command line

$
0
0
We need the ability to send the projects to source control. I have found the blog on how to use SVN Source Control Blog Link

But with our DevOps guys they don't want to use PHPRunner IDE to build the site. Is there a way to automate the building from a command line so this could be automated?

Thanks

PDF view - Print Page

$
0
0
In Printer page , under PDF view I have set in page designer to deny no wrap on the fields unless this means no wrap on the button label itself / kinda confusing . I have for testing purposes even changed the PDF scale to 20 percent .
I still get wrapped labels and field values in pdf view download . It seems the size of the label controls the size of the field which in turn wraps the values dependant on label size.

Example of a larger label :

Customer Information |
This is customer inform
mation field wrapped
instead of

Should be formatted like below:


Customer Information .............................. | Next field lablel should go here... |
This is customer information not wrapped| Next field values should go here..|

I also sometimes get this for an unknown reason as a label.

Customer Infor |
mation

as a label when viewing/download pdf.

I also want to point out in the new PDF API which is a great step in the new 10.3 version but . The PDF API to open a PDF does the same thing. It seems it wraps according to the label size of the page . How can we format correctly as well ?

Sample Screenshot when label is the problem . It happens vice / versa . This is Landscape view.

https://formsdatapro.com//pdf_sample.png



These labels and values should go across the page without wrap. If not how to change the fonts smaller in pdf view or scale down in pdf view. Obviously the screenshot above will be unacceptable to users.

If anyone has no problems with this please post what you did to accomplish something similar to fix this . Thanks





Thanks for any information in advance?


Phprunner 10.3 build 33876

View in browser Warning: Fatal error

$
0
0
Viewing in browser local today came up with the following error:-

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'D:/Spider Webster/OneDrive/Documents/My Web Sites/PHPRunner/PHPRunnerProjects/Utilisation/output/utidata_list.php' (include_path='.;C:\php\pear') in Unknown on line 0

I initially thought I had messed something up so started to revert to project backups but all the same?
Loaded another project and this was the same.
Everything works ok if I ftp to live site but this isnt a good way to develop and test.

anyone else come across this?

Ajax refresh List page using button

$
0
0
Hi
Is it possible to implement ajax Grid refresh event while using custom button (like in popup add/edit event ajax refresh list page)
I have added
var message = result["txt"] + " !!!";
if(alert (message)){}
else    window.location.reload(); 


but this reload the page altogether, not the grid alone.

if I use the following code in button on client after area it shows the result in server error feedback.
var message = result["txt"] + " !!!";
ctrl.setMessage(message);

Runner.runnerAJAX(Runner.pages.getUrl(pageObj.tName, pageObj.pageType)+"?a=return",
     pageObj.ajaxBaseParams,
   function(respObj){
      pageObj.pageReloadHn.call(pageObj, respObj)
     });



how can i modify the above to achieve the grid refresh using button

Same username different database.

$
0
0
Hi there. Thanks you for such a good on PHPRunner.

I wonder if we could do login (such as SaaS) but with different options.

Instead of username, can we so it on base of different critéria such ás years (database based on year, not username). The same user can access different data, depende on which year selected before Login.

Thank you
Viewing all 2586 articles
Browse latest View live