Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - andrewmak

1
General Discussion / Re: add new page - view page that can access publicly
Hi, thanks for taking time for helping, i already figure out the method to make page view publicly

i need to manually remove the following code, in the page controller file

Quote
      $allowed_roles = array ('hq', 'agent', 'agency');
      if(!in_array(strtolower(USER_ROLE), $allowed_roles)){
      $db->where("leads.agent", get_active_user('agent') );
      }
3
Questions / Re: set variable in custom js
@willvin
i only have very basic knowledge of php, now i know the code wont work in javascript. thanks

the page i try to set variable and run if/else command is a role base dashboard, it do not have a page for custom editing, how to do it in this case?

here is what i am trying to do, i have dashboard for user role = agency... when the agency user login he will see an embaded iframe dashboard by google datastudio.

so i want to get the user agency name get_active_user('agency');
if agency = A, then i set the iframe url belong to A
if agency = B, then i sent iframe url for B....

this way the user will only see his own data.

the page event function only have even for before and after ADD, but dont have a page ON LOAD option.

please advice, thanks a lot!
4
Questions / set variable in custom js
Code: [Select]
$(document).ready(function() {
   
var agency1 = "get_active_user('agency')";
alert('agency1');
if(agency1=="redkey"){
    alert('agency1');
}
else{
   
}
});

i try to set a variable with a helper code in custom JS, but get_active_user() do not work.

i want to set the variable and if agency = A, then show an iframe for agency A

how to set the variable on page load and pass the variable to the custom view?

thanks in advance!
7
Questions / Re: run a php function before page load
hi, i am not sure if i can use a php variable in the mysql command

i am looking for way to set the variable $opt when page load.

for example, if user role = agency, then i set $opt='or', else $opt='and'

thanks in advance
8
Questions / run a php function before page load
i want to let an agency able to view all his own records and his agents records,

in table Where condition:
failed:
Quote
"agent='". USER_NAME . "' $opt  agency = '". get_active_user('agency') . "'"
working:
Quote
"agent='". USER_NAME . "' or  agency = '". get_active_user('agency') . "'"

i am not able to set a variable $opt before page load... please advice, thanks
9
Suggestions / AdminLTE theme
I would like to suggest option to use AdminLTE theme for dashboard, it is free and look advance compare to bootstrap.
12
General Discussion / custom view with param never work


I try to create a "custom view" with a custom sql query (very basic query)

it will work if i hard coded the fixed value to the query

Code: [Select]
SELECT  * FROM room WHERE vendor_name = 'admin'


but it never work when change to '?' and param USER_EMAIL (i already echo USER_EMAIL in php and it is exactly the text 'admin')

i tried this on a few pc and it never work, is it a bug?
13
General Discussion / Re: onclick action in add.php
do you mean write the code directly to the php file or using the visual options in phprad?

can you provide a sample of the http_get(URL) of the add.php file?

thanks a lot
14
General Discussion / form wizard tutorial
Is there any video tutorial about form wizard? i just cant figure out how it work and no much info provided in the documentation. Thanks