コード例 #1
0
ファイル: api.php プロジェクト: CocDamCode/fu-where-are-you
function get_person_schedule($str, $date)
{
    if (!$date) {
        return array();
    }
    $email = mysql_real_escape_string($str);
    $query_date = date_format($date, 'Y-m-d');
    $result = execute_query("SELECT * FROM fuway_schedule WHERE email = \"{$email}\" AND slotdate = \"{$query_date}\" LIMIT 0, 10");
    $slots = array();
    if ($result) {
        while ($row = mysql_fetch_array($result)) {
            $slot = array();
            $person = array();
            $person["Email"] = $row["email"];
            $person["Code"] = $row["person_code"];
            $person["Name"] = $row["person_name"];
            $person["Role"] = $row["role"];
            $slot["Person"] = $person;
            $slot["Date"] = strtotime($row["slotdate"]);
            $slot["Slot"] = (int) $row["slot"];
            $slot["Room"] = $row["room"];
            $slot["Class"] = $row["class"];
            $slot["Course"] = $row["course"];
            array_push($slots, $slot);
        }
    }
    return $slots;
}
コード例 #2
0
ファイル: custom_menus.php プロジェクト: svenjantzen/imscp
/**
 * Generates menus list.
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 * @return void
 */
function admin_generateMenusList($tpl)
{
    $query = "SELECT * FROM `custom_menus`";
    $stmt = execute_query($query);
    if (!$stmt->rowCount()) {
        $tpl->assign('MENUS_LIST_BLOCK', '');
        set_page_message(tr('No custom menu found.'), 'static_info');
    } else {
        while (!$stmt->EOF) {
            $menuId = $stmt->fields['menu_id'];
            $menuLevel = $stmt->fields['menu_level'];
            $menuOrder = $stmt->fields['menu_order'];
            $menuName = $stmt->fields['menu_name'];
            $menuLink = $stmt->fields['menu_link'];
            if ($menuLevel == 'A') {
                $menuLevel = tr('Administrator');
            } elseif ($menuLevel == 'R') {
                $menuLevel = tr('Reseller');
            } elseif ($menuLevel == 'C') {
                $menuLevel = tr('Customer');
            } elseif ($menuLevel == 'AR') {
                $menuLevel = tr('Administrator and reseller');
            } elseif ($menuLevel == 'AC') {
                $menuLevel = tr('Administrator and customer');
            } elseif ($menuLevel == 'RC') {
                $menuLevel = tr('Reseller and customer');
            } elseif ($menuLevel == 'ARC') {
                $menuLevel = tr('All');
            }
            $tpl->assign(array('MENU_LINK' => tohtml($menuLink), 'MENU_ID' => $menuId, 'LEVEL' => tohtml($menuLevel), 'ORDER' => $menuOrder, 'MENU_NAME' => tohtml($menuName), 'LINK' => tohtml($menuLink)));
            $tpl->parse('MENU_BLOCK', '.menu_block');
            $stmt->moveNext();
        }
    }
}
コード例 #3
0
function ipban()
{
    $p = split('\\.', $_SERVER['REMOTE_ADDR']);
    $query = sprintf(CHECK_IPBAN, $p[0], $p[0], $p[1], $p[0], $p[1], $p[2], $p[0], $p[1], $p[2], $p[3]);
    $result = execute_query($query, 'ipban.php', 0, 0);
    $result->fetch_row();
    return $result->row[0];
}
コード例 #4
0
/**
 * Generates page
 *
 * @param iMSCP_pTemplate $tpl Template engine instance
 * @return void
 */
function generatePage($tpl)
{
    $stmt = execute_query("SELECT admin_id, admin_name FROM admin WHERE admin_type = 'reseller'");
    while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
        _generateResellerStatistics($tpl, $row['admin_id'], $row['admin_name']);
        $tpl->parse('RESELLER_STATISTICS_BLOCK', '.reseller_statistics_block');
    }
}
コード例 #5
0
ファイル: bruteforce.php プロジェクト: jaison/CeresCP
function bf_error($username)
{
    $log_ip = $_SERVER['REMOTE_ADDR'];
    $current = time();
    $query = sprintf(BF_ADD, $username, $log_ip, $current, 0);
    $result = execute_query($query, "check_user", 1, 0);
    return 1;
}
コード例 #6
0
function export_table2xls($table)
{
    $sql_query = "SELECT * FROM " . $table;
    $results = execute_query($sql_query);
    query2xls($results, 'xlsfiles/' . $table . '.xls');
    //	echo "<P>Table $table exported <A HREF='export/$table.xls'>here</A><P>";
    //	ob_implicit_flush();
}
コード例 #7
0
ファイル: form_functions.inc.php プロジェクト: nkiourt/amacs
function check_hcv_coinfection($code)
{
    $query = "SELECT * FROM coinfections WHERE HCV='1' AND PatientCode = " . $code;
    $result = execute_query($query);
    $row = mysql_fetch_array($result);
    $num_rows = mysql_num_rows($result);
    mysql_free_result($result);
    if ($num_rows != 1) {
        show_errormsg("Δεν υπάρχει στη βάση καταχώρηση με συλλοίμωξη HCV και κωδικό ασθενή " . $code . ". <a href='coinfection.php?code={$code}'>Καταχωρήστε πρώτα την συνλοίμωξη στη βάση.</a>");
    }
}
コード例 #8
0
ファイル: ajax_insert.php プロジェクト: nkiourt/amacs
function check_patient($code)
{
    $query = "SELECT * FROM patients WHERE PatientCode = " . $code;
    $result = execute_query($query);
    $row = mysql_fetch_array($result);
    $num_rows = mysql_num_rows($result);
    mysql_free_result($result);
    if ($num_rows == 1) {
        return 1;
    } else {
        return 0;
    }
}
コード例 #9
0
function change_sql_user_pass(&$sql, $db_user_id, $db_user_name)
{
    global $cfg;
    if (!isset($_POST['uaction'])) {
        return;
    }
    if ($_POST['pass'] === '' && $_POST['pass_rep'] === '') {
        set_page_message(tr('Please type user password!'));
        return;
    }
    if ($_POST['pass'] !== $_POST['pass_rep']) {
        set_page_message(tr('Entered passwords does not match!'));
        return;
    }
    if (strlen($_POST['pass']) > $cfg['MAX_SQL_PASS_LENGTH']) {
        set_page_message(tr('Too long user password!'));
        return;
    }
    $user_pass = $_POST['pass'];
    //
    // update user pass in the vhcs sql_user table;
    //
    $query = <<<SQL_QUERY
        update
            sql_user
        set
            sqlu_pass = ?
        where
            sqlu_id = ?
SQL_QUERY;
    $rs = exec_query($sql, $query, array($user_pass, $db_user_id));
    //
    // update user pass in the mysql system tables;
    //
    $query = <<<SQL_QUERY

        SET PASSWORD FOR '{$db_user_name}'@'%' = PASSWORD('{$user_pass}')
 
SQL_QUERY;
    $rs = execute_query($sql, $query);
    $query = <<<SQL_QUERY

\tSET PASSWORD FOR '{$db_user_name}'@localhost = PASSWORD('{$user_pass}')

SQL_QUERY;
    $rs = execute_query($sql, $query);
    write_log($_SESSION['user_logged'] . " : update SQL user password" . $db_user_name);
    set_page_message(tr('SQL user password was successfully changed!'));
    user_goto('manage_sql.php');
}
コード例 #10
0
ファイル: ip_usage.php プロジェクト: svenjantzen/imscp
/**
 * Generate List of Domains assigned to IPs
 *
 * @param  iMSCP_pTemplate $tpl Template engine
 * @return void
 */
