Przeglądaj źródła

cvs download done

master
patrick 6 lat temu
rodzic
commit
7d2850b3ce
2 zmienionych plików z 44 dodań i 2 usunięć
  1. +4
    -0
      css/xeroc.css
  2. +40
    -2
      ts.php

+ 4
- 0
css/xeroc.css Wyświetl plik

font-weight:900; font-weight:900;
} }


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

+ 40
- 2
ts.php Wyświetl plik



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


require_once(dirname(__FILE__) . '/autoload.php'); require_once(dirname(__FILE__) . '/autoload.php');
require_once (ABSPATH . 'wp-includes/pluggable.php'); require_once (ABSPATH . 'wp-includes/pluggable.php');
header("Content-type: text/csv"); header("Content-type: text/csv");
header("Content-Disposition:attachment; filename=$filename"); header("Content-Disposition:attachment; filename=$filename");
header("Content-Type: application/force-download"); header("Content-Type: application/force-download");
//readfile(dirname(__FILE__) . "/img/circle.png"); //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"; $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(); 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 //init database

Ładowanie…
Anuluj
Zapisz