Kaynağa Gözat

cvs download done

master
patrick 6 yıl önce
ebeveyn
işleme
7d2850b3ce
2 değiştirilmiş dosya ile 44 ekleme ve 2 silme
  1. +4
    -0
      css/xeroc.css
  2. +40
    -2
      ts.php

+ 4
- 0
css/xeroc.css Dosyayı Görüntüle

@@ -208,6 +208,10 @@ td.invoice_summary_header{
font-weight:900;
}

.select_client_check_box span.client_attr{
padding-left:60px;
}
#checkall_clients {
font-size: 1.5em;
padding-top: 20px;

+ 40
- 2
ts.php Dosyayı Görüntüle

@@ -10,6 +10,7 @@

namespace Biukop;
use XeroPHP\Models\Accounting\Address;
use XeroPHP\Models\Accounting\Payment;

require_once(dirname(__FILE__) . '/autoload.php');
require_once (ABSPATH . 'wp-includes/pluggable.php');
@@ -166,11 +167,48 @@ class AcareOffice{
header("Content-type: text/csv");
header("Content-Disposition:attachment; filename=$filename");
header("Content-Type: application/force-download");
//readfile(dirname(__FILE__) . "/img/circle.png");
$clients_in = "'" . implode("','", $clients) . "'";
$sql = "SELECT * from $this->table_name WHERE client in ($clients_in) and start >='$start 00:00:00' and start<='$finish 23:59:59'";
$results = $wpdb->get_results($sql);
$csv_header = "RegistrationNumber,NDISNumber,SupportsDeliveredFrom,SupportsDeliveredTo,SupportNumber,ClaimReference,Quantity,Hours,UnitPrice,GSTCode,AuthorisedBy,ParticipantApproved,InKindFundingProgram,ClaimType,CancellationReason\n";
echo "$csv_header" . print_r($clients, true) . print_r($_POST, true);
echo $csv_header;
foreach($results as $r)
{
echo $this->ndis_csv_line($r);
}
//echo $sql;
exit();
}
private function ndis_csv_line($record)
{
$str = "";
$registration = "4500000";
$ndisnumber = $this->get_client_ndis_account($record->client);
$date = new \DateTime($record->start);
$start = $date->format("Y-m-d");
$date = new \Datetime($record->finish);
$finish = $date->format("Y-m-d");
$quantity = 0;
$hours = 0;
$unitprice = 0;
$authorizedby="helen";
$participant_approved = "";
$in_kind_program ="";
$ClaimType = "";// standard;
$CancellationReason="";
return "$registration,$ndisnumber,$start,$finish,$record->tos,REC_{$record->id},$quantity,$hours,$unitprice,P1,$authorizedby,$participant_approved,$in_kind_program,$ClaimType,$CancellationReason\n";
}
private function get_client_ndis_account($client)
{
$user = get_user_by('login', $client);
return get_user_meta($user->ID,'account',true);
}
//init database

Yükleniyor…
İptal
Kaydet