|
|
|
@@ -33,7 +33,7 @@ class AcareOffice{ |
|
|
|
$this->setup_db_name(); |
|
|
|
$this->class_loader(); |
|
|
|
$this->apiv1 = new Apiv1($this, $this->job_table); |
|
|
|
|
|
|
|
//$this->check_csv_download(); |
|
|
|
|
|
|
|
add_option( "acare_ts_db_version", "1.0" ); |
|
|
|
register_activation_hook( __FILE__, array($this, 'db_install') ); |
|
|
|
@@ -145,13 +145,18 @@ class AcareOffice{ |
|
|
|
|
|
|
|
public function check_csv_download() |
|
|
|
{ |
|
|
|
$method = $_SERVER['REQUEST_METHOD']; |
|
|
|
if ( $method != "POST") |
|
|
|
return; |
|
|
|
|
|
|
|
global $wpdb; |
|
|
|
$url = $_SERVER['REQUEST_URI']; |
|
|
|
$matches=[]; |
|
|
|
preg_match("/\/ndiscsv\/start-([^\/]+)\/finish-([^\/]+)\/?$/", $url, $matches); |
|
|
|
if ( $matches !=3 || $_SERVER['REQUEST_URI'] != $matches[0] ) |
|
|
|
if ($url != "/ndiscsv/"){ |
|
|
|
return; |
|
|
|
$start = $matches[1]; |
|
|
|
$finish = $matches[2]; |
|
|
|
} |
|
|
|
$clients= $_POST['clients']; |
|
|
|
$start = $_POST['start'];; |
|
|
|
$finish = $_POST['finish'];; |
|
|
|
$filename="{$start}___{$finish}.csv"; |
|
|
|
|
|
|
|
header("Expires: 0"); |
|
|
|
@@ -162,7 +167,8 @@ class AcareOffice{ |
|
|
|
header("Content-Disposition:attachment; filename=$filename"); |
|
|
|
header("Content-Type: application/force-download"); |
|
|
|
//readfile(dirname(__FILE__) . "/img/circle.png"); |
|
|
|
echo "content of this file"; |
|
|
|
|
|
|
|
echo "content of this file " . print_r($clients, true) . print_r($_POST, true); |
|
|
|
exit(); |
|
|
|
|
|
|
|
} |
|
|
|
@@ -802,6 +808,7 @@ ZOT; |
|
|
|
'email'=> $s->user_email, |
|
|
|
'account'=> get_user_meta($s->ID, 'account', true), |
|
|
|
'address' => get_user_meta($s->ID, 'address', true), |
|
|
|
'paymemt'=>get_user_meta($s->ID, 'payment', true), |
|
|
|
'rating'=> 0, |
|
|
|
'unconfirmedjob'=> 0, |
|
|
|
); |