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

Make all fields read-only

$
0
0
I have a 'clients' table where I would like to make all controls read-only if the "Active" value in the record is "No".
The Yes/No field is actually a "dead-man's trigger' of-sorts where the average app 'user' should not be able to change the record once the value is "No".


While I can successfully make an individual control read-only
using the Javascript onload event for my Edit page:

var ctrlACT = Runner.getControl(pageid, 'Active');
			
 if(ctrlACT.getValue() == "No")
	ctrlACT.makeReadonly();

and subsequently selectively makeReadOnly other controls:



I am struggling to set all controls to read-only (even without a conditional if = statement).

I stumbled around the help pages and found reference to making fields required and tried to 'adapt' the code to my needs:

var recCtrlsArr = Runner.controls.ControlManager.getAt('clients');

for(var i=0;i<recCtrlsArr.length;i++)
{
  var ctrl = recCtrlsArr[i];
   ctrl.makeReadOnly();
}



However, this code has no effect, no error:

Am I on the wrong track?

..{wonk}

[SOLVED] email field

$
0
0
I have a column email and would like to be able to click on it and it then to go to outlook with that email address such as mailto: Can this be done?

Imbed the products_list into the order_details_add page

$
0
0
Hi,


I have this basic Orderdetails table:

Product | Unit Price | Quantity | Discount

Where the product supposed to be filled with items selected from Items table.


Normally when you want to enter Order Details data from the add page, you search for one item then select it then enter the item then go to next item till you complete the order. Like this demo:
https://xlinesoft.com/livedemo/phprunner/livedemo5/orders_add.php

However, I want to enhance data entry process. I want to achieve similar task but NOT to enter items one by one. Instead I want to add all items to my list first (with blank details like quantities and prices) in one shot. Later I will fill details like quantities and prices. This can be achieve with the following as general:

On Orderdetails/Add page: I want initially all items (Items table) to be displayed with a select option that user can select the items he wants to add to the orderdetails. Exactly as if we put the Items_list page (with search and filter controls) into the OrderDetails_Add page. Once user filters and selects all the required items then press one button [Add to the Page] then all items will be add to the screen with blank fields (Unit Price | Quantity | Discount). Nothing saved to the database so far.
Now user start filling these (Unit Price | Quantity | Discount) details and press [Submit] only now the data save to the database.Orderdetails.

Imbed the products_list page into the order_details_add page

Any idea how to achieve it? Any link?

thanks

Filter to show Null

$
0
0
Hello, I am wanting to create a filter that will give the user an option to show all records where a date field is null.

Working in asprunnerPro 9.8 and looking at the "Filter As" options for the field as applied to the filter panel.

or
Can I create a button that when the user clicks it will filter the list view with the requested null values in the date field? like a canned filter if you will.

Thanks.
Fen How

[SOLVED] Search Master and Details tables together

$
0
0
Has anyone done this PHP tip/trick in ASP.Net?

http://asprunner.com/forums/topic/24763-search-master-and-details-tables-together/page__hl__search%20details__fromsearch__1


This is exactly what I need to do but I can't figure out how to transpose the PHP to ASP.Net.

For reference, here is the PHP:


$srchObj = SearchClause::getSearchObject("orders");

$value = $srchObj->getFieldValue("product");

if( $value != null ) {
$srchObj->setSearchSQL("product", "OrderID in (select OrderID from OrderDetails where ProductName like '%$value%')");
}



Thanks,
Tim

Simple Javascript IF ELSE statement

$
0
0
Hi Guys,

On my add page I have two fields, "Duration" and "alert".

I'm trying to create a simple Javascript onload IF statement that will insert the words "Expires soon" in the "alert" field if the number in the "Duration" fields is <=90.

If the number in the "Duration" field is above >=90 the field should display "No Warning".

Getting the above working would be great!

However to make the statement perfect I would love to introduce a third field called "Course".

The ideal statement would now look the "Course" field and if the course title is called for example "Medical" ( which has a 180 day warning) the statement would look at the duration and if above 180 days for this specific course, display the words "Expires soon" in the "alert" field.

