honkmaster

Members
  • Content count

    32
  • Joined

  • Last visited

Community Reputation

0 Neutral

About honkmaster

  • Rank
    Newbie
  1. Hi, I have an issue and hope someone can point me in the right direction. I have a table called production Table production Id Job Company Status — —— ——— ——— 123 001 Test 1 Active 123 002 Test 1 Active 123 003 Test 1 Active 123 004 Test 1 Complete 123 005 Test 1 Active 123 006 Test 1 Complete 456 001 Test 2 Complete 456 002 Test 2 Complete 456 003 Test 2 Active 456 004 Test 2 Complete 456 005 Test 2 Active 456 006 Test 2 Complete 789 001 Test 3 Complete 789 002 Test 3 Active 789 003 Test 3 Active 789 004 Test 3 Active 789 005 Test 3 Active 789 006 Test 3 Active I'm trying to run a query that returns the following Company Active Complete Test 1 4 2 Test 2 2 4 Test 3 5 1 So its DISTINCT Id and counting the different status and return as above Any help would be great as I have been trying most of the day but without success Cheers Chris
  2. Ok I worked it out, under fitbox i had used true, you can use 2 charters here 'CM' the center and middle $fitbox (mixed) If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom).
  3. Hi, Im have a trouble understand how I align the image to centre vertical and horizontally any help would be great, Cheers Chris // Image Box $pdf->setCellPaddings(0, 0, 0, 0); $pdf->SetFillColor(255, 255, 255); $pdf->SetDrawColor(0, 0, 0); $pdf->Rect(10, 117, 188, 137, 'DF'); $pdf->Image('Upload/94428_075_10% Data Capture cards.jpg', 15, 122, 180, 125, 'JPG', '', '', false, 300, 'C', false, false, 0, true, false, false);
  4. Hi, i'm having a hard time with this one, I need to create a PDF with the results from a query into a html table, all I'm getting is the first row when I should get 6!! I'm quite new to TCPDF so any help would be great. Code below $pdf = new TCPDF(); // add a page $resolution= array(210, 297); // set margins $pdf->SetAutoPageBreak(false, 0); $pdf->setCellMargins(0, 0, 0, 0); $pdf->setCellPaddings(0, 0, 0, 0); // remove default header/footer $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); // get data from users table $storeid = $row_rsStoreID['Allocation_StoreId']; $formcode = $row_rsStoreID['Allocation_FormCode']; $qty = $row_rsStoreID['Allocation_Quantity']; $store = $row_rsStoreID['Allocation_Name']; // ----------------------------------------------------------------------------- $pdf->Write(10,10,0, 'Example of HTML tables', '', 0, 'L', true, 0, false, false, 0); $pdf->SetFont('Helvetica', '', 12); if($totalRows_rsStoreID > 0) { while($row_rsStoreID = mysql_fetch_assoc($rsStoreID,MYSQL_ASSOC)) { $tbl = <<<EOD <table border="1" cellpadding="5" cellspacing="0"> <tr> <td>$storeid</td> <td>$formcode</td> <td>$qty</td> </tr> </table> EOD; $pdf->writeHTML($tbl, true, false, false, false, ''); // ----------------------------------------------------------------------------- //Close and output PDF document $pdf->Output('Test', 'I');
  5. Worked a treat, thanks very much for help and pointing me in the right direction, Cheers
  6. Ok, if I'm posting 219, 200 19 how do I split that into 3 values from the one post? Cheers
  7. Set fill expect the following SetFillColor(219, 200, 19) for RGB or SetFillColor(0, 50, 50, 0) for CMYK I have posted both from form as $pdf->SetFillColor($getcolour); neither work? Cheers for reply
  8. Hi I'm stuck with an issue i can't work out. I'm using php and TCPDF to create a pdf label. The user uses a simple form and selects the colour the label needs to be. Problem I have got is no matter what I post TCPDF does not pick up the colour variable. In the below code the SetFillColour works if i put RGB or CMYK info in direct but not if I post it so $pdf->SetFillColor(219, 200, 19); works but if i post from a form $pdf->SetFillColor($getcolour); it does not??? Any ideas or help would be grateful, Cheers $getcolour = $_POST['colour'];// Format Store ID Block $pdf->StartTransform(); $pdf->SetFont('Helvetica', 'B', 40); $pdf->setCellPaddings(0, 0, 0, 0); $txt = $storeid; $pdf->SetXY(1,49); $pdf->Rotate(90); $pdf->SetFillColor($getcolour); $pdf->MultiCell(48, 0, $txt."n", 0, 'C', 1, 1, '' ,'', true); $pdf->StopTransform();
  9. This is code i'm using now, only the returned unix date is incorrect? $wholedate = $_POST['duedate'];$date_array = explode('.', $wholedate);$test = mktime(0,0,0,$date_array[1],$date_array[2],$date_array[0]);echo $test;echo '<br>';echo date('Y-m-d', $test); //Check if timestamp returns wanted date format
  10. the issue is when you convert that time stamp back it is in correct, i.e. i start by converting 2013-01--10 to a timestamp 1354233600, when you convert it back it = 2012.11.30 Cheers Chris
  11. Thanks for response and sorry for not stating the issue, when I run the code and check the unix date I get 1354233600 = 2012.11.30 ?? and not 2013-01-10 as expected. Cheers Chris
  12. Hi I have the following code I think the date format is wrong. I'm posting a date from a form as 2013-01-10, before I post it to mysql I want to convert it to unix format I'm still a beginner so need a help Cheers Chris $wholedate = $_POST['duedate'];$date_array = explode('.', $wholedate);$test = mktime(0,0,0,$date_array[1],$date_array[0],$date_array[2]);
  13. Hi, Any help would be great I have the following code which is looking at two dates, due date and today. <?php date_default_timezone_set('Europe/London');$now = time();if ($row_rsReleaseQue['duedate'] < date('d-m-Y',$now)) { echo '<tr class="tableBody3">';} else { echo '<tr class="tableBody1">';}?> I want to change the background colour of the line in my table based on the due date. < less that todays date = Red (tableBody3)== equal to today = Orange (tableBody2)> greater than today = Green (tableBody1) Cheers Chris
  14. Thank you so much, it worked, I now understand where I was going wrong Cheers Chris
  15. Hi I use this form to pass the number of upload fields and company name <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Untitled Document</title></head><body><form action="upload3.php" method="post">Number of Images to Upload<br />Company<input name="company" type="text" /><br /><select name="nouploads"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option></select><input type="submit" name="submit" id="submit" value="Submit" /></form></body></html>