105 foreach ($values as $key => $value)
106 $this->$key = $value;
116 $fp = @fopen(
$file,
'w+' );
121 fwrite($fp, $contens);
126 public function sendInvoice($subject, $message, $to = null, $bytes, $fname =
"faktura")
129 $content = chunk_split(base64_encode($bytes));
134 $uid = md5(uniqid(time()));
138 $header .=
"MIME-Version: 1.0\r\n";
139 $header .=
"Content-Type: multipart/mixed; boundary=\"".$uid.
"\"\r\n\r\n";
140 $header .=
"This is a multi-part message in MIME format.\r\n";
141 $header .=
"--".$uid.
"\r\n";
142 $header .=
"Content-type:text/plain; charset=utf-8\r\n";
143 $header .=
"Content-Transfer-Encoding: 7bit\r\n\r\n";
144 $header .= $message.
"\r\n\r\n";
145 $header .=
"--".$uid.
"\r\n";
146 $header .=
"Content-Type: application/octet-stream; name=\"".$filename.
"\"\r\n";
147 $header .=
"Content-Transfer-Encoding: base64\r\n";
148 $header .=
"Content-Disposition: attachment; filename=\"".$filename.
"\"\r\n\r\n";
149 $header .= $content.
"\r\n\r\n";
150 $header .=
"--".$uid.
"--";
165 $restore_me = ini_get(
'display_errors');
166 ini_set(
'display_errors', 0);
167 mail($to, $subject,
"", $header);
168 ini_set(
'display_errors', $restore_me);
177 $fname = array(
"Jesper",
"Nicolai",
"Alex",
"Stefan",
"Helmut",
"Elvis");
178 $lname = array(
"Gødvad",
"Lundgaard",
"Killing",
"Meyer",
"Schottmüller",
"Presly");
179 $city = array(
"Copenhagen",
"Århus",
"Collonge",
"Bremen",
"SecretPlace" );
180 $country = array(
"Denmark",
"Germany",
"France",
"Ümlaudia",
"Graceland");
181 $road = array(
" Straße",
" Road",
"vej",
" Boulevard");
183 $this->number = rand(1000,1010);
184 $this->name = $fname[rand(0,5)] .
" " . $lname[rand(0,5)];
185 $this->email =
"noreply@ilias.dk";
186 $this->address=
"Ilias" . $road[rand(0,3)] .
" " . rand(1,100);
187 $this->postalcode = rand(2000,7000);
188 $this->city =
$city[rand(0,3)];
189 $this->country =
$country[rand(0,4)];
190 $this->phone =
"+" . rand(1,45) .
" " . rand(100,999) .
" " . rand(1000, 9999);