Viewing file: aj_pdf.php (21.23 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//index.php
//include autoloader
require_once 'dompdf/autoload.inc.php';
require "connection.php";
session_start();
if (isset($_SESSION['user_id']))
{
$u_id = $_SESSION['user_id'];
$uname = $_SESSION['user_name'];
} else {
$u_id = '';
$uname = '';
}
use Dompdf\Dompdf;
use Dompdf\Options;
$options = new Options();
// //$options->set('defaultFont', 'roboto');
//$options->set('isPhpEnabled', 'true');
// $document = new Dompdf($options);
//$document = new Dompdf();
$output='';
$sql="select * from student_reg where user_id='$u_id'";
$result=$con->query($sql);
$row=$result->fetch_assoc();
// $sql = "SELECT * FROM student_reg where user_id='$u_id'";
// $result = mysqli_query($con, $sql) or die("database error:" . mysqli_error($con));
// $row = mysqli_fetch_assoc($result);
//print_r($row);
$sql1="select * from user_details where user_id='$u_id'";
$result1 = $con->query($sql1);
$row1 = $result1->fetch_assoc();
// $sql1 = "SELECT * FROM student_reg where user_id='$u_id'";
// $result1 = mysqli_query($con, $sql1) or die("database error:" . mysqli_error($con));
// $row1 = mysqli_fetch_assoc($result1);
if($row['profileImage']=='')
{
$img="profile_default.jpg";
}
else
{
$img='profileImages/'.$row['profileImage'];
}
if($row['career_objective']!='')
{
$carr_obj=$row['career_objective'];
}
else
{
$carr_obj="Self-motivated, highly passionate and hardworking fresher looking for an opportunity to work in a challenging organization to utilize my skills and knowledge to work for the growth of the organisation";
}
$output .= ' <div class="wrapper" style="position :relative; width: 100%; height:100%;">
<div class="sidebar-wrapper" style=" float: left; padding: 25px 10; min-height: 900px; ">
<!--//profile-container-->
<div class="contact-container container-block">
<div class="profileImg" style="">
<img style="" src="'.$img.'">
</div>
<ul class="list-unstyled interests-list">
<li class="email" style="margin-top: 2%;">
<img src="images/env.png" style="width:15px;height:15px;margin-top: 4px;">
<label style="margin-left:1px;">Email</label><br>
<label style=" font-size: 14px !important; margin-left:20px;">'.$row1["email"].'</label>
</li>
<li class="phone">
<img src="images/ph1.png" style="width:15px;height:15px;margin-top: 3px;">
<label style="margin-left:1px;">Mobile</label><br>
<label style="font-size: 14px !important; margin-left:20px;">'. $row1["phone"].'</label><br> </li>'
;
$output .='</ul>
</div>';
if($row["core_skill"]!=''){
$array = explode(',', $row['core_skill']);
$output .=' <div class="interests-container container-block">
<h2 class="container-block-title">CORE COMPETENCY</h2>
<ul class="list-unstyled interests-list">';
foreach ($array as $item)
{
$output .='<li ><img src="images/circle.png" style="width:15px;height:15px;margin-top: 2px;"> '.$item.'</li> ';
}
$output .='</ul>
</div>';
}
if($row["strengths"]!=''){
$array = explode(',', $row['strengths']);
$output .='<div class="interests-container container-block">
<h2 class="container-block-title">STRENGTHS</h2>
<ul class="list-unstyled interests-list">';
foreach ($array as $item)
{
$output .='<li>
<img src="images/circle.png" style="width:15px;height:15px;margin-top: 2px;"> '. $item.'</li> ';
}
$output .='</ul>
</div>';
}
$output .='<div class="interests-container container-block">
<h2 class="container-block-title" style="font-size: 16px;font-weight: bold;">Address</h2>
<ul class="list-unstyled interests-list">
<li>
<img src="images/address.png" style="width:15px;height:15px;margin-top: 2px;"> Permanent Address </li>
<li style="font-size: 14px !important;">'. $row["permanent_address1"] . '</li>
<li style="font-size: 14px !important;"> ' . $row["permanent_address2"] . '</li>
<li style="font-size: 14px !important;"> ' . $row["permanent_address3"] . '</li>
<li style="font-size: 14px !important;"> ' . $row["permanent_pincode"] . '</li>
</ul>
</div>
<div class="interests-container container-block">
</div>';
$output .='</div>
<div class="main-wrapper" style=" position:absalute !important; top:0 !important; left:0 !important; min-height: 100%; width: 58% !important; float: right !important; padding: 30px;"
<section class="section summary-section">
<div class="profile-container">
<h1 class="name" style=" margin-top: 40px; text-transform: uppercase;font-size: 40px;font-weight: 500;">'.$row1["name"].'</h1>
</div>
<h2 class="section-title" style="font-size: 15px;">Career Objective</h2>
<div class="summary">
<p class="font-rs" >
'.$carr_obj.'
</p>
</div><!--//summary-->
</section><!--//section-->';
$id = $row['stud_id'];
$sql2 = "select * from experience where stud_id=$id";
$result2 = $con->query($sql2);
if($result2->num_rows > 0){
$output .='<section class="section experiences-section">
<h2 class="section-title font-rs" style="font-size: 12px;">Work Experience</h2>
<div class="meta">';
while ($row2 = $result2->fetch_assoc()) {
$output .= '
<div class="time_summary" style="width:200px;float:left;"><span>'.$row2['duration'].'</span></div>
<div class="upper-row" style="width:200px;float:left;text-align:right;height:150px;margin-bottom:20px;">
<h3 class="subs-title">'. $row2['position'].'</h3>
<div class="details_sec">'. $row2['company_name'].'</div>
</div>
';
}
$output .='</div>
<br><br></section><!--//skills-section-->';
}
$id = $row['stud_id'];
$sql1 = "select * from resume_projects where stud_id=$id";
$result11 = $con->query($sql1);
if($result11->num_rows > 0){
$output .='<section class="section projects-section">
<h2 class="section-title font-rs" style="font-size: 12px;">Projects</h2>';
while ($row1 = $result11->fetch_assoc()) {
$acad='';
if(trim($row1["acadamic"])=="Academic"){
$acad='Academic Project';
}
$output .= '
<div style="width:300px;float:left;height:150px;margin-bottom:20px;">'.$acad . '</div>
<div style="width:300px;float:right;height:150px;margin-bottom:20px;">
<div style="width:300px;float:left;text-align:;">' . $row1["pro_name"]. '</div><br>
<div style="width:300px;float:left;text-align:;">' . $row1["description"] . ' </div><br>
<div style="width:300px;float:left;text-align:;">Technology:' . $row1["technology"] . '</div>
</div>
';
}
$output .='<br><br><br></section><!--//section-->';
}
if (!empty($row['achievements'])) {
$output .='<section class="section experiences-section">
<h2 class="section-title font-rs" style="font-size: 12px;">Achievements</h2>
<ul class="summary">';
$array = explode(',', $row['achievements']);
foreach ($array as $item) {
$output .= '<li><img src="images/circle_black.png" style="width:15px;height:15px;margin-top: 2px;"> '.trim($item).'</li>';
}
$output .='
</ul>
</section>';
}
if (!empty($row['interest'])) {
$output .='
<section class="section experiences-section">
<h2 class="section-title font-rs" style="font-size: 12px;">Interests</h2>
<ul class="list-unstyled interests-list">';
$array = explode(',', $row['interest']);
foreach ($array as $item) {
$output .= '<li><img src="images/circle_black.png" style="width:15px;height:15px;margin-top: 2px;"> '.trim($item).'</li>';
}
$output .='
</ul>
</section>';
}
$sql2 = "select * from education where stud_id=$id";
$result21 = $con->query($sql2);
if($result21->num_rows > 0){
$output .= '<section class="section experiences-section">
<h2 class="section-title" style="font-size: 15px;">Education</h2>';
while ($row2 = $result21->fetch_assoc()) {
$output .= '
<div style="width:300px;float:left;height:150px;margin-bottom:20px;">'.$row2["year"] . '</div>
<div style="width:300px;float:right;height:150px;margin-bottom:20px;">
<div style="width:300px;float:left;text-align:;">' . $row2["course"]. '</div><br>
<div style="width:300px;float:left;text-align:;">' . $row2["board"] . ' </div><br>
<div style="width:300px;float:left;text-align:;">Technology:' . $row2["specification"] . '</div><br>
<div>CGPA:' . $row2["mark"] . '%</div>
</div><br>
';
}
$output .='<br><br><br></section>';
}
$output .='<br><br><br><br><br><div class="row align-items-center mt-12">
<div class="col">
I, hereby declare that the information furnished above is true to the best of my knowledge and belief.
</div>
</div>
<div class="row align-items-center mt-4">
<br><br><br><br>
<div class="col">';
$currentDateTime = date('Y-m-d ');
$output .=' '.$currentDateTime.'</div>
<div class="col" style="text-align: right;">';
$output .=' '.$uname.'</div>
</div>
</div>
</div>';
$resulthtml= '<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/resumestyle.css">
<link rel="stylesheet" href="css/font.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet" href="css/pdf_css.css">
<!-- custom CSS -->
<style>
@font-face {
font-family: "Roboto";
font-style: sans-serif !important;
font-weight: normal;
src: url("https://www.srishticampus.com/dompdf/lib/fonts/RobotoSlab-Medium.ttf") format("truetype");
}
body{
font: roboto !important;
}
h1, h2, h3, h4, h5, h6 {
font-weight: bold !important;
}
a {
color: #2d7788;
}
p {
line-height: 1.5;
}
.profileImg {
width: 165px;
height: 165px;
margin: 10px auto;
overflow: hidden;
border-radius: 60pt !important;
}
.wrapper {
background: #ffffff;
max-width: 960px;
margin: 0 auto;
height: 100%;
position: relative;
}
.sidebar-wrapper {
background: #2f3031;
right: 0;
width: 30%;
min-height: 100%;
color: #fff;
}
.font-rs{
color: #444;
font-size: 14px!important;
margin-bottom: 10px;
font-weight: 200 !important;
}
.font-rs2{
font-size: 14px!important;
margin-bottom: 10px;
font-weight: 200 !important;
}
.sidebar-wrapper a {
color: #fff;
}
.sidebar-wrapper .profile-container {
padding: 20px;
background: rgba(0, 0, 0, 0.2);
text-align: center;
color: #fff;
}
.name {
font-size: 32px !important;
font-weight: bold !important;
margin-top: 0 !important;
margin-bottom: 10px !important;
}
.sidebar-wrapper .name {
font-size: 32px !important;
font-weight: bold !important;
margin-top: 0 !important;
margin-bottom: 10px !important;
}
.sidebar-wrapper .tagline {
color: rgba(255, 255, 255, 0.6);
font-size: 16px;
font-weight: normal;
margin-top: 0;
margin-bottom: 0;
}
.sidebar-wrapper .profile {
margin-bottom: 15px;
}
.sidebar-wrapper .contact-list .svg-inline--fa {
margin-right: 5px;
font-size: 18px;
vertical-align: middle;
}
.sidebar-wrapper .contact-list li {
margin-bottom: 15px;
}
.sidebar-wrapper .contact-list li:last-child {
margin-bottom: 0;
}
.sidebar-wrapper .contact-list .email .svg-inline--fa {
font-size: 14px;
}
.sidebar-wrapper .container-block {
padding: 0% 2% 1%;
}
.sidebar-wrapper .container-block-title {
text-transform: uppercase !important;
font-size: 16px !important;
font-weight: bold !important;
margin-top: 0 !important;
margin-bottom: 15px !important;
background: #7a7b7d !important;
/* color: #1e57ae; */
padding: 10px 10px !important;
border-left: 15px solid #ff9800;
}
.sidebar-wrapper .degree {
font-size: 14px;
margin-top: 0;
margin-bottom: 5px;
}
.sidebar-wrapper .education-container .item {
margin-bottom: 15px;
}
.sidebar-wrapper .education-container .item:last-child {
margin-bottom: 0;
}
.sidebar-wrapper .education-container .meta {
color: rgba(255, 255, 255, 0.6);
font-weight: normal;
margin-bottom: 0px;
margin-top: 0;
font-size: 12px;
}
.sidebar-wrapper .education-container .time {
color: rgba(255, 255, 255, 0.6);
font-weight: normal;
margin-bottom: 0px;
}
.sidebar-wrapper .languages-container .lang-desc {
color: rgba(255, 255, 255, 0.6);
}
.sidebar-wrapper .languages-list {
margin-bottom: 0;
}
.sidebar-wrapper .languages-list li {
margin-bottom: 10px;
}
.sidebar-wrapper .languages-list li:last-child {
margin-bottom: 0;
}
.sidebar-wrapper .interests-list {
margin-bottom: 0;
font-size: 14px;
padding-left: 10px;
}
.sidebar-wrapper .interests-list li {
margin-bottom: 10px;
word-break: break-all;
}
.sidebar-wrapper .interests-list li:last-child {
margin-bottom: 0;
}
.details a{
color:#2059af;
}
.download-resume{
font-size: 22px;
margin-left: 73%;
}
.main-wrapper {
background: #fff;
position: absalute;
top: 0px !important;
left: 0px !important;
min-height: 100%;
width: 70%;
}
.main-wrapper .section-title {
text-transform: uppercase;
font-size: 20px;
font-weight: normal;
color:black;
background: #cccccc78;
height: 20px;
padding: 5px;
border-left: 16px solid #ff9800;
position: relative;
margin-top: 0;
margin-bottom: 10px;
}
.main-wrapper .section-title .icon-holder {
width: 24px;
height: 20px;
margin-right: 8px;
padding-top: 1px;
display: block;
color: #fff;
float: left;
border-radius: 68%;
background-clip: padding-box;
background: #2d64b7;
text-align: center;
font-size: 15px;
position: relative;
top: 0;
}
.main-wrapper .section-title .icon-holder .svg-inline--fa {
font-size: 14px;
}
.section-title{
font-size: 12px;
}
.main-wrapper .section {
margin-bottom: 30px;
}
.main-wrapper .experiences-section .item {
margin-bottom: 30px;
}
.main-wrapper .upper-row {
position: relative;
overflow: hidden;
margin-bottom: 2px;
font-size: 13px;
}
.main-wrapper .job-title {
color: black;
font-size: 20px;
margin-top: 0;
margin-bottom: 0;
margin-bottom: 10px;
font-weight: 700;
}
.main-wrapper .time {
position: absolute;
right: 0;
top: 0;
color: black;
}
.main-wrapper .company {
color: black;
}
.main-wrapper .project-title {
font-size: 16px;
font-weight: normal;
margin-top: 0;
margin-bottom: 5px;
}
.main-wrapper .projects-section .intro {
margin-bottom: 30px;
}
.main-wrapper .projects-section .item {
margin-bottom: 15px;
}
.summary{
font-size: 14px;
}
.app {
height: 18px;
width: 240px;
padding: 0;
position: relative;
margin: 0 5px 0 5px;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
'.$output.'
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/fontawesome.js"></script>
<script type="text/javascript" src="https://www.srishticampus.com/js/fontawesome.js"></script>
';
echo $output;
echo $document->getOptions()->getChroot();
//die();
$document->loadHtml($resulthtml);
$document->set_base_path("/home4/srishtis/public_html/srishticampus/");
$document->setPaper('A4', 'portrait');
$document->render();
$sqlcheck=$con->query("select * from enrolldetails where user_id='$u_id' and admin_status=1");
if($sqlcheck->num_rows == 0){
// Instantiate canvas instance
$canvas = $document->getCanvas();
// Get height and width of page
$w = $canvas->get_width();
$h = $canvas->get_height();
// Specify watermark image
$imageURL = 'images/sicsfullogo.png';
$imgWidth = 300;
$imgHeight = 30;
// Set image opacity
$canvas->set_opacity(.2);
// Specify horizontal and vertical position
$x = (($w-$imgWidth)/2);
$y = (($h-$imgHeight)/2);
// Add an image to the pdf
$canvas->image($imageURL, $x, $y, $imgWidth, $imgHeight);
}
$document->stream("Srishti Campus" ,array("Attachment"=>0));
echo $document->output();
echo $resulthtml;
?>
|