<?php 
$pgMod="about_us";
    if($_POST)
    {

		      $ch = curl_init();
        $cfile = new CURLFile($_FILES['image']['tmp_name'], $_FILES['image']['type'], $_FILES['image']['name']);
       if($_FILES['image']['name'] !=""){
      
        $data = array("myimage"=>$cfile,"content"=>$_POST['content']);
       }else{
            $data = array("content"=>$_POST['content']);
       }
//  print_r($data);
// die();
        $url = "https://bps.savarnacloudtech.com/api/about.php";
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
        $responce = curl_exec($ch);

        redirect(URL_ADMIN_HOME.getQueryString(array("src"=>"website", "page_id"=>$pgMod)));

}	
?>

<?php 

// $data = $db->getRow("select * from about_us where id='1' ");
  $aryPgAct=array("src"=>"website", "page_id"=>$pgMod,"action"=>"add");

            $url = "https://bps.savarnacloudtech.com/api/get_aboutus.php";

            $context  = stream_context_create($options);
            $result = file_get_contents($url, false, $context);

            $temp = json_decode($result,true);
            
            // $aryList = $temp['slider'];
?>
	<div class="row-fluid">
        <form method="post" action="" enctype="multipart/form-data">
			<!-- Forms: Box -->
			<div class="span12">

				<!-- Forms: Top Bar -->
				<div class="top-bar">
					<h3><i class="icon-cog"></i>About us</h3>
				</div>
				<!-- / Forms: Top Bar -->

				<!-- Forms: Content -->
				<div class="well no-padding">

					    <div class="control-group">
							<label class="control-label" for="heading">Content</label>
							<div class="controls">
								<textarea rows="12" name="content" value="<?php echo $temp["content"]; ?>" class="input-block-level"><?php echo $temp["content"]; ?></textarea>
							</div>
						</div>
                       
                        
                        
                                    <div class="control-group">
            					<label class="control-label" for="heading">Choose Photo</label>
            					<div class="controls">
            						<input type="file" id="image" name="image" class="input-block-level" value="<?php echo $temp["slider"]; ?>">
            						  <?php if($temp["slider"]!=""){ ?>
                                    <img src="<?php echo $temp["slider"]; ?>" style="width: 820px;">
                                <?php } ?>
            					</div>
            					
            				</div>
                                 
                         
						<div class="form-actions" style="text-align: center;margin-bottom: 3%;">
                        
							<button type="submit" class="btn btn-primary"> Save Changes</button>
							
						</div>
                        
				</div>
				<!-- / Forms: Content -->

			</div>
			<!-- / Forms: Box -->

        </form>
	</div>