Jump to content

winuser2003

Members
  • Posts

    110
  • Joined

  • Last visited

Everything posted by winuser2003

  1. Okay just so I am on the same page - create another table under the same DB with the items I took out to reference those? correct?
  2. I took out the items and I probably messed this up bad, I am trying though... Here is what I did... Code Change: <?php mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost", "winuser2003", "homer123", "pmapp"); $tdata = ''; $res = $conn->query("SELECT id, first_name, last_name, SUM(i.pass_fail=0) as `Defect Count`, ..., manager_sign_x, manager_sign_y FROM pmvisit"); foreach ($res as $r) { $tdata .= "<tr><td>{$r['id']}</td> <td>{$r['first_name']}</td> <td>{$r['last_name']}</td> <td>{$r['tech_phonenum']}</td> <td>{$r['store_name']}</td> <td>{$r['store_num']}</td> <td>{$r['store_address']}</td> <td>{$r['manager_name']}</td> <td>{$r['robot_num']}</td> <td>{$r['checkin_time']}</td> <td>{$r['tech_general_comment']}</td> <td>{$r['manager_comments']}</td> <td>{$r['checkout_time']}</td> <td>" . drawImage($r['manager_sign_x'], $r['manager_sign_y']) . "</td>\n"; } LEFT JOIN pmvisit_item i ON v.id = i.visit_id AND pass_fail = 0 GROUP BY v.id function drawImage($xcoords, $ycoords) { $xa = $xcoords[0]=='[' ? json_decode($xcoords, 1) : explode(',', $xcoords); // put x coords into an array $ya = $ycoords[0]=='[' ? json_decode($ycoords, 1) : explode(',', $ycoords); // put x coords into an array $w = max($xa)+1; // get the max coord values so we know the size $h = max($ya)+1; // define the path $path = "M $xa[0] $ya[0] "; // move to the first x,y position unset($xa[0], $ya[0]); // remove the the first items from the array foreach ($xa as $i => $x) { // loop through arrays $y = $ya[$i]; // pairing the ith x with the ith y $path .= "L $x $y "; // define line to x y } // create svg object $w x $h to display image $im = "<svg width='$w' height='$h'> <path d='$path' stroke='#000' stroke-width='2' fill='none'/> </svg>"; return $im; } ?> <!DOCTYPE html> <html> <head> <style type="text/css"> table { border-collapse: collapse; width: 60%; } th { background-color: blue; color: white; padding: 10px; text-align: left; } td { padding: 4px 20px;; } </style> </head> <body> <table border="1" style="width: 60%;"> <tr><th>ID</th> <th>First name</th> <th>Last name</th> <th>Tech Phone Number</th> <th>Store Name</th> <th>Store Number</th> <th>Store Address</th> <th>Manager's Name</th> <th>Manager's Comments</th> <th>Robot Number</th> <th>Checkin Time</th> <th>Technician General Comments</th> <th>Checkout Time</th> <th>Manager Signature</th> <tr> <?=$tdata?> </table> </body> </html> Database Update : I appreciate you helping me with this... your method from what I can tell from your post would make it easier... just need help getting there.
  3. Okay let me refactor the DB labels a little better, I think he did that to test the connection to the mobile app. I will update you when I complete this task
  4. Yes yes I know, the collegue working on the mobile app did it that way, and for the life of me I have no clue why. Probably too lazy to make it right. this my output with the code ?> <!DOCTYPE html> <html> <head> <style type="text/css"> table { border-collapse: collapse; width: 60%; } th { background-color: blue; color: white; padding: 10px; text-align: left; } td { padding: 4px 20px;; Result : Checkin time a bit off Checkout time a bit off.... I made the adjustment from 60 to 20, I think its too much data. Correct me please if I am wrong.
  5. so we pulled some paper docs and did notice that signatures were primarlily on average one path meaning.... like a doctor or what I call "chicken scratch." Over 90% of the documentation would have reference 1 path so I think we are fine the way we are. Not many signatures have 2 names it looks like. You made the comment "its rare" and your right. Next Question: How do I get this time stamp to look a bit more correct? I know ( correct me if I am wrong ) there is CSS styling... but for the life of me I cannot get the timestamp to look correct. <?php mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost", "winuser2003", "homer123", "pmapp"); $tdata = ''; $res = $conn->query("SELECT id, first_name, last_name, tech_phonenum, store_name, store_num, store_address, manager_name, robot_num, checkin_time, item_one, item_two, item_three, item_four, item_five, item_six, item_seven, item_eight, item_nine, item_ten, item_eleven, item_twlve, item_thirteen, item_fourteen, item_fifteen, item_sixteen, item_seventenn, item_eighteen, item_nineteen, item_twenty, item_twentyone, item_twentytwo, tech_general_comment, checkout_time, manager_sign_x, manager_sign_y FROM pmvisit"); foreach ($res as $r) { $tdata .= "<tr><td>{$r['id']}</td> <td>{$r['first_name']}</td> <td>{$r['last_name']}</td> <td>{$r['tech_phonenum']}</td> <td>{$r['store_name']}</td> <td>{$r['store_num']}</td> <td>{$r['store_address']}</td> <td>{$r['manager_name']}</td> <td>{$r['robot_num']}</td> <td>{$r['checkin_time']}</td> <td>{$r['item_one']}</td> <td>{$r['item_two']}</td> <td>{$r['item_three']}</td> <td>{$r['item_four']}</td> <td>{$r['item_five']}</td> <td>{$r['item_six']}</td> <td>{$r['item_seven']}</td> <td>{$r['item_eight']}</td> <td>{$r['item_nine']}</td> <td>{$r['item_ten']}</td> <td>{$r['item_eleven']}</td> <td>{$r['item_twlve']}</td> <td>{$r['item_thirteen']}</td> <td>{$r['item_fourteen']}</td> <td>{$r['item_fifteen']}</td> <td>{$r['item_sixteen']}</td> <td>{$r['item_seventenn']}</td> <td>{$r['item_eighteen']}</td> <td>{$r['item_nineteen']}</td> <td>{$r['item_twenty']}</td> <td>{$r['item_twentyone']}</td> <td>{$r['item_twentytwo']}</td> <td>{$r['tech_general_comment']}</td> <td>{$r['checkout_time']}</td> <td>" . drawImage($r['manager_sign_x'], $r['manager_sign_y']) . "</td>\n"; } function drawImage($xcoords, $ycoords) { $xa = $xcoords[0]=='[' ? json_decode($xcoords, 1) : explode(',', $xcoords); // put x coords into an array $ya = $ycoords[0]=='[' ? json_decode($ycoords, 1) : explode(',', $ycoords); // put x coords into an array $w = max($xa)+1; // get the max coord values so we know the size $h = max($ya)+1; // define the path $path = "M $xa[0] $ya[0] "; // move to the first x,y position unset($xa[0], $ya[0]); // remove the the first items from the array foreach ($xa as $i => $x) { // loop through arrays $y = $ya[$i]; // pairing the ith x with the ith y $path .= "L $x $y "; // define line to x y } // create svg object $w x $h to display image $im = "<svg width='$w' height='$h'> <path d='$path' stroke='#000' stroke-width='2' fill='none'/> </svg>"; return $im; } ?> <!DOCTYPE html> <html> <head> <style type="text/css"> table { border-collapse: collapse; width: 60%; } th { background-color: blue; color: white; padding: 10px; text-align: left; } td { padding: 4px 60px;; } </style> </head> <body> <table border="1" style="width: 60%;"> <tr><th>ID</th> <th>First name</th> <th>Last name</th> <th>Tech Phone Number</th> <th>Store Name</th> <th>Store Number</th> <th>Store Address</th> <th>Manager's Name</th> <th>Robot Number</th> <th>Checkin Time</th> <th>Bumper Tie Rod Mounting Screws</th> <th>Inspect/Clean Caster and Drv Wheel</th> <th>Inspect Bumper Damage</th> <th>Remove Motor Cble Ties / inspect frayed cables</th> <th>Inspect Screws/Parts in tray area</th> <th>Vaccum Cooling Air Inlets for PC</th> <th>Visual Cable Inspection / Connections</th> <th>12V Power Port Inspection</th> <th>Lidar Drv Belt Inspect</th> <th>Backdoor Alignment Check</th> <th>Charging Connector Contact Condition</th> <th>Trim lwr right cover under lidar</th> <th>Tighten GO Button nut</th> <th>Align WiFi Antenna</th> <th>Center Camera Alignment Check</th> <th>Lidar Rotation Check</th> <th>Googly Eyes Check</th> <th>Cleaned Non-Optical Cover Surfaces</th> <th>Clean all Optical Imaging Components</th> <th>Inspect Dock Connector / Height / Contact Condition</th> <th>Dock and Fudicals Cleaned</th> <th>Dock and Park Tape</th> <th>Technician General Comments</th> <th>Checkout Time</th> <th>Manager Signature</th> <tr> <?=$tdata?> </table> </body> </html> Next: I would like to add arrows for filters / and maybe build a search out... would you be able to assist me with this? I will be glad to donate more for your assistance.
  6. How would I be able to build something that tells someone else they are on that specific URL? I am working to collect more data for better understanding of the issue... please be patient.
  7. Good Point, let me look at that Update: Your right look at the Screenshot How would that be fixed code wise?
  8. All, Thank you for your help with this specific project and its been ongoing for a while now. I been doing alot of consulting of where I should start I will do my best to explain this.... Lets say your in a office with 2 groups of 10 people. Those 10 people jump on the same websites everyday. The problem is no 2 people should be on the same website if one is working on it. a notification should pop up at some point and say "user ID X is currently working on this page please wait..." or something relevant to that. Once that person is done working on that webpage then the person making attempts can finally access it. Below is a statement from another consultant Basically, we work with robots and the control panel is through the web interface we use. Each robot has an ID as well as the people working on them also have ID's which is usually there email. I would prefer however to do this in a CSV or DB The problem is we do not want 2 people working on the same robot at the sametime. Today there is nothing that notifies us if someone else is working on that robot or not. You will see in the statement he mentions "Multi-View" which is a custom UI that uses tampermonkey chrome plugin to overlay a better interface over the actual interface. I hope this description is not to vague, if it is please let me know and I will try to go way more indepth of what is needed for this project.
  9. OKay I will create a new topic about my project and let me know what you think. I appreciate you looking at this project with me, its pretty big and involves node.js.
  10. are you familiar with AJAX? I need some advice for another project but if its possible, I am willing to compensate for the help and assistance. Just mainly looking for guidance.
  11. Man I hope you live another 70 plus years thats incredible! I am honored to be talking to you right now... I hope we work again in the future and thank you again for all the time / help / and support! just wow!! god bless and may you continue to live healthy!
  12. okay, so looks like we can conclude? I appreciate everything. I will be doing more testing and keep you updated as far as progress... I do appreciate everything and I want to keep learning. First time I ever graphed from mysql. I know 30.00 is not alot, and hopefully in the future we can work together more because I would really like to compensate you alot more for all the help you have given.... One question... are you really 71?
  13. ahh ok ok, should I still do an array though?
  14. 1 is from the android app - the other you know where its from. I think on his side he just took out the brackets because the DB is no longer showing the brackets from his side which is allowing the code to work. Let me know if that makes sense.
  15. so he and I are testing it, and its pretty much right on now... what do you think?
  16. so will I still need to create an array? is this still recommended?
  17. Result : Coordinates Used : X Coordinate: 61, 62, 64, 66, 73, 79, 84, 92, 100, 107, 112, 118, 121, 122, 123, 123, 123, 123, 123, 123, 121, 118, 114, 110, 108, 105, 103, 102, 99, 96, 92, 88, 86, 83, 80, 75, 69, 64, 58, 52, 47, 44, 40, 36, 34, 32, 30, 29, 29, 29, 29, 29, 31, 32, 36, 40, 45, 49, 56, 62, 70, 79, 85, 90, 96, 101, 104, 105, 108, 108, 109, 109, 109, 109, 109, 108, 105, 100, 95, 91, 88, 85, 82, 80, 77, 76, 72, 70, 67, 64, 61, 58, 57, 56, 56, 56, 56, 56, 56, 58, 61, 62, 64, 65, 68, 71, 76, 82, 89, 94, 100, 109, 117, 123, 127, 129, 130, 130, 130, 130, 128, 127, 125, 125, 125, 124, 124, 125, 127, 129, 132, 134, 135, 137, 137, 137, 137, 136, 134, 129, 126, 121, 116, 110, 106, 103, 102, 101, 98, 97, 97, 97, 102, 107, 115, 125, 135, 144, 152, 159, 168, 174, 182, 192, 202, 212, 223, 231, 239, 242, 243, 240, 231, 218, 206, 199, 190, 184, 181, 180, 180, 181, 187, 194, 206, 215, 222, 226, 227, 227, 224, 220, 215, 209, 203, 195, 190, 189, 192, 195, 199, 200, 204, 205, 207, 208, 203, 200, 198, 197, 196, 196, 197, 200, 201, 203, 207, 208, 210, 211, 214, 215, 214, 213, 211, 210, 209, 207, 204, 200, 196, 193, 189, 188, 187, 187, 187, 188, 189, 192, 194, 196, 200, 207, 217, 228, 239, 249, 260, 272, 276, 280, 282, 282, 339, 339, 338, 337, 334, 330, 325, 315, 306, 297, 289, 284, 279, 276, 275, 273, 273, 273, 275, 279, 282, 288, 294, 302, 310, 319, 328, 337, 348, 355, 359, 362, 363, 365, 366, 368, 369, 369 Y Coordinate: 56, 57, 57, 58, 58, 58, 58, 58, 58, 57, 55, 52, 51, 49, 47, 46, 43, 40, 37, 33, 28, 24, 20, 17, 15, 13, 13, 13, 13, 13, 14, 17, 19, 22, 26, 31, 36, 41, 46, 50, 54, 56, 59, 63, 64, 67, 71, 73, 76, 79, 81, 84, 86, 87, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 89, 87, 87, 87, 85, 84, 83, 80, 77, 76, 74, 71, 67, 64, 62, 62, 62, 62, 62, 62, 64, 64, 68, 70, 74, 78, 83, 89, 95, 101, 108, 114, 119, 123, 126, 128, 132, 133, 134, 135, 135, 135, 135, 133, 129, 125, 118, 112, 106, 99, 93, 86, 79, 74, 68, 65, 60, 58, 55, 54, 53, 52, 51, 52, 57, 60, 65, 71, 79, 88, 96, 104, 111, 117, 122, 127, 131, 136, 140, 143, 144, 144, 144, 144, 141, 138, 130, 121, 110, 97, 85, 74, 63, 55, 49, 42, 38, 37, 36, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 37, 39, 43, 44, 45, 45, 46, 46, 46, 46, 46, 44, 44, 43, 43, 44, 48, 52, 57, 64, 69, 75, 79, 80, 80, 78, 74, 72, 69, 67, 66, 66, 71, 74, 78, 81, 82, 83, 83, 83, 83, 81, 79, 78, 76, 76, 74, 73, 76, 77, 80, 81, 84, 88, 92, 97, 102, 109, 116, 123, 128, 133, 135, 138, 139, 139, 139, 139, 139, 135, 129, 124, 117, 110, 103, 94, 90, 86, 84, 84, 51, 50, 50, 50, 50, 53, 57, 63, 70, 77, 85, 91, 98, 105, 111, 118, 124, 130, 135, 139, 142, 145, 146, 146, 146, 144, 139, 133, 123, 116, 107, 100, 93, 87, 81, 78, 76, 76 Why are the brackets making a difference though? I appreciate you teaching me along this project... learning quite a bit.
  18. Upon closer analysis it seems there is a bracket in the XY coordinates which is why it was not working originally on my end... [44, 44, 44, 45, 45, 45, 45, 45, 45, 43, 42, 41, 40, 39, 39, 39, 37, 37, 37, 37, 37, 37, 37, 39, 40, 43, 47, 47, 49, 51, 52, 52, 53, 54, 55, 57, 58, 59, 64, 68, 73, 80, 85, 89, 93, 94, 94, 95, 95, 95, 93, 91, 89, 87, 85, 83, 81, 79, 75, 75, 72, 69, 66, 63, 60, 57, 55, 52, 50, 47, 45, 43, 41, 41, 41, 123, 124, 124, 123, 122, 119, 117, 111, 105, 100, 94, 89, 85, 82, 78, 76, 75, 73, 73, 72, 72, 72, 72, 75, 77, 79, 81, 83, 83, 87, 91, 95, 101, 109, 118, 127, 137, 144, 150, 153, 155, 155, 155, 155, 155, 155, 154, 154, 153, 150, 147, 147, 145, 144, 144, 144, 144, 144, 149, 152, 155, 158, 163, 167, 170, 176, 184, 191, 197, 201, 203, 204, 205, 206, 206, 206, 205, 203, 203, 202, 202, 202, 202, 202, 202, 202, 204, 207, 210, 213, 219, 220, 222, 223, 224, 226, 228, 230, 234, 237, 242, 246, 252, 259, 269, 278, 287, 293, 301, 309, 316, 325, 333, 340, 345, 345, 343, 341, 341, 339, 335, 332, 329, 327, 327, 327, 327, 328, 328, 329, 329, 332, 332, 335, 336, 338, 339, 343, 343, 346, 346] Once i removed these brackets from the beginning and end the image showed up fine. I am not sure if we can do anything about that though... Does this just mean its being sent as an array rather than a string?
  19. not sure how I did this... but I changed a couple items in the DB entry and this happen...
  20. if I am defining these, would that cause a problem though? I mean we may have quite a bit of signatures, and if I am defining a set of X and Y points won't they be all the same? example, I gave you the X and Y coordinates of a signatre and you were able to see the output which is what I expected. Lets say I give you another set of XY coordinates based on be defining the array, are they still going to be the same? or is the array going to say from this X point and to this Y point I will plot this image based on these newly submitted coordinates. Hope that makes sense.
  21. this is correct so far right? <?php mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost", "winuser2003", "homer123", "pmapptest"); $tdata = ''; $res = $conn->query("SELECT userid, fname, lname, sign_x, sign_y FROM winuser_demo"); foreach ($res as $r) { $tdata .= "<tr><td>{$r['userid']}</td> <td>{$r['fname']}</td> <td>{$r['lname']}</td> <td>" . drawImage($r['sign_x'], $r['sign_y']) . "</td>\n"; } function drawImage($xcoords, $ycoords) { $xa = explode(',', $xcoords); // create array from $xcoord string $ya = explode(',', $ycoords); // create array from $ycoord string $w = max($xa)+10; $h = max($ya)+10; $path = "M $xa[0] $ya[0] "; unset($xa[0], $ya[0]); foreach ($xa as $i => $x) { $y = $ya[$i]; $path .= "L $x $y "; } $im = "<svg width='$w' height='$h' > <path d='$path' stroke='#000' fill='none'/> </svg>"; return $im; } ?>
  22. sorry about that, right now I am wishing I knew a hell of alot more about plotting this .... I changed the function back to your example.
  23. I got it to output, looks right... correct me if I am wrong anywhere, but am I going to have to count that thing up to a 1000? HAHA You did this in like a few seconds LOL --- in the earlier post with your signature screenshot. Did you on your end just redo it like this on your side to get that signature to show up? <?php mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost", "winuser2003", "homer123", "pmapptest"); $tdata = ''; $res = $conn->query("SELECT userid, fname, lname, sign_x, sign_y FROM winuser_demo"); foreach ($res as $r) { $tdata .= "<tr><td>{$r['userid']}</td> <td>{$r['fname']}</td> <td>{$r['lname']}</td> <td>" . drawImage($r['sign_x'], $r['sign_y']) . "</td>\n"; } function drawImage($xcoords, $ycoords) { $x = "1, 2, 3, 4, 5"; // comma separated string - Would I have to go to 1000 on this then? $arr = explode (', ', $x); $y = "1, 2, 3, 4, 5"; // comma separated string - Would I have to go to 1000 on this then? $arr = explode (', ', $y); echo '<pre>', print_r($arr, 1), '</pre>'; $w = max($xa)+10; $h = max($ya)+10; $path = "M $xa[0] $ya[0] "; unset($xa[0], $ya[0]); foreach ($xa as $i => $x) { $y = $ya[$i]; $path .= "L $x $y "; }
  24. so how would i make that an array from this existing code? because your image with the signature showing is exactly what I am looking for. <?php mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost", "winuser2003", "homer123", "pmapptest"); $tdata = ''; $res = $conn->query("SELECT userid, fname, lname, sign_x, sign_y FROM winuser_demo"); foreach ($res as $r) { $tdata .= "<tr><td>{$r['userid']}</td> <td>{$r['fname']}</td> <td>{$r['lname']}</td> <td>" . drawImage($r['sign_x'], $r['sign_y']) . "</td>\n"; } function drawImage($xcoords, $ycoords) { $xa = explode(',', $xcoords); $ya = explode(',', $ycoords); $w = max($xa)+10; $h = max($ya)+10; $path = "M $xa[0] $ya[0] "; unset($xa[0], $ya[0]); foreach ($xa as $i => $x) { $y = $ya[$i]; $path .= "L $x $y "; } $im = "<svg width='$w' height='$h' > <path d='$path' stroke='#000' fill='none'/> </svg>"; return $im; } ?> <!DOCTYPE html> <html> <head> <style type="text/css"> table { border-collapse: collapse; width: 60%; } th { background-color: black; color: white; padding: 8px; text-align: left; } td { padding: 4px 8px;; } </style> </head> <body> <table border="1" style="width: 60%;"> <tr><th>ID</th> <th>First name</th> <th>Last name</th> <th>Image</th> <tr> <?=$tdata?> </table> </body> </html>
×
×
  • 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.