예제 #1
0
 public function postNewCustomer(NewCustomerRequest $request, Customer $customer, CustomerProfile $profile, Payment $payment)
 {
     $this->customer = $customer->create(['firstname' => Str::title($request->input('firstname')), 'lastname' => Str::title($request->input('lastname')), 'email' => Str::lower($request->input('email')), 'phone' => $request->input('phone')]);
     if ($this->customer) {
         $dob = explode('/', $request->input('dob'));
         $dob_piece = [$dob[2], $dob[1], $dob[0]];
         $this->profile = $profile->create(['customer_id' => $this->customer->id, 'dob' => implode('-', $dob_piece), 'gender_id' => $request->input('gender'), 'state_id' => $request->input('state_of_origin'), 'hostel_address' => $request->input('hostel_address'), 'guardian_name' => Str::words($request->input('guardian_name')), 'guardian_phone' => $request->input('guardian_phone'), 'guardian_address' => $request->input('guardian_address')]);
         // Add Payment Balance
         $this->payment = $payment->create(['customer_id' => $this->customer->id, 'start_balance' => empty($request->input('account_balance')) ? 0 : $request->input('account_balance'), 'account_balance' => empty($request->input('account_balance')) ? 0 : $request->input('account_balance')]);
         // Generate THC Code
         $thc_code = thcFormater($this->customer->id);
         // Generate QR Code
         generateQRCode($thc_code);
         // Add Customer THC generated code
         $customer->whereId($this->customer->id)->update(['thc' => $thc_code, 'qrcode' => '/customers/qrcodes/' . $thc_code . '.png']);
         if ($this->profile) {
             flash()->success('Customer Added Successfully!');
         } else {
             flash()->error('An error occurred, try adding the Customer again!');
         }
     } else {
         flash()->error('An error occurred, try adding the Customer again!');
     }
     return redirect()->route('customer.list');
 }
예제 #2
0
$pdf->SetFont('arial', '', $sizetitre);
$pdf->RotatedCell($angle, $xtitre, $ytitre, $wtitre, $htitre, $_GET['titre'], 0, 0, 'C');
$pdf->RotatedText(15, 15, $titre, 0);
$pdf->SetFont('arial', '', $sizeechelle);
if ($_GET['echelle'] == 0) {
    $pdf->RotatedText($posixechelle, $posiyechelle, 'Sans échelle', $angle);
} else {
    $pdf->RotatedText($posixechelle, $posiyechelle, '1/' . $_GET['echelle'] . ' ème', $angle);
}
if ($print_basic_copyright) {
    $pdf->SetFont('arial', '', 6);
    $pdf->RotatedText(5, 5, "Les photographies sont propriétées de l'IGN, les données cadastrales sont propriétées de la DGI. Reproduction interdite.", 0);
}
//génération du qrcode;
$url_qrcode = "https://" . $_SERVER["HTTP_HOST"] . "/interface/qrprint.php?var=" . $application . "\$" . $_GET['x'] . "\$" . $_GET['y'] . "\$" . $_GET['lar'] . "\$" . $_GET['hau'] . "\$" . $_GET['zoom'] . "\$" . $_GET['format'] . "\$" . $_GET['legende'] . "\$" . $_GET['titre'] . "\$" . $_GET['echelle'] . "\$" . $_GET['parce'] . "\$" . $_GET['raster'];
$pdf->Image(generateQRCode($url_qrcode, 100), $xqrcode, $yqrcode, 30, 30, 'PNG');
$pdf->SetDrawColor(0);
$pdf->SetFont('arial', '', 10);
if ($_GET['legende'] == 1 || $_GET['legende'] == 3) {
    $legende = "";
    //$pyy=250;
    $idprov = "";
    for ($i = 0; $i < count($rastx); $i++) {
        $ra = explode(".", $rastx[$i]);
        $id = $ra[0];
        $lib = str_replace("_", " ", $ra[1]);
        if ($id != "") {
            $req1 = "select col_theme.intitule_legende as intitule_legende,theme.libelle_them,col_theme.fill,col_theme.symbole,col_theme.opacity,col_theme.ordre,col_theme.stroke_rgb,style.fill as style_fill,style.symbole as style_symbole,style.opacity as style_opacity,style.font_size  as style_fontsize,style.stroke_rgb  as style_stroke from admin_svg.appthe left outer join admin_svg.col_theme on appthe.idappthe=col_theme.idappthe join admin_svg.theme on appthe.idtheme=theme.idtheme left outer join admin_svg.style on appthe.idtheme=style.idtheme where appthe.idappthe='" . $id . "'  and (intitule_legende='" . $lib . "' or libelle_them='" . $lib . "')";
            $couch = $DB->tab_result($req1);
            if ($couch[0]['intitule_legende'] == "") {
                $legend = $couch[0]['libelle_them'];
예제 #3
0
/**
 * 对主页传进来的URL进行解析
 *
 * Date: 2015/12/9
 * Time: 16:55
 */
require_once '../config/Constant.php';
require_once '../database/ProductsDB.php';
require_once '../smarty/config.php';
require_once '../phpqrcode/phpqrcode.php';
//得到URL 传进来的id
$id = $_GET['id'];
if (!$smarty->isCached('item_product.tpl', $id)) {
    $itemProduct = readDatabase($id);
    $screenShotObject = parseJSON($itemProduct);
    generateQRCode($itemProduct);
    $smarty->assign('qrCodeImage', QR_NAME);
    $smarty->assign('itemProduct', $itemProduct);
    $smarty->assign('screenShotArray', $screenShotObject);
}
$smarty->display('item_product.tpl', $id);
/**
 * 生成QRCode
 */
function generateQRCode($itemProduct)
{
    //在这里要确保 products文件夹中apk名字 与 数据库名字一样
    $qrCodeHref = DOMAIN . '/products' . '/' . $itemProduct['download'];
    define('QR_NAME', 'itemQRCode.png');
    QRcode::png($qrCodeHref, QR_NAME, 'L', 5.5);
}
예제 #4
0
 public function demo(Order $order)
 {
     return generateQRCode('THC0001');
     //        $code = QrCode::size(150)->generate('THC0002');
     //        return $code;
 }
예제 #5
0
<?php

require_once __DIR__ . '/../init.php';
login();
$db = getDb();
if (!empty($_GET['hash'])) {
    generateQRCode($_GET['hash']);
}
if (!empty($_POST['persons'])) {
    $hash = hash('sha1', uniqid(rand(), true));
    // insert new persons
    $persons = array_filter(explode(',', $_POST['persons']));
    $query = $db->prepare('INSERT INTO person2hash (hash, person) VALUES (:hash, :person)');
    foreach ($persons as $person) {
        $query->execute(array('hash' => $hash, 'person' => $person));
    }
    header('Location: ' . Config::HOST . Config::BASE_URI . 'manage/generateQRCode.php?hash=' . $hash);
    exit;
}
if (!empty($_GET['delete'])) {
    $query = $db->prepare('DELETE FROM person2hash WHERE hash = :hash');
    $query->execute(array('hash' => $_GET['delete']));
}
$persons = getPersons();
// get active hashes
$query = $db->prepare('SELECT GROUP_CONCAT(person ORDER BY person ASC SEPARATOR ", ") as persons, hash FROM person2hash GROUP BY hash');
$query->execute();
$hashes = $query->fetchAll();
?>
<!DOCTYPE html>
<html>
예제 #6
0
 function qrCode()
 {
     $id = $_GET['id'];
     generateQRCode($CONFIG['default']['base_url'] . 'browse/indivDetail/?id=' . $id);
 }