PHP Classes

File: xcopwe3.php

Recommend this page to a friend!
  Classes of Damir   PHP Even Swaps   xcopwe3.php   Download  
File: xcopwe3.php
Role: Example script
Content type: text/plain
Description: Compensation table
Class: PHP Even Swaps
Implement decision methods using Even Swaps
Author: By
Last change:
Date: 9 years ago
Size: 9,821 bytes
 

Contents

Class file image Download
<?
session_start
();
error_reporting(0);
require_once(
'instfile.php');
date_default_timezone_set('Europe/Zagreb');


$jk= new DB();

if(isset(
$_GET['rever']))$rev=$_GET['rever'];
else
$rev="rev";
$bf=escapee($_GET['dod7dzdude3e3w3e']);

     
$sel="Select atribut.id as ATRIBID, atribut.ime as ATRIBIME, jedinica as ATJED from sol_tab, atribut where solid='".$bf."' and atribid=atribut.id ";
 
$skir=$jk->DBquery($sel);
      if (!
$skir){
      exit(
4);
      }
 
$drop1=$jk->DBres2arrN($skir);
 
$atribnum=count($drop1);
 
$pkp="0";
 for(
$i=0;$i<count($drop1);$i++)$pkp.=":".$drop1[$i][0];
   

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<title>Even Swaps</title>
<link href="stilovi.css" rel="stylesheet" type="text/css">
<script src="RICO/src/prototype.js" type="text/javascript"></script>
<script src="RICO/src/rico.js" type="text/javascript"></script>
<script src="RICO/src/ricoAjaxEngine.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {margin:0px; padding:0px; background-color:transparent; height: 100%;color: black}
.tddd{ border-bottom:0px;min-width:40px; width:auto;margin:0px; padding-bottom:3px; padding-top:4px;}
.tdddbrd{ border:1px solid black; width:auto;margin:0px; padding-bottom:3px; padding-top:4px;}
.tdddbb{ border-bottom:0px; width:auto;margin:0px; padding-bottom:3px; padding-top:4px;background-color:#abcdef; }
.tdddgg{ border:1px solid gray; width:auto;margin:0px; padding-bottom:3px; padding-top:4px;background-color:AliceBlue; }
.kdod{ background-color:transparent; text-align:center; font-size:11px;;text-transform: uppercase;}
.kdodd{ background-color:transparent; text-align:center; font-size:11px;text-transform: uppercase; padding-left:5px;}
td {padding:0px; border:0px; background-color:transparent; text-align:center; font-size:14px; font-weight:bold;}
.tbl{ border:0px; height:auto;padding:0px; margin-top:5px;margin-left:5px;margin-bottom:22px;}
.txshd{color: white;text-shadow: 2px 2px 4px #000000;}
.cop{padding:5px; text-align:left; border:1px Solid Gray; color:White; font-family:verdana; font-size:13px;}
.impresije{ border:0px; color:White; display:block; padding:0px; margin:0px; width:100%; height:100%; display:block;}
.copyras{ text-align:center; font-family:courier; font-size:9px; }
.dodDodDop2{ width:50px;
margin-bottom:3px;
margin-top:3px;
  border:1px inset #DCDCDC;
  border-radius: 20px;
  padding: 5px 8px;
  color: #333;
   text-shadow: 0px 2px 4px rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 2px 0 rgba(0,0,0,.2),
    0 0 4px rgba(0,0,0,0.1);}

input[type=submit]:hover, input[type="button"]:hover{
    border: 1px solid #999;color:#000;
}
input[type="submit"], input[type="button"] {background: #398525; /* old browsers */
background: -moz-linear-gradient(top, #8DD297 0%, #398525 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#8DD297), color-stop(100%,#398525)); /* webkit */
display: block; width: 150px; height: 30px; padding: 0px; margin: 0 auto;
box-shadow: inset 0px 0px 6px #fff;
-webkit-box-shadow: inset 0px 0px 6px #fff;
border: 1px solid #5ea617;
border-radius: 10px;
font-size:12px;
vertical-align:middle; }
#evome
{
 
  background-color: #F07575; /* fallback color if gradients are not supported */
  background-image: -webkit-linear-gradient(top, hsl(0, 80%, 70%), #bada55); /* For Chrome 25 and Safari 6, iOS 6.1, Android 4.3 */
  background-image: -moz-linear-gradient(top, hsl(0, 80%, 70%), #bada55); /* For Firefox (3.6 to 15) */
  background-image: -o-linear-gradient(top, hsl(0, 80%, 70%), #bada55); /* For old Opera (11.1 to 12.0) */
  background-image: linear-gradient(to bottom, hsl(0, 80%, 70%), #bada55); /* Standard syntax; must be last */


border:1px inset #DCDCDC;border-radius:20px;padding: 5px 8px;color: #333;
  box-shadow:
    inset 0 2px 0 rgba(0,0,0,.2),
    0 0 4px rgba(0,0,0,0.1);

display:block;
text-align:center; font-weight:bold; cursor:pointer;
position:relative; margin-left:15px;margin-right:15px; vertical-align:middle;
}
#grad
{
background: -webkit-linear-gradient(left,Gray ,AliceBlue ); /*Safari 5.1-6*/
background: -o-linear-gradient(right,Gray ,AliceBlue ); /*Opera 11.1-12*/
background: -moz-linear-gradient(right,Gray ,AliceBlue ); /*Fx 3.6-15*/
background: linear-gradient(to right, Gray , AliceBlue ); /*Standard*/

border:1px inset #DCDCDC;border-radius:20px;padding: 5px 8px;color: #333;
  box-shadow:
    inset 0 2px 0 rgba(0,0,0,.2),
    0 0 4px rgba(0,0,0,0.1);

height:22px; width:182px; display:inline;
text-align:center; font-weight:bold; cursor:pointer;
position:relative; margin-left:15px;margin-right:15px; vertical-align:middle;
}
#grad:hover
{
background: -webkit-linear-gradient(left,AliceBlue,Gray); /*Safari 5.1-6*/
background: -o-linear-gradient(right,AliceBlue,Gray); /*Opera 11.1-12*/
background: -moz-linear-gradient(right,AliceBlue,Gray); /*Fx 3.6-15*/
background: linear-gradient(to right, AliceBlue, Gray); /*Standard*/

border:1px inset #DCDCDC;border-radius:20px;padding: 5px 8px;color: #333;
  box-shadow:
    inset 0 2px 0 rgba(0,0,0,.2),
    0 0 4px rgba(0,0,0,0.1);
}
#dolje {
width: 95%;
clear: left; bottom:0; /* stick to bottom */
padding-top: 6px;
margin-top:15px;
    margin-left: auto;
    margin-right: auto;
border:1px outset #DCDCDC;border-radius:30px;padding: 5px 8px;color: #333;
min-height:200px;
    background: -webkit-linear-gradient(white, WhiteSmoke ); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(white, WhiteSmoke ); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(white, WhiteSmoke ); /* For Firefox 3.6 to 15 */
    background: linear-gradient(white, WhiteSmoke ); /* Standard syntax (must be last) */
}
#gore{
width: 95%;
text-align: left;
    height:auto !important; /* real browsers */
    min-width: 0px;
    display: table;
clear: right;
padding-top: 6px;
margin-top:15px;
vertical-align:middle;
    margin-left: auto;
    margin-right: auto;
    border:1px inset #DCDCDC;border-radius:30px;padding: 5px 8px;color: #333;
    background: -webkit-linear-gradient(WhiteSmoke,white ); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(WhiteSmoke,white ); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(WhiteSmoke,white ); /* For Firefox 3.6 to 15 */
    background: linear-gradient(WhiteSmoke,white ); /* Standard syntax (must be last) */
}
 -->
 </style>

 <script type="text/javascript">
 function isInt(n)
{
    return n != "" && !isNaN(n) && Math.round(n) == n;
}
function isFloat(n){
    return n != "" && !isNaN(n) && Math.round(n) != n;
}

function DdkkK(tt,dd){
console.log("reverse cell:"+dd);
if(!isInt(tt.value) && !isFloat(tt.value)){
alert("Just numbers!");
tt.value=0;
return false;
}
 var tb=document.getElementById(dd);
 tb.innerHTML=Math.round(10000/parseFloat(tt.value) ) / 10000;
console.log("cell value:"+tb.innerHTML)
            }
                   
 </script>
</head >

<body >
<div class="MainContent">

<div id="gore">
<form action="qqLp98.php" method="post" id="formica" accept-charset="utf-8">
<input type="hidden" name="revveverreve" value="<?echo $rev;?>" >
<input type="hidden" name="ppdeuu88u8ds" value="<?echo $pkp;?>" >
    <div style="width:100%; float:left; margin-top:15px;padding-bottom:35px; padding-left:16px; font-size:24px;clear:both; font-weight:bolder; display:block;">Compensation table: </div>
    <table align="left" cellSpacing="2" cellPadding="2" class="tbl" style="background:transparent;width:auto; margin-left:5px;">
    <tr><td class="tddd"><p style="width:30px;">&nbsp;</p></td>
  <?
for($i=0;$i<count($drop1);$i++)echo" <td class=\"kdod\">".$drop1[$i][1]."</td>";
?>
</tr>
 <?
 $i
=0;
 for(
$ii=0;$ii<$atribnum;$ii++){echo"<tr> <td class=\"kdodd\">".$drop1[$ii][1]."(+".$drop1[$ii][2].")</td>";
for(
$i=0;$i<count($drop1);$i++)if($i==$ii) echo"<td class=\"tdddbb\"><p style=\"color:transparent;\">&nbsp;aaaaaaaaaa</p></td>";
else if(
$i<$ii && $rev=="rev") echo"<td class=\"tdddgg\" id=\"".$ii."_id_".$i."\"><p>&nbsp;".$ii."__".$i."</p></td>";
else{
       if(
$rev=="rev") echo"<td class=\"tdddbrd\"><input class=\"dodDodDop2\" type=\"text\" OnChange=\"DdkkK(this,'".$i."_id_".$ii."');\" name= \"".$drop1[$ii][0]."_SS_".$drop1[$i][0]."\" value=\"\" required></td>";
       else echo
"<td class=\"tdddbrd\"><input class=\"dodDodDop2\" type=\"text\" name= \"".$drop1[$ii][0]."_SS_".$drop1[$i][0]."\" value=\"\" required></td>";
    }
echo
"</tr>";
}
 
?>
 
</table>


</div>



<div id="dolje">

  <div style="margin-top:82px;display:block;clear: both;margin-left:48px;" id="dodDSSwwS_2_w">
  <input type="button" value="<?if($rev=="rev")echo "Complete table"; else echo"Reverse table";?>"
  OnClick="document.location='index.php?dod7dzdude3e3w3e=<? echo $bf;?>&rever=<?if($rev=="rev")echo "sseewwss"; else echo"rev";?>'" >
  <input type="button" OnClick="document.forms.formica.submit();" style="margin-left:55px;" value="Submit" > </div>
 </form>

</div>
 
    <div class="copyras" align="center" >Even Swaps - 2015. </div>
    <br>

</div>
</body>
</html>
<?