Jump to content

rsalumpit

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by rsalumpit

  1. im so sorry if im cofussing you i dont own this code too im just helping a friend but it seems i need help also it took me a day to analys this one. the new $_GET values was sent to ajax_function.html by this JS fuction function updateMyStoreContent(params) { params.action = "myStoreContentStoreItems"; params.id = userId; params.time = new Date().toString(); new Ajax.Updater($("myStoreContentStoreItems"), "ajax_functions/ajax_function.html", { parameters: params, evalScripts: true, method: "get", onCreate: function(event) { $("myStoreContentStoreItems").update(""); $("myStoreItemsLoader").show(); $("myStoreItemsLoader").scrollTo(); }, onComplete: function(event) { $("myStoreItemsLoader").hide(); } }); } var userId = <?= $store_user_id ?>; $$(".storePageLink").map(function(linkElement) { linkElement.observe("click", function(event) { event.stop(); var page = this.id.substring("storePageLink_".length); updateMyStoreContent({page: page}); }); }); if ($("storePageSelectButton") != null) { $("storePageSelectButton").observe("click", function(event) { event.stop(); var page = $("pgs_id").value; updateMyStoreContent({page: page}); }); } ajax_function.html will process it call again the mycontroller.php to update the new query with this code: require_once(dirname(__FILE__) . '/../include_modules/mystore/MyController.php'); $myStoreItems = new myStoreItems(); $callback_func = array(&$myStoreItems,"showMyStoreAction"); call_user_func($callback_func,$_GET); and i want it get the new update query by dispalying it to index.html i hope you get my point..thank you!
  2. i think we're not on the same page..forget about ajax trust me its working all i need to know is how can i access a function variable again after call it using a different php page and return the to index.html look at my diagram: index.html call->mycontroller->showMyAction($_GET); to view default query..variables call successful index.html send->uses ajax script to send $_GET info to update new query->ajax functiom ajax_ajax_function call->mycontroller->showMyAction($_GET);when i try to dispaly the variables back to index.html is seems not working:-( thank you!
  3. no i just use $_GET['page'] because thats what i only need..i and i think its sending to MyController.php because i debug it var_dump($_GET) and i updates the new query the only problem is that i cant access the variables i also try to use globals but one effect..
  4. here is my ajax function function updateMyStoreContent(params) { params.action = "myStoreContentStoreItems"; params.id = userId; params.time = new Date().toString(); new Ajax.Updater($("myStoreContentStoreItems"), "ajax_functions/ajax_function.html", { parameters: params, evalScripts: true, method: "get", onCreate: function(event) { $("myStoreContentStoreItems").update(""); $("myStoreItemsLoader").show(); $("myStoreItemsLoader").scrollTo(); }, onComplete: function(event) { $("myStoreItemsLoader").hide(); } }); } var userId = <?= $store_user_id ?>; $$(".storePageLink").map(function(linkElement) { linkElement.observe("click", function(event) { event.stop(); var page = this.id.substring("storePageLink_".length); updateMyStoreContent({page: page}); }); }); if ($("storePageSelectButton") != null) { $("storePageSelectButton").observe("click", function(event) { event.stop(); var page = $("pgs_id").value; updateMyStoreContent({page: page}); }); }
  5. hi i cant access the function variables when it try to call it again..its a pagination script that uses ajax function to update the query.here is my code index.html <?php require_once (dirname(__FILE__) . '/include_modules/mystore/MyStoreController.php'); $myStoreItems = new myStoreItems(); $myStoreItems->showMyAction($_GET); <? if (count($myStoreItems->store_items)) : ?> <? for ($i = 0; $i < (count($myStoreItems->store_items)); $i++) : ?> some codes here that display the query result.. <? endif; ?> $paginationConfigMyStore=array();//some configs <? pagination_menu("#" , "store" , $myStoreItems->totalPagesMyStore , $myStoreItems->currentPageMyStore, false, $paginationConfigMyStore); ?> ................. /*javascript function that sends $_GET the current page number then call again MyController.php to update the new page content.. */ ?> MyController.php <?php require_once($inc_path . 'Controller.php'); class myStoreItems extends COntroller { public function showMyAction($_GET)//added action { $itemList = new ItemList(); $totalMyStore = $itemList->getUserStoreItemsCount($this->userId); $cp = 0; $np = 0; $start = 0; $limit = 0; $MAX_STORE_ITEMS = 3; old_pagination_adapter($start, $limit, $cp, $np, $totalMyStore, $MAX_STORE_ITEMS, $MAX_STORE_ITEMS, $_GET, 'page'); $this->store_items = $itemList->getUserStoreItems($this->userId, null, array('start' => $start, 'limit' => $limit)); $this->totalPagesMyStore = $np; $this->currentPageMyStore = $cp; } } ?> ajax_function.html <?php require_once(dirname(__FILE__) . '/../include_modules/mystore/MyController.php'); $myStoreItems = new myStoreItems(); $callback_func = array(&$myStoreItems,"showMyStoreAction"); call_user_func($callback_func,$_GET); ?> My problem is when i call again the function($myStoreItems->showMyAction($_GET); ) with the new request using javascript i cant access the vars $myStoreItems->store_items,$myStoreItems->totalPagesMyStore,$myStoreItems->currentPageMyStore again thats why it returns zero result but i debug it and see if the request $_GET was successfully sent and yes it is sent the only problem is that i cant access the vars again using "ajax_function.html" thank you for your time reading my post..
  6. Whats wrong with my code im having a problem with the header
  7. guys im working with one of my projects.. do have an array of US zip codes? thank you so much!
  8. i have this code but with error whats the right use of this <? $rand_con = mt_rand(1,90); switch ($rand_con){ case (1 to 30): echo $temp." "."RAINY"; break; case (31 to 60): echo $temp." "."FOGY"; break; case (61 to 90): echo $temp." "."WINDY"; break; }?>
  9. i think this is it man thanks ill try this..thnx to all
  10. i just need to randomize it but with percentage..
  11. RAIN SNOW FOG WIND SPRING 30% 0% 30% 30% SUMMER 15% 0% 30% 30% FALL 10% 0% 30% 30% WINTER 10% 30% 40% 30% how can i base in the percentage of all the given data for example: spring has to be 30%(rain,snow,fog,wind) probability and make a random function with exact probobility? thnx guys
  12. its a weather report..so thats why i need it daily.cronjob right?
  13. guys i need to know where should i start: i create a form that they can signup(username,passowrd,email,zipcode) i want to add a button that when they agree it will email the result daily. Email the result to me daily [submit]
  14. lets say i have 2 dates and i want to compare the two i want to display the first 7 days of the two compared date for example 07-31-2009 to 08-8-2009 output 07-31-2009 08-1-2009 08-2-2009 08-3-2009 08-4-2009 08-5-2009 08-6-2009
  15. If we are super beginners and you are not, why are you asking for our help? i think you got me wrong what im trying to say is i have a little bit of knowledge in php but not that good..thnx all guys to all the help its really help me here.. WORK UPDATE: *i created a registration form but having problem with the email verification..
  16. guys this is an online schooling(kinda) he gave me 3hrs and test if i can do more on what he expect on me..im not that super beginer compare to most of you here..i gave up on this assgnment but i still want to finish it..and now i need your help where should i start?the big problem is i dont have an idea on weather because the climate here in the philippines is not the same as US..any links or tutorials will be welcome..thatnk you guys..thank you
  17. im just a beginer in php can u help me on any?plss
  18. yah your right btw im just sharing it with you..any help will be welcome thanks!!!
  19. WEATHER TRACKING SYSTEM USER STORY PAGES 1. Non-logged-in home page: "Welcome to WeatherForecast" - Form: "Select a date range and enter your zip code to see historical or future forecast "; or they can register/login on the upper-right 2. Register Page: Username, Password, Email Address, Zip Code * Cannot login until email confirmation 3. Logged-in home page: - Automaticaly display the weather for the past 7 days, the weather for the coming 7 days; - Form to add weather data (zip code, date, average temperature, check-off conditions[wind,rain,snow,fog]) - Form: "Select a date range and enter your zip code to see historical or future forecast " - Button: Email the weather to me daily [submit] LOGIC FOR EACH PAGE *Forecating the weather: Temperature First month of Spring: 50 degrees +- a random number between -10 and 10 Second month of Spring: 60 degrees +- a random number between -5 and 5 Third month of Spring: 70 degrees +- a random number between -5 and 5 First Month of Summer: 75 degrees +- a random number between -5 and 5 Second Month of Summer: 80 degrees +- a random number between -5 and 5 Third Month of Summer: 85 degrees +- a random number between -5 and 5 First Month of Fall: 65 degrees +- a random number between -10 and 10 Second Month of Fall: 60 degrees +- a random number between -10 and 10 Third Month of Fall: 45 degrees +- a random number between -5 and 5 First Month of Winter: 45 degrees +- a random number between -10 and 10 Second Month of Winter: 35 degrees +- a random number between -10 and 10 Third Month of Winter: 30 degrees +- a random number between -5 and 5 Forecasting the weather: Adverse Conditions RAIN SNOW FOG WIND SPRING 30% 0 30% 30% SUMMER 15% 0 30% 30% FALL 10% 0 30% 30% WINTER 10% 30% 40% 30%
  20. How do you call a function of a class' parent class? can you also give me an example?
  21. How do you derive one class from another in php? pls help me on this thnx guys..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.