Jump to content

Russia

Members
  • Posts

    419
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Russia's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hey guys I have a small issue, i have an upload that resizes the image into thumbnail by max width and ratios the width based on that. Here is my code $width = 100; //*** Set a Fix Width & Height (Auto caculate) ***// $size = GetimageSize($images); $height = round($width * $size[1] / $size[0]); $images_orig = imagecreatefromjpeg($images); $photoX = ImagesX($images_orig); $photoY = ImagesY($images_orig); $images_fin = ImageCreateTrueColor($width, $height); ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width + 1, $height + 1, $photoX, $photoY); ImageJPEG($images_fin, $new_images); What I am wanting to do is instead upload the image with a max height and ratio the width proportionally. What variables do I have to reverse?
  2. I am working on an uploader and slowly getting it working, I am uploading 3 images at once, and setting arrays for each one as keys, with an increment of ++1. I am wanting to resize the image before it gets copied to the thumbnail folder. I have this code. <?php if (isset($_POST['addpart'])) { $image = $_FILES['images']['tmp_name']; $name = $_POST['username']; $i = 0; foreach ($image as $key) { $fileData = pathinfo(basename($_FILES["images"]["name"][$i])); $fileName[] = $name . '_' . uniqid() . '.' . $fileData['extension']; move_uploaded_file($key, "image/" . end($fileName)); //get uploaded file info before we proceed with resize $image_name = $_FILES['images']['name'][$i]; //file name $image_size = $_FILES['images']['size'][$i]; //file size $image_temp = $_FILES['images']['tmp_name'][$i]; //file temp $image_size_info = getimagesize($image_temp); //gets image size info from valid image file copy("image/" . end($fileName), "image_thumbnail/" . end($fileName)); $i++; } echo 'Uploaded<br>'; echo 'Main Image - ' . $fileName[0] . '<br>'; echo 'Extra Image 1 - ' . $fileName[1] . '<br>'; echo 'Extra Image 2 - ' . $fileName[2] . '<br>'; echo '<hr>'; } ?> Everything works with it. As you see, I started on getting the file info, but after that I am totally stuck on what to do after to resize the image proportionally with a maximum width of xPX and height to match it without looking distorted. Any help would be really appreciated. Thank You.
  3. every ethernet/wifi card a computer or phone has is assigned a different physical address, i think it grabs data off of that.
  4. hey guys thanks for the upcoming support how do I set the blue to fill up the remaining width of the while maininfo div? I tried setting the width:auto <div class="maininfo"> <div class="large">2</div> <div class="smallblock"> <div class="smalltop">3</div> <div class="small">4</div> </div> <div class="smallblock"> <div class="smalltop">5</div> <div class="small">6</div> </div> </div> .maininfo { width: 600px; } .large { float: left; height: 95px; background-color: blue; width:auto; } .smallblock { float: right; height: 90px; margin: 0 0 0 5px; width: 20%; } .small { background-color: red; height: 50%; width: 100%; } .smalltop { background-color: red; height: 50%; width: 100%; margin-bottom:5px; } Edit fiddle - JSFiddle
  5. Hey guys, I am working on something and keep getting some padding on my css navabar, its pretty simple but I cant figure out where it grabbing the padding from pushing it about 5 pixels to the right. jsfiddle live preview is a demo and here is a picture of the hover over. Notice the little gray space in between the hovered over Update Profile? I cant seem to find the code anywhere that would cause that. Anyone notice anything in my code? <head> <title>2 Column CSS Layout</title> <style type="text/css"> body { margin: 20px; font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; background-color: #555; } #nav { text-align:center; } /* Begin Navigation Bar Styling */ #nav ul { text-align: center; font-size: 11px; width: 100%; margin: 0; padding: 0; display:inline-block; padding: 0; list-style: none; background-color: #f2f2f2; border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; } #nav li { display:inline-block; } #nav li a { display: block; padding: 8px 15px; text-decoration: none; font-weight: bold; color: #069; border-right: 1px solid #ccc; } #nav li a:hover { color: #c00; background-color: #fff; } /* End navigation bar styling. */ div { text-align:center; } div#page { background-color: white; margin: 0 auto; text-align: left; width: 755px; padding:0px 10px 0 10px; } div#header { border-bottom:1px solid black; height: 30px; line-height: 30px; } div#content { background: none repeat scroll 0 0 none; border:0px solid blue; width:100%; line-height: 500px; min-height:500px; _height:500px } div#footer { border:0px solid red; height:30px; line-height: 30px; border-top:1px solid black; font-size: 9pt; } </style> <body> <div id="page"> <div id="header"> <div style="float: left;">Welcome Admin</div> <div style="float: right;">LOGOUT</div> <div id="nav"> <ul id="nav"> <li><a href="#">Home Page</a></li> <li><a href="#">My Account</a></li> <li><a href="#">Update Profile</a></li> <li><a href="#">Change Avatar</a></li> <li><a href="#">Change Password</a></li> <li><a href="#">Support</a></li> </ul> </div> </div> <div id="content">Content</div> <div id="footer"><div style="float: right;">copyright 2014</div></div> </div> </body>
  6. I thought about that, but I would have to figure out the exact pixels to keep on each side, is there way to set it as like 50% of 960?
  7. Hey guys, I am having trouble centering a navbar with css on my template. Here is a jsfiddle live preview for you. http://jsfiddle.net/LRS38/ I added text-align:center; to it but it still wont center. I also added a margin:0 auto; but no luck. Can anyone see what I am doing wrong? <div id="navigation"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li class="current"><a href="#">Services</a></li> <li><a href="#">Contact us</a></li> </ul> </div> and #navigation { text-align:center; background-color:#ef6b51; overflow:hidden; }
  8. Hey guys I have a table with a date selector that I am trying to add a current date option UNLESS there are rows already present with that date. Here is how it looks: Today is the 25th yet it shows the date for the 20th since there are rows present with the 07/20/2013 date in it. How would I do it so it shows the current date? <div class="lookup"> <form action="index.php" method="get"> <select name="exam_date" ONCHANGE="location = this.options[this.selectedIndex].value;" id="type" class="neutral"> <?php $sql_gdate = "SELECT distinct pat_date from patients ORDER BY pat_date DESC"; $result_gdate = mysql_query($sql_gdate); while($row_gdate= mysql_fetch_assoc($result_gdate)){ echo '<option value="?exam_date=' . $row_gdate['pat_date'] . '"'; IF ($exam_date == $row_gdate['pat_date']) { echo 'selected="selected"'; } else { echo ''; } echo '>' . $row_gdate['pat_date'] . '</option>'; } ?> </select> </form> </div>
  9. I appreciate the help, I have added the code to this query but it throws off errors: $result = mysql_query(' SELECT pat_id AS `ID`, concat(pat_lname, ', ', pat_fname) as `Full Name`, pat_date as `IME Date`, office_name as `Location`, ins_name as `Insurance Company`, pat_show as `Show(Y/N)` FROM patients INNER JOIN offices ON office_id = pat_loc INNER JOIN insurance ON ins_id = pat_ins ');
  10. Hey guys, how would I combine 2 columns into one specifically the first and last name? so its wellens, brian in one box. Like this: Right now I have it as: This is the code I am using <?php include_once "config.php"; $result = mysql_query(' SELECT pat_id AS `ID`, pat_lname as `Last Name`, pat_fname as `First Name`, pat_date as `IME Date`, office_name as `Location`, ins_name as `Insurance Company`, pat_show as `Show(Y/N)` FROM patients INNER JOIN offices ON office_id = pat_loc INNER JOIN insurance ON ins_id = pat_ins '); $csv_output = ''; $headersPrinted = false; while ($patient = mysql_fetch_assoc($result)) { if (!$headersPrinted) { $csv_output .= implode(',', array_keys($patient))."\n"; $headersPrinted = true; } $csv_output .= implode(',', array_values($patient))."\n"; } $filename = $file . "_" . date("d-m-Y_H-i", time()); header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header("Content-disposition: filename=" . $filename . ".csv"); print $csv_output; exit; ?> except do not know how to combine 2 parts into one, the line 8 and line 9
  11. I made this query so it combines 2 tables into one so It can get the name of the office and insurance company instead of the number variable it is but its not working. $values = mysql_query("SELECT pat_id,pat_lname,pat_fname,pat_date,pat_loc,pat_ins,pat_show FROM patients INNER JOIN offices ON office_id = pat_loc INNER JOIN insurance ON ins_id = pat_ins "); How the offices database looks like: How it looks when exporting: I am trying to get it to show the name Hackensack instead of a 2 for the location in pat_loc when it exports. How can I get that to work? Here is the whole statement: $values = mysql_query("SELECT pat_id,pat_lname,pat_fname,pat_date,pat_loc,pat_ins,pat_show FROM patients INNER JOIN offices ON office_id = pat_loc INNER JOIN insurance ON ins_id = pat_ins "); while ($rowr = mysql_fetch_row($values)) { for ($j = 0; $j < $i; $j++) { $csv_output .= $rowr[$j] . ", "; } $csv_output .= "\n"; }
  12. Thanks for that code, but how do I join 2 tables to set a value of another table for a number of patients?
  13. I managed to fix that too by changing it into $values = mysql_query("SELECT pat_id,pat_lname,pat_fname,pat_date,pat_loc,pat_ins,pat_show FROM " . $table . ""); but one last thing I am stuck on is making it so it shows the name of the number in the offices table that is stored as a number in the patients table as pat_ins and pat_loc I did: $values = mysql_query("SELECT pat_id,pat_lname,pat_fname,pat_date,pat_loc,pat_ins,pat_show FROM patients INNER JOIN offices ON office_id = pat_loc INNER JOIN insurance ON ins_id = pat_ins "); Could someone show me the problem? Here is how the offices table looks like
  14. I managed to figure out that part: $result = mysql_query("SHOW COLUMNS FROM " . $table . ""); $i = 0; if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { //$csv_output .= $row['Field'] . ","; $csv_output = "IME Date, Location, patientLast, Firstname, IMEcompany, Show Y/N, Billed"; $i++; } } Now how do I rearange around the second part where it lists the rows, I would like the column Last Name to come before First Name and Location to come after IME Date. This is the part that gets the rows: $csv_output .= "\n"; $values = mysql_query("SELECT * FROM " . $table . ""); while ($rowr = mysql_fetch_row($values)) { for ($j = 0; $j < $i; $j++) { $csv_output .= $rowr[$j] . ", "; } $csv_output .= "\n"; } Can I change $rowr[$j] to instead look like $rowr['pat_name'] and list in order the way I want the rows to look like. Where would I put the
  15. Hey guys I am trying to export a csv in my script and it works perfectly. Now what I need to do, is rename the columns to clean names and proper names before fully exporting the csv. Here is a picture of the database table: Here is the code: <?php include_once "config.php"; $table = 'patients'; // table you want to export $file = 'export'; // csv name. $result = mysql_query("SHOW COLUMNS FROM " . $table . ""); $i = 0; if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $csv_output .= $row['Field'] . ","; $i++; } } $csv_output .= "\n"; $values = mysql_query("SELECT * FROM " . $table . ""); while ($rowr = mysql_fetch_row($values)) { for ($j = 0; $j < $i; $j++) { $csv_output .= $rowr[$j] . ", "; } $csv_output .= "\n"; } $filename = $file . "_" . date("d-m-Y_H-i", time()); header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header("Content-disposition: filename=" . $filename . ".csv"); print $csv_output; exit; ?> As you can see it fetches the table names from this code: $result = mysql_query("SHOW COLUMNS FROM " . $table . ""); $i = 0; if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $csv_output .= $row['Field'] . ","; $i++; } } Now what I am trying to do is allow it to rename the database tables from pat_id to Patient ID pat_fname to Patient First Name pat_lname to Patient Last name and so on. To make it looks neat and readable in the csv file. How am I able to do that? I already tried a few codes like: $query = 'SHOW COLUMNS pat_id AS "user_id", pat_fname AS "first name", pat_lname AS "last name" FROM ' . $table;But it didnt work and gives off errors. Could someone with some knowledge help me out please.
×
×
  • 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.