-
Posts
18 -
Joined
-
Last visited
Everything posted by Enver
-
Here is a final changes //template "addassets" is where are assets information (Serial, Model, Name, Make ) //template "user" is for users and this template have field "Page" with name "user_select_asset" where i am using also this code in INPUT > PHP Costume Code. $assets = $pages->find("template=addassets"); $UserAssets = $pages->find("template=user, user_select_asset.count!=0, include=all")->remove($page); foreach($UserAssets as $AssetSelected) { foreach($AssetSelected->user_select_asset as $userA) { $assets->remove($userA); } } return $assets; in output when i edit a User in field Select Asset "user_select_asset" i can see all assets and i can select one, ok I selected asset with name "Asset1" good and I save a page, than I go to the second user Page to select other asset related to this user there is still Asset1 but some others now is not showing like Asset5 and 6. thanks.
-
I removed that part but still error and not working selected to skip.
-
I am doing something like this $user_select_assets = $pages->find("template=addase"); $borago = $pages->find("template=user, user_select_asset.count!=0")->remove($page); foreach($borago as $bora) { foreach($bora->user_select_asset as $snow) { $user_select_assets->remove($snow); } } return $user_select_assets; but i have some warning Invalid argument supplied for foreach() in /public_html/wire/modules/Inputfield/InputfieldPage/InputfieldPage.module(116) : eval()'d code on line 5
-
How to add that code there is any sample I tried to find on forum something related but not sure so if you can put me on road with some short code Thanks.
-
Hello I have field Page Select its possible in output select pages which are selected on any user don't show in select example Field Page which have inside template addAsset to get all pages related to this template Select ----Asset 1 ----Asset 2 ----Asset 3 ----Asset 4 if i have selected Asset 2 (in template User where is this field) don't show it anymore on select page field to skip it Select ----Asset 1 ----Asset 3 ----Asset 4 Thanks.
-
Thanks i just did it before 10 minutes after i tested the code Thanks again for everything here
-
Sorry for all of this i made here but now its everything working how i wanted i read some posts and other stuff mix some stuff @Macrura did on post and in the end i found it work trying different ways, this is a code fixed my trouble $findmylisting = $pages->find("id!=40, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; echo '<p>'; echo $f->fullname . " | "; echo $stateAdd . " | "; echo $f->resourceType . " | "; echo "("; $gewt = $pages->find("template=addProject, projectManager=$f"); foreach($gewt as $demos) { echo $demos->profName->title . ", "; } echo ")"; echo '</p>'; } Thanks Martijns and Macrura .
-
and where to use it its calling state from user profile (New Your, Florida etc...)
-
Thanks Martijn and Macrura here is a code what i did and is query exactly what i looked for $findmylisting = $pages->find("id!=40, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; echo '<p>'; echo $f->fullname . " | "; echo $stateAdd . " | "; echo $f->resourceType . " | "; echo "("; $gewt = $pages->find("template=addProject, projectManager=$f"); foreach($gewt as $demos) { echo $demos->profName->title . ", "; } echo ")"; echo '</p>'; } output Gent Gatoro | New Jersey | Direct | (Sanofi, Catalent, ) Demo Strato | New Jersey | Direct | (Sanofi, Catalent, Spice,) Grov Avat| New Jersey | Direct | (Sanofi, ) Bench Datop | New Jersey | Direct | (Alexd, Howsr, )
-
Now is outputting but is repeating same value from first user here is code $findmylisting = $pages->find("id!=40, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; $gewt = $pages->get("template=addProject"); echo '<p>'; echo $f->fullname . " | "; echo $stateAdd . " | "; echo $f->resourceType . " | "; echo $gewt->profName->title; echo '</p>'; } do i need to use foreach inside foreach or just a search using api this is output Andy Bamos | New York | Direct | Demo1ProfName Gana Fisher | New York | Direct | Demo1ProfName Art Demo | New Jersey | Indirect | Demo1ProfName Ash Khurta | New Jersey | Direct | Demo1ProfName
-
This what i am trying to get is similar to http://processwire.com/blogtest/categories/ you have categories name and under them you have pages they have selected different categories lets say we have category: Best Practices and in this category we have different pages this is same what i am trying to get beside categories i have users $findmylisting = $pages->find("id!=40, roles=superuser, template=user, sort=name"); foreach($findmylisting as $f) { $stateAdd = $pages->get("$f->state")->title; //State Field Page select(/states/...) State in user template echo '<p>'; echo $f->fullname; //user Full Name Field echo $stateAdd; echo $f->resourceType; //Resource Field Page select(/resource/...) in user template echo $f->ProfName; //Field ProfName page Select(/admin/access/users/...) in addProject template not in user template echo '</p>'; }
-
Everything is calling fine user info in front end you need to be login to get this info everything at this point is fine i am getting all datas from user information which use template user, here is another template called "addProject" inside this template is field called "ProfName" field type Page on this field i can select one user which is under "/admin/access/users/" what i am trying to call is: find users, list them and find Project Name where is selected this user on addProject, sample: template addProject ------------Project1 (Field(ProfName)has selected "user1") ------------Project2 (Field(ProfName)has selected "user1") ------------Project3 (Field(ProfName)has selected "user2") ------------Project4 (Field(ProfName)has selected "user3") ------------Project5 (Field(ProfName)has selected "user4") find users (template user) user1 "Project1 + Project2" user2 "Project3" user3 "Project4" user3 "Project5" Thanks for your time trying to help me on this.
-
The problem is this field is not at template "user" where i am using find $findmylisting = $pages->find("template=user, sort=name"); this filed is at "AddProject " template every post on this template can select a user which is added at user template
-
Field "ProfName" type "page" is field on page template addProject from this field you can select user so is Select the parent of the pages that are selectable. user1, user2, user3 ...
-
$findmylisting = $pages->find("id!=40, roles=superuser, template=user, sort=name"); foreach($findmylisting as $findit) { $stateAdd = $pages->get("$findit->state")->title; $resourceTypeAdd = $findit->resourceType; $getTest = $findit->pageSelect->ProfName; echo "<p>{$findit->fullname} - {$getTest} - {$stateAdd} - {$resourceTypeAdd}</p>"; } output Notice: Trying to get property of non-object in /home/drit/domains/demo/public_html/site/templates/test.php on line 10 John Smith - New Jersey - Direct Notice: Trying to get property of non-object in /home/drit/domains/demo/public_html/site/templates/test.php on line 10 Parker Demo - New York - Direct
-
I am trying to make it work but still Notice: Trying to get property of non-object in i checked last night in web site to find something what i am trying to do but still no luck,
-
First thanks for replay i will try to make it easy all what i need is to get field from different page they are related to user page selected $findmylisting = $pages->find("id!=40, template=user, sort=name"); foreach($findmylisting as $findit) { echo "{$findit->fullname} - {$findit->email} - {$findit->name}@mail.com - {here i want to sum fields 'SelectSource' from page addProject where is the user selected}"; } so lets say i have 4 other pages(page template addProject) they have field SelectSource with numbers so you pick a number and also have a field select userProfile "SelectUser" in query i want to get or find how many pages are selected userprofile (example "user1") and count all SelectSource numbers like 20+30+50 user can be selected on 2-3 different addProject pages so i just want to publish in user profile SelectSource Field + sum them if user is selected in 3 pages and SelectSource is in one page 20 other page 30 and other page 50,
-
I am developing a little app for my university to pass it, the problem is to count some number, i used field page for select stuff in my Template AddProject i have 4 fields beside name and title template AddProject with field ------- Field "SelectUSer" (user1, user2, user3) this field / page / Single page (Page) or boolean false when none selected ------- Field "SelectStatus" (Active, Inactive) this field / page / Single page (Page) or boolean false when none selected ------- Field "SelectProf" (Name, Name2, Name3) this field / page / Single page (Page) or boolean false when none selected ------- Field "SelectSource" (10,20,30,40,50,60,70,80,90,100) this Field is Select not page and i have a page when i list projects ListProject ----------Project 1 ------------Field "SelectUSer" (user1) ------------Field "SelectStatus" (Active) ------------Field "SelectProf" (Name) ------------Field "SelectSource" (20) ----------Project 2 ------------Field "SelectUSer" (user2) ------------Field "SelectStatus" (Active) ------------Field "SelectProf" (Name2) ------------Field "SelectSource" (50) ----------Project 3 ------------Field "SelectUSer" (user3) ------------Field "SelectStatus" (Active) ------------Field "SelectProf" (Name3) ------------Field "SelectSource" (80) i want to query Project 1 | User1 | Active | Name | 20 Project 2 | User2 | Active | Name2 | 50 Project 3 | User3 | Active | Name3 | 80 also query for user to grab field related to user and page user1 | Active | and Field SelectSource to get number from pages which have selected user1 or other user