<?php include "xtemplate.class.php"; include "model.php"; $a = new sanpham(); $p = $a->ngay(); print_r($p);
} $content = $k->text("main"); break; case 'hd': if (isset($_GET['save']) != true) { $hd = new XTemplate("hoadon.php"); $hd->parse("main"); $content = $hd->text("main"); } else { $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $cmt = $_POST['cmtnd']; $address = $_POST['address']; $p = $a->xl(); $date = $a->ngay(); $query = "INSERT INTO hoadon VALUES ('','{$name}','{$email}','{$phone}','{$cmt}','{$address}','','{$p}','','{$date}')"; mysql_query($query) or die(mysql_error()); $ht = new XTemplate("ht.php"); $ht->parse("main"); $content = $ht->text("main"); } break; case 'xoa': $query = "SELECT * FROM sanpham"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { if (isset($_SESSION[".{$row['id']}."]) == true) { unset($_SESSION[".{$row['id']}."]); } }
<?php include "model.php"; $a = new sanpham(); $d = $a->ngay(); $c = 24 / 12 / 2014; if ($c < $d) { echo $d; }