<?php
session_start();
require_once('instfile.php');
date_default_timezone_set('Europe/Zagreb');
$conn=dbi_conn();
if(isset($_POST['imeproblema'])){
if ($result = mysqli_query($conn, "Insert into projekt Values(".'NULL'.", '".escapee($_POST['imeproblema'])."')")) {
$last_id=mysqli_insert_id($conn);
//$result->close();
}
else die("Problem with querry - ".mysqli_error($conn));
$_SESSION['prid']=$last_id;
$stmt = mysqli_prepare($conn, "Insert into atribut Values(".'NULL'.", ?, ?, ?, ? )");
for($i=0;$i<count($_POST['ime']);$i++) {
mysqli_stmt_bind_param($stmt, "isii", $last_id, escapee($_POST['ime'][$i]),escapee($_POST['jedinica'][$i]),escapee($_POST['MV'][$i]) );
mysqli_stmt_execute($stmt);
}
mysqli_stmt_close($stmt);
header("Location: index.php?dod7dzdudhddd444=".$last_id." ");
}
else if(isset($_POST['InummmmI']))
{
$id_arr=array();
$num=escapee($_POST['InummmmI']);
$numuk=escapee($_POST['UkInummmmI']);
for($i=0;$i<$num;$i++)$id_arr[]=escapee($_POST['SSolIme'.$i]);
for($i=0;$i<$numuk;$i++){
if ($result = mysqli_query($conn, "Insert into solucije Values(".'NULL'.", '".escapee($_POST['imesolucije'][$i])."')")) {
$last_id=mysqli_insert_id($conn);
//$result->close();
}
else die("Problem s upitom 3 - ".mysqli_error($conn));
for($ia=0;$ia<$num;$ia++){
$rtz="SolIme".$ia;
$ertz=escapee($_POST[$rtz][$i]);
$idarr= $id_arr[$ia];
// echo $last_id." ".$id_arr[$ia]." ".escapee($_POST[$rtz][$i])."<br><br>";
$stmta = mysqli_prepare($conn, "Insert into sol_tab Values(".'NULL'.", ?, ?, ? )");
mysqli_stmt_bind_param($stmta, "iii", $last_id,$idarr ,$ertz );
if ( !mysqli_stmt_execute($stmta)) {
var_dump(mysqli_error($conn));
die( 'stmt error: '.mysqli_stmt_error($stmt1) );
}
mysqli_stmt_close($stmta);
}
}
header("Location: index.php?dod7dzdude3e3w3e=".$last_id." ");
}
else if(isset($_POST['ppdeuu88u8ds']))
{
$revv=escapee($_POST['revveverreve']);
// $tra="Insert into matrica Values(".'NULL'.", ?, ?, ?,? )");
$trara=array();
$id_arr=array();
$id_arr=explode(":",escapee($_POST['ppdeuu88u8ds']));
array_shift($id_arr);
for($ia=0;$ia<count($id_arr);$ia++)
for($i=0;$i<count($id_arr);$i++){
if($i==$ia)continue;
if(isset($_POST["".$id_arr[$ia]."_SS_".$id_arr[$i].""]))$zzz=escapee($_POST["".$id_arr[$ia]."_SS_".$id_arr[$i].""]);
else continue;
if($i>$ia && $revv=="rev"){
$trara[]=$id_arr[$ia].",".$id_arr[$i].",".$zzz.",".($zzz>0?1:0)." ";
$trara[]=$id_arr[$i].",".$id_arr[$ia].",".(1/$zzz).",".($zzz>0?1:0)." ";
}
else $trara[]=$id_arr[$ia].",".$id_arr[$i].",".$zzz.",".($zzz>0?1:0)." ";
}
for($i=0;$i<count($trara);$i++){
$stmta = mysqli_prepare($conn, "Insert into matrica Values(".'NULL'.", ?, ?, ?,? )");
$kso=explode(",",$trara[$i]);
list($a1,$a2,$a3,$a4)=array_values($kso);
mysqli_stmt_bind_param($stmta, "iidi",$a1,$a2,$a3,$a4 );
if ( !mysqli_stmt_execute($stmta)) {
var_dump(mysqli_error($conn));
die( 'stmt error: '.mysqli_stmt_error($stmt1) );
}
mysqli_stmt_close($stmta);
}
header("Location: index.php?dod7ccxx443KKKKmkm=".$a1." ");
}
?>
|