prefix."ppcdelocation"; if (isset( $_POST['fee_added'] ) && wp_verify_nonce($_POST['fee_added'],'addfee') ) { $wpdb->query($wpdb->prepare("INSERT INTO $table_name(address,nightr,weekr,monthr,start1,end1,night1,week1,month1,start2,end2,night2,week2,month2,start3,end3,night3,week3,month3,saltax,toutax,othertax,poolheatd,poolheatw,poolheatm,parkf,parkrate,othf,othrate,wifif,wifirate,clnf,clndys,discount,disrate,damgp,curr) VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)",array($address,$nightsr,$weeksr,$monsr,$dates1,$datee1,$nights1,$weeks1,$mons1,$dates2,$datee2,$nights2,$weeks2,$mons2,$dates3,$datee3,$nights3,$weeks3,$mons3,$saltax,$toutax,$othtax,$poolheatd,$poolheatw,$poolheatm,$parkfee,$park,$otherfee,$othr,$wififee,$wef,$cleanfee,$clndays,$discount,$disper,$dampro,$curr))); } } if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['updatefee']) ) { $id=sanitize_text_field($_POST['addressrecord']); $nightsr=sanitize_text_field($_POST['nightsr']); $nightsr=filter_var($nightsr, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $weeksr=sanitize_text_field($_POST['weeksr']); $weeksr=filter_var($weeksr, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $monsr=sanitize_text_field($_POST['monsr']); $monsr=filter_var($monsr, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $dates1=sanitize_text_field($_POST['dates1']); $datee1=sanitize_text_field($_POST['datee1']); $nights1=sanitize_text_field($_POST['nights1']); $nights1=filter_var($nights1, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $weeks1=sanitize_text_field($_POST['weeks1']); $weeks1=filter_var($weeks1, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $mons1=sanitize_text_field($_POST['mons1']); $mons1=filter_var($mons1, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $dates2=sanitize_text_field($_POST['dates2']); $datee2=sanitize_text_field($_POST['datee2']); $nights2=sanitize_text_field($_POST['nights2']); $nights2=filter_var($nights2, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $weeks2=sanitize_text_field($_POST['weeks2']); $weeks2=filter_var($weeks2, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $mons2=sanitize_text_field($_POST['mons2']); $mons2=filter_var($mons2, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $dates3=sanitize_text_field($_POST['dates3']); $datee3=sanitize_text_field($_POST['datee3']); $nights3=sanitize_text_field($_POST['nights3']); $nights3=filter_var($nights3, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $weeks3=sanitize_text_field($_POST['weeks3']); $weeks3=filter_var($weeks3, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $mons3=sanitize_text_field($_POST['mons3']); $mons3=filter_var($mons3, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $saltax=sanitize_text_field($_POST['saltax']); $saltax=filter_var($saltax, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $toutax=sanitize_text_field($_POST['toutax']); $toutax=filter_var($toutax, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $othtax=sanitize_text_field($_POST['othtax']); $othtax=filter_var($othtax, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); if($othtax==""){$othtax=0;} $poolheatd=sanitize_text_field($_POST['poolheatd']); $poolheatd=filter_var($poolheatd, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); //if($poolheatd==""){$poolheatd=0;} $poolheatw=sanitize_text_field($_POST['poolheatw']); $poolheatw=filter_var($poolheatw, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); //if($poolheatw==""){$poolheatw=0;} $poolheatm=sanitize_text_field($_POST['poolheatm']); $poolheatm=filter_var($poolheatm, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); //if($poolheatm==""){$poolheatm=0;} $parkfee=sanitize_text_field($_POST['parkfee']); $parkfee=filter_var($parkfee, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $park=sanitize_text_field($_POST['park']); if($parkfee==""){$parkfee=0;} $otherfee=sanitize_text_field($_POST['otherfee']); $otherfee=filter_var($otherfee, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); if($otherfee==""){$otherfee=0;} $othr=sanitize_text_field($_POST['othr']); $wififee=sanitize_text_field($_POST['wififee']); $wififee=filter_var($wififee, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); $wef=sanitize_text_field($_POST['we']); if($wififee==""){$wififee=0;} $cleanfee=sanitize_text_field($_POST['clnfee']); $cleanfee=filter_var($cleanfee, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); if($cleanfee==""){$cleanfee=0;} $clndays=sanitize_text_field($_POST['clndays']); $clndays=filter_var($clndays, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); //if($clndays==""){$clndays=0;} $discount=sanitize_text_field($_POST['discount']); $discount=filter_var($discount, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); if($discount==""){$discount=0;} $disper=sanitize_text_field($_POST['dis']); $dampro=sanitize_text_field($_POST['dmpr']); $dampro=filter_var($dampro, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); if($dampro==""){$dampro=0;} $curr=sanitize_text_field($_POST['currency']); $table_name = $wpdb->prefix."ppcdelocation"; if (isset( $_POST['fee_update'] ) && wp_verify_nonce($_POST['fee_update'],'updatefee') ) { $wpdb->query($wpdb->prepare("UPDATE $table_name SET nightr=%s,weekr=%s,monthr=%s,start1=%s,end1=%s,night1=%s,week1=%s,month1=%s,start2=%s,end2=%s,night2=%s,week2=%s,month2=%s,start3=%s,end3=%s,night3=%s,week3=%s,month3=%s,saltax=%s,toutax=%s,othertax=%s,poolheatd=%s,poolheatw=%s,poolheatm=%s,parkf=%s,parkrate=%s,othf=%s,othrate=%s,wifif=%s,wifirate=%s,clnf=%s,clndys=%s,discount=%s,disrate=%s,damgp=%s,curr=%s WHERE lc_id=%d", $nightsr,$weeksr,$monsr,$dates1,$datee1,$nights1,$weeks1,$mons1,$dates2,$datee2,$nights2,$weeks2,$mons2,$dates3,$datee3,$nights3,$weeks3,$mons3,$saltax,$toutax,$othtax,$poolheatd,$poolheatw,$poolheatm,$parkfee,$park,$otherfee,$othr,$wififee,$wef,$cleanfee,$clndays,$discount,$disper,$dampro,$curr,$id)); } } class ppcde_plugin_admin { /** verbingo_plugin father class */ private $ppcde_settings_key = 'ppcde_setting'; private $ppcde_options_key = 'ppcde_options'; private $addfee_settings_key = 'ppcde_fee'; private $plugin_settings_tabs = array(); private $localleft = 'left'; function __construct() { add_action( 'init', array( &$this, 'ppcde_scripts_admin')); add_action( 'init', array( &$this, 'load_ppcde_settings')); add_action( 'admin_init', array( &$this, 'register_ppcde_fee_settings' )); add_action( 'admin_init', array( &$this, 'register_addfee_settings' )); add_action( 'admin_init', array( &$this, 'regestered_locations' )); add_action( 'admin_menu', array( &$this, 'add_admin_menus' )); } function regestered_locations() { global $wpdb; $table_name = $wpdb->prefix."ppcdelocation"; $locations = $wpdb->get_results("SELECT * FROM $table_name",ARRAY_A); return $locations; } /** UTILITY FUNCTIONS * */ private function sections($head, $text = '') { echo '
' . $text . '
'; } private function sectiontop() { echo '