<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php"); ?>
<?php

  $m->where("status",'0');
  $m->where("updates_id", $_GET['id']);
  $notifications123 = $m->get("eduportal_updates_details");


  if (isset($_GET['id'])) {
    

    $m->where ("updates_id", $_REQUEST['id']);

    $m->where ("branch_id", $_SESSION['branch']);

    $old_recored =  $m->get ('eduportal_seen_updates');


  if(count($old_recored)>0){


    $data = array(
      

      'date_time' => date("Y-m-d h:i:sa")
    );

     
      $m->where("updates_id",$_GET['id']);
      $m->where("branch_id",$_SESSION['branch']);
      $m->update('eduportal_seen_updates',$data);

  } else {

    $data = array(
       
        'branch_id' => $_SESSION['branch'],

        'updates_id' => $_GET['id'],     

        'date_time' => date("Y-m-d h:i:sa")

      );
      // echo "data--"."<pre>"; print_r($data); echo "</pre>";
         $result = $m->insert('eduportal_seen_updates',$data);

         }

  }

   ?>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Updates | EduPortal</title>
    <?php include('RootMe/css_links.php');?>
</head>
<body class="nav-md">
<div class="container body">
<div class="main_container">
<div class="col-md-3 left_col">
 <?php include('RootMe/sidebar.php');?>
 <?php include('RootMe/header.php');?>
</div>




<div class="right_col" role="main">
<div class="">

<div class="clearfix"></div>
<div class="row">
<div class="col-md-12">
<div class="x_panel">
<div class="x_title">
<h2>View Updates</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div class="row">



<div class="col-md-8 col-sm-12 ">
  <div class="inbox-body">
    
    <div class="mail_heading row">
      <div class="col-md-8">

      </div>
      <div class="col-md-4 text-right">
        <p class="date"><b>Posted:</b> <?php echo date("d-M-Y",strtotime($notifications123[0]['date_time']));?></p>
      </div>


      <div class="col-md-12"  >
        <h4 style="font-weight: bold;"> <?php echo $notifications123[0]['title'];?></h4>
      </div>

    </div>




<div class="view-mail" style="font-size: 16px;">
<p><?php echo $notifications123[0]['description'];?> </p>
</div>

<div class="attachment">

<!-- <p>
<span><i class="fa fa-paperclip">&nbsp;Image</i></span>


<!-- <a href="#">Download all attachments</a> |

</p>
<ul>
 <?php if($notifications123[0]['images']!=''){ ?>

        <a href="<?php echo DOMAIN.AgentDirectory;?>/img/<?php echo $notifications123[0]['images']; ?>">
        
        <img class="thumbnail"
        src="<?php echo DOMAIN.AgentDirectory;?>/img/<?php echo $notifications123[0]['images']; ?>"
         style="height:20%; width:100%; " />
       </a>
      <?php }  ?>

</ul> -->
</div>


</div>
</div>




<div class="col-md-4 col-sm-12 mail_list_column" style="padding-top: 1%;border: 1px solid #DBDBDB;">


      <a href="#">
      <div class="mail_list"  style="border:none;">
      <div class="left">

      </div>
      <div class="right">
      <?php

      $qr="SELECT * FROM eduportal_updates_details where status=0";
      $other_notification=$m->query($qr); 

      foreach($other_notification as $others){

        $m->where("updates_id",$others['updates_id']);
        $m->where("branch_id",$_SESSION['branch']);
        $records=$m->get('eduportal_seen_updates');


      ?>

      <div style="height: 80px;margin-top:1%;padding: 10px; background-color: <?php if(count($records)>0){echo "#f7f7f7;"; } else {echo "#d3d3d3;"; } ?> ">

        <a href="updates.php?<?php echo session_id().session_id().session_id();?>&id=<?php echo $others['updates_id'];?>">


          <h3 style="font-size: 14px; font-weight: 600px;"><?php echo substr($others['title'],0,85);?>  </h3>

         
          <span style="float: left;"> 
              <small> <?php echo date("d-M-Y",strtotime($others['date_time']));?></small>
           </span>

          <span style="float: right;"> 
             <button style=" background-color: #00adef; color: white; border:none;">Read more</button>
           </span>
          
        </a>
      </div>
      



      <?php } ?>

      
      </div>
      </div>
      </a>

