<!DOCTYPE html>
<html>
    <head>
        <?php include("header-js.php");?>	
		
<!-----hrm-------------->		
<link rel="stylesheet" href="css/style.css" />
<!-- Responsive -->
<link rel="stylesheet" href="css/responsive.css" />
<!--<link rel="stylesheet" href="css/style.css" />-->
<link rel="stylesheet" href="css/styles.css" />
<!-- Responsive -->
<!--<script language="javascript" src="js/css3-mediaqueries.js" type="text/javascript"></script>-->

<!-----hrm-------------->
        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->

    </head>
	<?php
	include_once("class/class.MySQL.php");
	include_once("class/userdefinedfunctions.php");
	$db	=new MySQL();
	$userfunction	=new userdefinefunctions();
    session_start();

	function firstSunday($DATE)
    {
	// $DATE='2014-04-01';
         $date = date('Y-m',strtotime($DATE));
         $day = trim(strtotime("%e",$DATE));

        for($day; $day <= '7'; $day++){
             $dd = strftime("%A",strtotime($date.'-'.$day));
            if($dd == 'Sunday'){
                return $day;
            }
        }
    }
?>


    <body class="skin-blue">
 <?php include("header.php"); ?>
                 <!-- Small boxes (Stat box) -->
                    

                    <!-- Main row -->
                    <div class="row">
                    
					<div id="wrapper" style="width:1048px;">


<div class="content">

<div class="report-tab">

<div class="employee-title">
<div class="report-left" style="width:300px"><h2><translate>Manage Organization News</translate><span></span></h2></div>



<div class="clear-float"></div>
</div><!-- /employee-title -->



<div class="report-cell-02">

<!--<label><input type="button" value="Timesheet" data-page="Timesheet_show"  class="btn-tab-01 Timesheet_show" /></label>
<label><input type="button" value="Muster Roll" data-page="Muster_Roll_show"  class="btn-tab-01 Muster_Roll_show" /></label>-->
    


<ul class="payroll-menu" style="margin-bottom:0px !important; ">
<li data-page="listOrganizationNews" class="nav-menubar"  style="padding-bottom: 30px !important;"><translate>Organization News</translate></li>
</ul>
<ul class="payroll-menu" style="margin-bottom:0px !important; ">
<li data-page="addOrganizationNews" class="nav-menubar" style="padding-bottom: 30px !important;"><translate>Add News</translate></li>
</ul>



	
    
<div class="clear-float"></div>
</div>
<form class="add-news-form">
<div class="content-area">

</div>
</form>

<?php
	//////////////////////////////user rights checking//////////////////////////////////////

$userid=$_SESSION['admin_id'];

$sub_rights=mysql_fetch_array(mysql_query("select * from menu  where  menu_name='Organization News'  "));

$view_rights=mysql_fetch_array(mysql_query("select * from tbl_user_rights where user_id='$userid' and m_menu_id='$sub_rights[menu_id]'"));


//////////////////////////////user rights checking//////////////////////////////////////
?>
<?php if($_SESSION['usertype']=='Superadmin' || $_SESSION['branchadmin']=='Y'){?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="new-news" style="display:none;">
  <!--<tr>
    <td width="29%">Add News </td>
    <td width="71%">&nbsp;</td>
  </tr>-->
  <tr>
  <!--  <td valign="middle"><label>News Title</label> </td>-->
    <td><input type="text" name="news_title" id="news_title" class="news_title form-control" placeHolder="Add News Title"><br/></td>
  </tr>
  <tr>
<!--    <td valign="top"><label>New</label></td>-->
    <td><textarea class="news_description" name="news_description"  id="news_descriptions">Add News here ...</textarea><br/></td>
  </tr>
  <tr>
<!--    <td>&nbsp;</td>-->
    <td><input type="button" name="Submit" class="submit-news color-button3" value="Submit">
	<input type="button" name="Submit" class="cancel-news color-button3" value="Cancel"></td>
  </tr>
</table>

<?php } else{?>

       <?php if($view_rights['add_right']==1){?>
	   <table width="100%" border="0" cellspacing="0" cellpadding="0" class="new-news" style="display:none;">
  <!--<tr>
    <td width="29%">Add News </td>
    <td width="71%">&nbsp;</td>
  </tr>-->
  <tr>
  <!--  <td valign="middle"><label>News Title</label> </td>-->
    <td><input type="text" name="news_title" class="news_title form-control" id="news_title" placeHolder="Add News Title"><br/></td>
  </tr>
  <tr>
<!--    <td valign="top"><label>New</label></td>-->
    <td><textarea class="news_description" name="news_description" placeHolder="Add News Title" id="news_descriptions">Add News here ...</textarea><br/></td>
  </tr>
  <tr>
<!--    <td>&nbsp;</td>-->
    <td><input type="button" name="Submit" class="submit-news color-button3" value="Submit">
	<input type="button" name="Submit" class="cancel-news color-button3" value="Cancel"></td>
  </tr>
</table>
	   <?php }else { ?>
       	   <table width="100%" border="0" cellspacing="0" cellpadding="0" class="new-news" style="display:none;">

  <tr>
  
    <td align="center"><font color="#FF0000" size="4">Sorry You Don't Have Enough Permission To View This Form.....</font></td>
  </tr>
  </table>
<?php } } ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit_news" style="display:none;">
  <!--<tr>
    <td width="29%">Add News </td>
    <td width="71%">&nbsp;</td>
  </tr>-->
  <tr>
  <!--  <td valign="middle"><label>News Title</label> </td>-->
    <td><input type="text" name="news_title" class="news_title form-control" id="news_title" placeHolder="Add News Title"><br/></td>
  </tr>
  <tr>
<!--    <td valign="top"><label>New</label></td>-->
    <td><textarea class="news_description" name="news_description" id="news_descriptions" placeHolder="Add News Title">Add News here ...</textarea><br/></td>
  </tr>
  <tr>
<!--    <td>&nbsp;</td>-->
    <td><input type="button" name="Submit" class="submit-news color-button3" value="Submit">
	<input type="button" name="Submit" class="cancel-news color-button3" value="Cancel"></td>
  </tr>
</table>
</div>



<div class="clear-float"></div>
</div><!-- /content -->


<div class="footer">

<strong>© add-HRM</strong><br />
<span>Developed by <a href="http://www.aadhocc.com" target="_blank">Aadhocc</a></span></div><!-- /footer -->

</div>
                    </div><!-- /.row (main row) -->
                </section><!-- /.content -->
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
<?php 
include("footer-js.php");
?>
		
		<!--------------scripts for employee list-------------->
<!--<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>-->

<script src="js/plugins/ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="js/common.js"></script>
<script src="js/manage-news.js"></script>
<script language="javascript" src="js/css3-mediaqueries.js" type="text/javascript"></script>
	<!--------------scripts for employee list-------------->
    </body>
</html>