示例#1
0
 public function PDF_DO()
 {
     include labels();
     $pdf = new Gift_PDF();
     $title = '';
     $uid = $_POST['uid'];
     $toMail = $_POST['to-mail'];
     $fromMail = $_POST['sender-mail'];
     $fromName = $_POST['sender-name'];
     $pdf->SetTitle($title);
     $pdf->PrintChapter($labelET['Company name'], 1, "Kupongi kood: {$uid}");
     $pdf->ContentHolder();
     $pdf->Ln(10);
     $name = $_POST['name'] . ' kingitus' . ' ID ' . $uid;
     $file = $name;
     $file .= '.pdf';
     $pdf->Output('files/PDF/' . $file);
     //Redirect
     //header('Location: ' . 'FILES/' . $file);
     require "libaries/PHPMailer/class.phpmailer.php";
     $mail = new PHPMailer();
     $mail->IsMail();
     $path = "files/PDF/" . $file;
     $mail->SetFrom($fromMail, "Kingituse tegi sulle: {$fromName}");
     $mail->AddAddress($toMail);
     $mail->Subject = "Kingitus Falseprogrammingu poolt";
     $mail->Body = "Vaata PDF faili. Kingitusi tegi sulle {$fromName} Emaililt: {$fromMail}";
     $mail->AddAttachment($path);
     if (!$mail->Send()) {
         echo "Error saatmisega: " . $mail->ErrorInfo;
     } else {
         echo "Kiri saadetud";
     }
 }
 public function __invoke()
 {
     $this->createLabel();
     $alert_text = [];
     $history = [];
     $currentTime = new \DateTime();
     $today = $currentTime->format('m') + 1 + "/" + $currentTime . getDate() + "/" + $currentTime->format('Y');
     $keywordIterator;
     $line_counter = 0;
     while ($keywordIterator->hasNext()) {
         $keyword = keywordIterator . next();
         $line_counter++;
         $current_quality_score = $keyword->qualityScore;
         $keywordLabelsIterator = keyword . labels() . withCondition("Name STARTS_WITH 'QS: '") . get();
         if ($keywordLabelsIterator->hasNext()) {
             $keyword_label = $keywordLabelsIterator . next();
             $matches = new RegExp('QS: ([0-9]+)$') . exec($keyword_label . getName());
             $old_quality_score = $matches[1];
         } else {
             $old_quality_score = 0;
         }
         // For the history also note the change or whether this keyword is new
         if ($old_quality_score > 0) {
             $change = $current_quality_score - $old_quality_score;
         } else {
             $change = "NEW";
         }
         $row = [$today, $keyword . getCampaign() . getName(), $keyword . getAdGroup() . getName(), $keyword . getText(), $current_quality_score, $change];
         $history . push(row);
         // If there is a previously tracked quality score and it's different from the current one...
         if ($old_quality_score > 0 && $current_quality_score != $old_quality_score) {
             // Make a note of this to log it and possibly send it via email later
             $alert_text . push($current_quality_score + "\t" + $old_quality_score + "\t" + $change + "\t" + $keyword . getText());
             // Remove the old label
             $keyword . removeLabel($keyword_label . getName());
         }
         // Store the current QS for the next time by using a label
         $keyword . applyLabel("QS: " + $current_quality_score);
     }
     if ($line_counter == 0) {
         $this->logger->log("Couldn't find any keywords marked for quality score tracking. To mark keywords for tracking, apply the label '" + $label_name + "' to those keywords.");
         return;
     }
     $this->logger->log("Tracked " + $line_counter + " keyword quality scores. To select different keywords for tracking, apply the label '" + $label_name + "' to those keywords.");
     // Store history
     $history_sheet = spreadsheet . getSheetByName('QS history');
     $history_sheet . getRange($history_sheet . getLastRow() + 1, 1, $history . length, 6) . setValues($history);
     // If there are notes for alerts then prepare a message to log and possibly send via email
     if ($alert_text . length) {
         $message = "The following quality score changes were discovered:\nNew\tOld\tChange\tKeyword\n";
         for ($i = 0; $i < count($alert_text); $i++) {
             $message += $alert_text[i] + "\n";
         }
         // Also include a link to the spreadsheet
         $message += "\n" + "The complete history is available at " + $spreadsheet . getUrl();
         $this->logger->log($message);
         // If there is an email address send out a notification
         if ($email_address && $email_address != "YOUR_EMAIL_HERE") {
             $this->mailer->sendEmail($email_address, "Quality Score Tracker: Changes detected", $message);
         }
     }
 }
示例#3
0
 public function index()
 {
     include labels();
     require 'templates/pages/index.php';
     require 'templates/forms/gift_form.php';
 }
示例#4
0
文件: index.php 项目: halfbro/radare
?>
">
; references
;    add <input name="input"></form>
<form method="get"><input type=hidden name=tab value="<?php 
echo $tab;
?>
"><input type=hidden name="action" value="add_com"><input type="hidden" name="offset" value="<?php 
echo $offset;
?>
">
; comments
;    add <input name="input">
;    <a href="?offset=$offset&tab=comment">edit comment</a>
;    <a href="?offset=$offset&tab=notes">notes</a></form>
<? labels(); ?>
</pre></div>
</td>

<td valign="top" style="padding:5"><pre>
<?
if (!strcmp($tab,"hexdump")) {
	print str_replace("strings",
		"<a href=\"?offset=$offset&tab=strings\">strings</a>",
		str_replace("disasm",
		"<a href=\"?offset=$offset\">disasm</a>",
		str_replace("notes",
		"<a href=\"?offset=$offset&tab=notes\">notes</a>",
		str_replace("comment",
		"<a href=\"?offset=$offset&tab=comment\">comment</a>",
		str_replace("plain",
示例#5
0
    provision();
}
if ($sektion == "personlige_valg") {
    personlige_valg();
}
if ($sektion == "ordre_valg") {
    ordre_valg();
}
if ($sektion == "vare_valg" || $sektion == "varianter" || $sektion == "label") {
    vare_valg();
}
if ($sektion == "shop_valg") {
    shop_valg();
}
if ($sektion == "labels") {
    labels($valg);
}
if ($sektion == "prislister") {
    prislister();
}
if ($sektion == "rykker_valg") {
    rykker_valg();
}
if ($sektion == "div_valg") {
    div_valg();
}
if ($sektion == "docubizz") {
    docubizz();
}
if ($sektion == "bilag") {
    bilag();