Jump to content

alexcmm

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

alexcmm's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm sorry if you feel I was out of line. I was just trying to be to the point and didn't mean to imply anything else. I guess I should have started with "thanks for all of you help up until now, but..." Please realize that this wasn't my first or even second thread that was dropped(ignored) after a certian point - before resolution. If I realized this is just how it is sometimes, I wouldn't have posted what I did. I am truly thankful for all of the help given up until this point. I'm sorry I wasn't able to take the information given, then find the solution on my own. Again, I never expected complete code to be written for me. That's not the case at all. In fact, in my last post (before todays post) I just wanted and example of one little snippet of code. I don't mind figuring things out. I enjoy the hell out of it when I actually make something work. I just needed more after looking around to see if I could make sense of it. I hope you can see that I've posted here quite a few times before and I've always been exceedingly polite. Anyway, I offer my apologies for my part in this. Ironically, this has sparked a lot of help for me, huh!! =) Thank you all for your time.
  2. See, there was nothing smart ass about my post. I was not sarcastic or rude. Just frustrated and telling you exactly what my issue was. You saying it was smart ass, just takes the wind out of your sails. I carefully considered before I posted this that it would piss people off. But I thought, if they knew they could help more with the same or less effort, maybe they would hear that. And if they don't... I'm not really getting what I need here anyway. My goal wasn't to upset... but to show you that I' m not being helped like I could be And there has never been a time that I have either found a piece of code or been given code, that I didn't disect it as much as I possibly could. I don't just take it, use and never look back. I want to understand this. But my last thread was simply dropped after a while. I'm sorry... I treid reading the PHP.net pages about that issue, as well as this one. I need to see it in action to understnd it best. That's how I learn. I know you're trying to teach people to fish here... but that method just hasn't been working for me lately. I need a little more. If you don't want to help me (Halofreek)... that's fine. Nothing I can do about it. But you're proviong my point that if I don't ask a question just the right way, or try to decipher partial answers, I'm going to be blown off by you... the knowledgable community. And it makes you look like elitists. But that can't be true, right? Why would you be here helping people like me. Just be thoughtful that people like me feel like they're being blown off instead of helped. If you don't care that I'm being made to feel that way... ok. Enough said. I won't count on you anymore for help. And maybe that's how you want it. (And I never assumed anyone got paid for thier help here. I do know that donations are requested to help pay for overhead, though.)
  3. At the risk of being kicked off of this forum, I have to say... I always seem to get about 40-50% help from this place on my issues. I'm am not very well versed in PHP and need help, that's why I'm here. Every answer I get seems to be rushed and only half the story. Then when I need more help I end up just being ignored. I seriously thought about donating money to this forum, but I'm waiting to have an issue actually get resolved. I had some things early on that were real easy that made it through to resolution, but even that was like pulling teeth. For example, I saw another persons post that asked how to sort by date. There were a few reply questions "gathering more info" that were just pointless. I mean this is so easy that I knew the answer, and I could have explained it in one reply. Probably because I know how the newbie mind works. It seems obvious to me that if someone is asking a simple question like that, they may need to see an example of what it looks like or some explaination of what some of the compontents mean. Anything else is going to seem cryptic to a newbie.... like myself. I'm guessing I'll have some "really nice" replies to this message, but I really feel like that needed to be said. If you all are really wanting to help, then do it all the way, and not just as much as you feel like before dropping it. If anybody is interested in helping me still, I would greatly appreciate it. I've already given my code. The reason was so someone could see how I need to work my issue into my existing code. If someone could look and help show me what my code SHOULD look like that would be great. Thanks, alexcmm
  4. Can you give me an example of what that looks like? Thanks!
  5. Hello, I was given this code that works great, which cuts off text after so many characters, and I can add a little "more..." link to see the whole thing. What I'd like to find is code that lets me limit how many lines show, but doesn't care about characters. This is the code I have already... would it be close to this? <? MYSQL_CONNECT(localhost, $username, $password) OR DIE("DB connection unavailable"); @mysql_select_db( "$database") or die( "Unable to select database"); $query="SELECT * FROM $table ORDER BY id DESC limit 1"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); $announ=mysql_result($result,$i,"announ"); $short = substr ($announ, 0 , 165); $count = strlen($short); $link = "... <i><a href='main_announ.php?id=$id' class=\"text_small\">[more...]</span></a></i>"; if($count < "165") { echo $short; } else { echo $short . $link; } $i++; } ?> Thanks for your help!
  6. Here's the javascript I use: <SCRIPT LANGUAGE="JavaScript"> <!-- Begin // Set up the image files to be used. var theImages = new Array() // do not change this // To add more image files, continue with the // pattern below, adding to the array. theImages[0] = '../images/pic1.jpg' theImages[1] = '../images/pic2.jpg' theImages[2] = '../images/pic3.jpg' theImages[3] = '../images/pic4.jpg' theImages[4] = '../images/pic5.jpg' // do not edit anything below this line var j = 0 var p = theImages.length; var preBuffer = new Array() for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = theImages[i] } var whichImage = Math.round(Math.random()*(p-1)); function showImage(){ document.write('<img src="'+theImages[whichImage]+'">'); } // End --> </script>
  7. Thanks obsidian... but I don't get it. You did simplify my code but it looks exactly the same in HTML. I'm not sure how to loop the $totals array, the alternating colors don't work, and it still has a total of 1 night when there are no dates chosen for a person. It's well over my head at the moment and when I get help that says something like, "now you just need to..." I'm new and lost I just want to give up. I need to see it to understand the logic. I have no idea of the syntax to get this to loop as you suggested. I'm not sure how else to ask, but to say, "can you spell it out for me?". If not, I understand... I've been a pain in your a$$ for days now. You have gotten me far. I really appreciate the help you've given and hope that you haven't run out of patience for me.
  8. Yes, thanks for sticking with me obsidian. *disclaimer* I know I probably have some extra stuff in there that's not needed. I'll go through and clean up after I have the hard stuff over with. Here goes: <table width="100%" border="1" cellspacing="1" cellpadding="1"> <tr height="30" bgcolor="#999999" class="smalldate"> <td align='left' valign='middle'>Last Name</td> <td align='left' valign='middle'>First Name</td> <td align='center' valign='middle'>Market Country</td> <td align='center' valign='middle'>Hotel</td> <td align='center' valign='middle'>Check-in</td> <td align='center' valign='middle'>Checkout</td> <td align='center' valign='middle'>May 1</td> <td align='center' valign='middle'>May 2</td> <td align='center' valign='middle'>May 3</td> <td align='center' valign='middle'>May 4</td> <td align='center' valign='middle'>May 5</td> <td align='center' valign='middle'>May 6</td> <td align='center' valign='middle'>May 7</td> <td align='center' valign='middle'>May 8</td> <td align='center' valign='middle'>May 9</td> <td align='center' valign='middle'>May 10</td> <td align='center' valign='middle'>May 11</td> <td align='center' valign='middle'>May 12</td> <td align='center' valign='middle'>May 13</td> <td align='center' valign='middle'>May 14</td> <td align='center' valign='middle'>Total Nights</td> </tr> <?php $id=$_GET['id']; include 'dbinfo.php'; MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable"); @mysql_select_db( "$database") or die( "Unable to select database"); $query="SELECT * FROM $usertable"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); $firstname=mysql_result($result,$i,"firstname"); $lastname=mysql_result($result,$i,"lastname"); $marketcountry=mysql_result($result,$i,"marketcountry"); $hotel=mysql_result($result,$i,"hotel"); $checkin=mysql_result($result,$i,"checkin"); $checkout=mysql_result($result,$i,"checkout"); $start = mysql_result($result,$i,"checkin"); $end = mysql_result($result,$i,"checkout"); list($stDay, $stMon, $stYear) = explode('-', $start); list($edDay, $edMon, $edYear) = explode('-', $end); $startTS = strtotime("$stYear-$stMon-$stDay"); $endTS = strtotime("$edYear-$edMon-$edDay"); $day = 60 * 60 * 24; $nights = array(); while ($startTS <= $endTS) { $nights[] = date('Y-m-d', $startTS); $startTS += $day; } $start = strtotime("May 1"); echo "<tr align='center' valign='middle' class='smalldate'><td align='left'>$lastname</td><td align='left'>$firstname</td><td>$marketcountry</td><td>$hotel</td><td>$checkin</td><td>$checkout</td>\n"; while ($start <= strtotime("May 14")) { echo "<td>"; echo " "; if (in_array(date('Y-m-d', $start), $nights)) { echo "<b>•</b>"; } echo "</td>\n"; $start += $day; } echo "<td>" . count($nights) . "</td>"; ++$i; } ?> </tr> </table> I guess while I'm at it, I'll tell you that I'd love to get the rows to alternate colors too. I have it for other pages, but there are no other arrays to contend with, so I'm not sure how to stick it in with this one... that existing code is: <?php $arr = get_defined_functions(); for($i = 0; $i < $numofrows; $i++) { $row = mysql_fetch_array($result); //get a row from our result set if($i % 2) { //this means if there is a remainder echo "<TR bgcolor=\"#F0EEEE\">\n"; } else { //if there isn't a remainder we will do the else echo "<TR bgcolor=\"white\">\n"; } echo "<td class=\"smalldate\"><a href=\"register.php?id=".$row['ID']."\">edit</a></font></td> <td class=\"smalldate\" class=\"tablebg\"><img src=\"images/spacer.gif\" width=\"0\" height=\"0\">".$row['lastname']."</td> <td class=\"smalldate\" class=\"tablebg\"><img src=\"images/spacer.gif\" width=\"0\" height=\"0\">".$row['firstname']."</td> <td class=\"smalldate\" class=\"tablebg\"><img src=\"images/spacer.gif\" width=\"0\" height=\"0\">".$row['marketcountry']."</td> <td class=\"smalldate\" class=\"tablebg\"><img src=\"images/spacer.gif\" width=\"0\" height=\"0\">".$row['arrivaldate']."</td>\n"; } ?>
  9. But if anyone can help, you can find my last question here: http://www.phpfreaks.com/forums/index.php/topic,131741.0.html Thanks!
  10. I have this working just like you said but have a few more questions about this. As it is now my html looks like this when the script is run: | Last Name | First Name | Country | Hotel | May 1 | May2 (etc...) | May 14 | Total Nights | | Roberts | Bob | USA | Hilton | • | • | | 2 | My first issue isn't that big of a deal... but if the person has no dates selected yet, but the total says 1, even though there are no bullets. Any ideas? Second issue: How can I show a total per day? eg. how many rooms are occupied per day? So it would look something like this: | Last Name | First Name | Country | Hotel | May 1 | May2 (etc...) | May 14 | Total Nights | | Roberts | Bob | USA | Hilton | • | • | | 2 | | Doe | Joh | USA | Hilton | • | • | • | 3 | ... ... | | | | | 45 | 64 | 23 | | I guess that's all I have for now. I will definitely make a phpfreaks donation after all of this!!
  11. Ohhhhhh, I see.... I was trying to replace your static July dates with some date variable pulled from the database... I realize now that I should have just replaced those with my own static dates that I'm actually dealing with. When I first tried replacing those july dates I replaced it with: $stYear-$stMon-$stDay & $edYear-$edMon-$edDay Now I replaced it with my real May dates and I see what you mean. Thanks Obsidian... I appreciate your help, and your hesitation to just hand it to me. (Although you pretty much did )
  12. Ok, so this is cool, but this code shows the day only if the person is staying in the hotel... I need it to show and empty cell for the days the person isn't there too. Would that look anything like this? if (in_array(date('Y-m-d', $start), $nights)) { echo "<br /><b>X</b>"; } else { echo "<br /><b>O</b>";
  13. This is great... you make it look so easy. Thanks!
  14. I'm not sure if I'm asking too much from the people on this forum. I feel bad for needing my hand held. If there's another place meant for beginners can someone share that with me? I understand what's happening in the code you gave if I can see it, and I even understand the logic behind the last part you mentioned, but can't put the code together. Even with the link you gave... that page is a mile long and I'm not really sure what I'm looking for. If anyone has any tolerance left for me, can you please show me what this would look like.
  15. Man, this is awesome! You guys blow me away. With that said, may I ask another question taking in one step further? (or maybe a different direction) How can I get it to show that a person is or isn't staying on a particular day? Like the crude table layout I gave earlier: Name 5 May 6 May 7 May 8 May Bob Roberts 1 1
×
×
  • 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.