Else display "No warning" is the duration is above the warning limit for this specific course.

Any inspiration or tips would be much appreciated, my code is below.

Best wishes,
J


var ctrlDuration = Runner.getControl(pageid, 'Duration');
var ctrlalert =  Runner.getControl(pageid, 'alert');
 

ctrlDuration.on('change', function(e) {

   if (this.getValue() <=90) {

       ctrlalert.setValue("Expires Soon");

   } else {

     
     ctrlalert.setValue("No Warning");
   }

});



How to center login window in bootstrap

$
0
0
Hello,

I am trying to center the login pop window in the middle of the screen. All my attempts to work it around faild. Is there any way to do this? Am I missing something ?

Thanks

aspr98 password one menu item

$
0
0
I have a project menu that the first couple of menu items do not need password protect. My last menu item is an Administration menu. I would like to hard code with password for only this item... Is this possible. Note I am not a coder and will need instruction of how to code this in my project. Thank you in advance for any help you can extend me.
regards -bnpsr

Powershell Script

$
0
0
Hello,

Is it possible to launch a PowerShell script from a "After record added" event? If so, what would that event look like?

Change behavior of view page when record not found

$
0
0
I have a situation where it is possible (due to complicated factors) that a user of my app may attempt to open a record in a view page when the record called actually does not exist. The baked-in behavior when this occurs is the application redirects to the list page. This makes sense under normal circumstances, but in my case it just causes confusion.

What I want to happen instead is redirect the user to a different page. The problem is I'm struggling with how to code that and if there is even an event available where it would work. Ideally, I would need to be able to insert my code after the SQL is run but before the page is displayed. I have tried placing the following code in both the BeforeShowView() and ProcessValuesView() events with no luck. I think that either my test for missing page id isn't working, or the redirect occurs within the base code before these events fire.

Here's my code:


// Try to redirect to notopic page rather than list page if current page not found
string pageID = values["Page"].ToString();
if (string.IsNullOrEmpty(pageID))
	{
		MVCFunctions.HeaderRedirect("page","view","editid1=notopic");
	}



Any ideas?


Show/Hide Password at Login

$
0
0
Please, Any one know how to Show/Hide Password at Login Screen with Checkbox or another Object?

Add a background image to the Login Page

$
0
0
Hi all,



I am struggling trying to add a background image to my login page. Normally I would do this via the HTML body tag but I understand that this is now deprecated in HTML5. Using the Styling page I have added the background function to the custom CSS button with no luck. Any recommendations?

Body {background-image: url("/images/vineyard.jpg")}

Thanks,
Jason

Security Forms

$
0
0
Hi

I have setup security using phprunner, but when i log onto my website it gives me no option to put more users in. In fact nothing appears neither a security form or the existing tables i could see before implementing security.

Thanks
Mike

Changing first admin user by new users - how to?

$
0
0
Hi at all,
I offer SAAS-solutions based on phpRunner with dynamic user settings. Most customers get their individual database with only one user. So I deliver a database with user "admin" and password "admin" as default. This way, currently people can only change the password to their liking, since changing "admin" username to my experience breaks the admin-menu - it isn´t available anymore. But since this is so uncommon, they lock themselves out by thinking, their email address or real world name would be the "new" user name, which is fixed to "admin" in reality. Endless support is the consequence.

Only way I see to have a freely named admin is to add a second user first as standard and changing this from the first admin to admin status. After logging out and logging in with the second admin I could delete the first admin and I am free. But my customers often don´t buy a second or third seat, so I don´t want them to add additional users and therefor hide the add-button in users. Further only having to add a second admin just to rename the first is a bit akward.

How can I give new customers free admin access with username to their linking?

[SOLVED] Emailing with button

$
0
0
I have the code below in a button on server event on list page , When I hardcode email the code sends the email . If I use $_SESSION value or $data value , I get error message using PHPrunner 9.7 . I had this working with session value
in 8.0. I am using inline add , but in 8.0 I did not need to add any other code .



