<?php include_once $BL->props->get_page("templates/alp_admin/html/header.php"); ?>
<div id="content">
    <div id="display_list">
      <div class="tabs2" name='tt2' id='tt2' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs2';" ><?php echo $BL->props->lang['~faq']; ?></div>
      <div class="tab_separator">&nbsp;</div>
      <div class="tabs" name='tt4' id='tt4' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs';" ><a href="admin.php?cmd=addfaq" class="add_link"><?php echo $BL->props->lang['+addfaq']; ?></a></div>
      <div class="tab_separator">&nbsp;</div>
      <div class="tabs" name='tt1' id='tt1' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs';" ><a href="admin.php?cmd=faqgroup" class="add_link"><?php echo $BL->props->lang['+faqgroup']; ?></a></div>
      <div class="tab_separator">&nbsp;</div>
      <div class="tabs" name='tt3' id='tt3' onmouseover="javascript:this.className='tabs1';" onmouseout="javascript:this.className='tabs';" ><a href="admin.php?cmd=addfaqgroup" class="add_link"><?php echo $BL->props->lang['+addfaqgroup']; ?></a></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 class="tdheading" colspan="4">
					  <b>&nbsp;</b>
					  </td>
                    </tr>					
					<tr> 
                      <td colspan="4" 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>
		          <?php if (!count($faqs)) { ?>
    				<tr>
    					<td class="text_grey" colspan="4">
                        	<div align='center'>
                        	<?php echo $BL->props->lang['No_faq']; ?>
                        	</div>
    					</td>
    				</tr>
		          <?php } else { ?>
					<td class='text_grey' width="1%"></td>
                      <td class='text_grey'>
                      <b><?php echo $BL->props->lang['faqgroup_name']; ?></b></td>
                      <td class='text_grey'>
					  <b><?php echo $BL->props->lang['~faq']; ?></b></td>
                      <td class='text_grey' width='10%'></td>
                    </tr>		
					<?php foreach ($faqs as $key => $val) { ?>
                    <tr> 
                      <td colspan='4' 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' width="1%"></td>
                    <td class='text_grey'>
                      <?php $temp = $BL->faqgroups->getByKey($val['faqgroup_id']); echo isset($temp['faqgroup_name'])?$temp['faqgroup_name']:""; ?>
                      </td>
                      <td class='text_grey'>
					  <?php echo $val['questions']; ?>
                      </td>
                      <td class='text_grey' width='10%'><div align='right'>
                      <?php if($BL->getCmd("editfaq")){ ?>
                      <a href='<?php echo $PHP_SELF; ?>?cmd=editfaq&faq_id=<?php echo $val['faq_id']; ?>'><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; ?>edit_all.gif' alt='<?php echo $BL->props->lang['Edit']; ?>' border='0'></a>
                      &nbsp;
                      <?php } ?>                      
                      <?php if($BL->getCmd("delfaq")){ ?>
                      <a href="javascript:if(confirm('<?php echo $BL->props->lang['Do_you_want_to_delete_this_faq']; ?>'))document.location='<?php echo $PHP_SELF; ?>?cmd=delfaq&faq_id=<?php echo $val['faq_id']; ?>'"><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; ?>delete.gif' alt='<?php echo $BL->props->lang['Delete']."?"; ?>' border='0'></a>
                      &nbsp;
                      <?php } ?>
                      </div></td>
                    </tr>
                    <?php } ?>
		            <?php } ?>
					<tr> 
                      <td colspan="4" 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>
                  </table>
				  <br />
					<table width="100%" border="0" cellspacing="2" cellpadding="2" class="list_table">				
					<tr> 
                      <td class="text_grey" 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; ?>edit_all.gif'> <?php echo $BL->props->lang['Edit']; ?>
					  &nbsp;
					  <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; ?>delete.gif'> <?php echo $BL->props->lang['Delete']; ?>
					  </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"); ?>