/booka/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/booka/trunk

« back to all changes in this revision

Viewing changes to dbEditor.php

  • Committer: Gustav Hartvigsson
  • Date: 2010-02-23 13:09:24 UTC
  • Revision ID: gego@quad-20100223130924-d89fe0jlrugg9a6t
Lots of broken code that i have no idea how to fix.
it is the date checker that does not work. -_-...

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
        header('Location: ./BooKa.php');
10
10
        
11
11
}
12
 
 
 
12
$errorMsg = null; //ERRORMSG!
13
13
include "./inc/dbConnect.php";
14
14
 
15
15
//manipulation of DB
20
20
$newStartDate = $_POST[StartDate];
21
21
$newEndDate = $_POST[EndDate];
22
22
 
23
 
 
24
 
 
25
 
if( $newname != null && $newphone != null && $newmail != null && $newadress != null && $newStartDate != null && $newEndDate != null ){
 
23
$valid=true; //this will be true untill it is changed.
 
24
 
 
25
include "./inc/formif.php";
 
26
include "./inc/regex.php";
 
27
 
 
28
 
 
29
if( $valid ){
26
30
        
27
31
        $db->queryexec("BEGIN;
28
32
                INSERT INTO bookings(name, StartDate, EndDate, phone, mail, adress) VALUES('{$newname}', '{$newStartDate}', '{$newEndDate}', '{$newphone}', '{$newmail}', '{$newadress}');
31
35
}
32
36
//end of DB manipulation.
33
37
 
34
 
include "./inc/formif.php";
35
38
include "./inc/head.php";
36
39
?>
37
40
 
40
43
        <div class="menu2">
41
44
                 <h2> You are logedin <a href="logout.php"> [logout] </a><a href=BooKa.php> [Return] </a> </h2>
42
45
                 <hr />
 
46
                 <?php
 
47
                 if($errorMsg!=null){
 
48
                        echo "  <p>".$errorMsg."</p> <!-- this paragraph is created by the php script -->";
 
49
                 }
 
50
                 ?>
43
51
                 
44
52
                 <form action="dbEditor.php" method="post">
45
53
                        <div class="lefta">
56
64
                        <p><input type="submit" value="add" name="add" class="add" /></p>
57
65
                </form>
58
66
                 
 
67
                 
59
68
                <h2> current DB structure. </h2>
60
69
                 
61
 
                <table> <!-- muckup tabell -->
 
70
                <table> <!-- tabell -->
62
71
                        <tr> <!-- row one -->
63
72
                                <td> id </td>
64
73
                                <td> Name </td>
91
100
                                        </form>
92
101
                                </td>
93
102
                        </tr> <!-- end of row two and up -->
94
 
                        
95
103
                        <?
96
104
                        }
97
105
                        ?>