<?php
	ob_start();
	session_start();
	
	//Include Files
	include("admin.php");
	
	include("dbConnection.php");
	
	//Declaring Variable
	$studentid;
	$recordSet1;
	$recordSet2;
	$dateOfCreation;
	$stdrollno;
	$studentname;
	$classname;
	$dob;
	//$placeOfBirth;
	$address;
	$country;
	$gender;
	$uploadImage;
	//$age;
	//$timeOfBirth;
	//$maritalStatus;
	$NA = "<font color = 'red'>Not Available</font>";
	
	$filePath;
	$fileName;
	$pageSize;
	
	//Retrieving Session Variable
	if(isset($_REQUEST["add_alerts_id"]))
	{
		$add_alerts_id = $_REQUEST["add_alerts_id"];
		//echo $studentid;
	}
	else
	{
		header('Location:index.php?message=Unauthorised%20Access%20Prohibited');
	}
	$add_alerts_id = convert_uudecode($add_alerts_id);
	//echo $add_alerts_id;
	//Creating 'dbConnection' Object
	$dbObject = new dbConnection();
	$con = $dbObject->getConnection();
	//echo $con;
	
	if($con)
	{
		//echo "MySQL Server Connected<br/>";
		$dbResult = $dbObject->selectDatabase();
		if($dbResult)
		{
			
			$adminObj = new admin();
			
			$recordSet1 = $adminObj->getAlertDetails($add_alerts_id,$con);
			while($row = mysql_fetch_array($recordSet1))
			{
				$add_alerts_id = $row["add_alerts_id"];
				$main_title = $row["main_title"];
				$sub_title = $row["sub_title"];
				$sub_main_title = $row["sub_main_title"];	
				$description = $row["description"];
				$uploadImage = $row["uimage"];
				$read_more = $row["read_more"];
				$facebook = $row["facebook"];
				$google_plus = $row["google_plus"];
				$twitter = $row["twitter"];
				$status = $row["status"];								
			}
			
		}
		else
		{
			echo mysql_errno() . " : " . mysql_error();
		}
	}
	else
	{
		echo mysql_errno() . " : " . mysql_error();
	}
	
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="keywords" content="admin, dashboard, bootstrap, template, flat, modern, theme, responsive, fluid, retina, backend, html5, css, css3">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" href="#" type="image/png">

  <title>Alerts</title>

  <!--icheck-->
  <link href="js/iCheck/skins/minimal/minimal.css" rel="stylesheet">
  <link href="js/iCheck/skins/square/square.css" rel="stylesheet">
  <link href="js/iCheck/skins/square/red.css" rel="stylesheet">
  <link href="js/iCheck/skins/square/blue.css" rel="stylesheet">

  <!--dashboard calendar-->
  <link href="css/clndr.css" rel="stylesheet">


  <!--common-->
  <link href="css/style.css" rel="stylesheet">
  <link href="css/style-responsive.css" rel="stylesheet">




  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->
  <script type = "text/javascript" src = "../js/paging.js"></script>
  
</head>

<body class="sticky-header">

