PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 307,160 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,553 people online right now. Registration is fast and FREE... Join Now!




Online Information and Reservation for a Beauty Salon

 

Online Information and Reservation for a Beauty Salon

mikxxx

22 Feb, 2009 - 05:18 AM
Post #1

New D.I.C Head
*

Joined: 18 Nov, 2008
Posts: 31

I'm really having a hard time doing this thesis. sad.gif

Who knows how to make an admin side for this using PHP and MySQL?
I'm sorry, I'm really having difficulties. sad.gif



User is offlineProfile CardPM
+Quote Post


Core

RE: Online Information And Reservation For A Beauty Salon

22 Feb, 2009 - 08:24 AM
Post #2

The .NET Dude
Group Icon

Joined: 8 Dec, 2008
Posts: 3,043



Thanked: 217 times
Dream Kudos: 900
Expert In: C#, VB.NET, WPF, .NET Framework

My Contributions
Moved to PHP. smile.gif

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is online!Profile CardPM
+Quote Post

CTphpnwb

RE: Online Information And Reservation For A Beauty Salon

22 Feb, 2009 - 08:50 AM
Post #3

D.I.C Lover
Group Icon

Joined: 8 Aug, 2008
Posts: 2,101



Thanked: 155 times
Dream Kudos: 100
Expert In: PHP

My Contributions
mad.gif mad.gif mad.gif mad.gif mad.gif mad.gif mad.gif mad.gif
User is online!Profile CardPM
+Quote Post

musya

RE: Online Information And Reservation For A Beauty Salon

22 Feb, 2009 - 09:46 AM
Post #4

D.I.C Addict
Group Icon

Joined: 25 Apr, 2007
Posts: 726



Thanked: 8 times
Dream Kudos: 50
My Contributions
@CTphpnwb hehe

This post has been edited by musya: 22 Feb, 2009 - 09:46 AM
User is offlineProfile CardPM
+Quote Post

CTphpnwb

RE: Online Information And Reservation For A Beauty Salon

22 Feb, 2009 - 10:38 AM
Post #5

D.I.C Lover
Group Icon

Joined: 8 Aug, 2008
Posts: 2,101



Thanked: 155 times
Dream Kudos: 100
Expert In: PHP

My Contributions
In case anyone is confused, I can't see any reason this has been moved to php. If it belongs anywhere, it belongs here:
http://www.dreamincode.net/forums/showforum96.htm

User is online!Profile CardPM
+Quote Post

mikxxx

RE: Online Information And Reservation For A Beauty Salon

24 Feb, 2009 - 05:03 AM
Post #6

New D.I.C Head
*

Joined: 18 Nov, 2008
Posts: 31

@ core: thanks for being nice. smile.gif

I've got my reservation form just like this:

CODE
<?php
// Connects to your Database
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("artista_salon") or die(mysql_error());

