<?php include ("app_needed/config.php");
require_once("app_classes/module_tags.inc"); 
if(!$_SESSION[unique])
header("Location: ".APP_WEBSITE."/login.html");
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=<?= language("CHARSET") ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?= language('PAGE_list_tags_title') ?> - <?= $config->get_value('platform_title') ?></title>
<link rel="shortcut icon" type="image/png" href="app_images/favicon.png"/>
<link href="app_needed/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="app_needed/style.tipsy.css" type="text/css" />
</head>

<body>
<div id="wrapper">
	<?php include("module.header.php"); ?>
	<?php include ("module.menu.php"); ?>
	<div class="content">
	  <div class="info">
        <div class="left">
		<h1><?= language('PAGE_list_tags_title') ?></h1>
        </div>
        <div class="right">
        <a href="new-tag.html" class="btn"><?= language('BUTTON_new_tag') ?></a>
        </div>
        <div class="clear"></div>
		</div>
	  <div class="box  list_head">
	    <div class="inside">
	      <table width="100%" border="0">
	        <tr>
	          <td width="39%"><?= language('TABLE_tag_name')?></td>
	          <td width="17%"  class="none"><?= language('TABLE_tag_type')?></td>
	          <td width="14%"  class="none"><?= language('TABLE_status')?></td>
	          <td width="15%"  class="none"><?= language('TABLE_created_date')?></td>
	          <td width="15%"><?= language('TABLE_actions')?></td>
            </tr>
          </table>
        </div>
      </div>
      <?php 
		$sql = "SELECT * FROM `app_tags` ORDER BY `date` DESC ";
		$result = mysql_query ($sql);
		while ($tags = mysql_fetch_array($result))
		{
			$tag = new class_tags($tags[unique]);
			
		?>
      <div class="box list" id="<?= $tag->get_unique() ?>">
        <table width="100%" border="0">
          <tr>
            <td width="39%"><strong>
              <?= $tag->get_name() ?>
              -
              <?= $tag->get_website() ?>
              </strong><br /></td>
            <td width="17%" class="none"><?= $tag->get_ad_type() ?>
              <?php if($tag->get_tag_cost() == 2) echo " - CPC"; ?></td>
            <td width="14%" class="none <?= $tag->get_status()?>"><?php if($tag->get_valid() == 1 || $tag->get_valid() == 2) { ?>
              <input type="checkbox" class="switcher" id="t<?= $tag->get_unique() ?>" <?php if($tag->get_valid() == 1) echo "checked"; ?> />
              <?php }else echo"<span>" .$tag->get_status()."</span>";?></td>
            <td width="15%"class="none"><?= $tag->get_date() ?></td>
            <td width="15%"><a href="tag-<?= $tag->get_unique() ?>.html"><img src="app_images/icon-edit.png" width="24" class="tip" title="<?= language('ICON_tag_edit') ?>"  /></a> <a href="personal-daily-<?=$tag->get_unique()?>.html"><img src="app_images/icon-stats.png" width="24" class="tip" title="<?= language('ICON_statistics') ?>"  /></a> <a href="javascript:delete_tag('<?= $tag->get_unique() ?>')"><img src="app_images/icon-delete.png" width="24" class="tip" title="<?= language('ICON_tag_delete') ?>"  /></a></td>
          </tr>
        </table>
      </div>
      <?php } ?>
    </div>
</div>
<div id='confirm'>
<div class="left">
	<div class='title'><span><?= language('CONFIRM') ?></span></div>
	<div class='message'></div>
</div>
<div class="right">
	<div class='buttons'>
				<span class='no simplemodal-close'><?= language('NO') ?></span><span class='yes'><?= language('YES') ?></span>
               
	</div>
</div>
<div class="clear"></div>
	</div>
		<!-- preload the images -->
	<div style='display:none'>
		<img src='img/confirm/header.gif' alt='' />
		<img src='img/confirm/button.gif' alt='' />
	</div>

<script type="text/javascript" src="app_needed/jquery-1.9.0.min.js"></script>
<script type='text/javascript' src='app_needed/jquery.accordionmenu.js'></script>
<script type='text/javascript' src='app_needed/jquery.checkbox.js'></script>
<script type='text/javascript' src='app_needed/jquery.tipsy.js'></script>
<script type='text/javascript' src='app_needed/function.ajax.js'></script>
<script type='text/javascript' src='app_needed/simply-toast.min.js'></script>
<script type='text/javascript' src='app_needed/jquery.simplemodal.js'></script>
<script type='text/javascript' src='app_needed/functions.js'></script>
</body>
</html>
<?php mysql_close($conn); ?>