Search found 607 matches

by pböttcher
2019-10-15 06:37
Forum: Advanced Customizations > Hooks
Topic: check and avoid duplicate fields and show custom error message
Replies: 7
Views: 88

Re: check and avoid duplicate fields and show custom error message

Hi,

your syntax at the alert is wrong (you have combined two statements).
by pböttcher
2019-10-14 15:08
Forum: Getting Started
Topic: Show/Hide a dropdown based on value from another dropdown
Replies: 8
Views: 60

Re: Show/Hide a dropdown based on value from another dropdown

Hi ,

you need to check at the beginning the actual value and only hide if the value does not match .

if ($j('#project_stage_id').val() != "7") $j('#loss_reason').parents('.form-group').hide();
by pböttcher
2019-10-14 14:27
Forum: Getting Started
Topic: Show/Hide a dropdown based on value from another dropdown
Replies: 8
Views: 60

Re: Show/Hide a dropdown based on value from another dropdown

sorry,

can you change

if($j('e.added.id).val() == "7"){

to

if( e.added.id == "7"){
by pböttcher
2019-10-14 12:47
Forum: Getting Started
Topic: Show/Hide a dropdown based on value from another dropdown
Replies: 8
Views: 60

Re: Show/Hide a dropdown based on value from another dropdown

Hi, that is actually what you tell in the script. Only difference should be, that if you select from the dropdown a field, which has the PK of the lookup = 7, then the loss_reason should show. If you want the loss_reason to be hidden at startup, you need to add this code as well. Add $j('#loss_reaso...
by pböttcher
2019-10-13 20:24
Forum: Getting Started
Topic: Show/Hide a dropdown based on value from another dropdown
Replies: 8
Views: 60

Re: Show/Hide a dropdown based on value from another dropdown

Hi,

try

Code: Select all

$j(function(){
	
	
	$j('#project_stage_id-container').on('change', function(e){
		if($j('e.added.id).val() == "7"){
			$j('#loss_reason').parents('.form-group').show();
			$j('#loss_reason').focus().select();
		}else{
			$j('#loss_reason').parents('.form-group').hide();
			
		}
	})

})
by pböttcher
2019-10-13 10:18
Forum: Advanced Customizations > Hooks
Topic: check and avoid duplicate fields and show custom error message
Replies: 7
Views: 88

Re: check and avoid duplicate fields and show custom error message

Hi, well, just clear the fields and let the user re-enter the data. $j.ajax({ url:'full_name_check.php', type:'post', dataType:'json', data:{'full_name':cognome+' '+nome,'SelectedID':SelectedID}, success:function(resp) { if(resp['availability']==1) { alert('Il nome completo esiste già'); $j('#cognom...
by pböttcher
2019-10-12 19:40
Forum: Advanced Customizations > Hooks
Topic: check and avoid duplicate fields and show custom error message
Replies: 7
Views: 88

Re: check and avoid duplicate fields and show custom error message

Hi,

can you explain what is not working? The code itself seem clean.
by pböttcher
2019-10-12 09:59
Forum: Bugs/annoyances
Topic: Hide/Show fields base on condition
Replies: 2
Views: 62

Re: Hide/Show fields base on condition

Hi,

please check the value of

$j('#selectionner').val()

As this is a lookup, it will not contain the actual value, but the key to the lookup-table.
by pböttcher
2019-10-10 16:54
Forum: Advanced Customizations > Hooks
Topic: Modify the original DV SQL
Replies: 15
Views: 161

Re: Modify the original DV SQL

hmmm, that is strange.

is it possible that you post all the Query fields?
by pböttcher
2019-10-10 15:23
Forum: Advanced Customizations > Hooks
Topic: Modify the original DV SQL
Replies: 15
Views: 161

Re: Modify the original DV SQL

Hi ,

you need to add the "WHERE " string as well.

So after changing the QueryWhere should show:

[QueryWhere] => WHERE Casa = 30
by pböttcher
2019-10-09 18:44
Forum: Getting Started
Topic: hook for index.php / homepage?
Replies: 8
Views: 166

Re: hook for index.php / homepage?

Hi, almost, I used some time ago this. You may try it. Or possibly use the new function of 5.8 (which I did not test) <?php $filename=basename($_SERVER['SCRIPT_FILENAME']); $tablename=substr($filename,0,-4); // exclude the login page if ($tablename == "index" && isset($_SESSION['memberID']) && $_SES...
by pböttcher
2019-10-08 20:42
Forum: Advanced Customizations > Hooks
Topic: Modify the original DV SQL
Replies: 15
Views: 161

Re: Modify the original DV SQL

try to add this in the init part. you shall see the $option parameters

ob_start();
$xc=get_object_vars($options);
ksort($xc);
print_r($xc);
$c=ob_get_clean();
echo "<pre>".htmlspecialchars($c)."</pre>";
by pböttcher
2019-10-08 09:11
Forum: Tips And Tricks
Topic: google map auto geolocation data
Replies: 4
Views: 155

Re: google map auto geolocation data

Hi, sorry to ask again. Do you want to display the current location of the user on the map, as shown in the picture, or do you want to capture the current latitude and longitude in some fields ? Actually you can use the TABLENAME_dv function to add the javascript code provided on the google document...
by pböttcher
2019-10-08 08:53
Forum: Getting Started
Topic: show image from url
Replies: 6
Views: 99

Re: show image from url

Hi,

you can add to the TABLENAME.php -> TABLENAME_dv function something like:

Code: Select all

	$url=YOUR_SQL_STATEMENT_TO_RETRIEVE_THE_URL;
	$html.=<<<EOC
	<script>
		\$j(SPACE_TO_PUT_THE_IMAGE_AFTER).after('<img src="$url">');
	</script>
EOC;
by pböttcher
2019-10-08 06:41
Forum: Getting Started
Topic: show image from url
Replies: 6
Views: 99

Re: show image from url

Hi,

just to clarify, the url is in the database and that points to an "external" image (an image that does not belong to you app)?
by pböttcher
2019-10-08 06:38
Forum: Advanced Customizations > Hooks
Topic: Modify the original DV SQL
Replies: 15
Views: 161

Re: Modify the original DV SQL

Hi,

maybe you need to check if there is already a where statement for that table. In that case you would need

$options->QueryWhere=" AND Casa = 30";
by pböttcher
2019-10-08 06:36
Forum: Getting Started
Topic: hook for index.php / homepage?
Replies: 8
Views: 166

Re: hook for index.php / homepage?

Hi,

just check which page is currently loaded and execute your code only when the index page is loaded.
by pböttcher
2019-10-07 20:08
Forum: Advanced Customizations > Hooks
Topic: Modify the original DV SQL
Replies: 15
Views: 161

Re: Modify the original DV SQL

in the hooks/TABLENAME.php file

where TABLENAME is the table where you want to apply the where clause to the sql query.
by pböttcher
2019-10-07 19:16
Forum: Advanced Customizations > Hooks
Topic: Error message if a pair of values exist in database
Replies: 5
Views: 114

Re: Error message if a pair of values exist in database

TABLENAME_before_insert

but you need to replace TABLE with your tablename and TABLENAME is of course your tablename as well.
by pböttcher
2019-10-07 18:41
Forum: Advanced Customizations > Hooks
Topic: Modify the original DV SQL
Replies: 15
Views: 161

Re: Modify the original DV SQL

Hi,

you can use the TABLENAME_init function.

add:

Code: Select all

$options->QueryWhere="where YOUR CLAUSE";
by pböttcher
2019-10-07 15:22
Forum: Advanced Customizations > Hooks
Topic: Error message if a pair of values exist in database
Replies: 5
Views: 114

Re: Error message if a pair of values exist in database

Hi, you can try $val = sqlvalue("SELECT count(*) from TABLE where first_last_name='{$data['first_last_name']}'"); if ($val != 0) return false; This will create the default message, that you could not insert the record. If you want to add some custom error message you will need to go through the post...
by pböttcher
2019-10-07 10:14
Forum: Advanced Customizations > Hooks
Topic: Count values in table field - after insert
Replies: 5
Views: 84

Re: Count values in table field - after insert

Hi, this depends on how you create your order number. E.g. you could user Order-YYYY-xxxxxx where YYYY is the year and xxxxxx is the counter for the order number. In such a case you could do the following in the after function: $year = date("Y"); $next = sqlvalue("SELECT 1+MAX(0+SUBSTRING(OrderNo,12...
by pböttcher
2019-10-07 07:25
Forum: Advanced Customizations > Hooks
Topic: Count values in table field - after insert
Replies: 5
Views: 84

Re: Count values in table field - after insert

Hi, what is your question? What is OrderNo2, What is your table structure? Why are you using LAST_INSERT_ID() and not $data['selectedID']? The sqlValue("SELECT OrderNo2 FROM Orders where id_order = LAST_INSERT_ID()", $eo); has a syntax error, sqlvalue does not have 2 parameters. It should be sqlValu...
by pböttcher
2019-10-07 07:17
Forum: Advanced Customizations > Hooks
Topic: Error message if a pair of values exist in database
Replies: 5
Views: 114

Re: Error message if a pair of values exist in database

Hi, you can either check in the hooks/TABLNAME.php -> TABLENAME_before_insert if a record alredy exisits in the database through an SQL query and return false, with a custom error message. (see also https://forums.appgini.com/phpbb/viewtopic.php?t=3190) or you can hook onto the two fields (firstname...
by pböttcher
2019-10-07 07:11
Forum: Tips And Tricks
Topic: google map auto geolocation data
Replies: 4
Views: 155

Re: google map auto geolocation data

Hi,

not sure I get what you try to do, but I would rather think that you need to do that on the client side, as I would expect that you want to catch the clients geolocation.

Otherwise please explain in more detail what you try to get.