Jump to content

brent123456

Members
  • Posts

    76
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

brent123456's Achievements

Member

Member (2/5)

0

Reputation

  1. I have checked this out. Does anyone know any good tutorials on using these classes. Didn't find much on the website itself. Would be every helpful.
  2. It seems to be working ok as far as reading the sheet I think it is just something broken in my loop.
  3. Hi, I am trying to parse this excel document it is opening the document and printing it fine. What I can't figure out is how to make sure that if there are less then 15 cells (like 10 fill cells then 3 empty cells then 2 full cells) in the row to stop it from adding them in the wrong column. Basically if there are only 12 rows it will insert them under the wrong table heading and just insert "null" and "null" and "null" in the last three columns of the table. I am trying to get it to skip over the columns with no value and just print "null" in them. Thanks $data = array(); function add_computer( $location, $tagnumber, $manufactur, $model_num, $serial_num, $description, $short_def, $oid_1, $product, $serialnum, $processor, $ghz, $memory, $size, $purchase_year ) { global $data; $data []= array( 'location' => $location, 'tagnumber' => $tagnumber, 'manufactur' => $manufactur, 'model_num' => $model_num, 'serial_num' => $serial_num, 'description' => $description, 'short_def' => $short_def, 'oid_1' => $oid_1, 'product' => $product, 'serialnum' => $serialnum, 'processor' => $processor, 'ghz' => $ghz, 'memory' => $memory, 'size' => $size, 'purchase_year' => $purchase_year ); } if ( $_FILES['file']['tmp_name'] ) { $dom = DOMDocument::load($_FILES['file']['tmp_name']); $rows = $dom->getElementsByTagName( 'Row' ); $first_row = true; foreach ($rows as $row) { if ( !$first_row ) { $location = ""; $tagnumber = ""; $manufactur = ""; $model_num = ""; $serial_num = ""; $description = ""; $short_def = ""; $oid_1 = ""; $product = ""; $serialnum = ""; $processor = ""; $ghz = ""; $memory = ""; $size = ""; $purchase_year = ""; $index = 1; $cells = $row->getElementsByTagName( 'Cell' ); foreach( $cells as $cell ) { $ind = $cell->getAttribute( 'Index' ); if ( $ind != null ) $index = $ind; if ( $index == 1 ) $location = $cell->nodeValue; if ( $index == 2 ) $tagnumber = $cell->nodeValue; if ( $index == 3 ) $manufactur = $cell->nodeValue; if ( $index == 4 ) $model_num = $cell->nodeValue; if ( $index == 5 ) $serial_num = $cell->nodeValue; if ( $index == 6 ) $description = $cell->nodeValue; if ( $index == 7 ) $short_def = $cell->nodeValue; if ( $index == 8 ) $oid_1 = $cell->nodeValue; if ( $index == 9 ) $product = $cell->nodeValue; if ( $index == 10 ) $serialnum = $cell->nodeValue; if ( $index == 11 ) $processor = $cell->nodeValue; if ( $index == 12 ) $ghz = $cell->nodeValue; if ( $index == 13 ) $memory = $cell->nodeValue; if ( $index == 14 ) $size = $cell->nodeValue; if ( $index == 15 ) $purchase_year = $cell->nodeValue; $index += 1; } add_computer( $location, $tagnumber, $manufactur, $model_num, $serial_num, $description, $short_def, $oid_1, $product, $serialnum, $processor, $ghz, $memory, $size, $purchase_year ); } $first_row = false; } } ?>
  4. Code a few other test this code out please. It may not be working because I am using a stand alone version of IE6 on XP SP2. Could a few others try this code to see if it works ok. Thank you.
  5. I have a print button on my site that brings up the print window it works fine in IE7 and FF but it will not work in IE6. Could someone offer me some advice on getting this to work in IE6? Thanks <a href="javascript:window.print()">Print Page</a>
  6. Does anyone have a link to an example link of how to use Javascript to detect the speed? This is not for an intro page it is for the main index page of my site. I have a small movie that has pictures and updates that loads when you first come to the main page of the site. Basically I don't want it to load for dial-up users. The link idea would work for an intro page but for my main index page it would already be loading by the time the user clicks the "High Speed" or "Low Speed" links. Thanks
  7. I want to load and image if they have dial-up or a flash movie if they have high speed. Is there anyway I can do this when the user comes to the page for the first time? I found the script below that another user had posted but I am not sure if that would work for checking dial-up vs high speed? http://www.phpfreaks.com/forums/index.php/topic,155661.0.html Thanks
  8. At least your doing something constructive like learning PHP. You could be spending 12 hours a day surfing porn.
  9. I am looking for a good apache web hosting provider in the Netherlands that has English support & site, with PHP and MYSQL databases. Between 25 & 30 euros a month. Could anyone give me some recommendations? Thanks
  10. Hi Guys, Thanks for your replies. I am self taught as well I learned VB as my first programming language in College. I wasn't into MS stuff. Not portable among other things. I taught myself PHP over time I never learn a lot about OOP programming. MYSQL came with PHP so that is the Database that I picked up. Your right good books have been helping me I checked out the sticky about books, good stuff in there.
  11. Could anyone offer me some advice on this one?
  12. Thank you, I Have looked this over but I am still having trouble figuring out he logic to get the pages. $x only prints out 789 everytime but the pages only go till 7 so far. I am not really sure were to implement the number of pages in my paging code. $totalpage = 100; $pagelimit=3;//3row $p=(int)($num_pages/$pagelimit)+1; echo $p; $pagedisplay =$p*$pagelimit; $num_pages = $pagedisplay - 3+1 ; for ($x = $num_pages;$x<=$pagedisplay;$x++){ echo $x; } if($num_pages > 1) { // determine what page the script is on. $current_page =($start/$display) + 1; // if not on the first page make a previous page if ($current_page != 1) { echo '<a href="index.php?do=requestpage&s=' . ($start - $display) . '&np=' . $num_pages . '"> Prev </a> '; } // make all the numbered pages ffor ($x = $num_pages;$x<=$pagedisplay;$x++){ if($i != $current_page) { echo '<a href="index.php?do=requestpage&s=' . (($display * ($i - 1))) . '&np=' . ($display*$x) . '"> ' . $x . ' </a>'; } else { echo $x . ''; } } // if it's not the last page , make a next button. if ($current_page != $num_pages) { echo '<a href="index.php?do=requestpage&s=' . ($start + $display) . '&np=' . $num_pages . '"> Next </a> '; } }
  13. if($num_pages > 1) { // determine what page the script is on. $current_page =($start/$display) + 1; // if not on the first page make a previous page if ($current_page != 1) { echo '<a href="index.php?do=requestpage&s=' . ($start - $display) . '&np=' . $num_pages . '"> Prev </a> '; } // make all the numbered pages for ($i = 1; $i <= $num_pages; $i++) { if($i != $current_page) { echo '<a href="index.php?do=requestpage&s=' . (($display * ($i - 1))) . '&np=' . $num_pages . '">' . $i . '</a>'; } else { echo $i . ''; } } // if it's not the last page , make a next button. if ($current_page != $num_pages) { echo '<a href="index.php?do=requestpage&s=' . ($start + $display) . '&np=' . $num_pages . '"> Next </a> '; } } I am having trouble trying to figure out how to break this up into only a few pages at a time like <prev 3 4 5 next> instead of 1234567891011121314 next>. Could anyone offer me a hand with this it would be a big help. Thanks.
×
×
  • 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.