get_row( $wpdb->prepare(
"SELECT * FROM wp_adv_advertising WHERE ID= %d",
intval($_GET['Item'])
));
if($itemSelected===null){ ?>
Errore: il prodotto da lei scelto non è disponibile
La preghiamo di riprovare
Personalizza la tua pubblicità
insert( 'wp_adv_sales',
array(
'state' => '1',
'advertisingID'=> $Item,
'link'=> $_POST['link'],
'textLink'=> $_POST['textLink'],
'datefinish'=> $newdate
)
);
//pagina di registrazione passando atraverso metodo get l'id della vendita
wp_redirect( home_url() . "/registrazione-e-pagamento?ID=$wpdb->insert_id&Item=$Item&_wpnonce=$nonceADVcustomadvertising&token=adv_custom_to_register" );
}
else
{
// The nonce was valid and the user has the capabilities, it is safe to continue.
// These files need to be included as dependencies when on the front end.
require_once( ABSPATH . 'wp-admin/includes/file.php' );
$upload_overrides = array( 'test_form' => false );
// Let WordPress handle the upload.
// Remember, 'my_image_upload' is the name of our file input in our form above.
$adv_photo_id = wp_handle_upload( $_FILES['imgBanner'] , $upload_overrides);
if ( $adv_photo_id && ! isset( $adv_photo_id['error'] ) ) {
$sql_sale = $wpdb->insert( 'wp_adv_sales',
array(
'state' => '1',
'advertisingID'=> $Item,
'link'=> $_POST['link'],
'linkImg'=> $adv_photo_id['url'],
'datefinish'=> $newdate
)
);
//pagina di registrazione
wp_redirect( home_url() . "/registrazione-e-pagamento?ID=$wpdb->insert_id&Item=$Item&_wpnonce=$nonceADVcustomadvertising&token=adv_custom_to_register" );
} else {
/**
* Error generated by _wp_handle_upload()
* @see _wp_handle_upload() in wp-admin/includes/file.php
*/
echo $adv_photo_id['error'];
}
}
}else {
//inserimento errore --------------------------
}
}
function adv_custom_adv_page_css() {
wp_register_style( 'customCSSAdvManagement', URL_ADVERTISING_PLUGIN . 'template/css/PageAdvManagement.css' );
wp_enqueue_style( 'customCSSAdvManagement' );
}
add_action('wp_enqueue_scripts', 'adv_custom_adv_page_css');
?>