<?php
/*
 **************************************************************************************************
 *    Copyright (c) 2010-2012 Just Another Video script
 *
 * 	  This file is part of Just Another Video Script.
 *    Version 1.4.3
 *    info@justanothervideoscript.com
 **************************************************************************************************
 *    Come to website for support or buying additional plugins/modules.
 *    http://justanothervideoscript.com/
 **************************************************************************************************
 *    By using this software you agree that you have read and acknowledged our End-User License
 *    Agreement available at http://justanothervideoscript.com/license and can be bound by it.
 **********************************************************************************
 */
include_once("adminfunctions.inc");

	if (isset($_POST['submit'])) { 
		$hdvideo = $_POST['hdvideo'] == 'on' ? 1 : 0 ;
		$db->query("UPDATE `setting` SET `value` = '".$hdvideo."' WHERE `setting` = 'hdvideo'") ;
		$maxresolution_h = $_POST['maxresolution_h'] ;
		$db->query("UPDATE `setting` SET `value` = '".$maxresolution_h."' WHERE `setting` = 'maxresolution_h'") ;
		$maxresolution_w = $_POST['maxresolution_w'] ;
		$db->query("UPDATE `setting` SET `value` = '".$maxresolution_w."' WHERE `setting` = 'maxresolution_w'") ;
		$mp4box = $_POST['mp4box'] ;
		$db->query("UPDATE `setting` SET `value` = '".$mp4box."' WHERE `setting` = 'mp4box'") ;
		$downhdmember = $_POST['downhdmember'] == 'on' ? 1 : 0 ;
		$db->query("UPDATE `setting` SET `value` = '".$downhdmember."' WHERE `setting` = 'downhdmember'") ;	
		$downhdguest = $_POST['downhdguest'] == 'on' ? 1 : 0 ;
		$db->query("UPDATE `setting` SET `value` = '".$downhdguest."' WHERE `setting` = 'downhdguest'") ;	
		$submitmsg = "Everything has been updated now." ;
		
	}
	
	$hdvideo = getSetting(hdvideo, $db) == 1 ? 'CHECKED' : '' ;
	$maxresolution_h = getSetting(maxresolution_h, $db) ;
	$maxresolution_w = getSetting(maxresolution_w, $db) ;
	$mp4box = getSetting(mp4box, $db) ;
	$downhdmember = getSetting(downhdmember, $db) == 1 ? 'CHECKED' : '' ;
	$downhdguest = getSetting(downhdguest, $db) == 1 ? 'CHECKED' : '' ;
	
?>
<h2>HD Settings</h2>
<div class="settings">

	<fieldset>
		<form action="" method="post" enctype="multipart/form-data">
		<table>
			<tr>
					<h3><?=$submitmsg?><h3>
			</tr>
			<tr>
					<td>Enable HD video:</td>
					<td><input type="checkbox" name="hdvideo" <?=$hdvideo?>></td>
			</tr>
			<tr>
					<td>mp4box path:</td>
					<td><input type="text" size="50" name="mp4box" value="<?=$mp4box?>"></td>
			</tr>
			<tr>
					<td>Guest can download HD videos(mp4):</td>
					<td><input type="checkbox" name="downhdguest" <?=$downhdguest?>></td>
			</tr>	
			<tr>
					<td>Members can download HD videos(flv):</td>
					<td><input type="checkbox" name="downhdmember" <?=$downhdmember?>></td>
			</tr>			
			<tr>
					<td>Max Resolution height:</td>
					<td><input type="text" size="10" name="maxresolution_h" value="<?=$maxresolution_h?>"></td>
			</tr>	
			<tr>
					<td>Max Resolution width:</td>
					<td><input type="text" size="10" name="maxresolution_w" value="<?=$maxresolution_w?>"></td>
			</tr>	
			<tr>	
					<td><input class="submitbutton" type="submit" name="submit" value="Submit" /></td>
			</tr>
		</table>
		</form>

	</fieldset>
</div>

