<?php
// INCLUDE HEADER IN PAGE
include('other_header.php');
// GET CURRENT DATE AND TIME
mysql_query("UPDATE Web_Settings SET firstrun='0' WHERE id='1'");
mysql_query("UPDATE Web_Footer_Menu SET link='f.signin' WHERE link='f.abuse'");
mysql_query("UPDATE Web_Footer_Menu SET link='f.signin' WHERE link='f.contact'");
$date = date('Y-m-d H:i:s');
if($_POST['save1']) {
	$newtitle = $_POST['title'];
	$description = $_POST['description'];
	$keywords = $_POST['keywords'];
	$mainurl = $_POST['mainurl'];
	$homeblocks = $_POST['homeblocks'];
	$paymentproof = $_POST['paymentproof'];
	$hwmchproofs = $_POST['hwmchproofs'];
	$ppvr = $_POST['ppvr'] / 100;
	$mincashout = $_POST['mincashout'];
	$mindeposit = $_POST['mindeposit'];
	$contactem = $_POST['contactem'];
	$smtphost = $_POST['smtphost'];
	$smtpport = $_POST['smtpport'];
	$smtpauth = $_POST['smtpauth'];
	$smtpusername = $_POST['smtpusername'];
	$smtppass = $_POST['smtppass'];
	$frommail = $_POST['frommail'];
	$replytoemail = $_POST['replytoemail'];
	mysql_query("UPDATE Web_Settings SET paymentproof='$paymentproof',hwmchproofs='$hwmchproofs',title='$newtitle',description='$description',keywords='$keywords',mainurl='$mainurl',homeblocks='$homeblocks',ppvr='$ppvr',mincashout='$mincashout',mindeposit='$mindeposit',contactem='$contactem',smtphost='$smtphost',smtpport='$smtpport',smtpauth='$smtpauth',smtpusername='$smtpusername',smtppass='$smtppass',frommail='$frommail',replytoemail='$replytoemail' WHERE id='1'");
	echo"<script type='text/javascript'>window.location= 'admin.Firstrun'</script>";
}
if($_POST['save2']) {
	$smactive = $_POST['smactive'];
	$smckey = $_POST['smckey'];
	$smvkey = $_POST['smvkey'];
	$smhkey = $_POST['smhkey'];
	$rcactive = $_POST['rcactive'];
	$rcsitekey = $_POST['rcsitekey'];
	$rcsecretkey = $_POST['rcsecretkey'];
	mysql_query("UPDATE Web_Settings SET smactive='$smactive',smckey='$smckey',smvkey='$smvkey',smhkey='$smhkey',rcactive='$rcactive',rcsitekey='$rcsitekey',rcsecretkey='$rcsecretkey' WHERE id='1'");
	echo"<script type='text/javascript'>window.location= 'admin.Firstrun'</script>";
}
if($_POST['save3']) {
	$jsonrates = $_POST['jsonrates'];
	$virustotal = $_POST['virustotal'];
	mysql_query("UPDATE Web_Settings SET jsonrates='$jsonrates',virustotal='$virustotal' WHERE id='1'");
	echo"<script type='text/javascript'>window.location= 'admin.Firstrun'</script>";
}
if($_POST['save4']) {
	$autocontinue = $_POST['autocontinue'];
	$bandur = $_POST['bandur'];
	$viddur = $_POST['viddur'];
	$intdur = $_POST['intdur'];
	$banneractive = $_POST['banneractive'];
	$videoactive = $_POST['videoactive'];
	$interstitialactive = $_POST['interstitialactive'];
	mysql_query("UPDATE Web_Settings SET autocontinue='$autocontinue',viddur='$viddur',bandur='$bandur',intdur='$intdur',banneractive='$banneractive',videoactive='$videoactive',interstitialactive='$interstitialactive' WHERE id='1'");
	echo"<script type='text/javascript'>window.location= 'admin.Firstrun'</script>";
}
?>
  <div class="container">
    <div class="jumbotron">
  						<h1>Shortify FirstRun Wizard</h1>
  						<p>Welcome in your control panel. Your installation was successfully done. 
  						Now you only need to configure all required settings. 
  						Below this information box is some inputs which will need to be filled. 
  						This is fresh new release, so we still want to update some files. 
  						You can check update status in tab Settings > Updates from header menu. 
  						Thank you for purchasing our item.</p>
  					</div>
 	 </br>
 	 <div class="jumbotron">
  						<h1>Cronjob settings</h1>
  						<p>Here is path to folder where is cronjob file saved, this file need to be run every day at midnight hour (0:00).</p>
  						<p>system/general/actions/cronjob.php</p>
  						<p>File will need to be run with hash information in HTTP GET type.<br>
  						Hash information must be same as admin secret word<br>
  						Here is basic scheme - system/general/actions/cronjob.php?hash=HASH_INFORMATION</p>
						<p>Actual secret word of admin is <b><?php echo $session_hash;?></b></p>  						
  						<p>so, you will need to run this - system/general/actions/cronjob.php?hash=<b><?php echo $session_hash;?></b></p>
  						<p>This is full command prepared for Linux servers</p>
  						<input readonly="readonly" onmouseover="this.select()" style="cursor:copy; opacity: 1;text-align: center;" class="form-control" value="0 0 * * * php <?php echo $fullserverdirectory;?>/system/general/actions/cronjob.php?hash=<?php echo $session_hash;?>" name="url" type="text">
  					</div>
 	 <?php
		$keywords = $sa['keywords'];								//***************
		$description = $sa['description'];						//***************
		$mainurl = $sa['mainurl'];									//***************
		$mincashout = $sa['mincashout'];							//***************
		$mindeposit = $sa['mindeposit'];							//***************
		$jsonrates = $sa['jsonrates'];							//***************
		$virustotal = $sa['virustotal'];							//***************
		$homeblocks = $sa['homeblocks'];							//***************
		$paymentproof = $sa['paymentproof'];							//***************
		$hwmchproofs = $sa['hwmchproofs'];							//***************
		$ppvr = 100*$sa['ppvr'];									//***************
		$contactem = $sa['contactem'];							//***************
		$title = $sa['title'];										//***************
		$interstitialactive = $sa['interstitialactive'];	//***************
		$banneractive = $sa['banneractive'];					//***************
		$videoactive = $sa['videoactive'];						//***************
		$intdur = $sa['intdur'];									//***************
		$viddur = $sa['viddur'];									//***************
		$bandur = $sa['bandur'];									//***************
		$autocontinue = $sa['autocontinue'];					//***************
		$smtphost = $sa['smtphost'];								//***************
		$smtpport = $sa['smtpport'];								//***************
		$smtpauth = $sa['smtpauth'];								//***************
		$smtpusername = $sa['smtpusername'];					//***************
		$smtppass = $sa['smtppass'];								//***************
		$replytoemail = $sa['replytoemail'];					//***************
		$frommail = $sa['frommail'];								//***************
		$smactive = $sa['smactive'];								//***************
		$smckey = $sa['smckey'];									//***************
		$smvkey = $sa['smvkey'];									//***************
		$smhkey = $sa['smhkey'];									//***************
		$rcactive = $sa['rcactive'];								//***************
		$rcsitekey = $sa['rcsitekey'];							//***************
		$rcsecretkey = $sa['rcsecretkey'];						//***************
	?>
		<div class="row">
      <div class="col-md-8 col-md-offset-2">
        <div class="well">
			<div class="row">
				<center>
				<form name="csrf_form" id="campaignform" action="" method="POST">
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<span class="input-group-btn">
								<input value="Save" class="btn btn-default" style="width: 150px;" name="save1" type="submit">
							</span>
					</div>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Title:</span>
               				<input name="title" value="<?php echo $title;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Description:</span>
               				<input name="description" value="<?php echo $description;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Keywords:</span>
               				<input name="keywords" value="<?php echo $keywords;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Web URL:</span>
               				<input name="mainurl" value="<?php echo $mainurl;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Home Blocks:</span>
               						<input id="hm1" class="toggle toggle-left" name="homeblocks" value="1" type="radio" <?php if($homeblocks == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="hm1" class="btn">Activated</label>
											<input id="hm2" class="toggle toggle-right" name="homeblocks" value="0" type="radio" <?php if($homeblocks == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="hm2" class="btn">Deactivated</label>
           							</div>
									</div>
									</center>					
							</div>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">FrontEnd Payment proofs:</span>
               						<input id="pp1" class="toggle toggle-left" name="paymentproof" value="1" type="radio" <?php if($paymentproof == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="pp1" class="btn">Activated</label>
											<input id="pp2" class="toggle toggle-right" name="paymentproof" value="0" type="radio" <?php if($paymentproof == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="pp2" class="btn">Deactivated</label>
           							</div>
									</div>
									</center>					
							</div>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">How much proofs you want display?:</span>
               						<input name="hwmchproofs" value="<?php echo $hwmchproofs;?>" class="form-control" type="text">
           							</div>
									</div>
									</center>					
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Referral Percentage:</span>
               				<input name="ppvr" value="<?php echo $ppvr;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Minimal withdraw:</span>
               				<input name="mincashout" value="<?php echo $mincashout;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Minimal deposit:</span>
               				<input name="mindeposit" value="<?php echo $mindeposit;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Contact Email:</span>
               				<input name="contactem" value="<?php echo $contactem;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SMTP Host:</span>
               				<input name="smtphost" value="<?php echo $smtphost;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SMTP Port:</span>
               				<input name="smtpport" value="<?php echo $smtpport;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SMTP Auth:</span>
               				<input name="smtpauth" value="<?php echo $smtpauth;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SMTP Username:</span>
               				<input name="smtpusername" value="<?php echo $smtpusername;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SMTP Password:</span>
               				<input name="smtppass" value="<?php echo $smtppass;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SMTP From email:</span>
               				<input name="frommail" value="<?php echo $frommail;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SMTP Reply to email:</span>
               				<input name="replytoemail" value="<?php echo $replytoemail;?>" class="form-control" type="text">
       					  	</div>
							</div>
							</center>
					</div>
					<input type="hidden" name="csrf_token" value="<?php echo $token; ?>">
				</form>
				</br>
				</center>
			</div>
        </div>
        
        <div class="well">
			<div class="row">
				<center>
				<form name="csrf_form" id="campaignform" action="" method="POST">
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<span class="input-group-btn">
								<input value="Save" class="btn btn-default" style="width: 150px;" name="save2" type="submit">
							</span>
					</div>					
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">SolveMedia Active:</span>
               						<input id="solve1" class="toggle toggle-left" name="smactive" value="1" type="radio" <?php if($smactive == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="solve1" class="btn">Activated</label>
											<input id="solve2" class="toggle toggle-right" name="smactive" value="0" type="radio" <?php if($smactive == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="solve2" class="btn">Deactivated</label>
           							</div>
									</div>
									</center>					
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SolveMedia C-Key:</span>
               				<input name="smckey" value="<?php echo $smckey;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SolveMedia V-Key:</span>
               				<input name="smvkey" value="<?php echo $smvkey;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">SolveMedia H-Key:</span>
               				<input name="smhkey" value="<?php echo $smhkey;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">reCAPTCHA Active:</span>
               						<input id="rcaptcha1" class="toggle toggle-left" name="rcactive" value="1" type="radio" <?php if($rcactive == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="rcaptcha1" class="btn">Activated</label>
											<input id="rcaptcha2" class="toggle toggle-right" name="rcactive" value="0" type="radio" <?php if($rcactive == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="rcaptcha2" class="btn">Deactivated</label>
           							</div>
									</div>
									</center>					
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">reCAPTCHA Site Key:</span>
               				<input name="rcsitekey" value="<?php echo $rcsitekey;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">reCAPTCHA Secret Key:</span>
               				<input name="rcsecretkey" value="<?php echo $rcsecretkey;?>" class="form-control" type="text">
       					  	</div>
							</div>
							</center>
					</div>
					<input type="hidden" name="csrf_token" value="<?php echo $token; ?>">
				</form>
				</br>
				</center>
			</div>
        </div>
        
        <div class="well">
			<div class="row">
				<center>
				<form name="csrf_form" id="campaignform" action="" method="POST">
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<span class="input-group-btn">
								<input value="Save" class="btn btn-default" style="width: 150px;" name="save3" type="submit">
							</span>
					</div>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">JSON Rates API:</span>
               				<input name="jsonrates" value="<?php echo $jsonrates;?>" class="form-control" type="text">
               				<input value="Create one here" onclick="window.open('http://jsonrates.com/')" class="btn btn-default" style="width: 150px;" type="button">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">VirusTotal API:</span>
               				<input name="virustotal" value="<?php echo $virustotal;?>" class="form-control" type="text">
               				<input value="Create one here" onclick="window.open('https://www.virustotal.com/')" class="btn btn-default" style="width: 150px;" type="button">
       					  	</div>
							</div>
							</center>
					</div>
					<input type="hidden" name="csrf_token" value="<?php echo $token; ?>">
				</form>
				</br>
				</center>
			</div>
        </div>
        
        <div class="well">
			<div class="row">
				<center>
				<form name="csrf_form" id="campaignform" action="" method="POST">
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<span class="input-group-btn">
								<input value="Save" class="btn btn-default" style="width: 150px;" name="save4" type="submit">
							</span>
					</div>
					<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
							<center>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Interstitial Active:</span>
               						<input id="interstitialactive1" class="toggle toggle-left" name="interstitialactive" value="1" type="radio" <?php if($interstitialactive == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="interstitialactive1" class="btn">Activated</label>
											<input id="interstitialactive2" class="toggle toggle-right" name="interstitialactive" value="0" type="radio" <?php if($interstitialactive == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="interstitialactive2" class="btn">Deactivated</label>
           							</div>
									</div>
									</center>					
							</div>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Video Active:</span>
               						<input id="videoactive1" class="toggle toggle-left" name="videoactive" value="1" type="radio" <?php if($videoactive == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="videoactive1" class="btn">Activated</label>
											<input id="videoactive2" class="toggle toggle-right" name="videoactive" value="0" type="radio" <?php if($videoactive == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="videoactive2" class="btn">Deactivated</label>
           							</div>
									</div>
									</center>					
							</div>
							<div data-original-title="Enter your long URL" data-toggle="tooltip" data-placement="top" title="555" class="input-group">
								<center>
									<div class="form-group has-success">
										<div class="input-group">
               						<span class="input-group-addon">Banner Active:</span>
               						<input id="banneractive1" class="toggle toggle-left" name="banneractive" value="1" type="radio" <?php if($banneractive == '1'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="banneractive1" class="btn">Activated</label>
											<input id="banneractive2" class="toggle toggle-right" name="banneractive" value="0" type="radio" <?php if($banneractive == '0'){echo 'checked';}?>><label style="min-width:30.2%;width:auto" class="btn btn-default" for="banneractive2" class="btn">Deactivated</label>
           							</div>
									</div>
									</center>					
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Interstitial Duration:</span>
               				<input name="intdur" value="<?php echo $intdur;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Video Duration:</span>
               				<input name="viddur" value="<?php echo $viddur;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Banner Duration:</span>
               				<input name="bandur" value="<?php echo $bandur;?>" class="form-control" type="text">
       					  	</div>
							</div>
							<div class="form-group has-success">
								<div class="input-group">
               				<span class="input-group-addon">Auto continue:</span>
               				<input name="autocontinue" value="<?php echo $autocontinue;?>" class="form-control" type="text">
       					  	</div>
							</div>
							</center>
					</div>
					<input type="hidden" name="csrf_token" value="<?php echo $token; ?>">
				</form>
				</br>
				</center>
			</div>
        </div>
      </div>
    </div>
</div>

<?php
include('other_footer.php');
?>
