<?
include "../common.php";
include "../classMySQL.php";
//include "mydb.php";
$db = new db_mysql($server_name, $userdb, $passdb, $databasename,"");

 $db->select("file, hit", "product", "id='$pid'");
	   $file = $db->result(0, "file");
	   $ada = $db->num_rows();
	   //---update hit--
	$newhit = $db->result(0, "hit") + 1;
	$db->update("product", "hit=$newhit", "id=$pid");
	   $FILENAME = "../produk/file/$file"; //SET YOUR FILE HERE
	   include_once "../classes/class.httpdownload.php";
	   $object = new httpdownload;
	   switch (@$_GET['download']) {
			case 'resume_speed':
			case 'noresume_speed':
			case 'resume':
			case 'noresume':
				$object->set_byfile($FILENAME);
				if ($_GET['download'] == 'noresume' || $_GET['download'] == 'noresume_speed') $object->use_resume = false;
				if ($_GET['download'] == 'resume_speed' || $_GET['download'] == 'noresume_speed' ) $object->speed = 100;
				$object->download();
			break;
		}	

	
?>