<?php
include 'include/db.php';
include 'include/connect.php';
$id = $_POST['id'];
$todays = date("Y-m-d");

if(!empty($id)){

                $data['hot_pro'] = $_POST['hot_pro'];
                $data['hot_img'] = $_POST['blog_img'];
                $data['hot_date'] = $todays;
                $data['hot_status'] = $_POST['status'];
                
		$rs = $db->update('tbpromotionhot',$data,'hot_id',$id);
           if($rs){
            echo "0";
           } else {
            echo "00";
           }

     } else {

           
      $rs = $db->insert('tbpromotionhot',array(
       'hot_pro' => $_POST['hot_pro'],
       'hot_img' => $_POST['blog_img'],
       'hot_status' => $_POST['status'],
       'hot_date' => $todays
            ));

           if($rs){
            echo "2";
           } else {
            echo "0";
           }
}
?>

