Your IP : 10.1.73.149


Current Path : /home/bolconlineco/www/coordinator/
Upload File :
Current File : /home/bolconlineco/www/coordinator/update_news.php

<?php 
  ob_start();
  session_start();
  ?>
<?php include('includes/header.php'); ?>

<?php
if(!isset($_SESSION['coordinator']) || $_SESSION['coordinatorrole'] != 2)
 {
	header("location:../index.php");
	exit(); 
 }
?>
<script language="javascript" src="includes/jquery.js"></script>

<h3 class="page-title">Update News</h3>
<ul class="page-breadcrumb breadcrumb">
    <li><i class="fa fa-home"></i> <a href="dashbord.php"> Home </a> <i class="fa fa-angle-right"></i> </li>
    <li><a href="News.php"> News Management </a><i class="fa fa-angle-right"> </i> </li>
    <li class="active">Update News</li>
</ul>
					
				<?php
				     if(isset($_POST['news']))
					  {
						  
						 $id = $_POST['id'];
						 
						 $title = $_POST['title'];
						 
						 $desc=$_POST['description'];
						 
						 $status = $_POST['status'];
						 
						 $query  = "update tbl_news set title='$title',descriptions='$desc',nStatus='$status' where id='$id'";
						 
						 $result = mysql_query($query) or die(mysql_error());
						 
						 header("location:News.php?msg=Updated Successfully");
						 
						 exit();
						 
						   
					  }
				
				?>	

                      
                <?php
				  if(isset($_GET['id']))
				   {
					   $id= $_GET['id'];
					   
					   $result = mysql_query("select * from tbl_news where id='$id'") or die(mysql_error());
					   
					   $fetch = mysql_fetch_array($result);
				   }
				?>
              
                         <form action="" method="post" class="form-horizental">
                             <div class="form-group clearfix">
                                <label for="title" class="col-sm-2 control-label">Title:</label>
                                 <div class="col-sm-6">
                                    <input  type="text" name="title" style="width:500px;" value="<?php echo $fetch['title']; ?>" class="form-control"/>
                                 </div>
							</div>

                             <div class="form-group clearfix">
                                <label for="description" class="col-sm-2 control-label">Description:</label>
                                 <div class="col-sm-6">
                              <textarea class="ckeditor form-control" name="description" id="description" rows="10" cols="50"><?php echo $fetch['descriptions']; ?></textarea>
                                </div>
                            </div>

                             <div class="form-group clearfix">
                                 <label for="status" class="col-sm-2 control-label">Status:</label>
                                 <div class="col-sm-6">
                               <select name="status" class="form-control">
                               <?php
							   
							   if($fetch['nStatus']==1)
							    {
									?>
                               <option value="1">Enable</option>
                               <option value="0">Disable</option>
                               <?php
								}else
								{
							   ?>
                               <option value="0">Disable</option>
                               <option value="1">Enable</option>
                               <?php
								}
							   ?>
                               </select>
                            </div>
                            </div>

                            <div class="form-group clearfix">
                                <div class="col-sm-6 col-sm-offset-2">
                                   <input type="hidden" name="id" value="<?php echo $id;?>" />
									<input class="add2 btn btn-success" type="submit" name="news" value="Update " />
								</div>						
							</div>
                            </form> 
                            </div>
                            </div>
                            </div>
                            </div>
                            </div>
                            </div>

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


  <?php include('../includes/footer.php');?>
<script>
	CKEDITOR.replace( 'description',
    {
        filebrowserBrowseUrl : '<?php echo $url;?>combine/cms/ckfinder/ckfinder.html',
        filebrowserImageBrowseUrl : '<?php echo $url;?>combine/cms/ckfinder/ckfinder.html?Type=Images',
        filebrowserFlashBrowseUrl : '<?php echo $url;?>combine/cms/ckfinder/ckfinder.html?Type=Flash',
        filebrowserUploadUrl : '<?php echo $url;?>combine/cms/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
        filebrowserImageUploadUrl : '<?php echo $url;?>combine/cms/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
        filebrowserFlashUploadUrl : '<?php echo $url;?>combine/cms/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
    });
	</script>