Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- ini_set('display_startup_errors', 1);
- error_reporting(E_ALL);
- /*ini_set('display_startup_errors', 1);
- ini_set('display_errors', 1);
- error_reporting(-1);*/
- global $wpdb;
- //die('x');
- $user = wp_get_current_user();
- //if( current_user_can('editor') || current_user_can('administrator') || ( $user->roles[0] == 'shop_manager' )) {
- // 'SELECT * FROM `wp_orders_onepage_v2` WHERE `product_id` = 61581 order by order_id asc'
- $orders = 'SELECT * FROM `wp_orders_onepage_v2` WHERE `product_id` = 61624 order by order_id asc';// LIMIT 500;
- $orders_array = $wpdb->get_results($orders, ARRAY_A);
- foreach ($orders_array as $arr) {
- $mess=$arr['order_event'];
- if (strcasecmp( $arr['distanciya'], "7,5 км ") != 0 && strcasecmp( $arr['distanciya'], "Казанский Велопарад Тинькофф") != 0) { #Проверка на валидность дистанции
- $phone = preg_replace('/\D/', '', $arr['phone']); #Проверка корректности номера
- if (strlen($phone) == 10 && $phone[0] == 9) {
- $phone = '7' . $phone;
- }
- if (strlen($phone) < 11 || intval($arr['billing_start_number']) <= 0) {
- continue;
- }
- $message ='Вы участвуете в Тур де Татарстан Казань 2019 - '.$arr['distanciya'].' под №'. $arr['billing_start_number']; #Заданаие текста сообщения
- $sendstring = 'http://smspilot.ru/api.php?send=' . $message . '&to=' . $phone . '&apikey=ZCTT45UU9G03M3N4G7LT7L68G8LCP4BHX719FWUPH3C1Y8G4OTF86TJ9OHV1JM32';
- $response = wp_remote_get($sendstring); #Отправка сообщения
- echo $response['response']['message'] . '<br>';
- }
- }
- //} ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement