$("input[type=submit]").on("click", function(e) {
e.preventDefault();
var answer = $(this).val();
var data = $(this).closest("form").serialize();
$.ajax({
url: '/includes/treatmentTestVar1.php',
method: 'post',
dataType: 'html',
data: data + "&answer=" + answer,
success: function(result){
console.log(result);
}
});
});
class GeneralClass
{
static private $links;
function __construct() {
ob_start(array("self", "pageAssembly"));
}
public function includeComponent($name, $template)
{
if ($template === "") $template = "default";
$defPath = "/core/components/";
self::$links .= '<link rel="stylesheet" href="' . $defPath . $name . '/templates/' . $template . '/style.css">';
self::$links .= '<script type="text/javascript" src="' . $defPath . $name . '/templates/' . $template . '/script.js"></script>';
include_once $defPath . $name . "/templates/" . $template . "/template.php";
}
public function pageAssembly($buffer) {
return str_replace('</head>', self::$links . '</head>', $buffer);
}
}
<a download="password.txt" id="data" href="#" style="display: none;"></a>
<script>
var type = "data:application/octet-stream;base64, ";
var text = "Данные для авторизации \\r\\nЛогин: ' . $login . ' \\r\\nПароль: ' . $password . '";
var base = btoa(unescape(encodeURIComponent(text)));
var res = type + base;
document.getElementById("data").href = res;
document.getElementById("data").click();
location.href=location.href;
</script>
friend MatrixClass* operator+ (MatrixClass A, MatrixClass B);
//...
MatrixClass* operator+ (MatrixClass A, MatrixClass B)
{
//...
}
friend MatrixClass* operator+ (MatrixClass& A, MatrixClass& B);
//...
MatrixClass* operator+ (MatrixClass& A, MatrixClass& B)
{
//...
}
// Выбор оптимального размера
$initialSizeWidth = 660;
$initialSizeHeight = 500;
// $image[0] - ширина, $image[1] - высота
if( $image[1] > $image[0] ){
$adaptedWidth = $initialSizeWidth;
$coefficienWidth = $image[0] / $initialSizeWidth;
$prevHeight = $image[1] / $coefficienWidth;
$adaptedHeight = $initialSizeHeight;
$coefficienHeight = $prevHeight / $initialSizeHeight;
$adaptedWidth = $initialSizeWidth / $coefficienHeight;
}else{
$adaptedHeight = $initialSizeHeight;
$coefficienHeight = $image[1] / $initialSizeHeight;
$prevWidth = $image[0] / $coefficienHeight;
$adaptedWidth = $initialSizeWidth;
$coefficienWidth = $prevWidth / $initialSizeWidth;
$adaptedHeight = $initialSizeHeight / $coefficienWidth;
}
$('.number_service[data-row-index="2"]').css({'dicplay' : 'block'})