Exemple #1
0
 function action()
 {
     parent::action();
     if (isset($_GET['ajax_save_promo']) and $_GET['ajax_save_promo'] == 1) {
         $arr = Tools::getValuesForTable('promo_text', $_POST);
         //zisti ci existuje
         $id_file = dibi::fetchSingle("SELECT id_file FROM [promo_text] WHERE id_file = %i", $_POST['id_file']);
         //
         //			$arr = array(
         //				'title'=>$_POST['title'],
         //				'alt'=>$_POST['alt'],
         //				'link'=>$_POST['link'],
         //				'link_name'=>$_POST['link_name'],
         //			);
         if ($id_file) {
             dibi::query("UPDATE promo_text SET ", $arr, "WHERE id_file = %i", $id_file);
         } else {
             $arr['id_file'] = $_POST['id_file'];
             dibi::query("INSERT INTO promo_text ", $arr);
         }
         exit;
     }
 }