<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
  <title>KAMPUS MARKETI</title>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <!-- **** layout stylesheet **** -->
  <link rel="stylesheet" type="text/css" href="http://localhost/univ/themes/default/style/style.css" />
  <!-- **** colour stylesheet **** -->
  <link rel="stylesheet" type="text/css" href="http://localhost/univ/themes/default/style/colour_3.css" />
</head>

<body>
  <div id="main">
    <div id="logo">
      <h1>Kampüs Marketi</h1>
      <? $me = Auth::instance()->get_user();?>
    </div>
    <div id="menubar">
      <ul id="menu">
            <li><a><?= html::anchor("main/act","Anasayfa-<br>İlanlar") ?></a></li>
	    <li><a><?= html::anchor("thesale/sale","<b>İlan Ver</b>") ?></a></li>
            <li><a><?= html::anchor("onsale/index","Satiştaki <br> Ürünlerim") ?></a></li>
            <li><a><?= html::anchor("message/index","Mesajlar[".session::instance()->get("newMsg")."]") ?></a></li>
            <li><a><?= html::anchor("profile/index","Profilim") ?></a></li>
            <li><a><?= html::anchor("auth/logout","Çıkış");?></a></li>        
      </ul>
      <!--
      <div id="search">
        <form method="post" action="#">
          <p><input class="searchfield" type="text" value="" />
          <input class="searchbutton" name="submit" type="submit" value="search" /></p>
        </form>
      </div>
      -->
    </div>
    <div id="site_content">
        <div id="head_image">
        	<div id="slogan"><strong>KAMPÜS MARKETİ</strong> <br />
       	    Kampüs ve bölüm içindeki ilanlarınız için özelleştirilmiş bir websitesi</div>
            <div id="under_slogan_text">Kampüs içindeki her türlü ilana kolaylıkla ulaşın <br/>  
                Bölüm içindeki kitap alış-verişlerinizi artık rahatlıkla yapabilirsiniz <br/>
		Artık kolaylıkla kendi bölümünüzde ve kampüsünüzde ilan verebilirsiniz
		</div>
        </div>
      <div class="sidebar">
        <div class="sidebaritem">
          <h3>İLAN ARAMA KONUMU</h3>
          <ul>
            <li><a><?= html::anchor("main/act/-1","BÖLÜMÜNDEN") ?></a></li>
            <li><a><?= html::anchor("main/act/-2","KENDİ KAMPÜSÜNDEN") ?> </a></li>
            <li><a><?= html::anchor("main/act/-3","TÜM İLANLAR") ?> </a></li><!-- EKLENDI-->
	      <div id="search2">
		İlan Arama
	      <?=form::open("login/index")?>		
			      <?= form::input("search") ?>
			      <?=form::submit("ara", "Arama Yap")?>
	      <?=form::close()?> 
	      </div>
          </ul>
        </div>
        <div class="sidebaritem">
          <h3>KATEGORİLER</h3>
          <ul>
            <li><a><?= html::anchor("main/act/0","TÜM ÜRÜNLER") ?> </a></li>
            <li><a><?= html::anchor("main/act/2","KİTAP") ?> </a></li>
            <li><a><?= html::anchor("main/act/3","ELEKTRONİK") ?>  </a></li>
            <li><a><?= html::anchor("main/act/1","GİYSİ") ?> </a></li>
            <li><a><?= html::anchor("main/act/4","EV ARKADAŞI") ?>   </a></li>
          </ul>
        </div>            
        <div class="sidebaritem">
          <h3>BİLGİLERİM</h3>
          <ul>
            <a>Kullanıcı Adı:<?= $me?></a><br>
            <a>Üniversite:<?= $me->university->univname?></a><br>
            <a>Bölüm:<?= $me->department->departname?></a><br>
          </ul>
        </div>
      </div>
      <div id="content">
	<div id="ilan">
	<h1>İLANLAR</h1>
	</div>	  
            <? $i=(1+($pagination->current_page-1)*($pagination->items_per_page)); ?>
	<?  foreach($sales as $sale):?>
        <? $i++; ?>
<? if($i%2==0){  ?>
	<div id="sales1">
	   <blockquote>	    
	    <div id="sales2">
		<div id="number" >
		<h1><?//= $i; ?> </h1>
		</div>
		<div id="saleuser">    
		<?= $sale->user->username?>
		</div>
		<div id="saletime"> 
		<?=timation::sinceSaved(strtotime($sale->time))." ".'<br/>'?>
		</div>
		<div id="saleheader">
		  <?= html::anchor("productcontrol/production/".$sale->id, substr($sale->header, 0,30)."...")?>
	      </div>
	      <div id="saleinfo">
		  <?= substr($sale->product_type,0,30)."..." ?>
	      </div></br>
	      <div id="university1">
		  <?= $sale->university->univname ?> 
	      </div>
	    <?//= html::anchor("productcontrol/complain/".$sale->id," complain")?>
	    </div>
	    <?= "<hr align='center' width='85%'/>"?>
	   </blockquote>
	</div>
<? } else{ ?>
	<div id="sales3">
	  <blockquote>	
	  <div id="sales2">
	      <div id="number" >
	      <h1><?//= $i; ?> </h1>
	      </div>
	      <div id="saleuser">    
	      <?= $sale->user->username?>
	      </div>
	      <div id="saletime"> 
	      <?=timation::sinceSaved(strtotime($sale->time))." ".'<br/>'?>
	      </div>
	      <div id="saleheader">
		  <?= html::anchor("productcontrol/production/".$sale->id, substr($sale->header, 0,30)."...")?>
	      </div>
	      <div id="saleinfo">
		  <?= substr($sale->product_type,0,30)."..." ?>
	      </div></br>
	      <div id="university1">
		  <?= $sale->university->univname ?>
	      </div>
	  <?//= html::anchor("productcontrol/complain/".$sale->id," complain")?>
	  </div>
	  <?= "<hr align='center' width='85%'/>"?>
	 </blockquote>
	</div>
    <? } ?>
	<?  endforeach;?>
	</div>
	<br/><br/><br/>
	<div id="page">
	<?= $pagination?><br/>
    </div>

  </div>
    <div id="footer">
      Görüş ve önerileriniz için kampusmarketi@gmail.com adresine mail gönderebilirsiniz.
    </div>
</body>
</html>
