daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Apr 29th, 2017 526 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include('constant.php');
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  6.  
  7. <head>
  8.   <title>SISTEM KEMASUKAN PELAJAR LATIHAN INDUSTRI PPKT</title>
  9.   <meta name="description" content="free website template" />
  10.   <meta name="keywords" content="enter your keywords here" />
  11.   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  12.   <meta http-equiv="X-UA-Compatible" content="IE=9" />
  13.   <link rel="stylesheet" type="text/css" href="css/style.css" />
  14.   <script type="text/javascript" src="js/jquery.min.js"></script>
  15.   <script type="text/javascript" src="js/image_slide.js"></script>
  16.   <script type="text/javascript" src="js/jquery.easing-sooper.js"></script>
  17.   <script type="text/javascript" src="js/jquery.sooperfish.js"></script>
  18.   <script type="text/javascript">
  19.     $(document).ready(function() {
  20.       $('ul.sf-menu').sooperfish();
  21.     });
  22.   </script>
  23. </head>
  24.  
  25. <body>
  26.  
  27. <?php
  28. include('header.php');
  29. ?>
  30.  
  31.     <div id="banner">
  32.         <div id="welcome">
  33.           <h1> <img width="940" height="250" src="images/log.png"  /><br></h1>
  34.             <div id="welcome_slogan"></div><!--close welcome-->
  35.         </div>
  36.     </div>      
  37.                   <br><br><br><br><p><p><br><p><br>
  38.  
  39.     <div id="container">
  40.         <div class="row-fluid">
  41.             <div class="span12">
  42.                 <ul id="myTab" class="nav nav-tabs"><br>
  43.                 <a href onclick="window.location.href='home_student.php'" data-toggle="modal"><i class="icon-signout icon-large"></i>&nbsp;KEMBALI</a>
  44.                
  45.                 </ul>
  46.                
  47.             </div>
  48.         </div>
  49.       </div>
  50.  
  51.    
  52.  
  53. <div class="container"><br><br>
  54.     <div class="thumbnail">
  55.         <div class="row">
  56.     <div class="span2"></div>
  57.             <div class="span9"><br>
  58.                 <center>
  59.     <div class="alert alert-info"><strong><i class="icon-file"></i>&nbsp;Sila Penuhkan Maklumat Dengan Lengkap. Sebarang Pertanyaan Sila Hubungi Pegawai Yang Bertugas</strong></div>
  60.     <form enctype="multipart/form-data" class="form-horizontal" method="POST" action = "indexstudent.php">
  61.         <center>
  62.         <legend class="text-info"> <i class="fa fa-user"></i>&nbsp;MAKLUMAT PERIBADI</legend>
  63.         <div class="form-group">
  64.            
  65.             <div class="control-group">
  66.             <label class="control-label" for="stud_pic">Gambar Pasport</label>
  67.             <input type="file" class="form-control" name="stud_pic" accept="image/jpeg/jpg/png" required>
  68.             </div>
  69.            
  70.                          
  71.             <div class="control-group">
  72.             <label class="control-label" for="stud_name">Nama Penuh</label>
  73.             <input type="text" class="span4" id="stud_name" name="stud_name"  required>
  74.             </div>
  75.            
  76.            
  77.             <div class="control-group">
  78.             <label class="control-label" for="stud_ic">No Kad Pengenalan</label>
  79.             <input type="text" class="span4" id="stud_ic" name="stud_ic" required>
  80.             </div>
  81.            
  82.            
  83.             <div class="control-group">
  84.             <label class="control-label" for="stud_add">Alamat Surat Menyurat</label>
  85.             <input type="text" class="span4" id="stud_add" name="stud_add"  required>
  86.             </div>
  87.            
  88.            
  89.             <div class="control-group">
  90.             <label class="control-label" for="stud_postcode">Poskod</label>
  91.             <input type="text" class="span4" id="stud_postcode" name="stud_postcode"  required>
  92.             </div>
  93.            
  94.            
  95.             <div class="control-group">
  96.             <label class="control-label" for="stud_city">Bandar</label>
  97.             <input type="text" class="span4" id="stud_city" name="stud_city"  required>
  98.             </div>
  99.        
  100.    
  101.             <div class="control-group">
  102.             <label class="control-label" for="stud_state">Negeri</label>
  103.             <select class="span2" name="stud_state" id= "stud_state" required>
  104.             <option value = ""></option>
  105.             <option value = "KELANTAN">KELANTAN</option>
  106.             <option value = "TERENGGANU">TERENGGANU</option>
  107.             <option value = "PAHANG">PAHANG</option>
  108.             <option value = "PULAU PINANG">PULAU PINANG</option>
  109.             <option value = "PERLIS">PERLIS</option>
  110.             <option value = "KEDAH">KEDAH</option>
  111.             <option value = "PERAK">PERAK</option>
  112.             <option value = "SELANGOR">SELANGOR</option>
  113.             <option value ="WILAYAH PERSEKUTUAN">WILAYAH PERSEKUTUAN</option>
  114.             <option value = "MELAKA">MELAKA</option>
  115.             <option value = "NEGERI SEMBILAN">NEGERI SEMBILAN</option>
  116.             <option value = "JOHOR">JOHOR</option>
  117.             <option value = "SABAH">SABAH</option>
  118.             <option value = "SARAWAK">SARAWAK</option>
  119.             </select>
  120.             </div>
  121.            
  122.            
  123.             <div class="control-group">
  124.             <label class="control-label" for="stud_email">Email</label>
  125.             <input type="text" class="span4" id="stud_email" name="stud_email" required>
  126.             </div>
  127.            
  128.             <div class="control-group">
  129.             <label class="control-label" for="stud_phone">No Telefon</label>
  130.             <input type="text" class="span4" id="stud_phone" name="stud_phone" required>
  131.             </div>
  132.            
  133.             <div class="control-group">
  134.             <label class="control-label" for="stud_waris">Nama Waris</label>
  135.             <input type="text" class="span4" id="stud_waris" name="stud_waris" required>
  136.             </div>
  137.            
  138.          <div class="control-group">
  139.             <label class="control-label" for="stud_pwaris">No Telefon Waris</label>
  140.             <input type="text" class="span4" id="stud_pwaris" name="stud_pwaris" required>
  141.             </div>
  142.          
  143.             <div class="control-group">
  144.             <label class="control-label" for="stud_gender">Jantina</label>
  145.             <select class="span2" id= "stud_gender" name="stud_gender" required>
  146.             <option></option>
  147.             <option value= "LELAKI">LELAKI</option>
  148.             <option value = "PEREMPUAN" >PEREMPUAN</option>
  149.             </select>
  150.             </div>
  151.                              
  152.            
  153.             <legend class="text-info"> <i class="fa fa-user"></i>&nbsp;MAKLUMAT TEMPAT PENGAJIAN</legend>
  154.             <div class="form-group">
  155.            
  156.                          
  157.                 <div class="control-group">
  158.                 <label class="control-label" for="stud_iptname">Nama IPT/IPTS</label>
  159.                 <input type="text" class="span4" id="stud_iptname" name="stud_iptname"  required>
  160.                 </div>
  161.                
  162.            
  163.                 <div class="control-group">
  164.                 <label class="control-label" for="stud_iptadd">Alamat Tempat Pengajian</label>
  165.                 <input type="text" class="span4" id="stud_iptadd" name="stud_iptadd"  required>
  166.                 </div>
  167.                
  168.  
  169.                 <div class="control-group">
  170.                 <label class="control-label" for="stud_faculty"> Nama Fakulti</label>
  171.                 <input type="text" class="span4" id="stud_faculty" name="stud_faculty"  required>
  172.                 </div>
  173.                
  174.  
  175.            
  176.                 <div class="control-group">
  177.                 <label class="control-label" for="stud_course">Bidang Pengajian</label>
  178.                 <input type="text" class="span4" id="stud_course" name="stud_course"  required>
  179.                 </div>
  180.                
  181.              
  182.                 <div class="control-group">
  183.                 <label class="control-label" for="cgpa">CGPA</label>
  184.                 <input type="text" class="span4" id="cgpa" name="cgpa"  required>
  185.                 </div>
  186.            
  187.              
  188.                 <div class="control-group">
  189.                 <label class="control-label" for="stud_iptphone">No Telefon IPT/IPTS</label>
  190.                 <input type="text" class="span4" id="stud_iptphone" name="stud_iptphone"  required>
  191.                 </div>
  192.                
  193.            
  194.                 <div class="control-group">
  195.                 <label class="control-label" for="stud_iptfax">No Faks IPT/IPTS</label>
  196.                 <input type="text" class="span4" id="stud_iptfax" name="stud_iptfax"  required>
  197.                 </div>
  198.                
  199.              
  200.                 <div class="control-group">
  201.                 <label class="control-label" for="stud_sv">Nama Penyelia</label>
  202.                 <input type="text" class="span4" id="stud_sv" name="stud_sv"  required>
  203.                 </div>
  204.            
  205.            
  206.                 <div class="control-group">
  207.                 <label class="control-label" for="stud_sdate">Tarikh Mula Latihan Industri </label>
  208.                  <input type="date" class="form-control" name="stud_sdate" required>
  209.                 </div>
  210.              
  211.                          
  212.                 <div class="control-group">
  213.                 <label class="control-label" for="stud_edate">Tarikh Tamat Latihan Industri </label>
  214.                  <input type="date" class="form-control" name="stud_edate" required>
  215.                   </div>
  216.  
  217.                    <div class="control-group">
  218.                 <label class="control-label" for="stud_adate">Tarikh Mohon </label>
  219.                  <input type="date" class="form-control" name="stud_adate" required>
  220.                   </div>
  221.            
  222.            
  223.                 <legend class="text-info"> <i class="fa fa-user"></i>&nbsp;LAMPIRAN</legend>
  224.             <div class="form-group">
  225.  
  226.                 <div class="control-group">
  227.                 <label class="control-label" for="transkrip">Transkrip</label>
  228.                 <input type="file" class="form-control" name="stud_transkrip" required>
  229.                 </div>
  230.  
  231.                 <div class="control-group">
  232.                 <label class="control-label" for="resume">Resume</label>
  233.                 <input type="file" class="form-control" name="stud_resume" required>
  234.                 </div>
  235.            
  236.                 <div class="control-group">
  237.                 <label class="control-label" for="surat">Surat Permohonan Universiti</label>
  238.                 <input type="file" class="form-control" name="stud_surat" required>
  239.                 </div>
  240.  
  241.                
  242.                 <center>
  243.                 <input type="submit" name="submit" value="Hantar" class="btn btn-info"></input>
  244.                 </div>
  245.                         </center>
  246.                     </form>
  247.                 </center>
  248.             </div>
  249.         </div>
  250.     </div>
  251. </div>
  252. <div id="footer_container">
  253.     <div id="footer">
  254.       <a href="#">SISTEM KEMASUKAN PELAJAR LATIHAN INDUSTRI PPKT</a> | <a href="#">Copyright &copy; 2016 - All Rights Reserved</a>
  255.     </div><!--close footer-->  
  256. </div><!--close footer_container-->
  257.  
  258.   </body>
  259.   </html>
  260.  
  261.     <?php
  262.     if (isset($_POST['submit'])){
  263.     //var_dump($_FILES);
  264.     //var_dump($_POST);
  265.    
  266.     $stud_pic= mysql_escape_string(file_get_contents($_FILES['stud_pic']['tmp_name']));
  267.     $stud_name=$_POST['stud_name'];
  268.     $stud_ic=$_POST['stud_ic'];
  269.     $stud_add=$_POST['stud_add'];
  270.     $stud_postcode=$_POST['stud_postcode'];
  271.     $stud_city=$_POST['stud_city'];
  272.     $stud_state=$_POST['stud_state'];
  273.     $stud_phone=$_POST['stud_phone'];
  274.     $stud_email=$_POST['stud_email'];
  275.     $stud_gender=$_POST['stud_gender'];
  276.     $stud_iptname=$_POST['stud_iptname'];
  277.     $stud_iptadd=$_POST['stud_iptadd'];
  278.     $stud_faculty=$_POST['stud_faculty'];
  279.     $stud_course=$_POST['stud_course'];
  280.     $stud_course=$_POST['stud_course'];
  281.     $stud_iptphone=$_POST['stud_iptphone'];
  282.     $stud_iptfax=$_POST['stud_iptfax'];
  283.     $stud_sv=$_POST['stud_sv'];
  284.     $stud_sdate=$_POST['stud_sdate'];
  285.     $stud_edate=$_POST['stud_edate'];
  286.     $cgpa=$_POST['cgpa'];
  287.     $stud_waris=$_POST['stud_waris'];
  288.     $stud_pwaris=$_POST['stud_pwaris'];
  289.     $stud_adate=$_POST['stud_adate'];
  290.     ///to upload file pdf doc...any document in database
  291.     $stud_resume=rand(1000,100000).'_'.time().'_'.str_replace(' ','_',$_FILES['stud_resume']['name']);
  292.     $stud_surat=rand(1000,100000).'_'.time().'_'.str_replace(' ','_',$_FILES['stud_surat']['name']);
  293.     $stud_transkrip=rand(1000,100000).'_'.time().'-'.str_replace(' ','_',$_FILES['stud_transkrip']['name']);
  294.     $pathArray = explode(DIRECTORY_SEPARATOR,$_SERVER['SCRIPT_FILENAME']);
  295.     unset($pathArray[count($pathArray) - 1]);
  296.     //$realPath = 'C:\xampp\htdocs\internship1\internship';
  297.     $sp_resume = BASEPATH.DIRECTORY_SEPARATOR.'storage'.DIRECTORY_SEPARATOR.'resume'.DIRECTORY_SEPARATOR.$stud_resume;
  298.     $sp_surat = BASEPATH.DIRECTORY_SEPARATOR.'storage'.DIRECTORY_SEPARATOR.'surat'.DIRECTORY_SEPARATOR.$stud_surat;
  299.     $sp_transkrip = BASEPATH.DIRECTORY_SEPARATOR.'storage'.DIRECTORY_SEPARATOR.'transkrip'.DIRECTORY_SEPARATOR.$stud_transkrip;
  300.     //var_dump($sp_resume);
  301.     //var_dump($sp_surat);
  302.     //var_dump($sp_transkrip);
  303.    
  304.     move_uploaded_file($_FILES['stud_resume']['tmp_name'], $sp_resume);
  305.     move_uploaded_file($_FILES['stud_surat']['tmp_name'], $sp_surat);
  306.     move_uploaded_file($_FILES['stud_transkrip']['tmp_name'], $sp_transkrip);
  307.     //exit();
  308.    
  309.     //$stud_resume=mysql_escape_string(file_get_contents($_FILES['stud_resume']['tmp_name']));
  310.     //$stud_surat=mysql_escape_string(file_get_contents($_FILES['stud_surat']['tmp_name']));
  311.     //$stud_transkrip=mysql_escape_string(file_get_contents($_FILES['stud_transkrip']['tmp_name']));
  312.    
  313.    
  314.    
  315.    
  316.     $query = "INSERT INTO student (stud_pic,stud_name,stud_ic,stud_add,stud_postcode,stud_city,stud_state,stud_gender,stud_email,stud_phone,stud_iptname,stud_iptadd,stud_faculty,stud_course,stud_iptphone,stud_iptfax,stud_sv,stud_sdate,stud_edate,cgpa,stud_waris,stud_pwaris,stud_transkrip,stud_resume,stud_surat, stud_adate)
  317.   VALUES" ."('$stud_pic','$stud_name','$stud_ic','$stud_add','$stud_postcode','$stud_city','$stud_state','$stud_gender','$stud_email','$stud_phone','$stud_iptname','$stud_iptadd','$stud_faculty','$stud_course','$stud_iptphone','$stud_iptfax','$stud_sv','$stud_sdate','$stud_edate','$cgpa', '$stud_waris', '$stud_pwaris','$stud_transkrip','$stud_resume','$stud_surat', '$stud_adate')";
  318.    
  319.     mysql_query($query)or die(mysql_error());
  320.     ?>
  321.     <script type="text/javascript">
  322.     alert('Permohonan anda telah berjaya. Terima Kasih. Nota : Sila semak status permohonan selepas sebulan daripada tarikh hantar permohonan.');
  323.     window.location="papar_student_stud.php";
  324.     </script>
  325.  
  326.     <?php
  327.     }
  328.     ?>
  329.  
  330.     <?php
  331. require'vendor/autoload.php';
  332. ?>
  333.  
  334. <?php
  335. /**
  336.  * This example shows settings to use when sending via Google's Gmail servers.
  337.  */
  338.  
  339. //SMTP needs accurate times, and the PHP time zone MUST be set
  340. //This should be done in your php.ini, but this is how to do it if you don't have access to that
  341. date_default_timezone_set('Asia/Kuala_Lumpur');
  342.  
  343. //require 'C:\xampp\htdocs\internship1\internship\vendor\phpmailer\phpmailer/PHPMailerAutoload.php';
  344.  
  345. //Create a new PHPMailer instance
  346. $mail = new PHPMailer;
  347.  
  348. //Tell PHPMailer to use SMTP
  349. $mail->isSMTP();
  350.  
  351. //Enable SMTP debugging
  352. // 0 = off (for production use)
  353. // 1 = client messages
  354. // 2 = client and server messages
  355. $mail->SMTPDebug = 0;
  356.  
  357. //Ask for HTML-friendly debug output
  358. $mail->Debugoutput = 'html';
  359.  
  360. //Set the hostname of the mail server
  361. $mail->Host = 'smtp.gmail.com';
  362. // use
  363. // $mail->Host = gethostbyname('smtp.gmail.com');
  364. // if your network does not support SMTP over IPv6
  365.  
  366. //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
  367. $mail->Port = 587;
  368.  
  369. //Set the encryption system to use - ssl (deprecated) or tls
  370. $mail->SMTPSecure = 'tls';
  371.  
  372. //Whether to use SMTP authentication
  373. $mail->SMTPAuth = true;
  374.  
  375. //Username to use for SMTP authentication - use full email address for gmail
  376. $mail->Username = "wan.oxyride@gmail.com";
  377.  
  378. //Password to use for SMTP authentication
  379. $mail->Password = "farhan93";
  380.  
  381. //Set who the message is to be sent from
  382. $mail->setFrom('wan.oxyride@gmail.com', 'First Last');
  383.  
  384. //Set an alternative reply-to address
  385. $mail->addReplyTo('replyto@example.com', 'First Last');
  386.  
  387. //Set who the message is to be sent to
  388. $mail->addAddress('sheerahana@gmail.com', 'John Doe');
  389.  
  390. //Set the subject line
  391. $mail->Subject = 'PHPMailer GMail SMTP test';
  392.  
  393. //Read an HTML message body from an external file, convert referenced images to embedded,
  394. //convert HTML into a basic plain-text alternative body
  395. $mail->msgHTML('hjgjj');
  396.  
  397. //Replace the plain text body with one created manually
  398. $mail->AltBody = 'This is a plain-text message body';
  399.  
  400. //Attach an image file
  401. $mail->addAttachment('C:\xampp\htdocs\internship1\internship');
  402.  
  403. //send the message, check for errors
  404. if (!$mail->send()) {
  405.     echo "Mailer Error: " . $mail->ErrorInfo;
  406. } else {
  407.     echo "Message sent!";
  408. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top