$body = "";


while( $data = $button->getNextSelectedRecord() )

{

$body .= "Employee: ".$data["Employee"]. " Employee #: ".$data["EmployeeID"]."\n";
$body .= "Customer: ".$data["Customer"]. " Customer #: ".$data["CustomerID"]."\n";
$body .= "Allocated Item: ".$data["brand"]."\n";
$body .= "Cases: ".$data["cases"]." Bottles: ".$data["bottles"]."\n";
$body .= "Comments: ".$data["Comments"]."\n";
$body .= "\n-----------\n\n";
}


// send the email

$email ="test@test.com"; // This works fine
$email =$_SESSION["fsm_email"]; // This does not work I get the error message from code below error happended. readonly field
$email =$data["manager_email"]; // This also does not work this is actual value in database.
read only field from session value

$subject = "Allocation";

$arr = runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $body));



$result["txt"] = "Allocations were sent to your FSM.";



// 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;

}

Change password server error

$
0
0
Using PHPRunner 9.8 with access database. Password encryption is turned off to eliminate that from the equation.
When a user is logged into the application and clicks on "change password" they are taken to the appropriate change password page but when they fill in their old password and their new password and click on submit they get the following error message:

php error happened
Technical information
Error type 256
Error description S1000
URL dancesofuniversalpeace.org/leaders/changepwd.php?
Error file G:\PleskVhosts\pwdonline.info\httpdocs\intnew\leaders\connections\Connection.php
Error line 661
SQL query select [Password] as [Password] from [NAMES] where [Name ID]='HEETBR01'

More info



Call stack
File: line Function Arguments
#0. connections\Connection.php:661 trigger_error 1. S1000; 2. 256;
#1. connections\Connection.php:661 Connection->triggerError 1. S1000;
#2. connections\ODBCConnection.php:75 ODBCConnection->query 1. select [Password] as [Password] from [NAMES] where [Name ID]='HEETBR01';
#3. classes\changepwdpage.php:202 ChangePasswordPage->changePassword N/A
#4. classes\changepwdpage.php:292 ChangePasswordPage->process N/A
#5. changepwd.php:184 Global scope N/A


Any ideas how to fix this?

Bootstrap Message Block

$
0
0
I am trying to use message block in bootstrap . I add the message code but nothing comes up . Any way to do this in bootstrap CSS. My message shows up if I delete all data in grid . As soon as I add a record it disappears. 9.7

button to Print page or Click actions on list to Print page

$
0
0
Hi,
i'd like to insert a button in list page or edit page that redirect to print page of my record.

i put in the on Client after
location.href="distinte_print.php";

but the page opened is always the print page of my 1st record in the table "distinte"

the same if i use click actions - open page - Print Page on a field of my list page of table "distinte".

how may i pass the key value of the record to the print page?

phprunner enterprise 9.8 build 29929 x64

thanks
Fabio

Upload Images to CDN

$
0
0
I would like to upload my images to a CDN, not to local server.

How can I achieve this?

Can we use asprunner.net fileupload to a CDN (Content delivery network) ? Especially for images.

We can select "Absolute Path" on FileUpload, can we enter a url path here?

Does anyone use CDN with asprunner.net?

Thanks.

Reresh List Page After Delete

$
0
0
Hello,

I actually have a few questions:

1) Is it possible to refresh the List Page after deleting an entry? I know it can be done by creating a new button and adding code to the "Client After" event but I would like to use the default "Delete" button if possible.

2) I am now able to refresh the "List Page" after an "Inline Add" but would also like to do it after a pop-up add/edit.

3) Incase it gets lost in timnorvel's thread, is there a way to record all "Inline Add" when clicking "Save All" and THEN refresh the page?

Not sure if this changes anything but I'm working with 3 different tables: Family, Applicant, Charges. Applicant is the details table of Family, and Charges is the details table of Applicant.
Viewing all 2520 articles
Browse latest View live