Created
July 20, 2015 12:14
-
-
Save anonymous/07bdea8b4a17a70c0a23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function insert_booking_date_match(Array $date = null,$rule_id) | |
{ | |
$sql = "-- insert_booking_date_match | |
BEGIN; | |
DELETE FROM | |
rule_booking_date_match | |
WHERE | |
rule_id = ".$rule_id." | |
; | |
"; | |
if( $date != null ) | |
{ | |
$sql .= " | |
INSERT INTO | |
rule_booking_date_match(rule_id,date_from,date_to) | |
VALUES( | |
".$rule_id." | |
, | |
'".date('Y-m-d',$date['from'])."' | |
, | |
'".date('Y-m-d',$date['to'])."' | |
);"; | |
} | |
$sql .= "COMMIT;"; | |
$result = $this->db->query($sql); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment