Jump to content

Miko

Members
  • Posts

    131
  • Joined

  • Last visited

    Never

Everything posted by Miko

  1. Miko

    Generate PDF

    Okay, I've been working on this one now and I'm having allready an error Fatal error: Uncaught exception 'PDFlibException' with message 'String parameter 'type' has bad value 'jpg'' in C:\xampp\htdocs\control_signatures\pdf.php:30 Stack trace: #0 C:\xampp\htdocs\control_signatures\pdf.php(30): pdf_open_image_file(Resource id #4, 'jpg', '001-STRUVAY.jpg', 'page', 0) #1 {main} thrown in C:\xampp\htdocs\control_signatures\pdf.php on line 30 Here's the code <?php $dir = "./0532/20091022/T301/"; $open = opendir("./0532/20091022/T301/"); $result = glob("./0532/20091022/T301/*.jpg"); // Create the PDF object $mypdf = PDF_new(); // Open / create PDF PDF_open_file($mypdf, ""); // Begin of page PDF_begin_page($mypdf, 595, 842); $myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0); PDF_setfont($mypdf, $myfont, 10); // Show text for($i=0; $i < count($result); $i++){ $source = $result[$i]; $name = basename($source, ".jpg"); $getSize = getimagesize($dir.$name. ".jpg"); $width = $getSize[0]; $height = $getSize[1]; $myimage = PDF_open_image_file($mypdf, "jpg", "001-STRUVAY.jpg", "page", $i); PDF_place_image($mypdf, $myimage); PDF_close_image($mypdf, $myimage); } PDF_show_xy($mypdf, "SAMPLE PDF", 50, 750); PDF_show_xy($mypdf, "Made by Avril", 50, 730); // End of page PDF_end_page($mypdf); // Close / delete PDF PDF_close($mypdf); $mybuf = PDF_get_buffer($mypdf); $mylen = strlen($mybuf); header("Content-type: application/pdf"); header("Content-Length: $mylen"); header("Content-Disposition: inline; filename=signatures$dir.pdf"); print $mybuf; PDF_delete($mypdf); ?> Don't know what I'm doing wrong here
  2. Miko

    Generate PDF

    okay thanks! I know what to do now
  3. Miko

    Generate PDF

    So bassicaly I can write loop in loop so that I can position my images and image names?
  4. Hello, I must make a PDF with PHP. The following things should come on this PDF file: - title - description of about 4 lines - images - image name - 2 options of this image (something like check) So basically one of my users comes on my webpage (intranet) gets a result with some search requests. Then he should create a pdf file that will contain the title, description + images and the options. Creating a pdf isn't so complicated, the main issue is that the amount of images that the user requests is variable. Fortunally each image has a size of 240px width and 120px height, what I want to do is place those images next and below each other on the pdf. So basically something like this: A Title Some description Image 01 | Image 02 | Image 03 | Image 04 ImgNm 01 | ImgNm 02 | ImgNm 03 |ImgNm 04 Image 05 | Image 06 | Image 07 | Image 08 ImgNm 05 | ImgNm 06 | ImgNm 07 |ImgNm 08 And so on ... Somebody know how to do this or may know a script that can do this? Thanks!
  5. Hi! Just tried this and it seems to work, BUT the main problem is the positions of the images. Since I don't know in advance the number of images I will get it is hard to code the positions for each image. For example: I have a page with 50 images, each image has a size of 240width and 120height, I would like to position those images next and beneath each other, something like this: image1 | image 2 | image 3 | image4 image4 | image 5 | image 6 | image7 and so on .. any ideas?
  6. Hello, I have this script that automatically gets images from a folder and print them out on a webpage. So far everything works, but want I want to do now is generate a pdf of those images, knowing that the amount of images is variable they should be placed nicely on the pdf file. I know that since php v4 there is a pdf function, tested this, but isn't really what I'm looking for. Anyone knows a good php script for this? or maybe a good and fast way to print out those images? Thanks
  7. Miko

    GROUP

    Hello! I making an SQL statement. My DB looks like this: nr | year | month | day here I have data that is simply plain date: 25 | 2009 | 12 | 01 but since there are more then 1 day in a month I have this: 25 | 2009 | 12 | 02 25 | 2009 | 12 | 03 25 | 2009 | 12 | 04 So what I want to do is select the nr 25 and list the dates which have the nr 25 of course. This is very simple with this SQL statement: SELECT * FROM dates WHERE nr = 25 The main thing is, I want to make combo boxes of each collumn in php, so I group it by year, but then I have only 1 result : 25 | 2009 | 12 | 01 And not the others. Anyone knows how to do this? Thanks
  8. hi! Ok, it was almost that, but I had to change then onchange="gotoUrl(this.value)" to onchange="document.location(this.value)" Thanks
  9. Hello, I'm searching the web for about 2hours now for a javascript. The javascript should do the following: I have a combo box with some option values inside, when the visitor selects one of the options it should go to another url. Something like this: http://hostname.com/viewImages.php?val=213&date=20091012 I know that I have to to make my element like this: <select name="name" onChange="javascript()"> But I don't know how to build the javascript that should do what I've mentioned. Somebody knows this? Thanks
  10. find it: <a href='#'>
  11. Hi there! I'm trying to combine some PHP code in my jQuery: I have this code here: $('#selectDepot').append("<?php echo "<ul>"; foreach($fetchdepot as $depot){$depotNr = $depot['depots']; echo "<li><a href='\"#\"'>".$depotNr."</a></li>";} echo "</ul>"; ?>"); As you can see my php code will get some info and echo it out as a hyperlink. The strange thing is that when I remove the hyperlink the data is printed out correctly, but when I add the hyperlink (a href="") well, it just disappears. Anyone can help me out here? Thanks!
  12. lol found id! IE doesn't show images if there isn't a width or height specified (which I haven't done), I've added this and it's working Thanks ! ;
  13. I would like to, but since it is an intranet app and we don't have a public web server (well there is but this one in another country and we don't have permission ). I can maybe check some free php scripts that gives the opportunity to upload images and view them on a web server, something like wordpress
  14. lol I've got it just done it with opendir("./folder/"); this works! but the annoying part is .. the files are images, and firefox shows me the images, but not Internet Explorer (tested in IE 6 ,7 Got an idea?
  15. Actually I'm building a small web app does should work like this: User goes to the web page where there are 4 different depotnumbers (hard coded) User selects his depot number and get's then a combo box with several dates in it (this is loaded in another script using an Ajax script) User choses date and get's then the images These images are stored on the server off course, I've developed and tested the web app on my local pc (using xampp) so the opendir works fine. But since the users don't open the web app on the server but via there own pc it doesn't work, so as you said, I should use ftp connection then. What function is there for this?
  16. there wouldn't be any permissions violations beause the server is at 2 feet from me But the thing is that I need to print out the content of some folders :/
  17. okay, what should I use or do? Thanks
  18. No idea, I don't do alot of php development (mostely xhtml, css & jquery). I've found opendir() via google, but don't find anything else
  19. Hello, I'm encountering a problem with this script: $depot = $explode[0]; $date = $explode[1]; $tournr = $explode[2]; $open = opendir("http://serveraddress/folder/$depot/$date/$tournr/"); // (It is an intranet script) $files = glob("http://serveraddress/folder/$depot/$date/$tournr//*.jpg"); ?> <div class="images"> <p>Selected depot / date / tour:<br /> <strong><?php echo "D".$depot." / D".$date." / ".$tournr ?></strong></p> <?php for($i=0; $i<count($files); $i++){ $num = $files[$i]; $filename = basename($num, ".jpg"); //$size = getimagesize($dir.$filename.".jpg"); $width = $size[0]; $height = $size[1]; $filename_explode = explode("-",$filename); $filenam = $filename_explode[1]; ?> <div class="images_result"> <img id="image" src="<?php echo $num; ?>" alt="Signature <?php echo $filename; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" /> <p><?php echo $filenam; ?></p> </div> <?php } ?> </div> The code works just fine, but I get this error messages: Warning: opendir(http://serveraddress/folder/0532/20091023/T336/) [ function.opendir ]: failed to open dir: not implemented in D:\xampp\htdocs\folder\images.php on line 10 Selected depot / date / tour: D0532 / D20091023 / T336 Basically I'm trying to open a folder with images that is located on one of our servers, but it wont work Anyone know why? Thanks
  20. Hello, Not sure that I'm posting this at the right location, if so just tell me I'm looking a way to make a "star rating system" for my day-time job. It should work like this: User has page with several images Each image has the "star rating" with max value 5 stars User clicks on one of the stars depending on the rating that he want's to give and is then stored in my MySQL DB Anyone knows a simple php script for this? Thanks!
  21. Hello, Not sure if i'm asking this on the correct location I'm quite new with jQuery so don't hit me if I'm asking something stupid . I'm trying to pass data to my mySQL database, but I'm doing that 2 jQuery scripts: User comes on my page where there is a list with some values, e.g 530, 532, 534 etc etc .. User clicks on one of them, this link is using the jQuery to get another php file which get's the data from my DB and list it below the first list, here's the code for this: $('#letter-e a').click(function(){ $.get('e.php', {'depot': $(this).text()},function(data){ $('#dict').html(data); }); return false }); So the second list is another step that can't be avoided to get the final result. In other words, i'ts another list where the user has to chose one of the items from the list to see the final result, I've added this code inf the 'e.php' file: $('#letter-f a').click(function(){ $.get('f.php', {'date': $(this).text()},function(data){ $('#entry2').html(data); }); return false }); The problem is that my 'f.php' only gets 1 variable value, but I'll need 2 or more (maybe in the futur), someone knows how to pass multiple variables to a php file using jQuery? Thanks Smile
  22. thanks both of the methods are working I could used directly the INSERT query, but this would give errors and our server is logging every error, so I don't like it if my errorlogfile is getting bigger
  23. Hello, I'm creating a script that should check in my MySQL DB if a value is allready present or not, if it is not present it should insert it into the database. Was thinking of doing like this: SELECT * FROM dates WHERE date = $date AND depot = $depot then add an IF statement if($sql_date != $date){ "insert into db statement and code } Seems that it isn't a correct way to do it? Maybe work with array?
  24. ok thanks, it works!
×
×
  • 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.