<?php include_once $BL->props->get_page("templates/alp_admin/html/header.php"); ?>
<div id="content">
    <div id="display_list">
      <div class="tabs" name='tt1' id='tt1' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs';" ><a href="admin.php?cmd=coupons" class="add_link"><?php echo $BL->props->lang['~coupons']; ?></a></div>
      <div class="tab_separator">&nbsp;</div>
      <div class="tabs2" name='tt2' id='tt2' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs2';" ><?php echo $title; ?></div>
      <div class="tab_separator">&nbsp;</div>
    </div>
	<div id="display_list">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table">
					<tr> 
                      <td colspan="2" class="tdheading">
					  <b>&nbsp;</b>
					  </td>
                    </tr>
					<tr> 
                      <td colspan="2" class="text_grey"><img src="elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>spacer.gif" alt="" width="100%" height="1" /></td>
                    </tr>
				<tr>
					<td class="text_grey" colspan="2">
					<form name='form1' id='form1' method='post' action='<?php echo $PHP_SELF; ?>'>
				    <table width='100%' border='0' cellspacing='0' cellpadding='0'>
                      <tr> 
                        <td width='1%' class='text_grey'><div align='center'>
                        <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18'></div></td>
                        <td class='text_grey'>
						<div id="form1_label">
						<?php echo $BL->props->lang['Name']; ?>
						</div>
						<div id="form1_field">
                            <input name='coupon_name' type='text' class='search' id='coupon_name' size='20' value='<?php if($cmd=="edit_coupon")echo $coupon['coupon_name']; ?>' />
                          </div></td>
                      </tr>
                      <tr> 
                        <td colspan='2' class='text_grey'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' /></td>
                      </tr>

                      <tr> 
                        <td class='text_grey'><div align='center'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' 
height='18'></div></td>
                        <td class='text_grey'>
						<div id="form1_label">
						<?php echo $BL->props->lang['discount']; ?>
						</div>
						<div id="form1_field">
                            %<input name='coupon_discount' type='text' class='search' id='coupon_discount' size='7' value='<?php if($cmd=="edit_coupon")echo $coupon['coupon_discount']; ?>' />
                          </div></td>
                      </tr>
                      <tr> 
                        <td colspan='2' class='text_grey'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' /></td>
                      </tr>
                                          
                      
                      <tr> 
                        <td class='text_grey'><div align='center'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' 
height='18'></div></td>
                        <td class='text_grey'>
						<div id="form1_label">
						<?php echo $BL->props->lang['Include_domains']; ?>
						</div>
						<div id="form1_field">
                            <select name='coupon_domain' class='search'>
                            <option value='1' <?php if($cmd=="edit_coupon" && $coupon['coupon_domain']==1)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['Yes']; ?></option>
                            <option value='0' <?php if($cmd=="edit_coupon" && $coupon['coupon_domain']==0)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['No']; ?></option>
                            </select>
                        </div>
                        </td>
                      </tr>
                      <tr> 
                        <td colspan='2' class='text_grey'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' /></td>
                      </tr>
                      
                      
                      <tr> 
                        <td class='text_grey'><div align='center'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' 
height='18'></div></td>
                        <td class='text_grey'>
						<div id="form1_label">
						<?php echo $BL->props->lang['Include_addons']; ?>
						</div>
						<div id="form1_field">
                            <select name='coupon_addons' class='search'>
                            <option value='1' <?php if($cmd=="edit_coupon" && $coupon['coupon_addons']==1)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['Yes']; ?></option>
                            <option value='0' <?php if($cmd=="edit_coupon" && $coupon['coupon_addons']==0)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['No']; ?></option>
                            </select>
                        </div>
                        </td>
                      </tr>
                      <tr> 
                        <td colspan='2' class='text_grey'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' /></td>
                      </tr>
                      
                      <tr> 
                        <td class='text_grey'><div align='center'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' 
height='18'></div></td>
                        <td class='text_grey'>
                        <div id="form1_label">
                        <?php echo $BL->props->lang['customer_to_use']; ?>
                        </div>
                        <div id="form1_field">
                            <select name='customer_use' class='search'>
                            <option value='0' <?php if($cmd=="edit_coupon" && $coupon['customer_use']==0)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['all']; ?></option>
                            <option value='1' <?php if($cmd=="edit_coupon" && $coupon['customer_use']==1)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['new']; ?></option>
                            <option value='2' <?php if($cmd=="edit_coupon" && $coupon['customer_use']==2)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['current']; ?></option>
                            </select>
                        </div>
                        </td>
                      </tr>
                      <tr> 
                        <td colspan='2' class='text_grey'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' /></td>
                      </tr>
                      
                      
                      <tr> 
                        <td class='text_grey'><div align='center'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' 
height='18'></div></td>
                        <td class='text_grey'>
                        <div id="form1_label">
                        <?php echo $BL->props->lang['usage']; ?>
                        </div>
                        <div id="form1_field">
                            <select name='repeated' class='search'>
                            <option value='0' <?php if($cmd=="edit_coupon" && $coupon['repeated']==0)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['once']; ?></option>
                            <option value='1' <?php if($cmd=="edit_coupon" && $coupon['repeated']==1)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['repeated']; ?></option>
                            </select>
                        </div>
                        </td>
                      </tr>
                      <tr> 
                        <td colspan='2' class='text_grey'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' /></td>
                      </tr>
                      
                      <tr> 
                        <td class='text_grey'><div align='center'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' 
height='18'></div></td>
                        <td class='text_grey'>
						<div id="form1_label">
						<?php echo $BL->props->lang['Valid Upto']; ?>
						</div>
						<div id="form1_field">
							<?php
							if ($cmd == "edit_coupon")
							{
								list ($y, $m, $d)= explode("-", $coupon['coupon_valid']);
								echo $BL->utils->datePicker($d, $m, $y, "search");
							}
							else
							{
								echo $BL->utils->datePicker(date('d'), date('m'), date('Y'), "search");
							}
							?>
                        </div>
                        </td>
                      </tr>
                      <tr> 
                        <td colspan='2' class='text_grey'><img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' /></td>
                      </tr>
                      
                      
                      <tr> 
                        <td class='text_grey'><div align='center'></div></td>
                        <td class='text_grey'>
						<div id="form1_label">
						&nbsp;
						</div>
						<div id="form1_field"> 
                        	<input type='hidden' name='coupon_id' value='<?php if($cmd=="edit_coupon")echo $coupon['coupon_id']; ?>' />
                            <input type='hidden' name='cmd' value='<?php echo $cmd; ?>' />
                            <input name='submit' type='submit' class='search1' value='<?php if($cmd=="edit_coupon")echo $BL->props->lang['Update'];else echo $BL->props->lang['add']; ?>' />
                          </div></td>
                      </tr>
                    </table>
				  </form>
					</td>
				</tr>		
                  </table>
	</div>
</div>
<!--end content -->
<div id="navBar">
<?php include_once $BL->props->get_page("templates/alp_admin/html/_sidepanel.php"); ?>
</div>
<!--end navbar -->
<?php include_once $BL->props->get_page("templates/alp_admin/html/footer.php"); ?>