$sql2 = "SELECT * FROM investments WHERE username = '******' AND doj = '{$doj}'"; $result2 = mysql_query($sql2); $gain = 0; if (mysql_num_rows($result2) > 0) { while ($row2 = mysql_fetch_array($result2)) { $gain = $row2['GainLoss']; } } if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_array($result)) { $stockName = $row['stockname']; $purchasePrice = $row['purchaseprice']; $stopLoss = $row['stoploss']; $sharesRemaining = $row['no_of_stocks']; $sharesInitiallyPurchased = $row['initialNumber']; $currentClose = getClose($stockName); $arr = array("stockName" => $stockName, "purchasePrice" => $purchasePrice, "sharesRemaining" => $sharesRemaining, "stopLoss" => $stopLoss, "sharesInitiallyPurchased" => $sharesInitiallyPurchased, "currentClose" => $currentClose); array_push($exitArray, $arr); } } if (mysql_num_rows($result) > 0) { array_push($exitArray, $gain); } echo json_encode($exitArray); function getClose($tableName) { $sql2 = "SELECT close FROM {$tableName} ORDER BY date DESC LIMIT 1"; $result1 = mysql_query($sql2); if (mysql_num_rows($result1) > 0) { while ($row1 = mysql_fetch_array($result1)) { $close = $row1['close'];
$enprofit = true; } else { $enprofit = false; } debug_print("Enable the computation of profits: {$tempEnprofit}<Br/>"); } else { $enprofit = false; debug_print("Enable the computation of profits: false<Br/>"); } if (isset($_GET['chart']) || $isCmd) { $chartDataType = isset($_GET['chart']) ? $_GET['chart'] : $cmdChart; //$chartDataType = $_GET['chart']; debug_print("Date range: from {$fromDate} to {$toDate}<Br>"); switch ($chartDataType) { case 'close': getClose($company, $fromDate, $toDate, $dataorg, $mysql_host, $mysql_database, $mysql_user, $mysql_password); break; case 'current': getCurrentDayPrices($company, $dataorg, $mysql_host, $mysql_database, $mysql_user, $mysql_password); break; case 'volume': getVolume($company, $fromDate, $toDate, $dataorg, $mysql_host, $mysql_database, $mysql_user, $mysql_password); break; case 'ohlcur': getOHLCurrent($company, $dataorg, $mysql_host, $mysql_database, $mysql_user, $mysql_password); break; case 'ohlc': getOHLC($company, $fromDate, $toDate, $dataorg, $mysql_host, $mysql_database, $mysql_user, $mysql_password); break; case 'ohlcha': getOHLCHA($company, $fromDate, $toDate, $dataorg, $mysql_host, $mysql_database, $mysql_user, $mysql_password);
$graph->xaxis->SetTickLabels(array('Nov 2014', 'Dec 2014', 'Jan 2015', 'Feb 2015', 'March 2015', 'April 2015', 'May 2015', 'June 2015')); $graph->xaxis->title->SetFont(FF_FONT2, FS_BOLD, 20); $graph->xaxis->title->Set('Dates'); $graph->xgrid->SetColor('#E3E3E3'); // Create the first line $p1 = new LinePlot($close); $graph->Add($p1); $p1->SetColor("#6495ED"); $graph->legend->SetFrameWeight(2); // Output line $graph->Stroke(); } } function getClose($name) { $db = new mysqli('stardock.cs.virginia.edu', 'cs4750npb3ux', 'fall2015', 'cs4750npb3ux'); $getCloseInfo = "select close from stock where name = '{$name}'"; $resultClose = $db->query($getCloseInfo); $close = array(); while ($row = $resultClose->fetch_assoc()) { array_push($close, $row['close']); } $db->close(); return $close; } $name = $_GET["name"]; $close = getClose($name); View::graphs($name, $close); ?>
while ($C = db_fetch_array($CMT_DATA)) { $CQUE = "INSERT INTO kimsbod7_" . $table . "_rpl \n\t\t\t\t\t\t(RP_PARENT,RP_EMOTION,RP_ROOT,RP_MB_ID,RP_NAME,RP_PASS,\n\t\t\t\t\t\t RP_CONTENT,RP_HTML,RP_FILE,RP_LINK,RP_VOTE,RP_DATE,RP_NAKCHAL) \n\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t('{$Now_Num['1']}','{$C['RP_EMOTION']}','{$C['RP_ROOT']}','{$C['RP_MB_ID']}','{$C['RP_NAME']}','{$C['RP_PASS']}',\n\t\t\t\t\t\t '" . addslashes($C[RP_CONTENT]) . "','{$C['RP_HTML']}','','{$C['RP_LINK']}','{$C['RP_VOTE']}','{$C['RP_DATE']}','{$C['RP_NAKCHAL']}')"; db_query($CQUE, $DB_CONNECT); } } if ($R[BB_FILE]) { $BBFILE_EXP = explode(';', $R[BB_FILE]); for ($j = 0; $j < sizeof($BBFILE_EXP); $j++) { if (is_file('../../../table/' . $old_table . '/upload/' . $BBFILE_EXP[$j])) { @copy('../../../table/' . $old_table . '/upload/' . $BBFILE_EXP[$j], '../../../table/' . $table . '/upload/' . $BBFILE_EXP[$j]); } } } } } getClose('총' . ($Multi_Uid_Num - 1) . '개의 데이터가 복사되었습니다.', $table); } } ?> <html> <head> <title><?php if ($type == 'move') { ?> 데이터 이동<?php } else { ?> 데이터 복사<?php } ?>
include './conf.php'; if ($action == 'group_change') { $whatexp = explode('=', $what); if ($whatexp[1] <= $MYDATA[MB_CASH]) { $update = $MYDATA[MB_PRICEDAY] ? date("Ymd", mktime(0, 0, 0, substr($MYDATA[MB_PRICEDAY], 4, 2) + $whatexp[0], substr($MYDATA[MB_PRICEDAY], 6, 2), substr($MYDATA[MB_PRICEDAY], 0, 4))) : date("Ymd", mktime(0, 0, 0, date("m") + $whatexp[0], date("d"), date("Y"))); $uptype = $mbr[term_type]; $cash = -$whatexp[1]; $date = date("YmdHis"); $comment = $type == 'continue' ? $MB_GROUP[$mbr[term_type] - 1] . " " . $whatexp[0] . "개월 기간연장하셨습니다." : $MB_GROUP[$mbr[term_type] - 1] . "으로 전환하셨습니다."; $QUE = "INSERT INTO kimsmall7_cash\n\t\t(CS_MB_ID,CS_CASH,CS_COMMENT,CS_DATE)\n\t\tVALUES\n\t\t('{$v_LogId}','{$cash}','{$comment}','{$date}')"; db_query($QUE, $DB_CONNECT); db_query("UPDATE kimsmall7_members SET MB_CASH=MB_CASH+" . $cash . ",MB_TYPE='" . $uptype . "',MB_PRICEDAY='" . $update . "' WHERE MB_ID='" . $v_LogId . "'", $DB_CONNECT); getClose($comment); } else { getClose('정상적인 접근이 아닙니다. '); } } ?> <html> <head> <title><?php echo $MB_GROUP[$mbr[term_type] - 1]; ?> <?php if ($type == 'continue') { ?> 기간연장<?php } else { ?>