??????????????? ??????????????? 0) { echo "Access Denied"; exit; } require_once('/home/andyrdhboardrevi/public_html/wp-content/themes/witalk/registration/includes/dbconnect.php'); use setasign\Fpdi\Fpdi; use setasign\Fpdi\PdfReader; require_once('/home/andyrdhboardrevi/public_html/__pdff__/fpdf.php'); require_once('/home/andyrdhboardrevi/public_html/__fdipdf__/src/autoload.php'); $query = "select dru.*, dss.*, dru.`date` as regdate from dha_registered_user dru left join dha_seminars dss on dru.seminar_id=dss.seminar_id where dru.name_id='".mysqli_real_escape_string($con,$_SESSION['userID'])."' and (dru.status=1 or dru.status=6)"; $rowQuery = mysqli_query($con,$query); $data = mysqli_fetch_array($rowQuery); $txt = ''; $certFile = ''; $streamArray = [5,6,7]; if($data['packageSelected'] == 5 || $data['packageSelected'] == 6 || $data['packageSelected'] == 7 || $data['packageSelected'] == 8 || $data['packageSelected'] == 9){ $monthstream = date("n", strtotime($data["regdate"])); $yearstream = date("Y", strtotime($data["regdate"])); if($monthstream > 3){ $yearstream = $yearstream + 1; } // if( $yearstream >=2022) die("Certificate not available!!"); $certFile = ".certFiles__New/5-s-cert-".$yearstream.".pdf"; try { // initiate FPDI $pdf = new Fpdi(); // add a page $pdf->AddPage("L"); // set the source file $pdf->setSourceFile("/home/andyrdhboardrevi/public_html/".$certFile); $tplIdx = $pdf->importPage(1); // use the imported page and place it at position 10,10 with a width of 100 mm $size = $pdf->getTemplateSize($tplIdx); $data['firstname'] = stripslashes($data['firstname']); $data['lastname'] = stripslashes($data['lastname']); $pdf->useTemplate($tplIdx, 5, 5, 285); //$pdf->AddPage('L', array($size['width'], $size['width'])); // now write some text above the imported page $pdf->SetFont('Helvetica'); $pdf->SetFontSize(40); $pdf->SetTextColor(0, 0, 0); $pdf->SetXY(66, 146); $pdf->Write(0, $data['firstname'] .' '. $data['lastname']); $pdf->Output('Cert_'.$data['firstname'] .'_'. $data['lastname'].'_'.date("Y").'.pdf', 'D'); } catch (Exception $ex) { die("Certificate not available!!"); } exit(); } if($data['seminar_id'] > 0) { $date1 = strtotime(date("Y-m-d")); $date2 = strtotime($data['certDate']); if($data['seminar_id'] == 1) { $certFile = "DHACEATLANTA.pdf"; } else if($data['seminar_id'] == 2) { $certFile = "DHACEDALLAS.pdf"; } else if($data['seminar_id'] == 3) { $certFile = "DHACECHICAGO.pdf"; } else if($data['seminar_id'] == 4) { $certFile = "DHACEBALTIMORE.pdf"; } else if($data['seminar_id'] > 4) { $certFile = ".certFiles__New/".$data['seminar_id']."-cert.pdf"; } if($date1>$date2) { if($certFile == ''){ die("Error!!"); } if (!file_exists("/home/andyrdhboardrevi/public_html/".$certFile)) { die("Certificate not available!!"); } // initiate FPDI $pdf = new Fpdi(); // add a page $pdf->AddPage("L"); // set the source file $pdf->setSourceFile("/home/andyrdhboardrevi/public_html/".$certFile); $tplIdx = $pdf->importPage(1); // use the imported page and place it at position 10,10 with a width of 100 mm $size = $pdf->getTemplateSize($tplIdx); $data['firstname'] = stripslashes($data['firstname']); $data['lastname'] = stripslashes($data['lastname']); $pdf->useTemplate($tplIdx, 5, 5, 285); //$pdf->AddPage('L', array($size['width'], $size['width'])); // now write some text above the imported page $pdf->SetFont('Helvetica'); $pdf->SetFontSize(40); $pdf->SetTextColor(0, 0, 0); $pdf->SetXY(66, 146); $pdf->Write(0, $data['firstname'] .' '. $data['lastname']); $pdf->Output('Cert_'.$data['firstname'] .'_'. $data['lastname'].'_'.date("Y").'.pdf', 'D'); } else { die("Certificate will be enabled after seminar!!"); } } else { die('User Not found!!'); } ?>