<?php
  require_once("../../../wp-load.php");
  global $wpdb;
  $PGPath=plugins_url()."/clickbar/";
  
  $ClickBarName=$_POST['ClickBarName'];
  $CountDownDate=$_POST['CountDownDate'];
  $LinkText=$_POST['LinkText'];
  $BarText=$_POST['BarText'];
  $ButtonText=$_POST['ButtonText'];
  $BarColor=$_POST['BarColor'];
  $BarTexture=$_POST['BarTexture'];
  $RedirectURL=$_POST['RedirectURL'];
  $Position=$_POST['Position'];
  $EndText=$_POST['EndText'];
  $CountDownTime=$_POST['CountDownTime'];
  $BarTextColor=$_POST['BarTextColor'];
  
  $v=$_POST['v'];
  
  $table_name = $wpdb->prefix . "clickbar";
  
  $sql=" UPDATE $table_name SET ClickBarName='$ClickBarName' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET CountDownDate='$CountDownDate' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET LinkText='$LinkText' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET BarText='$BarText' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET ButtonText='$ButtonText' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET BarColor='$BarColor' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET BarTexture='$BarTexture' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET RedirectURL='$RedirectURL' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET Position='$Position' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET EndText='$EndText' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET CountDownTime='$CountDownTime' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  $sql=" UPDATE $table_name SET BarTextColor='$BarTextColor' WHERE C_ID='$v' ";
  $re=$wpdb->query($sql);
  
  
  header('location: '.admin_url().'admin.php?page=clickbar&p=d');
?>
