<?php
/*

  osCommRes, Services Online
  http://www.oscommres.com

  Copyright (c) 2005 osCommRes

  Released under the GNU General Public License
  
  Freeway eCommerce from ZacWare
http://www.zac-ware.com/freeway

Copyright 2007 ZacWare Pty. Ltd
*/
// Set flag that this is a parent file
	define( '_FEXEC', 1 );
require('includes/application_top.php');?>
<html>
<head>
<title>Valid Events List</title>
<style type="text/css">
<!--
h4 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center}
p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
th {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
-->
</style>
<head>
<body>
<table width="550" border="1" cellspacing="1" bordercolor="gray">
<tr>
<td colspan="3">
<h4>Valid Events List</h4>
</td>
</tr>
<?
   $coupon_get=tep_db_query("select restrict_to_events from " . TABLE_COUPONS . "  where coupon_id='".$HTTP_GET_VARS['cid']."'");
   $get_result=tep_db_fetch_array($coupon_get);

    echo "<tr><th>Events ID</th><th>Events Name</th></tr><tr>";
    $pr_ids = split("[,]", $get_result['restrict_to_events']);
    for ($i = 0; $i < count($pr_ids); $i++) {
      $result = mysql_query("SELECT * FROM events e, events_description ed WHERE e.events_id = ed.events_id and language_id = '" . $languages_id . "'and e.events_id  = '" . $pr_ids[$i] . "'");
      if ($row = mysql_fetch_array($result)) {
            echo "<td>".$row["events_id"]."</td>\n";
            echo "<td>".$row["events_name"]."</td>\n";
            echo "</tr>\n";
      }
    }
      echo "</table>\n";
?>
<br>
<table width="550" border="0" cellspacing="1">
<tr>
<td align=middle><input type="button" value="Close Window" onClick="window.close()"></td>
</tr></table>
</body>
</html>
