function afficher_msg($titre) { if (strlen($titre) != 0) { echo '<h1>' . $titre . '</h1>' . "\n"; } else { echo '<h1>' . $GLOBALS['nom_application'] . '</h1>' . "\n"; } // message vert if (isset($_GET['msg'])) { if (array_key_exists(htmlspecialchars($_GET['msg']), $GLOBALS['lang'])) { confirmation($GLOBALS['lang'][$_GET['msg']]); } } // message rouge if (isset($_GET['errmsg'])) { if (array_key_exists($_GET['errmsg'], $GLOBALS['lang'])) { no_confirmation($GLOBALS['lang'][$_GET['errmsg']]); } } }
function client_sign($cookie, $tieba) { preg_match('/BDUSS=([^ ;]+)/i', $cookie, $matches); $BDUSS = $matches[1]; $ch = curl_init('http://c.tieba.baidu.com/c/c/forum/sign'); $tbs = confirmation($cookie); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'User-Agent: Mozilla/5.0 (SymbianOS/9.3; Series60/3.2 NokiaE72-1/021.021; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.1.16352')); curl_setopt($ch, CURLOPT_COOKIE, $cookie); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); $array = array('BDUSS' => $BDUSS, '_client_id' => '03-00-DA-59-05-00-72-96-06-00-01-00-04-00-4C-43-01-00-34-F4-02-00-BC-25-09-00-4E-36', '_client_type' => '4', '_client_version' => '1.2.1.17', '_phone_imei' => '540b43b59d21b7a4824e1fd31b08e9a6', 'fid' => $tieba['fid'], 'kw' => urldecode($tieba['url']), 'net_type' => '3', 'tbs' => $tbs['tbs']); $sign_str = ''; foreach ($array as $k => $v) { $sign_str .= $k . '=' . $v; } $sign = strtoupper(md5($sign_str . 'tiebaclient!!!')); $array['sign'] = $sign; curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array)); $sign_json = curl_exec($ch); curl_close($ch); @json_decode($sign_json, true); }
$batchid=$DB->get_record('facetoface',array('id'=>$id)); return redirect($CFG->wwwroot.'/mod/facetoface/view_sessions.php?sessiontype='.$batchid->active.'&batchid='.$batchid->id); } else if($type=="cancel"){ cancelbatch($id); $batchid=$DB->get_record('facetoface',array('id'=>$id)); return redirect($CFG->wwwroot.'/mod/facetoface/view_sessions.php?sessiontype='.$batchid->active.'&batchid='.$batchid->id); } else if($type=="deactivate"){ deactivatebatch($id); $batchid=$DB->get_record('facetoface',array('id'=>$id)); return redirect($CFG->wwwroot.'/mod/facetoface/view_sessions.php?sessiontype='.$batchid->active.'&batchid='.$batchid->id); } else if($type=="release"){ releasebatch($id); $batchid=$DB->get_record('facetoface',array('id'=>$id)); return redirect($CFG->wwwroot.'/mod/facetoface/view_sessions.php?sessiontype='.$batchid->active.'&batchid='.$batchid->id); } else if($type=="confirmation"){ confirmation($id); return redirect($CFG->wwwroot.'/mod/facetoface/my_sessions.php'); } else if($type=="completion"){ completion($id); $batchid=$DB->get_record('facetoface',array('id'=>$id)); return redirect($CFG->wwwroot.'/mod/facetoface/view_sessions.php?sessiontype='.$batchid->active.'&batchid='.$batchid->id); } } ////ends here ?>
function afficher_msg() { // message vert if (isset($_GET['msg'])) { if (array_key_exists(htmlspecialchars($_GET['msg']), $GLOBALS['lang'])) { $suffix = isset($_GET['nbnew']) ? htmlspecialchars($_GET['nbnew']) . ' ' . $GLOBALS['lang']['rss_nouveau_flux'] : ''; // nb new RSS confirmation($GLOBALS['lang'][$_GET['msg']] . $suffix); } } // message rouge if (isset($_GET['errmsg'])) { if (array_key_exists($_GET['errmsg'], $GLOBALS['lang'])) { no_confirmation($GLOBALS['lang'][$_GET['errmsg']]); } } }
apologize("Please select a stock and number of shares to sell"); } else { //query if user already owns this stock $rowtrans = query("SELECT * FROM stocks WHERE id = ? and symbol = ?", $_SESSION["id"], $stock["symbol"]); $rowtrans = $rowtrans[0]; $newshares = $rowtrans["shares"] - $_POST["shares"]; if ($newshares < 0) { apologize("You are selling more than the shares you own. You have " . $rowtrans["shares"] . " shares to sell of " . $stock["symbol"] . "."); } else { if ($newshares == 0) { $delete = query("DELETE FROM stocks WHERE id = ? and symbol = ?", $_SESSION["id"], $stock["symbol"]); } else { $result = query("UPDATE stocks set shares = ? where id = ? and symbol = ?", $newshares, $_SESSION["id"], $stock["symbol"]); } } $rowuser = query("SELECT * FROM users WHERE id = ?", $_SESSION["id"]); $rowuser = $rowuser[0]; $newcash = $rowuser["cash"] + $stock["price"] * $_POST["shares"]; // insert into transaction table sell and update the cash amount in the users table $insert = query("INSERT INTO history (id, type, symbol, shares, price) VALUES(?, ?, ?, ?, ?)", $_SESSION["id"], "Sell", $stock["symbol"], $_POST["shares"], $stock["price"]); $update = query("UPDATE users set cash = ? where id = ? ", $newcash, $_SESSION["id"]); if (strlen($rowuser["email"]) < 1) { apologize("Stocks have been sold but you do not have email on file."); } $email = confirmation($_POST["shares"], $stock["name"], "sold", $rowuser["email"]); redirect("/"); } } else { // else render form render("sell_form.php", ["title" => "Sell"]); }
require_once '../class/payment_calculation.class.php'; require_once '../class/payments.class.php'; require_once '../class/payment_cancel.class.php'; require_once '../../../baseInfo/class/salary_item_report.class.php'; require_once '../class/arrear_pay_calculation.class.php'; require_once inc_QueryHelper; require_once inc_response; require_once inc_dataReader; $task = isset($_REQUEST["task"]) ? $_REQUEST["task"] : ""; switch ($task) { case "ProcessPayment": ProcessPayment(); case "getProgress": getProgress(); case "confirmation": confirmation(); case "Remove": Remove(); //----------------------------- //----------------------------- case "registerDoc": registerDoc(); case "deleteDoc": deleteDoc(); case "DifferSalaryItems": DifferSalaryItems(); case "ProcessArrearPayment": ProcessArrearPayment(); } function ProcessPayment() {