function listIPDomains($tpl)
{
    $resellerId = $_SESSION['user_id'];
    $stmt = exec_query('SELECT reseller_ips FROM reseller_props WHERE reseller_id = ?', $resellerId);
    $data = $stmt->fetchRow();
    $resellerIps = explode(';', substr($data['reseller_ips'], 0, -1));
    $stmt = execute_query('SELECT ip_id, ip_number FROM server_ips WHERE ip_id IN (' . implode(',', $resellerIps) . ')');
    while ($ip = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
        $stmt2 = exec_query('
				SELECT
					domain_name
				FROM
					domain
				INNER JOIN
					admin ON(admin_id = domain_admin_id)
				WHERE
					domain_ip_id = :ip_id
				AND
					created_by = :reseller_id
				UNION
				SELECT
					alias_name AS domain_name
				FROM
					domain_aliasses
				INNER JOIN
					domain USING(domain_id)
				INNER JOIN
					admin ON(admin_id = domain_admin_id)
				WHERE
					alias_ip_id = :ip_id
				AND
					created_by = :reseller_id
			', array('ip_id' => $ip['ip_id'], 'reseller_id' => $resellerId));
        $domainsCount = $stmt2->rowCount();
        $tpl->assign(array('IP' => tohtml($ip['ip_number']), 'RECORD_COUNT' => tr('Total Domains') . ': ' . $domainsCount));
        if ($domainsCount) {
            while ($data = $stmt2->fetchRow(PDO::FETCH_ASSOC)) {
                $tpl->assign('DOMAIN_NAME', tohtml(idn_to_utf8($data['domain_name'])));
                $tpl->parse('DOMAIN_ROW', '.domain_row');
            }
        } else {
            $tpl->assign('DOMAIN_NAME', tr('No used yet'));
            $tpl->parse('DOMAIN_ROW', 'domain_row');
        }
        $tpl->parse('IP_ROW', '.ip_row');
        $tpl->assign('DOMAIN_ROW', '');
    }
}
コード例 #11
0
/**
 *
 */
function update_reseller_owner()
{
    if (isset($_POST['uaction']) && $_POST['uaction'] === 'reseller_owner') {
        $query = "\n\t\t\tSELECT\n\t\t\t\t`admin_id`\n\t\t\tFROM\n\t\t\t\t`admin`\n\t\t\tWHERE\n\t\t\t\t`admin_type` = 'reseller'\n\t\t\tORDER BY\n\t\t\t\t`admin_name`\n\t\t";
        $rs = execute_query($query);
        while (!$rs->EOF) {
            $admin_id = $rs->fields['admin_id'];
            $admin_id_var_name = "admin_id_{$admin_id}";
            if (isset($_POST[$admin_id_var_name]) && $_POST[$admin_id_var_name] === 'on') {
                $dest_admin = $_POST['dest_admin'];
                $query = "\n\t\t\t\t\tUPDATE\n\t\t\t\t\t\t`admin`\n\t\t\t\t\tSET\n\t\t\t\t\t\t`created_by` = ?\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t`admin_id` = ?\n\t\t\t\t";
                exec_query($query, array($dest_admin, $admin_id));
            }
            $rs->moveNext();
        }
    }
}
コード例 #12
0
ファイル: grava_especie.php プロジェクト: kureshio/colecao
function grava_quais($id1, $id2, $qual, $id_conn)
{
    switch ($qual) {
        case 1:
            $sql = 'INSERT INTO tb_familiaquaisespecies ';
            $sql .= '(familia_id, especie_id) ';
            $sql .= 'VALUES';
            $sql .= '(' . $id1 . ',' . $id2 . ')';
            break;
        case 2:
            $sql = 'INSERT INTO tb_generoquaisespecies ';
            $sql .= '(genero_id, especie_id) ';
            $sql .= 'VALUES';
            $sql .= '(' . $id1 . ',' . $id2 . ')';
            break;
    }
    return execute_query($sql, $id_conn);
}
コード例 #13
0
ファイル: ip_usage.php プロジェクト: svenjantzen/imscp
/**
 * Generate List of Domains assigned to IPs
 *
 * @param iMSCP_pTemplate $tpl
 * @return void
 */
function listIPDomains($tpl)
{
    $stmt = execute_query('SELECT ip_id, ip_number FROM server_ips');
    while ($ip = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
        $stmt2 = exec_query('
				SELECT
					t1.domain_name, t3.admin_name
				FROM
					domain AS t1
				INNER JOIN
					admin AS t2 ON(t2.admin_id = t1.domain_admin_id)
				INNER JOIN
					admin as t3 ON(t3.admin_id = t2.created_by)
				WHERE
					t1.domain_ip_id = :ip_id
				UNION
				SELECT
					t1.alias_name AS domain_name, t4.admin_name
				FROM
					domain_aliasses AS t1
				INNER JOIN
					domain AS t2 USING(domain_id)
				INNER JOIN
					admin AS t3 ON(admin_id = domain_admin_id)
				INNER JOIN
					admin AS t4 ON(t4.admin_id = t3.created_by)
				WHERE
					alias_ip_id = :ip_id
			', array('ip_id' => $ip['ip_id']));
        $domainsCount = $stmt2->rowCount();
        $tpl->assign(array('IP' => tohtml($ip['ip_number']), 'RECORD_COUNT' => tr('Total Domains') . ': ' . $domainsCount));
        if ($domainsCount) {
            while ($data = $stmt2->fetchRow(PDO::FETCH_ASSOC)) {
                $tpl->assign(array('DOMAIN_NAME' => tohtml(idn_to_utf8($data['domain_name'])), 'RESELLER_NAME' => tohtml($data['admin_name'])));
                $tpl->parse('DOMAIN_ROW', '.domain_row');
            }
        } else {
            $tpl->assign('DOMAIN_NAME', tr('No used yet'));
            $tpl->parse('DOMAIN_ROW', 'domain_row');
        }
        $tpl->parse('IP_ROW', '.ip_row');
        $tpl->assign('DOMAIN_ROW', '');
    }
}
コード例 #14
0
ファイル: funcao.php プロジェクト: kureshio/colecao
function libera_acesso($item, $id_conn)
{
    if ($_SESSION['admin'] == '0') {
        $sql = "SELECT tb_usuarioquaisacessos.usuarioquaisacessos_id FROM tb_acesso ";
        $sql .= "INNER JOIN tb_usuarioquaisacessos ON (tb_usuarioquaisacessos.acesso_id = tb_acesso.acesso_id) ";
        $sql .= "WHERE tb_acesso.acesso_nome='%s' ";
        $sql .= "AND tb_usuarioquaisacessos.usuario_id = '%s' LIMIT 1";
        $sql = sprintf($sql, mysql_real_escape_string($item), mysql_real_escape_string($_SESSION['usuario_id']));
        $acessou = execute_query($sql, $id_conn);
        if (!$acessou) {
            $messagem = 'Query Inválida: ' . mysql_error() . "\n";
            $messagem .= 'Pesquisa Inteira: ' . $sql;
            die($messagem);
        }
        if (num_rows($acessou) == 0) {
            header("Location: acesso_proibido.php");
            exit(0);
        }
    }
}
コード例 #15
0
ファイル: ip_manage.php プロジェクト: svenjantzen/imscp
/**
 * Generates IPs list.
 *
 * @access private
 * @param iMSCP_pTemplate $tpl Template engine
 * @return void
 */
function _client_generateIpsList($tpl)
{
    /** @var $cfg iMSCP_Config_Handler_File */
    $cfg = iMSCP_Registry::get('config');
    $query = "SELECT * FROM `server_ips`";
    $stmt = execute_query($query);
    if ($stmt->rowCount()) {
        while (!$stmt->EOF) {
            list($actionName, $actionUrl) = _client_generateIpAction($stmt->fields['ip_id'], $stmt->fields['ip_status']);
            $tpl->assign(array('IP' => $stmt->fields['ip_number'], 'NETWORK_CARD' => $stmt->fields['ip_card'] === NULL ? '' : tohtml($stmt->fields['ip_card'])));
            $tpl->assign(array('ACTION_NAME' => $cfg->BASE_SERVER_IP == $stmt->fields['ip_number'] ? tr('Protected') : $actionName, 'ACTION_URL' => $cfg->BASE_SERVER_IP == $stmt->fields['ip_number'] ? '#' : $actionUrl));
            $tpl->parse('IP_ADDRESS_BLOCK', '.ip_address_block');
            $stmt->moveNext();
        }
    } else {
        // Should never occur but who knows.
        $tpl->assign('IP_ADDRESSES_BLOCK', '');
        set_page_message(tr('No IP address found.'), 'info');
    }
}
コード例 #16
0
ファイル: grava_usuario.php プロジェクト: kureshio/colecao
function grava_usuario()
{
    $filename = upload_foto();
    require '../config/infodbcon.php';
    require '../config/database.php';
    $id_conn = open_database();
    $post = array_map("mysql_real_escape_string", $_POST);
    execute_query("START TRANSACTION", $id_conn);
    if ($post['cmb_cadastro'] == '0') {
        $sql = 'INSERT INTO tb_usuario ';
        $sql .= '(usuario_nome, usuario_login, usuario_senha, usuario_email, usuario_foto, usuario_info, usuario_ativo)';
        $sql .= 'VALUES ';
        $sql .= '(\'' . addslashes(utf8_decode($_POST['nome'])) . '\', \'' . utf8_decode($post['login']) . '\', ';
        $sql .= '\'' . md5('123mudar') . '\', \'' . $post['email'] . '\',';
        $sql .= '\'' . $filename . '\', \'' . addslashes(utf8_decode($_POST['infor'])) . '\', \'' . ($post['ativo'] ? 1 : 0) . '\')';
    } else {
        $sql = 'UPDATE tb_usuario SET ';
        $sql .= 'usuario_nome = \'' . addslashes(utf8_decode($_POST['nome'])) . '\', usuario_login = \'' . $post['login'] . '\', ';
        $sql .= 'usuario_email = \'' . $post['email'] . '\', ';
        $sql .= 'usuario_info=\'' . addslashes(utf8_decode($_POST['infor'])) . '\', ';
        $sql .= 'usuario_ativo=\'' . (isset($post['ativo']) ? 1 : 0) . '\' ';
        if ($post['trocoufoto']) {
            $sql .= ',usuario_foto=\'' . $filename . '\' ';
        }
        $sql .= 'WHERE ';
        $sql .= 'usuario_id=' . $post['cmb_cadastro'];
    }
    if (!execute_query($sql, $id_conn)) {
        $messagem = utf8_decode('Query Inválida: ') . mysql_error() . "\n";
        $messagem .= 'Pesquisa Inteira: ' . $sql;
        echo $messagem;
        execute_query("ROLLBACK", $id_conn);
    } else {
        execute_query('COMMIT', $id_conn);
        echo '1';
    }
    execute_query("END TRANSACTION", $id_conn);
    close_database($id_conn);
}
コード例 #17
0
ファイル: email.php プロジェクト: YonasBerhe/LS
function sendFinalEmails($email, $client_key, $final1, $final2, $final3, $final4)
{
    //echo 'final email '.$email.' '.$client_key.'<br>';
    //find device email and device type
    $sql = "call getDeviceInfo(" . sql_escape_string($email, 1) . ");";
    echo $sql;
    $Result = execute_query($mysqli, $sql);
    if ($Result) {
        $row = $Result[0]->fetch_assoc();
        $device_email = $row['email'];
        $device = $row['device'];
        $fname = $row['fname'];
        $lname = $row['lname'];
        $gSQL = 'CALL getOrgByKey(' . sql_escape_string($client_key, 1) . ');';
        //echo $gSQL;
        //echo '<br>';
        $gResult = execute_query($mysqli, $gSQL);
        $group_code = $gResult[0]->fetch_array()[0];
        //echo $group_code;
        //echo '<br>';
        //send to Socks
        $sMail = getSocksMailer();
        $sMail->Subject = "Litesprite User Completed Onboarding";
        $sMail->Body = "client key: " . $client_key . "<br>\n\t\t\t\t\t\tgroup: " . $group_code . "<br>\n\t\t\t\t\t\tCodes and Instructions have been sent to: " . $email . "<br> \n\t\t\t\t\t\tDevice: " . ($device == 'A' ? 'Android' : 'iOS') . "<br> \n\t\t\t\t\t\tDevice email: " . $device_email . "<br>\n\t\t\t\t\t\tLast name: " . $lname . "<br>\n\t\t\t\t\t\tFirst name:" . $fname;
        //echo $sMail->Body;
        //echo '<br>';
        $sMail->AddAddress("*****@*****.**");
        sendMail($sMail);
        //send to User
        $uMail = getSocksMailer();
        $uMail->Subject = "Litesprite Beta Sign-Up Completed!";
        $uMail->AddEmbeddedImage('../images/paw.png', 'paw');
        $uMail->Body = $final1 . $group_code . $final2 . $client_key . $final3 . $device_email . $final4;
        //echo $uMail->Body;
        $uMail->AddAddress($email);
        sendMail($uMail);
    }
}
コード例 #18
0
ファイル: ESBulkSync.php プロジェクト: pleio/elasticsearch
 public function syncAnnotations()
 {
     $dblink = get_db_link('read');
     $site = elgg_get_site_entity();
     $result = execute_query('SELECT COUNT(`id`) FROM elgg_annotations', $dblink);
     $row = mysqli_fetch_row($result);
     $total = (int) $row[0];
     $result = execute_query('SELECT `id` FROM elgg_annotations ORDER BY id', $dblink);
     while ($row = mysqli_fetch_row($result)) {
         $ids[] = $row[0];
         if (count($ids) == 50) {
             $this->processItems('annotations', $ids);
             $ids = array();
         }
         $i += 1;
         if ($i % 500 == 0) {
             echo round($i / $total * 100, 2) . "%\r";
         }
     }
     if (count($ids) > 0) {
         $this->processItems('annotations', $ids);
     }
 }
コード例 #19
0
function savedata()
{
    global $post, $get, $link, $jsonpost, $imageUploadDir;
    //func=register&DEBUGMODE=1&email=yashesh@zaptechsolutions.com&fname=yashesh&lname=parma&password=yashesh
    $retArray = array();
    if (!empty($jsonpost['name']) && !empty($jsonpost['location']) && !empty($jsonpost['phonenumber']) && !empty($jsonpost['image'])) {
        $imagename = generateImageFrom64BitData($jsonpost['image'], $imageUploadDir);
        $description = !empty($jsonpost['description']) ? $jsonpost['description'] : "";
        $category = !empty($jsonpost['category']) ? $jsonpost['category'] : "";
        $datetime = !empty($jsonpost['datetime']) ? $jsonpost['datetime'] : date("Y-m-d H:i:s");
        $query = "INSERT INTO `yasheshcfa`.`events` (`name`, `location`, `date`, `phonenumber`, `category`, `image`, `description`) VALUES ('{$jsonpost['name']}', '{$jsonpost['location']}', '{$datetime}', '{$jsonpost['phonenumber']}', '{$category}', '{$imagename}', '{$description}');";
        $result = execute_query($query);
        $insertedId = mysql_insert_id();
        $checkQuery = "select * from events where id='{$insertedId}'";
        $insertResult = execute_query($checkQuery);
        while ($row = mysql_fetch_assoc($insertResult)) {
            $userData = $row;
        }
        $retArray = array("status" => "success", "message" => "", "data" => $userData);
    } else {
        $retArray = array("status" => "error", "message" => "all field not filled");
    }
    echo encode_respond($retArray);
}
コード例 #20
0
ファイル: antiretro_insert.php プロジェクト: nkiourt/amacs
    } else {
        echo " και ημερομηνία λήξης " . $end2;
    }
    echo "<BR> και θέλετε να καταχωρήσετε <b>{$schema}</b> με ημερομηνία έναρξης " . $start;
    if ($enddate == '3000-01-01') {
        echo " και ανοιχτή ημερομηνία λήξης";
    } else {
        echo " και ημερομηνία λήξης " . $enddate;
    }
    echo "</div></p>";
    echo "<br><br><br><br><br><br>";
    echo "<div class='img-shadow'>";
    show_errormsg("");
    echo "</div>";
}
mysql_free_result($result);
// Insert Medicines
$sql = "";
for ($i = 0; $i < count($meds); $i++) {
    $sql = "INSERT INTO antiretro_treatments VALUES('" . $_GET['PatientCode'] . "', '" . $meds[$i]['id'] . "', '" . join_date($_GET, 'StartDate') . "', '" . $enddate . "')";
    //	echo $sql."<BR>";
    $what_happened = execute_query($sql);
}
// Insert Compliance, Discontinuation Reasons and Notes
$sql = "INSERT INTO antiretro_treatments_compliance VALUES('" . $_GET['PatientCode'] . "', '" . $schema . "', '" . join_date($_GET, 'StartDate') . "', '" . $enddate . "', '" . $_GET['comp'] . "', '" . $_GET['Reason1'] . "', '" . $_GET['Reason2'] . "', '" . $_GET['Notes'] . "')";
execute_query($sql);
mysql_close($dbconnection);
perform_post_insert_actions("", "antiretro.php?code=" . $_GET['PatientCode'], "");
?>

