This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $root_path = '/path/to/your/root/'; | |
| require_once($root_path.'vendor/autoload.php'); | |
| define('APPLICATION_NAME', 'Google Sheets Importer'); | |
| define('APP_CREDENTIALS_PATH', $root_path.'service-account-2fb0dd3da332.json');// The Json file's path that you received via service account | |
| define('SCOPES', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once $_SERVER['DOCUMENT_ROOT'].'/mailmerge/vendor/autoload.php'; | |
| use OntraportAPI\Ontraport; | |
| //live | |
| $key = "tbpy9FUGu9XXXX"; | |
| $appid = "2_9614_MnlYYYY"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $expires = 5*60*60*24; // how long to cache in secs.. | |
| header("Pragma: public"); | |
| header("Cache-Control: maxage=".$expires); | |
| header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT'); | |
| header('Content-type: text/css'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $f = fopen('lock', 'w') or die ('Cannot create lock file'); | |
| if (flock($f, LOCK_EX | LOCK_NB)) { | |
| ini_set('max_execution_time', 0); | |
| /** | |
| Database Configurations | |
| **/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function send_csv_mail($data, $body, $to = 'email@example.com', $subject = 'Website Report', $from = 'waqashassan98@gmail.com') { | |
| if (!$fp = fopen('php://temp', 'w+')) echo "unable to create csv"; | |
| foreach ($data as $row) | |
| { | |
| fputcsv($fp, $row); | |
| } | |
| rewind($fp); | |
| $csvData = stream_get_contents($fp); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get_bookings_in_date_range_wh( $next_monday, $next_friday, $product_id, true ); | |
| function get_bookings_in_date_range_wh( $start_date, $end_date, $product_or_resource_id = 0, $check_in_cart = true ) { | |
| $args = array( | |
| 'status' => get_wc_booking_statuses(), | |
| 'object_type' => 'product_or_resource', | |
| 'date_between' => array( | |
| 'start' => $start_date, | |
| 'end' => $end_date, | |
| ), |
NewerOlder