public function set_by_evaluator($evaluator, $isnew) { // fields needed for signing $this->data['CertCreateDateTime'] = $evaluator['created']; $this->data['CertKey'] = $evaluator['key']; $this->data['CertProduct'] = 1; // WinWrap Basic $this->data['CertFormat'] = 2; $this->data['CertKind'] = 1; // Evaluation $this->data['CertTest'] = 1; $this->data['CertVersion'] = count($evaluator['downloads']) + ($isnew ? 1 : 0); $this->data['CertName'] = $evaluator['company']; $this->data['CertDesc'] = $evaluator['name']; $this->data['CertUrl'] = $evaluator['email']; $this->data['CertPlatform'] = 0x7ffffff; // all platforms $this->data['CertOS'] = 0x7ffffff; // all OSs $this->data['CertOption'] = 0xffffff; // all options $this->data['CertExpirationDate'] = Util2::future_date($evaluator['agreement_date'], 60, $evaluator['expiration_date']); $this->data['RevokedDate'] = null; $this->data['ReissuedVersion'] = 0; $this->data['EncryptionKey1'] = $evaluator['key']; $this->data['EncryptionKey2'] = $evaluator['created']; // fields specific to evaluators $this->data['EvaluatorName'] = $evaluator['name']; $this->data['EvaluatorEmail'] = $evaluator['email']; $this->data['EvaluatorCompany'] = $evaluator['company']; $this->data['EvaluatorCompanyUrl'] = self::fix_url($evaluator['url']); }
public static function read_key($key) { $quote = self::read(['*'], TRUE, ["`key` = ?", $key]); $quote['items'] = QuoteItem::read_items($quote['id']); $annual_fee = 0; foreach ($quote['items'] as $item) { $annual_fee += $item['annual_fee']; } $quote['first_fee'] = $annual_fee; $quote['annual_fee'] = $annual_fee; if (!is_null($quote['discount'])) { $quote['first_fee'] -= $quote['discount']; } $quote['expiration'] = Util2::future_date(substr($quote['created'], 0, 10), 60); return $quote; }
<div class="container white"> <div class="content left"> <table class="data"> <thead> <th>Date</th> <th>Expires</th> <th>Company</th> <th>Contact/Email/Key</th> <th>Items</th> <th>Views</th> </thead> <tbody> <?php $quotes = Quote::read(['*'], FALSE, ['created > CURRENT_DATE - INTERVAL 2 MONTH'], 'created DESC'); foreach ($quotes as $quote) { $expiration = Util2::future_date(substr($quote['created'], 0, 10), 60); $items = QuoteItem::read_items($quote['id']); $views = QuoteView::read_views($quote['id']); $item_details = []; foreach ($items as $item) { $item_details[] = $item['quantity'] . ' ' . $item['part']; } $view_details = []; foreach ($views as $view) { $view_details[] = $view['created'] . ' ' . $view['ip']; } echo '<tr>'; echo '<td>' . htmlspecialchars($quote['created']) . '</td>'; echo '<td>' . htmlspecialchars($expiration) . '</td>'; echo '<td>' . htmlspecialchars($quote['company']) . '</td>'; echo '<td>' . htmlspecialchars($quote['technical_name']) . '<br/>';