D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
diafrica
/
result.dominicaninstitute.org
/
Filename :
apply-old.php
back
Copy
<?php require('PHPMailer/mail.php'); try{ //$conn = new PDO("mysql:host=localhost;dbname=diafrica_result","diafrica_result","07036543898Ola."); $conn = new PDO("mysql:host=localhost;dbname=diafrica_result","root",""); $conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); }catch(PDOException $e){ echo $e->getMessage(); } function create($table,$data){ global $conn; foreach($data as $field => $value){ $fields[] = sprintf("`%s`",$field); $values[] = sprintf("'%s'",$value); $field_list = join(',',$fields); $value_list = join(',',$values); } $query = sprintf("INSERT INTO `%s`(%s)VALUES(%s)",$table,$field_list,$value_list); $stmt = $conn->prepare($query); $stmt->execute(); return true; } /* function resize_image($file, $w, $h, $crop=false) { list($width, $height) = getimagesize($file); $r = $width / $height; if ($crop) { if ($width > $height) { $width = ceil($width-($width*abs($r-$w/$h))); } else { $height = ceil($height-($height*abs($r-$w/$h))); } $newwidth = $w; $newheight = $h; } else { if ($w/$h > $r) { $newwidth = $h*$r; $newheight = $h; } else { $newheight = $w/$r; $newwidth = $w; } } //Get file extension $exploding = explode(".",$file); $ext = end($exploding); switch($ext){ case "png": $src = imagecreatefrompng($file); break; case "jpeg": case "jpg": $src = imagecreatefromjpeg($file); break; case "gif": $src = imagecreatefromgif($file); break; default: $src = imagecreatefromjpeg($file); break; } $dst = imagecreatetruecolor($newwidth, $newheight); imagecopyresampled($dst, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); return $dst; } */ include('./simpleImage/simpleImage.php'); if (isset($_POST['submit'])) { $haddress = $_POST['haddress']; $caddress = $_POST['caddress']; $saddress = $_POST['saddress']; $fname = $_POST['fname']; $oname = $_POST['oname']; $reason = $_POST['reason']; $phone = $_POST['phone']; $email = $_POST['email']; $dob = $_POST['dob']; $matric = $_POST['matric']; $fromto = $_POST['fromto']; $program = $_POST['program']; $entry = $_POST['entry']; $office = $_POST['office']; $school = $_POST['school']; $semail = $_POST['semail']; $scc = $_POST['scc']; $sig = $_FILES['signature']['tmp_name']; $random = rand(0001,9999); $temporary = explode("." , $_FILES [ "signature" ][ "name" ]); $file_extension = end ($temporary ); $pic = $_FILES['signature']['name']; $picp = $_FILES['signature']['tmp_name']; $pics = $_FILES['signature']['size']; list($width,$height) = getimagesize($sig); $ext1 = pathinfo($pic, PATHINFO_EXTENSION); $ext1 = strtolower($ext1); /* $img_to_resize = resize_image($sig, 100, 100, $crop=false);*/ $rando = rand(00001,99999); $hash = sha1($pic); $hash = $hash.$rando; $upload_folder1 = "signature/".$hash.".".$ext1; $uploadpic = $hash.".".$ext1; $in = array('iden' => $random, 'haddress' => $haddress, 'caddress' => $caddress, 'saddress' => $saddress, 'sname' => $fname, 'oname' => $oname, 'reason' => $reason, 'phone' => $phone, 'email' => $email, 'dob' => $dob, 'matric' => $matric, 'fromto' => $fromto, 'program' => $program, 'entry' => $entry, 'office' => $office, 'school' => $school, 'semail' => $semail, 'scc' => $scc, 'signature' => $uploadpic, ); move_uploaded_file($sig, $upload_folder1); $signature = $upload_folder1; $image = new SimpleImage($signature); $image->resize(150, 100); $image->save($signature); $signature = $upload_folder1; create('trequest',$in); $to_email= 'records@dominicaninstitute.org'; $to_email2= 'registrar@dominicaninstitute.org'; $to_name='Registrar'; $subject="Application for Academic Transcript for $fname $oname"; $body ="<html><body style='text-align:center;'>"; $body.="Hello sir, an application for academic transcript has been sent.. Download it <a href='http://result.dominicaninstitute.org/apply2.php?d=$random'><button>Here</button></a>"; $body.="</body></html>"; mail::send_mail($to_email,$to_name,$subject,$body); mail::send_mail($to_email2,$to_name,$subject,$body); /*mail::send_mail('oladejioreoluwa94@gmail.com','oladejioreoluwa94@gmail.com',$subject,$body);*/ //$message = "You have successfully sent a mail to the registrar as reguards to your transcript click <a href='http://result.dominicaninstitute.org/apply2.php?d=$random'><button class='btn btn-success'>Here</button></a> to download your copy of the letter"; $message = "You have successfully sent a mail to the registrar as reguards to your transcript click <a href='http://localhost/du-result/apply2.php?d=$random'><button class='btn btn-success'>Here</button></a> to download your copy of the letter"; } ?> <!DOCTYPE html> <html> <head> <title>Application for Academic Transcript</title> <link rel="stylesheet" type="text/css" href="apply-old.css"> </head> <body> <div class="box"> <img src="logo2.png" style="display: block; margin: auto;" width="50%"> <h1 style="text-align: center; text-transform: uppercase;">Application for Academic Transcript</h1> <?php if (isset($message)) { ?> <div style="border: 1px solid black; margin:5px; border-radius: 10px; padding: 5px; background: #417b4e"> <?php echo $message; ?> </div> <?php } ?> <form method="post" enctype="multipart/form-data"> <h2>Bio-Data</h2> <div class="row"> <div class="form-group col-md-4"> <label>First Name</label> <input type="text" name="fname" required placeholder="Full Name"> </div> <div class="form-group col-md-4"> <label>Other Names</label> <input type="text" name="oname" required placeholder="Other Names"> </div> <div class="form-group col-md-4"> <label>House Address</label> <input type="text" name="haddress" required placeholder="e.g NO 1, Zone 1"> </div> </div> <div class="row"> <div class="form-group col-md-4"> <label>City Address</label> <input type="text" name="caddress" required placeholder="e.g city"> </div> <div class="form-group col-md-4"> <label>State/Country Address</label> <input type="text" name="saddress" required placeholder="e.g State, Country"> </div> <div class="form-group col-md-4"> <label>Phone Number</label> <input type="text" name="phone" required placeholder="e.g+234..."> </div> </div> <div class="row"> <div class="form-group col-md-4"> <label>Email</label> <input type="text" name="email" required placeholder="abc@example.com"> </div> <div class="form-group col-md-4"> <label>Date of Birth</label> <input type="date" name="dob" required placeholder="" min="1901-01-01" max="<?php echo date('Y-m-d');?>"> </div> <div class="form-group col-md-4"> <label>Nationalty</label> <input type="text" required placeholder=""> </div> </div> <h2>My DI Data</h2> <div class="row"> <div class="form-group col-md-3"> <label>Matric No</label> <input type="text" name="matric" required placeholder="e.g DI/123"> </div> <div class="form-group col-md-3"> <label>Year of Entry</label> <input type="text" name="entry" required placeholder="e.g 2018/2019"> </div> <div class="form-group col-md-3"> <label>Year of Graduation </label> <input type="text" name="fromto" required placeholder="e.g 2018/2019"> </div> <div class="form-group col-md-3"> <label>Program</label> <input type="text" name="program" required placeholder="e.g B.A. Philosophy" > </div> </div> <h2>Destination of Transcript</h2> <h3 style="color:red;">For Official Use</h3> <div class="row"> <div class="form-group col-md-4"> <label>Reason for Transcript <small>(in pursuit of)</small></label> <input type="text" name="reason" placeholder="eg in pursuit of Postgraduate Studies"> </div> <div class="form-group col-md-4"> <label>Full Name of Institution</label> <input type="text" name="school" placeholder="e.g Dominican University, Ibadan"> </div> <div class="form-group col-md-4"> <label>Institutional Address </label> <textarea name="office" placeholder="e.g The PostGraduate School; Dominican University, Ibadan P.M.B 5361 Oyo State Nigeria."></textarea> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label>Institution City/Country </label> <input type="text" name="scc" placeholder="e.g Ibadan, Nigeria"> </div> <div class="form-group col-md-6"> <label>Institution Email </label> <input type="email" name="semail" placeholder="abc@example.com"> </div> </div> <h3 style="color:red;">For Personal Use</h3> <div class="row"> <div class="form-group col-md-4"> <label>Email(Valid Personal Email) </label> <input type="email" name="semail" placeholder="abc@example.com"> </div> </div> <hr> <div class="row"> <div class="form-group col-md-4"> <label>Signature(size must not be greater than 100X100px) </label> <input type="file" name="signature" placeholder="e.g 2014-2018"> </div> </div> <button class="btn btn-success" type="submit" name="submit">Submit</button> </form> </div> </body> </html>