error_reporting(E_ALL ^ E_NOTICE); $con = mysql_connect("localhost","user",""); if (!$con){ die("Can not connect: " . mysql_error()); } mysql_select_db("pq",$con); $sql = "SELECT * FROM user"; $rs = mysql_query($sql) or die(mysql_error()); echo "<select name='responsible2'>"; while($row = mysql_fetch_array($rs)){ echo "<option value=".$row['Email'].">".$row['Position']."</option>"; $responsible2=$row['Position']; echo $responsible2; } mysql_free_result($rs); "</select>"; if(isset($_POST['Notify2'])){ $responsible2=$_POST['responsible2']; $progressid=$_SESSION['Progressid']; echo $progressid; mysql_query("INSERT INTO improvement_plan (Responsible2,Progressid) VALUES ('" . $responsible2 . "','" . $progressid . "')"); $Ipid = mysql_insert_id(); $result = mysql_query($query) OR die(mysql_error()); } if(!empty($result)) { $useremail=$_SESSION['Email']; require 'PHPMailer_5.2.4/PHPMailer_5.2.4/class.phpmailer.php'; $mail = new PHPMailer; $mail->IsSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.office365.com'; // Specify main and backup server $mail->Mailer = "smtp"; $mail->SMTPAuth = false; $mail->IsHTML(true); // Set email format to HTML $mail->ContentType = "text/html"; $mail->From ='$useremail'; $mail->FromName =$_SESSION['Username']; $mail->AddAddress($row['Email']); // Name is optional $mail->Subject = 'IPDS system Notification'; $mail->Body = 'Please do your Improvement Plan'; if(!$mail->Send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; }else{ echo 'Message has been sent'; } ?> <form name="ipdprogress" method="post" action="<?php echo $_SERVER['PHP_SELF']; ??>"> <input type="hidden" name="Progressid" value="<?php echo $progressid; ??>" /> <table width="850" border="1"> <tr align="center"> <th width="80" scope="col">Responsible</th> <input type="submit" name="Notify2" value="Notify" /> </tr> </form> <?php <br mode="hold" /?> $disable = ''; $i = 0; $d = 0; $con = mysql_connect("localhost","user",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("pq", $con); $sql = "SELECT * FROM improvement_plan where Ipid='" . $Ipid . "'"; $res_list = mysql_query($sql); if( isset( $_SESSION['Progressid'] ) ) { $progressid= $_SESSION['Progressid']; //mysql_query("INSERT INTO improvement_plan (Responsible2 VALUES ('" . $_SESSION["Position"] . "')"); //$message = "Record Modified Successfully"; } while($row_list = mysql_fetch_array($res_list)){ $i++; ?> <tr><td align="center"><div id="Responsible2<?php echo $i; ?>"><?php if($row_list['Responsible2'] != '0000-00-00'){ echo ($row_list['Responsible2']); }else{ echo '-'; } ??></div></td></tr> <tr><td align="center"><div id="Progressid<?php echo $i; ?>"><?php if($row_list['Progressid'] != '0000-00-00'){ echo ($row_list['Progressid']); }else{ echo '-'; } ??></div></td></tr> } if($i == 0){ ?> <tr><td colspan="7">No data.</td></tr> $disable = 'disabled="disabled"'; } ?> if($row['Status2'] == 'buka'){ } ?> <br> </br></table> </form>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)