Jump to content

rsalumpit

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rsalumpit's Achievements

Member

Member (2/5)

0

Reputation

  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?
×
×
  • 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.