</div>



 



</div>
</div>
</div>
</div>
</div>
</div>
</div>


<?php include("RootMe/footer.php");?>

</div>
</div>

<div class="compose col-md-6 col-xs-12">
<div class="compose-header">
New Message
<button type="button" class="close compose-close">
<span>×</span>
</button>
</div>
<div class="compose-body">
<div id="alerts"></div>
<div class="btn-toolbar editor" data-role="editor-toolbar" data-target="#editor">
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" title="Font"><i class="fa fa-font"></i><b class="caret"></b></a>
<ul class="dropdown-menu">
</ul>
</div>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" title="Font Size"><i class="fa fa-text-height"></i>&nbsp;<b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a data-edit="fontSize 5">
<p style="font-size:17px">Huge</p>
</a>
</li>
<li>
<a data-edit="fontSize 3">
<p style="font-size:14px">Normal</p>
</a>
</li>
<li>
<a data-edit="fontSize 1">
<p style="font-size:11px">Small</p>
</a>
</li>
</ul>
</div>
<div class="btn-group">
<a class="btn" data-edit="bold" title="Bold (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
<a class="btn" data-edit="italic" title="Italic (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
<a class="btn" data-edit="strikethrough" title="Strikethrough"><i class="fa fa-strikethrough"></i></a>
<a class="btn" data-edit="underline" title="Underline (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
</div>
<div class="btn-group">
<a class="btn" data-edit="insertunorderedlist" title="Bullet list"><i class="fa fa-list-ul"></i></a>
<a class="btn" data-edit="insertorderedlist" title="Number list"><i class="fa fa-list-ol"></i></a>
<a class="btn" data-edit="outdent" title="Reduce indent (Shift+Tab)"><i class="fa fa-dedent"></i></a>
<a class="btn" data-edit="indent" title="Indent (Tab)"><i class="fa fa-indent"></i></a>
</div>
<div class="btn-group">
<a class="btn" data-edit="justifyleft" title="Align Left (Ctrl/Cmd+L)"><i class="fa fa-align-left"></i></a>
<a class="btn" data-edit="justifycenter" title="Center (Ctrl/Cmd+E)"><i class="fa fa-align-center"></i></a>
<a class="btn" data-edit="justifyright" title="Align Right (Ctrl/Cmd+R)"><i class="fa fa-align-right"></i></a>
<a class="btn" data-edit="justifyfull" title="Justify (Ctrl/Cmd+J)"><i class="fa fa-align-justify"></i></a>
</div>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" title="Hyperlink"><i class="fa fa-link"></i></a>
<div class="dropdown-menu input-append">
<input class="span2" placeholder="URL" type="text" data-edit="createLink" />
<button class="btn" type="button">Add</button>
</div>
<a class="btn" data-edit="unlink" title="Remove Hyperlink"><i class="fa fa-cut"></i></a>
</div>
<div class="btn-group">
<a class="btn" title="Insert picture (or just drag & drop)" id="pictureBtn"><i class="fa fa-picture-o"></i></a>
<input type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />
</div>
<div class="btn-group">
<a class="btn" data-edit="undo" title="Undo (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a>
<a class="btn" data-edit="redo" title="Redo (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a>
</div>
</div>
<div id="editor" class="editor-wrapper"></div>
</div>
<div class="compose-footer">
<button id="send" class="btn btn-sm btn-success" type="button">Send</button>
</div>
</div>

<?php include('RootMe/js_linksscript.php');?>
</body>
</html>