コード例 #21
0
ファイル: hfc_list_entry.php プロジェクト: helio-vo/helio
function getmonthstat_for_year_from_tstat($feat_type, $id_observatory, $frc_info_id, $year)
{
    $tab_tables = array("fil" => "FILAMENTS", "pro" => "PROMINENCES", "ar" => "ACTIVEREGIONS", "ch" => "CORONALHOLES", "sp" => "SUNSPOTS", "t3" => "TYPE_III", "rs" => "RADIOSOURCES");
    $tab_month = array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
    $tab_results = array();
    $table = $tab_tables[$feat_type];
    //foreach($tab_month as $month) {
    $sql_query = "SELECT NB_FEAT FROM DATE_STAT WHERE ";
    //$sql_query = $sql_query."date_format(TIME_RANGE, '%Y-%m')='".$year."-".$month."'";
    $sql_query = $sql_query . "YEAR(TIME_RANGE)=" . $year;
    $sql_query = $sql_query . " AND OBSERVATORY_ID=" . $id_observatory;
    $sql_query = $sql_query . " AND FRC_INFO_ID=" . $frc_info_id;
    $sql_query = $sql_query . " AND FEAT_TYPE='" . $table . "'";
    $sql_query = $sql_query . " ORDER BY TIME_RANGE ASC";
    $rs = execute_query($sql_query);
    //$tab_results[$month] = $rs['NB_FEAT'][0];
    //}
    return array_values($rs['NB_FEAT']);
    //return $tab_results;
}
コード例 #22
0
ファイル: database.php プロジェクト: nachopavon/Elgg
/**
 * Remove a row from the database.
 *
 * @note Altering the DB invalidates all queries in {@link $DB_QUERY_CACHE}.
 *
 * @param string $query The SQL query to run
 *
 * @return int|false The number of affected rows or false on failure
 * @access private
 */