<section>
		<!-- left side start-->
		<div class="left-side sticky-left-side">

			<!--logo and iconic logo start-->
			<?php include("include/add-logo.php"); ?>
			<!--logo and iconic logo end-->

			<div class="left-side-inner">

				<!-- visible to small devices only -->
				<div class="visible-xs hidden-sm hidden-md hidden-lg">
					<div class="media logged-user">
						
					</div>

					<h5 class="left-nav-title">Account Information</h5>
					<ul class="nav nav-pills nav-stacked custom-nav">
						<li><a href="EditProfile.php"><i class="fa fa-user"></i> <span>Profile</span></a></li>
						<li><a href="changePassword.php"><i class="fa fa-cog"></i> <span>Settings</span></a></li>
						<li><a href="SignOut.php"><i class="fa fa-sign-out"></i> <span>SignOut</span></a></li>
					</ul>
				</div>

				<?php
					include("include/sideNav.php");
				?>
				

			</div>
		</div>
		<!-- left side end-->

		<!-- main content start-->
		
		<div class="main-content">

			<!-- header section start-->
			<div class="header-section">

				<!--toggle button start-->
				<a class="toggle-btn"><i class="fa fa-bars"></i></a>
				<!--toggle button end-->

				<!--search start-->
				<!-- <form class="searchform" action="index.html" method="post">
					<input type="text" class="form-control" name="keyword"
						placeholder="Search here..." />
				</form> -->
				<!--search end-->

				<!--notification menu start -->
				<div class="menu-right">
					<ul class="notification-menu">
						
						
						
							
						<li><a href="#" class="btn btn-default dropdown-toggle"
							data-toggle="dropdown"> Admin <span
								class="caret"></span>
						</a>
							<ul class="dropdown-menu dropdown-menu-usermenu pull-right">
								<li><a href="EditProfile.php"><i class="fa fa-user"></i> Profile</a></li>
								<li><a href="changePassword.php"><i class="fa fa-cog"></i> Settings</a></li>
								<li><a href="SignOut.php" data-toggle="model" data-target="#mymodel"><i
										class="fa fa-sign-out"></i> Log Out</a></li>
							</ul>
						</li>

					</ul>
				</div>
				<!--notification menu end -->

			</div>
			<!-- header section end-->


			
			<div class="container">

				<div class="modal fade" id="mymodal" role="dialog">
					<form action="go" method="post" id="mymodel">
						<div class="modal-dialog">

							<!-- Modal content-->
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal">&times;</button>
									<h4 class="modal-title">Logout Confirmation</h4>
								</div>
								<div class="modal-body">
									<p>Are you sure want to Sign out!</p>
								</div>
								<div class="modal-footer">
									<button autofocus="autofocus" type="submit"
										class="btn btn-default ">Yes</button>
									<button type="button" class="btn btn-default"
										data-dismiss="modal">No</button>
								</div>
							</div>

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

			</div>




        <!--body wrapper start-->
        <div class="wrapper">
            	<div class="row mt">
						<div class="col-lg-12">
							
								 <div class="col-xs-12 col-sm-12 col-md-10 col-lg-10 col-md-offset-2 col-lg-offset-2 toppad " >
								  
   									
   
								  <div class="panel panel-info">
									<div class="panel-heading">
									  <h3 class="panel-title"><?php echo $main_title;?></h3>
									</div>
									<div class="panel-body">
									  <div class="row">
										<div class="col-md-3 col-lg-3 " align="center"> 
											<!--img alt="User Pic" src="" class="img-circle img-responsive"--> 
											<?php
												if($uploadImage !== "" && file_exists($uploadImage))
												{
													echo "<a  id='example3' href='$uploadImage' title='alerts Proof' target='_blank' > <img src='$uploadImage' alt='images/noimage.png' class ='ima-circle img-responsive'/ target='_blank' width='85%' height='55%'></a>";
												
												
												}else
												{
													echo "<img src = 'images/noimage.png' width='25%' height='20%'></img>";
												}
											
											?>
										</div>
										
										<div class=" col-md-9 col-lg-9  table-responsive"> 
										  <table class="table table-user-information" >
											<tbody>
											  <tr>
												<td>Alerts Id</td>
												<td><?php echo $add_alerts_id;?></td>
											  </tr>
											  <tr><!--echo $phone;$postalCode;echo $state;echo $country;echo $referenceBy;-->
												<td>Main Title</td>
												<td><?php echo $main_title;?></td>
											  </tr>
											  <tr>
												<td>Sub Title</td>
												<td><?php echo $sub_title;?></td>
											  </tr>
											  <tr>
												<td>Sub-Main Title</td>
												<td><?php echo $sub_main_title;?></td>
											  </tr>
											  <tr>
												<td>Description</td>
												<td><?php echo $description;?></td>
											  </tr>
												<tr>
												<td>Read More</td>
												<td><?php echo $read_more;?></td>
											  </tr>
											  <tr>
												<td>Face Book</td>
												<td><?php echo $facebook; ?></td>
											  </tr>
												<td>Google Plus</td>
												<td><?php echo $google_plus; ?></td>
											  </tr>
											  </tr>
												<td>Twitter</td>
												<td><?php echo $twitter; ?></td>
											  </tr>
											 
											</tbody>
										  </table>
										  </div>
										  
										</div>

									  </div>

									</div>

										 <div class="panel-footer">

												<a href="viewAlerts.php" class="btn btn-sm btn-primary"><i class="fa fa-hand-o-left"></i></a>

												

												<span class="pull-right">
													
													<a href="editAlerts.php?add_alerts_id=<?php echo $add_alerts_id;?>" data-original-title="Edit this user" data-toggle="tooltip" type="button" class="btn btn-sm btn-warning"><i class="fa fa-pencil-square-o"></i></a>
													
												</span>


											</div>

									
								  </div>
								  
						   
						</div>
					</div>
        </div>
        <!--body wrapper end-->

        <!--footer section start-->
        <!--footer>
            2014 &copy; AdminEx by ThemeBucket
        </footer>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="js/jquery-migrate-1.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/modernizr.min.js"></script>
<script src="js/jquery.nicescroll.js"></script>

<!--easy pie chart-->
<script src="js/easypiechart/jquery.easypiechart.js"></script>
<script src="js/easypiechart/easypiechart-init.js"></script>

<!--Sparkline Chart-->
<script src="js/sparkline/jquery.sparkline.js"></script>
<script src="js/sparkline/sparkline-init.js"></script>

<!--icheck -->
<script src="js/iCheck/jquery.icheck.js"></script>
<script src="js/icheck-init.js"></script>

<!-- jQuery Flot Chart-->
<script src="js/flot-chart/jquery.flot.js"></script>
<script src="js/flot-chart/jquery.flot.tooltip.js"></script>
<script src="js/flot-chart/jquery.flot.resize.js"></script>
<script src="js/flot-chart/jquery.flot.pie.resize.js"></script>
<script src="js/flot-chart/jquery.flot.selection.js"></script>
<script src="js/flot-chart/jquery.flot.stack.js"></script>
<script src="js/flot-chart/jquery.flot.time.js"></script>
<script src="js/main-chart.js"></script>

<!--common scripts for all pages-->
<script src="js/scripts.js"></script>

<script type = "text/javascript">
	$(function(){
	$('select.styled').customSelect();
	});
	
	function search()
{
	//Retrieving Form Fields
	searchValue = document.getElementById("texSearch").value;
	if(searchValue == "")
	{
		document.getElementById("texSearch").focus();
		return false;
	}
	else
	{
		var filePath = "home.php?search="+searchValue;
		//alert(filePath);
		window.open(filePath,'_self');
	}
}
</script>
<script type="text/javascript">
 function CallPrint(print) {
 	//alert("strid");
            var prtContent = document.getElementById(print);
            var WinPrint = window.open('', '', 'letf=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0');
            WinPrint.document.write(prtContent.innerHTML);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();
        }
</script>
</body>
</html>