//checks cookies to make sure they are logged in
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM salon WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{

//if the cookie has the wrong password, they are taken to the login page
if ($pass != $info['password'])
{ header("Location: about_us.php");
}

//otherwise they are shown the admin area
else
{ ?>
<!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" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Artista Salon - Angeles</title>
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iecss.css" />
<![endif]-->
</head>

<body>

<div id="main_content">
    
<!--Heading-->

    <div class="stars_head">

    </div>

    <div id="header">
        <a href="login.php"><img src="images/header02.gif" /></a>
    </div>

    <div id="area">
        <img src="images/angeles.gif" />
    </div>    
<!--End of Heading-->    

<!--Part of Menu-->

    <div id="top_menu">
                    <ul class="menu">
                        <li><a class="nav" href="login.php">home</a></li>
                        <li><a class="nav" href="services.php">services</a></li>
                        <li><a class="nav" href="promos.php">promos</a></li>
                        <li><a class="nav" href="reservation.php">reservation</a></li>
                        <li><a class="nav" href="gallery.php" >gallery</a></li>
                        <li><a class="nav" href="contact.php">contact</a></li>
                    </ul>
    </div>    
    
<!--End of Menu-->  

<!--Right Content-->

<div id="rightpart">
        <div id="right_part">
              <img src="images/right_part.png" />
        </div>
         <div class="reservationimg">&nbsp;</div>
</div>        

<!-----------end of log in ------------------>

<div id="body_content">

<!--    <div id="reservebox">-->
                   <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                    <table class="serv">
                    <tr>
                      <td>&nbsp;
                        <h5>Hi          
                            <?php
                            $con = mysql_connect("localhost","root","");
                            if (!$con)
                              {
                                  die('Could not connect: ' . mysql_error());
                              }
                            mysql_select_db("artista_salon", $con);
                            $result = mysql_query("SELECT * FROM salon WHERE username = '$username'" );
                                while($row = mysql_fetch_array($result))
                              {
                              echo "<b>".$row['fname'] ."</b>";
                              }
                            ?>!!</h5>
                      </td>
                  </tr>
                    <tr>
                    <td>
                            <label>What kind of services would you like to book?</label>
                    </td>
                  </tr>
                </table>

                <tr>
                    <table>
                        <tr>
                            <td>                
                                <td style="border: solid 1px; width:160px;">
                                    <center>Hair Services <hr /></center>
                                    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                                     <input class="serv_radio" type="checkbox" name="servicename" value="haircut"/> Haircut
                                        <br />        
                                        <input class="serv_radio" type="checkbox" name="servicename" value="shampoo"/> Shampoo w/ Blowdry
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_iron"/> Hair Iron
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hot_oil"/> Hot Oil
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_mask"/> Hair Mask
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_detox"/> Hair Detox
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="salon_specialist"/> Salon Specialist
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="keratin"/> Keratin Treatment
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="aromatherapy"/> Aroma Therapy
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="cellophane"/> Cellophane
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="semicellophane"/> Semi Cellophane
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_reborn"/> Hair Reborn
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_color"/> Hair Color
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_relax"/> Hair Relax
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_rebond"/> Hair Rebond
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_extension"/> Hair Extension    
                                     <br /><br />                    
                                </td>    
                    
                                <td style="border: solid 1px; width:200px;">
                                    <center>Facial Treatment <hr /></center>                                  <input class="serv_radio" type="checkbox" name="servicename" value="facial"/> Facial (w/ hi-tech machine)
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="hair_makeup"/> Hair and Make up
                                        <br />                                                                
                                        <br />
                                    <center>Body Care <hr /></center>                            
                                     <input class="serv_radio" type="checkbox" name="servicename" value="swedish_aroma"/> Swedish Aromatherapy
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="swedish_shiatsu"/> Swedish-Shiatsu Combination
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="royalethaibody"/> Royale Thai Body Massage
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="balinesemass"/> Balinese Massage
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="bentosatherapy"/> Bentosa Therapy
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename"  value="bodyscrub"/> Body Scrub
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="bodybleach"/> Body Bleach
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="footmass"/> Foot Massage
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="handmass"/> Hand Massage
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="royalethaifoot"/> Royale Thai Foot Spa
                                        <br />        
                                   </td>    
                                <td style="border: solid 1px; width:160px;">
                                    <center>Hand & Foot<hr /></center>                            
                                     <input class="serv_radio" type="checkbox" name="servicename" value="manicure"/> Manicure
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="pedicure"/> Pedicure
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename" value="handspa"/> Hand Spa
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="footspa"/> Foot Spa
                                        <br />        
                                     <input class="serv_radio" type="checkbox" name="servicename" value="handparraffin"/> Hand Parraffin
                                        <br />                                  
                                     <input class="serv_radio" type="checkbox" name="servicename"  value="footparraffin"/> Foot Parraffin
                                         <br />
                                     <input class="serv_radio" type="checkbox" name="servicename" value="nailart"/> Nail Art
                                        <br />        
                                   </td>                                    
  
                        </td>                
                    </tr>                
                </table>                                    
             </tr>

            <br />

           <table class="serv">
                <tr>
                    <td>
                               <label>Preferred Date &nbsp;</label>
                                <select  name="month">
                                <option value="01">Jan </option>
                                <option value="02">Feb </option>
                                 <option value="03">Mar </option>
                                <option value="04">Apr </option>
                                <option value="05">May </option>
                                <option value="06">Jun </option>
                                <option value="07">Jul </option>
                                <option value="08">Aug </option>
                                <option value="09">Sep </option>
                                <option value="10">Oct </option>
                                <option value="11">Nov </option>
                                <option value="12">Dec </option>          
                            </select>

                               <select name="day" >
                                     <script language = "javascript">
                                     <!--
                                        for(var i=1;i<=31;++i)
                                            document.write("<option value = "+ i + ">"+ i + "</option>");    
                                        //-->
                                  </script>
                              </select>
    
        
                           <select  name="year">
                                  <script language = "javascript">
                                     <!--
                                         for(var i=2008;i<=2010;++i)
                                            document.write("<option value = "+ i + ">"+ i + "</option>");
                                    //-->
                                  </script>
                           </select>
                   </td>
                  </tr>

                <tr>
                    <table>
                        <tr>
                            <td>
                              <td>                        
                           <label>Preferred Time</label> <br />  

                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;9:00am <br />
                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;10:00am <br />
                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;11:00am <br />
                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;12:00nn <br />
                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;1:00pm <br />                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;2:00pm <br />                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;3:00pm <br />                                                                        </td>
                             <td>
                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;4:00pm <br />
                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;5:00pm <br />                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;6:00pm <br />                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;7:00pm <br />                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;8:00pm <br />                           <input class="checkbox_time" type="checkbox" name="time" size="40px" />&nbsp;&nbsp;&nbsp;9:00pm <br />
                  
                             </td>                          
                           </td>
                     </tr>
                 </table>
               </tr>
               <tr>
                   <td>
                  
                           <input class="sub" type="reset" value="Reset" name="reset" />
                                              
                           <input class="sub" type="submit" value="Submit" name="submit">
                   </td>
               </tr>
        </table>
        
        <div id="addmsg_box">
            <div class="addmsg_inbox">

                <table class="addmsg">
                    <tr class="addmsg">
                        <td class="addmsg">
                            Contact
                        </td>
                    </tr>
                       <tr class="addmsg">
                        <td class="addmsg">
                            <input class="contact_in" type="text" size="20px" border="1px" name="name" value="phone number" />
                        </td>
                    </tr>
                       <tr class="addmsg">
                        <td class="addmsg">
                            <input class="contact_in" type="text" name="text" value="email" />
                        </td>
                    </tr>                      
                    <tr class="addmsg">
                        <td class="addmsg">
                            Additional Message
                        </td>
                    </tr>
                       <tr class="addmsg">
                        <td class="addmsg">
                            <textarea name="comment" wrap="physical" ></textarea>
                        </td>
                    </tr>                                                          
                 </table>
            </form>


            </div>
            
        </div>  

    <div id="reserve_footer">
            <marquee behavior="scroll" direction="left">ARTISTA SALON - ANGELES</marquee>
    </div>
    
    <div class="footerlinks">
        <a class="footlinks" href="member.php">about us</a>
         ||
          <a class="footlinks" href="services.php">services</a>
         ||
         <a class="footlinks" href="promos.php">promos</a>
         ||
         <a class
User is offlineProfile CardPM
+Quote Post

mikxxx

RE: Online Information And Reservation For A Beauty Salon

24 Feb, 2009 - 05:09 AM
Post #7

New D.I.C Head
*

Joined: 18 Nov, 2008
Posts: 31

So sorry for putting all the codes here. crazy.gif

Thanks in advance smile.gif

I haven't made my database table for that one, I'm confused on how I can connect other fields from other table to the table that is specified for the reservation.

e.g.

i've got a table for reservation, and another one is for the services.

the question is, how can i put the serviceid on the reservation table? i'm really confused with those things.

and also the admin page, i have made the adding and viewing for the services, but editing/updating and deleting is so difficult for me.
i still have a lot of problems in my admin page, i still have to do the reservation, which is the main program, and for the users to be added and deleted..

oh well, i still have lots of things to do.. sad.gif
i'm really trying my best to do it, but i still need some help..

User is offlineProfile CardPM
+Quote Post

Moonbat

RE: Online Information And Reservation For A Beauty Salon

24 Feb, 2009 - 08:14 AM
Post #8

D.I.C Regular
Group Icon

Joined: 30 Jun, 2008
Posts: 423



Thanked: 24 times
Dream Kudos: 600
My Contributions
You should read up a little more on SQL to learn how to do more with your database. The SQL UPDATE statement is used to edit existing data in a database. The DELETE statement is for deleting records.

As far as putting data from one table to another, that is a database structure problem. You'll need to have a ServiceID field in the Reservation table to hold the ServiceID data from the Services table. In a database-driven application like a reservation system, you should make sure to add in all necessary fields to your table(s). With PHP, working between multiple tables is easy, as long as your tables are set up correctly. If you need more help on using MySQL with PHP, you should read W3School's PHP/MySQL Tutorials.

EDIT: On a side note, I don't think storing the administrator's password in your cookie is a good idea. It's a really bad idea actually, even if the password is hashed. I'd suggest looking into Session Handling in PHP for a more secure method of authenticating your administrator.

This post has been edited by Moonbat: 24 Feb, 2009 - 08:20 AM
User is online!Profile CardPM
+Quote Post

sl4ck3r

RE: Online Information And Reservation For A Beauty Salon

24 Feb, 2009 - 08:42 AM
Post #9

D.I.C Regular
Group Icon

Joined: 22 Sep, 2007
Posts: 261



Thanked: 6 times
Dream Kudos: 25
My Contributions
You can use a join or natural join to combine tables with like columns. I agree, don't store the password on the users box. Bad practice.

This post has been edited by sl4ck3r: 24 Feb, 2009 - 08:42 AM
User is offlineProfile CardPM
+Quote Post

mikxxx

RE: Online Information And Reservation For A Beauty Salon

24 Feb, 2009 - 10:23 PM
Post #10

New D.I.C Head
*

Joined: 18 Nov, 2008
Posts: 31

@ Moonbat:
I'm quite familiar with the update and delete,
the problem is.. I'm not good at using conditions.
Like,
if I'm going to delete just one record inside this table that contains many records, how will I be able to do that?
Or update it?

E.G.


id name
0001 bongbong modify delete
0002 winwin modify delete
0003 kimkim modify delete
0004 dasgda modify delete

there, how will i be able to modify/delete the each records ?
I've only made my adding and viewing of records.




@ sl4ck3r:
thanks. i'll keep that in mind.
so if i'm going to put on a serviceid on my service table,
will i still have to make another serviceid on my reservation table then?

User is offlineProfile CardPM
+Quote Post

JackOfAllTrades

RE: Online Information And Reservation For A Beauty Salon

25 Feb, 2009 - 04:57 AM
Post #11

I exist to Google your problems.
Group Icon

Joined: 23 Aug, 2008
Posts: 5,324



Thanked: 454 times
Dream Kudos: 50
Expert In: Being annoyed with lazy people.

My Contributions
How does one get to the stage of a "thesis" in computer programming and be "not good at conditions"?
User is offlineProfile CardPM
+Quote Post

Moonbat

RE: Online Information And Reservation For A Beauty Salon

25 Feb, 2009 - 07:51 AM
Post #12

D.I.C Regular
Group Icon

Joined: 30 Jun, 2008
Posts: 423



Thanked: 24 times
Dream Kudos: 600
My Contributions
You would use the WHERE clause in SQL to delete or update a row based on a condition (or multiple conditions).

If you already know how to make pages to add and view records, you should already know how to make a page to update and delete records. All you're really doing is using different SQL statements. The idea is the same.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 05:57PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month