<?php

echo "<h3>".__('Bugfixes / Feature Request', 'wct')."</h3>";
printf( __('Bugs and new Features can be requested on the WordPress.org Forum of the Plugin: %s.','wct')."<br/>", "<br/><br/><a href=\"http://bugtracker.wuk.ch/\" target=\"_blank\"><font size=\"+2\">".__('Contact','wct')." web updates kmu</font></a>");

echo "<h3>".__('Donating', 'wct')."</h3>";
echo __('The Development of the Plugin was very time intensive and 4 month of hard work was spend until version 1.0 was published. If you like this plugin, please feel free to make a donation to support the developer.','wct');
$paypal = array('_donations','Custom Table - Donation','');
include($this->wctpath."pages/paypal.php");
echo $out;

echo "<h3>".__('Payed Support', 'wct')."</h3>";
echo __('The Plugin was developed that you have no limits about the implementation. The other side of that is, it can be sometimes difficult to understand for a HTML Beginner.<br/>If you need help by the Setup or Support in adding new functionalities by your own, so you can get payed support.<br/>Engineer for 1 hour costs 80 &euro; / hour.','wct')."<br/><br/>";


$paypal = array('_cart','Custom Table - '. __('15 Mins Support for','wct').' '.$_SERVER['SERVER_NAME'],'20.00',__('Select and buy support option (if needed):','wct')."<br/><select name=\"quantity\"><option value=\"1\">".__('15 Mins - e.g. Make WCT Backupfile from SQL File', 'wct')."</option><option value=\"4\">".__('1 Hour - e.g. Instruction how to use it', 'wct')."</option><option value=\"8\">".__('2 Hours - e.g. Setup of HTML Code for perfect output', 'wct')."</option><option value=\"12\">".__('3 Hours - e.g. Setup of Output and Import of custom Table/DB', 'wct')."</option><option value=\"20\">".__('4 Hours - e.g. Complete Setup of the plugin and all tables are created', 'wct')."</option></select> ");
include($this->wctpath."pages/paypal.php");
echo $out;

if ($_POST['submit'] != '') {
	$headers = "From: ".str_replace(array("\r","\n"),array("",""),$_POST['name'])." <".str_replace(array("\r","\n"),array("",""),$_POST['mail']).">\r\n";
	$mailtext = "Name: ".$_POST['name']."\r\nRequest Typ: ".$_POST['type']."\r\n\r\nBeschreibung: ".$_POST['desc']."\r\n\r\nMail: ".$_POST['mail']."\r\nDomain: ".$_POST['domain']."\r\nOrgMail: ".get_settings( 'admin_email' )."\r\nOrgDomain: ".$_SERVER['SERVER_NAME']."\r\n\r\n";
	if ($this->prem_chk() !== true) { $mailtext .= "Keine Lizenz gefunden."; } else { $mailtext .= "Lizenz gefunden: ".$this->prem_chk('','1'); }

	wp_mail("wct@wuk.ch", "Custom Forms - ".$_POST['title'],$mailtext,$headers);
	echo "<font color=\"#008000\">".__('Request sent','wct')."</font>";
}
else {
	echo "<script language=\"JavaScript\">
	   function checkS() {
	      	if (document.fr.name.value == \"\" || document.fr.mail.value == \"\" || document.fr.domain.value == \"\" || document.fr.type.value == \"\" || document.fr.title.value == \"\" || document.fr.desc.value == \"\") {
		         alert('".__('Please fillout all fields!','wct')."');
		         return false;
		}
	      	if (document.fr.type.value == \"bugfix\") {
		         var check=confirm('".__('Bugfix should be submitted to the Support Forum on WordPress.org,\nplease see first topic on this page!\n\nPress OK to SEND the Emergency Request, otherwise Cancel!','wct')."');
		         if (check) { return true; }
			  else { return false; }
		}
		return true;
	   }
	</script>".__('Contact','wct')." web updates kmu ".__('with mail','wct').":<br/><form name=\"fr\" id=\"fr\" action=\"admin.php?page=wct_support\" method=\"POST\" onSubmit=\"return checkS()\">
	<table style=\"background-color:#E5E5E5;\">
		<tr><td valign=\"top\"><b>".__('Your Name','wct').":</b></td><td valign=\"top\"><input type=\"text\" name=\"name\" size=\"32\"></td></tr>
		<tr><td valign=\"top\"><b>".__('Your E-Mail','wct').":</b></td><td valign=\"top\"><input type=\"text\" name=\"mail\" size=\"32\" value=\"".get_settings( 'admin_email' )."\"></td></tr>
		<tr><td valign=\"top\"><b>WordPress Domain:</b></td><td valign=\"top\"><input type=\"text\" name=\"domain\" size=\"32\" value=\"".$_SERVER['SERVER_NAME']."\"></td></tr>

		<tr><td valign=\"top\"><b>".__('Request Type','wct').":</b></td><td valign=\"top\"><select name=\"type\">
			<option></option>
			<option value=\"bugfix\">".__('Bugfix Submit','wct')."</option>
			<option value=\"payed\">".__('Payed Request for Support','wct')."</option>
			<option value=\"unpayed\">".__('Unpayed Request for Support','wct')."</option>
		</select></td></tr>
		<tr><td colspan=\"2\" valign=\"top\">&nbsp;</td></tr>

		<tr><td valign=\"top\"><b>".__('Title:','wct')."</b></td><td valign=\"top\"><input type=\"text\" name=\"title\" size=\"64\"></td></tr>
		<tr><td valign=\"top\"><b>".__('Description','wct').":</b></td><td valign=\"top\"><textarea name=\"desc\" cols=\"100\" rows=\"10\"></textarea></td></tr>
		<tr><td></td><td valign=\"top\"><input type=\"submit\" name=\"submit\" value=\"".__('Submit Request','wct')."\"> ".__('This Action will send informations to web updates kmu via mail','wct')."</td></tr>
	</table>
	</form>";
}

?>