function delete_data($query)
{
    global $CONFIG, $DB_QUERY_CACHE;
    $query = elgg_format_query($query);
    elgg_log("DB query {$query}", 'NOTICE');
    $dblink = get_db_link('write');
    // Invalidate query cache
    if ($DB_QUERY_CACHE) {
        $DB_QUERY_CACHE->clear();
        elgg_log("Query cache invalidated", 'NOTICE');
    }
    if (execute_query("{$query}", $dblink)) {
        return mysql_affected_rows($dblink);
    }
    return FALSE;
}
コード例 #23
0
ファイル: marriage.php プロジェクト: icxbb-xx/eamod
             $result = execute_query($query, "marriage.php");
             $query = sprintf(PARTNER_RING, $GET_GID1);
             $result = execute_query($query, "marriage.php");
             $query = sprintf(PARTNER_RING, $GET_GID2);
             $result = execute_query($query, "marriage.php");
             $ban_until = time() + 2 * 60;
             // 2 minutos pra fazer efeito //testando vicous pucca
             $query = sprintf(PARTNER_BAN, $ban_until, $_SESSION[$CONFIG_name . 'account_id']);
             $result = execute_query($query, "marriage.php");
             redir("marriage.php", "main_div", $lang['MARRIAGE_DIVORCE_OK']);
         }
         alert($lang['MARRIAGE_NOTHING']);
     }
 }
 $query = sprintf(PARTNER_GET, $_SESSION[$CONFIG_name . 'account_id']);
 $result = execute_query($query, "marriage.php");
 if ($result->count() < 1) {
     redir("motd.php", "main_div", $lang['ONE_CHAR']);
 }
 opentable($lang['MARRIAGE']);
 echo "\r\n\t\t<table width=\"400\">\r\n\t\t<tr>\r\n\t\t\t<td align=\"left\" class=\"head\">" . $lang['NAME'] . "</td>\r\n\t\t\t<td align=\"left\" class=\"head\">" . $lang['MARRIAGE_PARTNER'] . "</td>\r\n\t\t\t<td align=\"center\" class=\"head\">" . $lang['MARRIAGE_DIVORCE'] . "</td>\r\n\t\t</tr>\r\n\t\t";
 while ($line = $result->fetch_row()) {
     $charname = htmlformat($line[0]);
     $GID1 = $line[1];
     $partnername = htmlformat($line[2]);
     if (strlen($partnername) < 4) {
         $partnername = $lang['MARRIAGE_SINGLE'];
     }
     $GID2 = $line[3];
     echo "    \r\n\t\t\t<tr>\r\n\t\t\t\t<td align=\"left\">{$charname}</td>\r\n\t\t\t\t<td align=\"left\">{$partnername}</td>\r\n\t\t\t";
     if ($CONFIG_marry_enable && $GID2 > 0) {
コード例 #24
0
ファイル: join.php プロジェクト: youngminz/Exchangers
            if (fetch_first_row("SELECT user_id FROM users WHERE user_id = ?", "s", $user_id) !== false) {
                $is_valid = false;
                $reason = T_("이미 존재하는 아이디입니다. 다른 아이디를 사용해 주세요.");
            }
            if ($is_valid == true) {
                if (fetch_first_row("SELECT user_id FROM users WHERE user_email = ?", "s", $user_email) !== false) {
                    $is_valid = false;
                    $reason = T_("다른 사용자가 사용 중인 이메일입니다. 다른 이메일을 사용해 주세요.");
                }
            }
        } else {
            $is_valid = false;
            $reason = T_("입력하신 두 개의 비밀번호가 다릅니다. 비밀번호를 다시 입력하세요.");
        }
        if ($is_valid === true) {
            execute_query("INSERT INTO users (ID, user_id, user_pass, user_nickname, user_email) " . "VALUES(NULL, ?, ?, ?, ?)", "ssss", $user_id, $user_pass, $user_nickname, $user_email);
            header('Location: /login.php?join=done');
        }
    } else {
        $is_valid = false;
        $reason = T_("작성하지 않은 곳이 있습니다.");
    }
}
//////////////////// HTML START ////////////////////
require_once "header.php";
?>

