View file File name : changeeventstatus.php Content :<?php session_start(); include("../include/config.php"); include("../include/functions.php"); include("../include/simpleimage.php"); validate_admin(); if($_REQUEST['update']=='Update Detail'){ $user_id =mysqli_real_escape_string($GLOBALS['conn'],$_REQUEST['user_id']); $cancelkey =mysqli_real_escape_string($GLOBALS['conn'],$_REQUEST['cancelkey']); $other_reason_for_cancel =mysqli_real_escape_string($GLOBALS['conn'],$_REQUEST['other_reason_for_cancel']); if($other_reason_for_cancel){ $reason_for_cancel=$other_reason_for_cancel; } else { $reason_for_cancel=$reason_for_cancel=mysqli_real_escape_string($GLOBALS['conn'],$_REQUEST['reason_for_cancel']); } $cancelKey = explode('-', $cancelkey); $oid = $cancelKey[0]; $eid = $cancelKey[1]; $pid = $cancelKey[2]; $obj->query("UPDATE tbl_order_event SET event_cancel_reason='$reason_for_cancel', event_cancel_date = now() where id='$eid' and order_id ='$oid'"); $obj->query("UPDATE tbl_order_itmes SET order_status = 5, status_date = now() WHERE order_id ='$oid' and productid ='$pid'"); $_SESSION['sess_msg']="Status updated successfully.!"; ?> <script> parent.location="order-events-report.php"; </script> <?php } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo SITE_TITLE; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="css/admin.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle" class="headingbg bodr text14"><em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: Cancel Event On Order ID #<?php echo $_REQUEST['order_id']; ?></td> </tr> <tr> <td height="100" align="left" valign="top" bgcolor="#f7faf9" class="bodr"> <table width="100%" cellpadding="0" cellspacing="10"> <tr> <td class="paddBot11 paddRt14" colspan="2"><h2>Events</h2></td> </tr> <tr> <td class="paddBot11 paddRt14" colspan="2"> <table width="100%" border="0" cellspacing="10" cellpadding="0"> <form name="frm" method="POST" enctype="multipart/form-data" action=""> <input type="hidden" name="cancelkey" value="<?php echo $_REQUEST['cancelkey'];?>" /> <input type="hidden" name="user_id" value="<?php echo $_REQUEST['user_id'];?>" /> <tr> <td width="33%" align="right" class="paddBot11 paddRt14"><strong>Event Status</strong></td> <td width="67%" align="left" class="paddBot11"> <select name="subscription_status" id="ddlOrderStatus" style="width:240px;" > <option value="0">Cancel</option> </select> </td> </tr> <tr> <td width="33%" align="right" class="paddBot11 paddRt14"><strong>Reason For Cancel</strong></td> <td width="67%" align="left" class="paddBot11"> <select name="reason_for_cancel" id="reason_for_cancel"> <option value="Change of mind">Change of mind</option> <option value="Something important came up">Something important came up</option> <option value="Health emergency">Health emergency</option> <option value="Family emergency">Family emergency</option> <option value="Other">My reason not listed</option> </select> </td> </tr> <tr id="otherreason" style="display:none;"> <td width="33%" align="right" class="paddBot11 paddRt14"><strong>Other Reason</strong></td> <td width="67%" align="left" class="paddBot11"><textarea id="other_reason_for_cancel" name="other_reason_for_cancel" rows="5" cols="40"></textarea></td> </tr> <tr></tr><tr></tr> <tr> <td width="33%" align="right" class="paddRt14 paddBot11"> </td> <td width="67%" align="left" class="paddBot11"><input type="submit" name="update" value="Update Detail" class="btn" onclick="return validateData();"/> </td> </form> </table></td> </tr> </table> <script type="text/javascript"> function validateData(){ var x = document.getElementById("reason_for_cancel").value; var otv = document.getElementById("otherreason"); if(x=='Other'){ otv.style.display='table-row'; var other_reason_for_cancel = document.getElementById("other_reason_for_cancel").value; if(other_reason_for_cancel==''){ document.getElementById("other_reason_for_cancel").focus() return false; } else { return true; } } else { return true; } } </script> </body> </html>