/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 inc/regex.php

  • Committer: Gustav Hartvigsson
  • Date: 2010-06-08 16:15:18 UTC
  • Revision ID: gego@quad-20100608161518-ix45g5v10atg9srl
fixxed some strange behavior where reloding the dbEditor.php caused it to commit the same data again te the db.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
                
9
9
                $EndDateunset = 'style="background-color: yellow;" ';
10
10
                
11
 
                $errorMsg= $errorMSG."the end date string must be YYYY-MM-DD .";
12
 
                $valid=false;
 
11
                $errorMsg = $errorMSG."the end date string must be YYYY-MM-DD .<br />";
 
12
                $valid = false;
13
13
        }
14
14
        
15
15
        if(! preg_match('/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/', $_POST[StartDate])){
16
16
                
17
17
                $StartDateunset = 'style="background-color: yellow;" ';
18
18
                
19
 
                $errorMsg= $errorMSG."the start date string must be YYYY-MM-DD .";
20
 
                $valid=false;
 
19
                $errorMsg = $errorMsg."the start date string must be YYYY-MM-DD .<br />";
 
20
                $valid = false;
21
21
        }
22
22
        //end of check if dates are valid
23
23
        //TODO: need more teisting.
24
24
        if($_POST[StartDate] > $_POST[EndDate]){
25
25
                
26
 
                $errorMsg= $errorMSG."End date is smaller then startdate .";
27
 
                $valid=false;
 
26
                $errorMsg = $errorMsg."End date is smaller then startdate .";
 
27
                $valid = false;
28
28
        }
29
29
        //TODO: Add check for if dates are in DB.
30
30