Search Results

Search found 12 results on 1 pages for 'user187580'.

Page 1/1 | 1 

  • how to use ob_start?

    - by user187580
    Hello I am using PHPSavant templating system for a project and I am not sure how to use ob_start in this. I have tried before .. for example, page_header.php -- ob_start(); page_footer.php -- ob_end_flush(); But because now I am using a templating system.. am not sure where to put these function. $template = new Savant3(); $template->some_var = $some_value; $template->display('default_template'); the default_template contains all of and populate section using some variables (set to $template object). Should I be using ob_start and ob_end_flush where my html code is or to include on each and every php file which calls to this template? Any ideas? thanks.

    Read the article

  • Retrieving ids of chid divs using jquery?

    - by user187580
    Hello, Please have a look on the code below .. <div id="click_me">Save</div> <div id="blocks_sortable"> <div id="block_1"> <h2>Block 1</h2> <div class="items_sortable connectedSortable"> <div id="item_1"> <span>Item 1</span></div> <div id="item_2"> <span>Item 2</span></div> <div id="item_3"> <span>Item 3</span></div> </div> </div> <div id="block_2"> <h2>Block 2</h2> <div class="items_sortable connectedSortable"> <div id="item_4"> <span>Item 4</span></div> <div id="item_5"> <span>Item 5</span></div> <div id="item_6"> <span>Item 6</span></div> </div> </div> </div> <script> $("#click_me").click(function() { var result = $("#blocks_sortable > div"); for(var i=0; i<result.length; i++){ var str = ""; var str2 = ""; var block = result[i]; //div object //retrieve block id and create the string with id str += "block="+$(block).attr("id")+"&items="; //trying to select all the items of the current Block var result2 = $(block+" > div"); for(var j=0; j<result2.length; j++){ var item = result2[j]; str2 += $(item).attr("id")+","; } //end for items str = str+str2; // looking for a final string in the format of .. block=block_1&items=item_1,item_2,item_3 for loop 1 alert(str); } }); </script> It is not working. Is there any easier and working solution to get these ids. Please help. Thank you.

    Read the article

  • How to create a chart from mysql data?

    - by user187580
    Hello, I have some data and want to create some dynamic charts. I have looked on Google visualisation api .. It looks great but the problem is I am not very familiar with it. Any ideas, how I can set the data.setValue from mysql data. <script type='text/javascript'> google.load('visualization', '1', {'packages': ['geomap']}); google.setOnLoadCallback(drawMap); function drawMap() { var data = new google.visualization.DataTable(); data.addRows(6); data.addColumn('string', 'Country'); data.addColumn('number', 'Popularity'); data.setValue(0, 0, 'Germany'); data.setValue(0, 1, 200); data.setValue(1, 0, 'United States'); data.setValue(1, 1, 300); data.setValue(2, 0, 'Brazil'); data.setValue(2, 1, 400); data.setValue(3, 0, 'Canada'); data.setValue(3, 1, 500); data.setValue(4, 0, 'France'); data.setValue(4, 1, 600); data.setValue(5, 0, 'RU'); data.setValue(5, 1, 700); var options = {}; options['dataMode'] = 'regions'; var container = document.getElementById('map_canvas'); var geomap = new google.visualization.GeoMap(container); geomap.draw(data, options); }; </script> I can create chart using some other methods but just interested in using Google Visualisation API. Thanks.

    Read the article

  • How to retrieve parent container ID after sorting using Jquery sortable??

    - by user187580
    Hello I have following markup and javascript to sort some items. Items can be sorted within a block or across other blocks. It works but I have a problem in retrieving correct block ID after an item is moved from one block to another. For example, if I move item 1 within "Block 1", I get "I am in Block= block_1" but if I move Item 1 to Block 2 I still get I am in Block 1. But I want to make the block 2 as its parent container. I need to retrieve this id so that I can do some ajax and update the db accordingly. Can you please help me correct this?? <div id="blocks_sortable"> <div id="block_1"> <h2>Block 1</h2> <div class="items_sortable connectedSortable"> <div id="item_1"> <span>Item 1</span></div> <div id="item_2"> <span>Item 2</span></div> <div id="item_3"> <span>Item 3</span></div> </div> </div> <div id="block_2"> <h2>Block 2</h2> <div class="items_sortable connectedSortable"> <div id="item_4"> <span>Item 4</span></div> <div id="item_5"> <span>Item 5</span></div> <div id="item_6"> <span>Item 6</span></div> </div> </div> </div> <script> $("#blocks_sortable").sortable({ }); $(".items_sortable").sortable({ connectWith: '.connectedSortable' , forcePlaceholderSize: true , stop : function(event, ui){ alert("I am in block = "+$(this).parent().attr("id")); } }).disableSelection(); </script> Thank you.

    Read the article

  • How to get values of xml elements?

    - by user187580
    Hi, I have some xml data and I am trying to access some elements. The structure of data is as below (using print_r($data)). I can get $data->{'parent'}->title, it works but if I try to get value of href using $data->{'parent'}->link[0]->{'@attributes'}->href .. it doesnt work .. any ideas? Thanks SimpleXMLElement Object ( [@attributes] => Array ( [children] => 29 [modules] => 0 ) [title] => Test title [link] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => data.php?id=2322 [rel] => self [type] => application/xml ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => data.php?id=2342 [rel] => alternate [type] => text/html ) ) ) [parent] => SimpleXMLElement Object ( [@attributes] => Array ( [children] => 6 [modules] => 0 ) [title] => Top [link] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => /data.php?id=5763 [rel] => self [type] => application/xml ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => /data.php?id=2342 [rel] => alternate [type] => text/html ) ) ) ) )

    Read the article

  • Searching a keyword in a long string in mysql?

    - by user187580
    Hello keyword = house SELECT * FROM products WHERE description LIKE '%house%' This query also returns records having keyword, for example, courthouse, but I want to look for house only. How do I search anywhere in the description for "house" only? Thanks. UPDATE just for more clarification .. actually house, can be at - the start of the description .. "House for sale..", - can be quoted -- "house", 'house' - can have exclamation .. house!!!, house! - others - house? etc .. this is why I used %house%

    Read the article

  • How to search within an xml data set?

    - by user187580
    Hi, I have some xml data and I am trying to keyword search data. For example, if I search "some" for the following data it returns me the <id> and <title>. <resource> <id>101</id> <title>Test Environment</title> <description><b>Some</b> description. </description> <type>classroom</type> </resource> <resource> <id>102</id> <title>ABC Test Environment</title> <description><b>Some</b> another description. </description> <type>classroom</type> </resource> ... I had a look on on xpath e.g. $xml->xpath('//title') but looks for elements only. Basically what I need to do is to create a functionality where users can keyword search within the above data set which I receive from third party api in the above format. Any ideas how I can achieve this? using PHP/ Javascript etc. Thanks.

    Read the article

  • how to retrieve substring from string having variable length of character in php?

    - by user187580
    Hello I have some data in the format of C222 = 50 C1234P687 = 'some text' C123YYY = 'text' C444 = 89 C345 = 3 C122P687 = 'some text' C122YYY = 'text' .... .... so basically 3 different forms "C" number = value, example - C444 = 89 "C" number "P" number = value, example - C123P687 = 'some text' "C" number "YYY" = value Only number is of variable length on the left side of (=) sign. Values vary. I want to store the data in db as INSERT INTO datatable c_id = "number after C" p_id = "number after P" // if it exists for a line of data value = 'value' yyy = 'value' Any ideas how to retrieve these numbers? Thanks

    Read the article

1