<main class="narrow">
  <form class="form-list" action="join.php" method="post">
    <h1><?php 
echo T_("회원 가입");
コード例 #25
0
ファイル: rpt_pmph_2.php プロジェクト: YonasBerhe/LS
require_once 'include/header.php';
require_once 'include/footer.php';
// echo isset($_SESSION['user_key'])."<br/>";
// echo strlen($_SESSION['user_key'])."<br/>";
if (isset($_SESSION['user_key']) == false || strlen($_SESSION['user_key']) < 1) {
    header('Location: /login');
}
if (strlen($args[1]) < 1) {
    $survey_id = 1;
} else {
    $survey_id = $args[1];
}
//Validate the user
$sql = "CALL rptPMPHbySurvey(" . sql_escape_string($survey_id, 0) . ");";
//echo $sql.'<br/>';
$Result = execute_query($mysqli, $sql);
if ($Result) {
    while ($row = $Result[0]->fetch_assoc()) {
        //$survey = $row['survey'];
        // $survey_id = $row['client_survey_baseline_id'];
        $client_key = $row['client_key'];
        $pmph2a = eval2($row['pmph2a']);
        $pmph2b = eval2($row['pmph2b']);
        $pmph2c = eval2($row['pmph2c']);
        $pmph2d = eval2($row['pmph2d']);
        $pmph2e = eval2($row['pmph2e']);
        $pmph2f = eval2($row['pmph2f']);
        $pmph2g = eval2($row['pmph2g']);
        $pmph2h = eval2($row['pmph2h']);
        $pmph2i = eval2($row['pmph2i']);
        $pmph2j = eval2($row['pmph2j']);
コード例 #26
0
        $_char_data = explode(" ", $cdata["data"]);
        $_char_gender = dechex($_char_data[$defines["GENDER"][CLIENT]]);
        unset($_char_data);
        $_char_gender = str_pad($_char_gender, 8, 0, STR_PAD_LEFT);
        $cdata["gender"] = $_char_gender[3];
        echo "<tr class=\"";
        if ($arenateam["captainguid"] == $cdata["guid"]) {
            echo "data3";
        }
        echo "\">\r\n\t\t<td>\r\n\t\t<div>\r\n\t\t<p></p>\r\n\t\t</div>\r\n\t\t</td><td><q><span class=\"";
        if ($arenateam["captainguid"] == $cdata["guid"]) {
            echo "gm";
        }
        echo "\"><a href=\"index.php?searchType=profile&character=", $cdata["name"], "&realm=", REALM_NAME, "\">", $cdata["name"], "</a></span></q></td>";
        switchConnection("characters", REALM_NAME);
        $gquery = mysql_fetch_assoc(execute_query("SELECT `guildid` FROM `guild_member` WHERE `guid` = " . $cdata["guid"] . " LIMIT 1"));
        $guildid = $gquery ? $gquery["guildid"] : 0;
        echo "<td class=\"\"><q><strong>", guild_tooltip($guildid), "</strong></q></td>";
        if ($cdata["played_season"]) {
            $win_percent = round($cdata["wons_season"] / $cdata["played_season"] * 100);
        } else {
            $win_percent = 0;
        }
        ?>
<td align="center"><img class="ci" onmouseout="hideTip()" onMouseOver="showTip('<?php 
        echo GetNameFromDB($cdata["race"], "dbc_chrraces");
        ?>
')" src="images/icons/race/<?php 
        echo $cdata["race"], "-", $cdata["gender"];
        ?>
.gif"><img src="shared/wow-com/images/layout/pixel.gif" width="2">
コード例 #27
0
ファイル: whoisonline.php プロジェクト: jaison/CeresCP
To contact any of the authors about special permissions send
an e-mail to cerescp@gmail.com
*/
session_start();
include_once 'config.php';
// loads config variables
include_once 'query.php';
// imports queries
include_once 'functions.php';
$jobs = $_SESSION[$CONFIG_name . 'jobs'];
if (is_woe()) {
    redir("motd.php", "main_div", $lang['WOE_TIME']);
}
$query = sprintf(WHOISONLINE);
$result = execute_query($query, "whoisonline.php");
opentable($lang['WHOISONLINE_WHOISONLINE']);
echo "\r\n<table width=\"500\">\r\n<tr>\r\n\t<td align=\"left\" class=\"head\">" . $lang['NAME'] . "</td>\r\n\t<td align=\"left\" class=\"head\">" . $lang['CLASS'] . "</td>\r\n\t<td align=\"center\" class=\"head\">" . $lang['BLVLJLVL'] . "</td>\r\n\t";
if (isset($_SESSION[$CONFIG_name . 'level']) && $_SESSION[$CONFIG_name . 'level'] >= $CONFIG['cp_admin']) {
    echo "<td align=\"center\" class=\"head\">" . $lang['WHOISONLINE_COORDS'] . "</td>";
}
echo "\r\n\t<td align=\"left\" class=\"head\">" . $lang['MAP'] . "</td>\r\n</tr>\r\n";
if ($result) {
    while ($line = $result->fetch_row()) {
        $charname = htmlformat($line[0]);
        if ($line[9] >= $CONFIG_gm_hide) {
            if (!isset($_SESSION[$CONFIG_name . 'level']) || isset($_SESSION[$CONFIG_name . 'level']) && $_SESSION[$CONFIG_name . 'level'] < $line[9]) {
                continue;
            }
        }
        echo "    \r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\">{$charname}</td>\r\n\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t";
コード例 #28
0
ファイル: hcv_antiiikes.php プロジェクト: nkiourt/amacs
				</TD>
				<TD>
				<textarea name=Note STYLE="overflow:hidden; width:450px; height: 50px"></textarea>
				</TD>
				</TR>
				</TABLE>
			</TD>
		</TR>

	</TABLE>
</TD>
</TR>
</TABLE>

<?php 
$result = execute_query("SELECT MAX(link_id) FROM `hcv_antiiikes_treatments`");
$row = mysql_fetch_array($result);
$link_id = $row[0];
echo "<input type='hidden' name='link_id' value='{$link_id}'>";
mysql_free_result($result);
?>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Αποθήκευση Δεδομένων">
<INPUT TYPE="reset" VALUE="Καθαρισμός">
</FORM>
<script>
function check_meds(med)
{
	if (med == "IFNα")
	{
		document.all['PEG-IFNα-2α'].checked = false;
コード例 #29
0
ファイル: admin-functions.php プロジェクト: gOOvER/EasySCP
/**
 * @param EasySCP_TemplateEngine $tpl
 * @param EasySCP_Database $sql
 */
function gen_user_list($tpl, $sql)
{
    $cfg = EasySCP_Registry::get('Config');
    $start_index = 0;
    $rows_per_page = $cfg->DOMAIN_ROWS_PER_PAGE;
    if (isset($_GET['psi'])) {
        $start_index = $_GET['psi'];
    }
    // Search request generated ?!
    if (isset($_POST['uaction']) && !empty($_POST['uaction'])) {
        $_SESSION['search_for'] = trim(clean_input($_POST['search_for']));
        $_SESSION['search_common'] = $_POST['search_common'];
        $_SESSION['search_status'] = $_POST['search_status'];
        $start_index = 0;
    } elseif (isset($_SESSION['search_for']) && !isset($_GET['psi'])) {
        // He have not got scroll through patient records.
        unset($_SESSION['search_for']);
        unset($_SESSION['search_common']);
        unset($_SESSION['search_status']);
    }
    $search_query = '';
    $count_query = '';
    if (isset($_SESSION['search_for'])) {
        gen_admin_domain_query($search_query, $count_query, $start_index, $rows_per_page, $_SESSION['search_for'], $_SESSION['search_common'], $_SESSION['search_status']);
        gen_admin_domain_search_options($tpl, $_SESSION['search_for'], $_SESSION['search_common'], $_SESSION['search_status']);
        $rs = exec_query($sql, $count_query);
    } else {
        gen_admin_domain_query($search_query, $count_query, $start_index, $rows_per_page, 'n/a', 'n/a', 'n/a');
        gen_admin_domain_search_options($tpl, 'n/a', 'n/a', 'n/a');
        $rs = exec_query($sql, $count_query);
    }
    $records_count = $rs->fields['cnt'];
    $rs = execute_query($sql, $search_query);
    if ($rs->recordCount() == 0) {
        if (isset($_SESSION['search_for'])) {
            $tpl->assign(array('USR_MESSAGE' => tr('Not found user records matching the search criteria!'), 'USR_LIST' => '', 'SCROLL_PREV' => '', 'SCROLL_NEXT' => '', 'TR_VIEW_DETAILS' => tr('view aliases'), 'SHOW_DETAILS' => 'show'));
            unset($_SESSION['search_for']);
            unset($_SESSION['search_common']);
            unset($_SESSION['search_status']);
        } else {
            $tpl->assign(array('USR_MESSAGE' => tr('Users list is empty!'), 'USR_LIST' => '', 'SCROLL_PREV' => '', 'SCROLL_NEXT' => '', 'TR_VIEW_DETAILS' => tr('view aliases'), 'SHOW_DETAILS' => 'show'));
        }
    } else {
        $prev_si = $start_index - $rows_per_page;
        if ($start_index == 0) {
            $tpl->assign('SCROLL_PREV', '');
        } else {
            $tpl->assign(array('SCROLL_PREV_GRAY' => '', 'PREV_PSI' => $prev_si));
        }
        $next_si = $start_index + $rows_per_page;
        if ($next_si + 1 > $records_count) {
            $tpl->assign('SCROLL_NEXT', '');
        } else {
            $tpl->assign(array('SCROLL_NEXT_GRAY' => '', 'NEXT_PSI' => $next_si));
        }
        $tpl->assign(array('TR_USR_USERNAME' => tr('Username'), 'TR_USR_CREATED_BY' => tr('Created by'), 'TR_USR_OPTIONS' => tr('Options'), 'TR_USER_STATUS' => tr('Status'), 'TR_DETAILS' => tr('Details'), 'TR_EDIT_DOMAIN' => tr('Edit domain'), 'TR_EDIT_USR' => tr('Edit user')));
        while (!$rs->EOF) {
            // user status icon
            $domain_created_id = $rs->fields['domain_created_id'];
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`admin_name`\n\t\t\t\tFROM\n\t\t\t\t\t`admin`\n\t\t\t\tWHERE\n\t\t\t\t\t`admin_id` = ?\n\t\t\t\tORDER BY\n\t\t\t\t\t`admin_name`\n\t\t\t\tASC\n\t\t\t\t;\n\t\t\t";
            $rs2 = exec_query($sql, $query, $domain_created_id);
            if (!isset($rs2->fields['admin_name'])) {
                $created_by_name = tr('N/A');
            } else {
                $created_by_name = $rs2->fields['admin_name'];
            }
            // Get disk usage by user
            $tpl->append(array('USR_DELETE_SHOW' => '', 'DOMAIN_ID' => $rs->fields['domain_id'], 'URL_DELETE_USR' => 'user_delete.php?domain_id=' . $rs->fields['domain_id'], 'URL_CHANGE_INTERFACE' => 'change_user_interface.php?to_id=' . $rs->fields['domain_admin_id']));
            if ($rs->fields['status'] == $cfg->ITEM_OK_STATUS) {
                $status_icon = 'ok';
                $status_url = 'domain_status_change.php?domain_id=' . $rs->fields['domain_id'];
            } elseif ($rs->fields['status'] == $cfg->ITEM_DISABLED_STATUS) {
                $status_icon = 'disabled';
                $status_url = 'domain_status_change.php?domain_id=' . $rs->fields['domain_id'];
            } elseif ($rs->fields['status'] == $cfg->ITEM_ADD_STATUS || $rs->fields['status'] == $cfg->ITEM_RESTORE_STATUS || $rs->fields['status'] == $cfg->ITEM_CHANGE_STATUS || $rs->fields['status'] == $cfg->ITEM_TOENABLE_STATUS || $rs->fields['status'] == $cfg->ITEM_TODISABLED_STATUS || $rs->fields['status'] == $cfg->ITEM_DELETE_STATUS) {
                $status_icon = 'reload';
                $status_url = '#';
            } else {
                $status_icon = 'error';
                $status_url = 'domain_details.php?domain_id=' . $rs->fields['domain_id'];
            }
            $tpl->append(array('STATUS_ICON' => $status_icon, 'URL_CHANGE_STATUS' => $status_url));
            // end of user status icon
            $admin_name = decode_idna($rs->fields['domain_name']);
            $domain_created = $rs->fields['domain_created'];
            if ($domain_created == 0) {
                $domain_created = tr('N/A');
            } else {
                $date_formt = $cfg->DATE_FORMAT;
                $domain_created = date($date_formt, $domain_created);
            }
            $domain_expires = $rs->fields['domain_expires'];
            if ($domain_expires == 0) {
                $domain_expires = tr('Not Set');
            } else {
                $date_formt = $cfg->DATE_FORMAT;
                $domain_expires = date($date_formt, $domain_expires);
            }
            $tpl->append(array('USR_USERNAME' => tohtml($admin_name), 'USER_CREATED_ON' => tohtml($domain_created), 'USER_EXPIRES_ON' => $domain_expires, 'USR_CREATED_BY' => tohtml($created_by_name), 'USR_OPTIONS' => '', 'URL_EDIT_USR' => 'admin_edit.php?edit_id=' . $rs->fields['domain_admin_id']));
            gen_domain_details($tpl, $sql, $rs->fields['domain_id']);
            $rs->moveNext();
        }
    }
}
コード例 #30
0
ファイル: login.php プロジェクト: jaison/CeresCP
     erro_de_login();
     bf_error(trim($POST_username));
     alert($lang['INCORRECT_CODE']);
 }
 if (strlen($POST_username) > 23 || strlen($POST_username) < 4) {
     erro_de_login();
     bf_error(trim($POST_username));
     alert($lang['USERNAME_LENGTH']);
 }
 if (strlen($POST_login_pass) > 23 || strlen($POST_login_pass) < 4) {
     erro_de_login();
     bf_error(trim($POST_username));
     alert($lang['PASSWORD_LENGTH_OLD']);
 }
 $query = sprintf(LOGIN_USER, trim($POST_username));
 $result = execute_query($query, 'index.php');
 if ($result->count() == 1 && ($line = $result->fetch_row())) {
     if ($CONFIG_md5_pass) {
         $POST_login_pass = md5($POST_login_pass);
     }
     if ($line[3] == $POST_login_pass) {
         $_SESSION[$CONFIG_name . 'account_id'] = $line[0];
         $_SESSION[$CONFIG_name . 'userid'] = $line[1];
         $_SESSION[$CONFIG_name . 'level'] = $line[2];
         if ($POST_remember_me) {
             setcookie("login_pass", md5($CONFIG_name . $line[3]), time() + 3600 * 24 * 30);
             setcookie("userid", $line[1], time() + 3600 * 24 * 30);
         }
     } else {
         erro_de_login();
         bf_error(trim($POST_username));