-
Content count
12 -
Joined
-
Last visited
Community Reputation
0 ComumAbout Renan Daniel

-
Inserir upload de arquivo em formulário de cadastro
Renan Daniel replied to Renan Daniel's topic in PHP
ficarei muito grato -
Inserir upload de arquivo em formulário de cadastro
Renan Daniel replied to Renan Daniel's topic in PHP
Consegui fazer o upload, agora uma duvida, eu coloquei assim : </div>"; } else { echo "<div class='form'> <h3>Você Preencheu Dados Errados</h3><br/> <p class='link'>Volara Para <a href='index.php'>Tentar Novamente</a> Agora.</p> </div>"; } if(isset($_FILES['fileUpload'])) { date_default_timezone_set("Brazil/East"); //Definindo timezone padrão $ext = strtolower(substr($_FILES['fileUpload']['name'],-4)); //Pegando extensão do arquivo $new_name = date("Y.m.d-H.i.s") . $ext; //Definindo um novo nome para o arquivo $dir = 'uploads/'; //Diretório para uploads move_uploaded_file($_FILES['fileUpload']['tmp_name'], $dir.$new_name); //Fazer upload do arquivo } } else { ?> <form class="form" action="" method="post" enctype="multipart/form-data"> Como eu faço para o nome desta imagem entrar na coluna do minha tabela? -
Inserir upload de arquivo em formulário de cadastro
Renan Daniel replied to Renan Daniel's topic in PHP
Tentei fazer assim mais no meio do caminho eu me enrolei -
Renan Daniel started following Oculta Texto Para Usuário de Nivel Diferente, Inserir upload de arquivo em formulário de cadastro, Liberar Acesso Externo do Ip and and 1 other
-
Seguinte Galera, Sou Iniciante, Com Muito Custo Cheguei num formulário que funciona, ele esta todo no mesmo arquivo(praticamente) Porém eu gostaria de saber como eu faço para inserir uma seleção de arquivo, para o cliente upar uma foto. Caso Alguém Queira me Ajudar Agradeço, Segue o Código : <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Registrar Uma Conta</title> <link rel="stylesheet" href="style.css"/> </head> <body style="background-image: url('bg7.jpg'); background-size: cover; background-position: top center;"> <?php require('db.php'); // When form submitted, insert values into the database. if (isset($_REQUEST['username'])) { // removes backslashes $username = stripslashes($_REQUEST['username']); //escapes special characters in a string $username = mysqli_real_escape_string($con, $username); $email = stripslashes($_REQUEST['email']); $email = mysqli_real_escape_string($con, $email); $password = stripslashes($_REQUEST['password']); $password = mysqli_real_escape_string($con, $password); $numero= stripslashes($_REQUEST['numero']); $numero = mysqli_real_escape_string($con, $numero); $data_nascimento = stripslashes($_REQUEST['data_nascimento']); $data_nascimento = mysqli_real_escape_string($con, $data_nascimento); $cpf = stripslashes($_REQUEST['cpf']); $cpf = mysqli_real_escape_string($con, $cpf); $rg = stripslashes($_REQUEST['rg']); $rg = mysqli_real_escape_string($con, $rg); $endereco_principal = stripslashes($_REQUEST['endereco_principal']); $endereco_principal = mysqli_real_escape_string($con, $endereco_principal); $banco_principal = stripslashes($_REQUEST['banco_principal']); $banco_principal = mysqli_real_escape_string($con, $banco_principal); $agencia_principal = stripslashes($_REQUEST['agencia_principal']); $agencia_principal = mysqli_real_escape_string($con, $agencia_principal); $ope_principal = stripslashes($_REQUEST['ope_principal']); $ope_principal = mysqli_real_escape_string($con, $ope_principal); $conta_principal = stripslashes($_REQUEST['conta_principal']); $conta_principal = mysqli_real_escape_string($con, $conta_principal); $nome_terceiro = stripslashes($_REQUEST['nome_terceiro']); $nome_terceiro = mysqli_real_escape_string($con, $nome_terceiro); $cpf_terceiro = stripslashes($_REQUEST['cpf_terceiro']); $cpf_terceiro = mysqli_real_escape_string($con, $cpf_terceiro); $agencia_terceiro = stripslashes($_REQUEST['agencia_terceiro']); $agencia_terceiro = mysqli_real_escape_string($con, $agencia_terceiro); $ope_terceiro = stripslashes($_REQUEST['ope_terceiro']); $ope_terceiro = mysqli_real_escape_string($con, $ope_terceiro); $conta_terceiro = stripslashes($_REQUEST['conta_terceiro']); $conta_terceiro = mysqli_real_escape_string($con, $conta_terceiro); $create_datetime = date("Y-m-d H:i:s"); $query = "INSERT into `users3` (username, password, email, numero, data_nascimento, cpf, rg, endereco_principal, banco_principal, agencia_principal, ope_principal, conta_principal, nome_terceiro, cpf_terceiro, agencia_terceiro, ope_terceiro, conta_terceiro, create_datetime) VALUES ('$username', '$password', '$email', '$numero', '$data_nascimento', '$cpf', '$rg', '$endereco_principal', '$banco_principal', '$agencia_principal', '$ope_principal', '$conta_principal', '$nome_terceiro', '$cpf_terceiro', '$agencia_terceiro', '$ope_terceiro', '$conta_terceiro','$create_datetime')"; $result = mysqli_query($con, $query); if ($result) { echo "<div class='form'> <h3>Você Foi Registrado com Sucesso.</h3><br/> <p class='link'><a href='#'>Login</a></p> </div>"; } else { echo "<div class='form'> <h3>Você Preencheu Dados Errados</h3><br/> <p class='link'>Volara Para <a href='index.php'>Tentar Novamente</a> Agora.</p> </div>"; } } else { ?> <form class="form" action="" method="post" enctype="multipart/form-data"> <center><img src="1.PNG" style=" width: 250px; "></center> <h1 class="login-title">Dados Pessoais</h1> <h3>Seus Dados São Protegidos.</h3> <input type="text" class="login-input" name="username" placeholder="Nome Completo" required /> <input type="text" class="login-input" name="email" placeholder="Seu Email"> <input type="password" class="login-input" name="password" placeholder="Sua Senha"> <input type="text" class="login-input" name="numero" placeholder="N° de Telefone"> <input type="text" class="login-input" name="data_nascimento" placeholder="Sua Data de Nascimento" required /> <input type="text" class="login-input" name="cpf" placeholder="Seu Cpf" required /> <input type="text" class="login-input" name="rg" placeholder="Seu Rg"required /> <input type="text" class="login-input" name="endereco_principal" placeholder="Seu Endereço"required /> <h1 class="login-title">Seus Dados Bancários</h1> <input type="text" class="login-input" name="banco_principal" placeholder="Nome do Seu Banco"required /> <input type="text" class="login-input" name="agencia_principal" placeholder="Nº Da Agência"required /> <input type="text" class="login-input" name="ope_principal" placeholder="Nº da Operação"required /> <input type="text" class="login-input" name="conta_principal" placeholder="Nº da Conta"required /> <h1 class="login-title">Dados Bancários de Terceiro</h1> <h3>Caso Queira Receber os Redimentos em Nome de Terceiros ( Mãe, Esposa, Filhos..)Deve Cadastrar a Conta Abaixo, e Deve Anexar Um Documento Reconhecido em Cartório Autorizando.</h3> <input type="text" class="login-input" name="nome_terceiro" placeholder="Nome do Titular"required /> <input type="text" class="login-input" name="agencia_terceiro" placeholder="Nº Da Agência"required /> <input type="text" class="login-input" name="ope_terceiro" placeholder="Nº Da Operação"required /> <input type="text" class="login-input" name="conta_terceiro" placeholder="Nº Da Conta"required /> <center><h3>Carregue a Autorização</h3></center> <input type="file" class="login-input" name="arquivo" placeholder="Carregar Autotização"required /> <input type="submit" name="submit" value="REGISTRAR" class="login-button"> <center style=" padding-top: 10px; "><a class="login-button" href="">Voltar Para o Inicio</a></center> </form> <?php } ?> </body> </html> Agradeço desde já a ajuda.
-
Galera Beleza? Não se aqui é o local certo, Caso não for por favor peço que mova o tópico. Segue Minha Dúvida : Tenho um painel de controle no seguinte ip interno 192.168.1.6 Gostaria que quando a pessoa entrasse no meu ip externo 189.71.134.235 pela porta "tal" ela fora redirecionada a este ip interno. Sei que tem como fazer isso pelo nat no modem, já fiz porém não funciona. Quando acesso o ip externo abre somente o modem. Modelo do meu modem : ZXDSL 831II V3 Obrigado a geral pela ajuda.
-
seguinte galera tenho o seguinte código : <?php include("includes/controller.php"); $pagename = 'index'; $container = ''; if(!$session->isAdmin()){ header("Location: login.php"); exit; } else{ $total_users = $adminfunctions->totalUsers(); ?> <!DOCTYPE html> <html> <head> <title> PAINEL MASTER </title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="fonts/Open Iconic/css/open-iconic-bootstrap.min.css" rel="stylesheet"> <link href="fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet"> <link href="css/navigation.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <link href="css/animation.css" rel="stylesheet"> <!-- Awesome Bootstrap Checkboxes CSS --> <link href="css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet"> </head> <body> <!-- Page Wrapper --> <div id="page-wrapper"> <!-- Side Menu --> <nav id="side-menu" class="navbar-default navbar-static-side" role="navigation"> <div id="sidebar-collapse"> <div id="logo-element"> <a class="logo" href="index.php"> <span class="x-hidden">M</span><span class="logo-full">ASTER</span> </a> </div> <?php include('navigation.php'); ?> </div> </nav> <!-- END Side Menu --> <?php include('top-navbar.php'); ?> <!-- Page Content --> <div id="page-content" class="gray-bg"> <!-- Title Header --> <div class="title-header white-bg"> <h2>Seu Painel</h2> <ol class="breadcrumb"> <li> <a href="index.php">Inicio</a> </li> <li class="active"> O Painel </li> </ol> </div> <!-- END Title Header --> <div class="row"> <div class="col-sm-6 col-md-3"> <div class="panel warm-blue-bg"> <div class="panel-body"> <div class="icon-bg"> <i class="oi oi-signal"></i> </div> <div class="text-center"> <h4><?php echo $session->getNumMembers(); ?> Seus Revendedores</h4> </div> </div> <div class="panel-footer clearfix panel-footer-link "> </div> </div> </div> <div class="col-sm-6 col-md-3"> <div class="panel purple-bg"> <div class="panel-body"> <div class="icon-bg"> <i class="oi oi-dollar"></i> </div> <div class="text-center"> <h4><?php echo $functions->calcNumActiveUsers(); ?> Receitas Geradas</h4> </div> </div> <div class="panel-footer clearfix panel-footer-link "> Por Seus Afiliados </div> </div> </div> <div class="col-sm-6 col-md-3"> <div class="panel red-bg"> <div class="panel-body"> <div class="icon-bg"> <i class="oi oi-dollar"></i> </div> <div class="text-center"> <h4><?php echo $adminfunctions->usersSince($session->username); ?> Seu Lucro Bruto</h4> </div> </div> <div class="panel-footer clearfix panel-footer-link "> </div> </div> </div> <!--<div class="col-sm-6 col-md-3"> <div class="panel orange-bg"> <div class="panel-body"> <div class="icon-bg"> <i class="oi oi-clipboard"></i> </div> <div class="text-center"> <h4><?php echo $configs->getConfig('record_online_users'); ?> Users Online </h4> </div> </div> <div class="panel-footer clearfix panel-footer-link "> <?php echo date('M j, Y, g:i a', $configs->getConfig('record_online_date')); ?> </div> </div> </div>--> </div> <div class="row"> <div class="col-md-12 col-lg-6"> <div class="panel"> <div class="panel-heading"> <div class="panel-options pull-right"> <button class="btn btn-sm expand-panel"><i class="oi oi-fullscreen-enter"></i></button> <button class="btn btn-sm close-panel"><i class="oi oi-x"></i></button> <button class="btn btn-sm minimise-panel"><i class="oi oi-minus"></i></button> </div> <i class="oi oi-folder"></i><h3 class="panel-title">Last 5 Visitors</h3> </div> <div class="panel-body table-responsive"> <table class="table table-hover table-striped"> <thead> <tr> <th>Username</th> <th>Status</th> <th>Last Visit</th> <th>Registered</th> <th class='text-center'>View</th> </tr> </thead> <tbody> <?php $sql = "SELECT * FROM users WHERE username != '" . ADMIN_NAME . "' ORDER BY timestamp DESC LIMIT 5"; $result = $db->prepare($sql); $result->execute(); while ($row = $result->fetch()) { $reg = $adminfunctions->displayDate($row['regdate']); $lastlogin = $adminfunctions->displayDate($row['timestamp']); $email = $row['email']; $email = strlen($email) > 25 ? substr($email, 0, 25) . "..." : $email; echo "<tr>"; echo "<td><a href='adminuseredit.php?usertoedit=" . $row['username'] . "'>" . wordwrap($row['username'],15,"<br>\n",TRUE) . "</a></td><td>" . $adminfunctions->displayStatus($row['username']) . "</td>"; echo "<td>" . $lastlogin . "</td><td>" . $reg . "</td>"; echo "<td class='text-center'><div class='btn-group btn-group-xs'><a href='adminuseredit.php?usertoedit=" . $row['username'] . "' title='Edit' class='open_modal btn btn-default'><i class='fa fa-pencil'></i> View</a></div></td>"; echo "</tr>"; } ?> </tbody> </table> </div> </div> <div class="panel"> <div class="panel-heading"> <div class="panel-options pull-right"> <button class="btn btn-sm expand-panel"><i class="oi oi-fullscreen-enter"></i></button> <button class="btn btn-sm close-panel"><i class="oi oi-x"></i></button> <button class="btn btn-sm minimise-panel"><i class="oi oi-minus"></i></button> </div> <i class="oi oi-folder"></i><h3 class="panel-title">Last 5 Registered Users</h3> </div> <div class="panel-body table-responsive"> <table class="table table-hover table-striped"> <thead> <tr> <th>Username</th> <th>Status</th> <th>Registered</th> <th>Last Visit</th> <th class='text-center'>View</th> </tr> </thead> <tbody> <?php $sql = "SELECT * FROM users WHERE username != '" . ADMIN_NAME . "' ORDER BY regdate DESC LIMIT 5"; $result = $db->prepare($sql); $result->execute(); while ($row = $result->fetch()) { $regdate = $row['regdate']; $lastlogin = $adminfunctions->displayDate($row['timestamp']); $reg = $adminfunctions->displayDate($row['regdate']); $email = $row['email']; $email = strlen($email) > 25 ? substr($email, 0, 25) . "..." : $email; echo "<tr>"; echo "<td><a href='" . $configs->getConfig('WEB_ROOT') . "adminuseredit.php?usertoedit=" . $row['username'] . "'>" . wordwrap($row['username'],15,"<br>\n",TRUE) . "</a></td><td>" . $adminfunctions->displayStatus($row['username']) . "</td>"; echo "<td>" . $reg . "</td><td>" . $lastlogin . "</td>"; echo "<td class='text-center'><div class='btn-group btn-group-xs'><a href='" . $configs->getConfig('WEB_ROOT') . "adminuseredit.php?usertoedit=" . $row['username'] . "' title='Edit' class='open_modal btn btn-default'><i class='fa fa-pencil'></i> View</a></div></td>"; echo "</tr>"; } ?> </tbody> </table> </div> </div> </div><!-- END Column --> <!-- <div class="col-md-12 col-lg-6"> <div class="panel"> <div class="panel-heading"> <div class="panel-options pull-right"> <button class="btn btn-sm expand-panel"><i class="oi oi-fullscreen-enter"></i></button> <button class="btn btn-sm close-panel"><i class="oi oi-x"></i></button> <button class="btn btn-sm minimise-panel"><i class="oi oi-minus"></i></button> </div> <i class="oi oi-people"></i><h2 class="panel-title">Users Online</h2> </div> <div class="panel-body"> <?php $stmt = $session->db->query("SELECT username FROM active_users ORDER BY timestamp DESC,username"); $num_rows = $stmt->columnCount(); if ($num_rows > 1) { $divider = ','; } else { $divider = ''; } while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { echo " <a href='adminuseredit.php?usertoedit=" . $row['username'] . "'>" . $row['username'] . "</a> " . $divider; } echo " and " . $session->calcNumActiveGuests() . " guests viewing the site."; ?> </div> </div> <div class="panel"> <div class="panel-heading"> <div class="panel-options pull-right"> <button class="btn btn-sm expand-panel"><i class="oi oi-fullscreen-enter"></i></button> <button class="btn btn-sm close-panel"><i class="oi oi-x"></i></button> <button class="btn btn-sm minimise-panel"><i class="oi oi-minus"></i></button> </div> <i class="oi oi-people"></i><h2 class="panel-title">User Stats</h2> </div> <div class="panel-body table-responsive"> <div id="basic-column-chart2"></div> </div> </div> </div> --> </div> <!-- END Row --> </div> <!-- END Page Content --> <?php include('rightsidebar.php'); ?> </div> <!-- END Page Wrapper --> <!-- Scroll to top --> <a href="#" id="to-top" class="to-top"><i class="oi oi-chevron-top"></i></a> <!-- JavaScript Resources --> <script src="js/jquery-2.1.3.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> <script src="js/xavier.js"></script> <!-- Highcharts JS Files --> <script src="js/plugins/charts/highCharts/highcharts.js"></script> <?php $sql = "SELECT FROM_UNIXTIME(`regdate`, '%M, %Y') AS `date`, COUNT(`users`.`id`) AS `count` FROM `users` GROUP BY `date` ORDER BY `regdate`"; $result = $db->prepare($sql); $result->execute(); while ($row = $result->fetch()) { $date[] = $row['date']; $count[] = $row['count']; } ?> <script> $(function () { $('#basic-column-chart2').highcharts({ chart: { type: 'column' }, title: { text: 'User Registrations by Month' }, subtitle: { text: 'Source: Xavier Dashboard' }, xAxis: { categories: ['<?php echo join($date, "', '") ?>'], crosshair: true }, yAxis: { min: 0, title: { text: 'New Users (number of)' } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' + '<td style="padding:0"><b>{point.y:f}</b></td></tr>', footerFormat: '</table>', shared: true, useHTML: true }, plotOptions: { column: { pointPadding: 0, borderWidth: 0 } }, series: [{ name: 'Registrations', data: [<?php echo join($count, ', ') ?>] }] }); }); </script> </body> </html> <?php } ?> Tenho o banco de dados x e a tabela y com a coluna z, Eu Preciso Que aonde esta <?php echo $session->getNumMembers(); ?> ele busque dentro da tabela y a coluna x e conte quantos resultados ele achou com o texto : (exemplo). Desde já agradeço a vocês galera. fico no aguardo
-
Muito Obrigado Parceiro Ajudou Muito. O Moderador Pode Fechar o Tópico.
-
Valew Velho Funcionou. uma ultima dúvida se no lugar do texto eu quiser retornar uma imagem ?
-
Nenhum dos dois deu certo galera :-( Segue o código da página ai <?php include_once ('misc_func.php'); if (!isset($_SESSION)) { @session_start(); } //include "./lang/$language"; if (!aff_check_security()) { aff_redirect('index.php'); exit; } include "header.php"; ?> <img src="images/wp_aff_stats.jpg" alt="Stats Icon" /> <?php $affiliates_clickthroughs_table = WP_AFF_CLICKTHROUGH_TABLE; $sales_table = WP_AFF_SALES_TABLE; $affiliates_table_name = WP_AFF_AFFILIATES_TABLE; wp_aff_show_stats(); include "footer.php"; function wp_aff_show_stats() { global $wpdb, $affiliates_table_name; $wp_aff_affiliates_db = $wpdb->get_row("SELECT * FROM $affiliates_table_name WHERE refid = '" . $_SESSION['user_id'] . "'", OBJECT); echo '<h3>' . AFF_WELCOME . ' ' . $wp_aff_affiliates_db->firstname . '</h3>'; $default_landing_page = get_option('wp_aff_default_affiliate_landing_url'); if (empty($default_landing_page)) { $default_affiliate_home_url = home_url(); } else { $default_affiliate_home_url = $default_landing_page; } $separator = '?'; $url = $default_affiliate_home_url; if (strpos($url, '?') !== false) { $separator = '&'; } $aff_url = $url . $separator . 'ap_id=' . $_SESSION['user_id']; $affiliate_link = '<a href="' . $aff_url . '" target="_blank">' . $aff_url . '</a>'; echo '<strong>' . AFF_AFFILIATE_ID . ': ' . $_SESSION['user_id'] . '</strong><br /><br />'; echo '<strong>' . AFF_YOUR_AFF_LINK . $affiliate_link . '</strong>'; echo "<br />"; echo apply_filters('wpap_below_your_affiliate_link', ''); //Welcome message $wp_aff_platform_config = WP_Affiliate_Platform_Config::getInstance(); $wp_aff_welcome_page_msg = $wp_aff_platform_config->getValue('wp_aff_welcome_page_msg'); if (!empty($wp_aff_welcome_page_msg)) { $wp_aff_welcome_page_msg = html_entity_decode($wp_aff_welcome_page_msg, ENT_COMPAT, "UTF-8"); $wp_aff_welcome_page_msg = apply_filters('the_content', $wp_aff_welcome_page_msg); echo '<div class="wp_aff_welcome_page_msg">' . $wp_aff_welcome_page_msg . '</div>'; } include ("reports.php"); if($commission_level == 5){ // se for 5 echo "ola mundo"; }else{ // se não echo "teste"; } if (isset($_POST['info_update'])) { $start_date = (string) $_POST["start_date"]; $end_date = (string) $_POST["end_date"]; echo '<h4>'; echo AFF_STATS_OVERVIEW_BETWEEN . ' <font style="color:#222">' . $start_date . '</font> ' . AFF_AND . ' <font style="color:#222">' . $end_date; echo '</font></h4>'; show_stats_between_dates($start_date, $end_date); } else { $curr_date = (date("Y-m-d")); $m = date('m'); $y = date('Y'); $start_date = $y . '-' . $m . '-01'; $end_date = $curr_date; echo '<h4>'; echo AFF_STATS_OVERVIEW; echo '</h4>'; show_stats_between_dates($start_date, $end_date); } } function show_stats_between_dates($start_date, $end_date) { global $wpdb; global $affiliates_clickthroughs_table; global $sales_table; global $affiliates_table_name; $aff_payouts_table = WP_AFF_PAYOUTS_TBL_NAME; $aff_leads_table = WP_AFF_LEAD_CAPTURE_TBL_NAME; $wp_aff_platform_config = WP_Affiliate_Platform_Config::getInstance(); $query = $wpdb->get_row("SELECT count(*) as total_record FROM $affiliates_clickthroughs_table WHERE refid = '" . $_SESSION['user_id'] . "' AND date BETWEEN '$start_date' AND '$end_date'", OBJECT); $total_clicks = $query->total_record; if (empty($total_clicks)) { $total_clicks = "0"; } $query = $wpdb->get_row("SELECT count(*) as total_record FROM $sales_table WHERE payment > 0 AND refid = '" . $_SESSION['user_id'] . "' AND date BETWEEN '$start_date' AND '$end_date'", OBJECT); $number_of_sales = $query->total_record; if (empty($number_of_sales)) { $number_of_sales = "0"; } $row = $wpdb->get_row("select SUM(sale_amount) AS total from $sales_table where refid = '" . $_SESSION['user_id'] . "' AND date BETWEEN '$start_date' AND '$end_date'", OBJECT); $total_sales = round($row->total, 2); if (empty($total_sales)) { $total_sales = "0.00"; } $row = $wpdb->get_row("select SUM(payment) AS total from $sales_table where refid = '" . $_SESSION['user_id'] . "' AND date BETWEEN '$start_date' AND '$end_date'", OBJECT); $total_commission = round($row->total, 2); if (empty($total_commission)) { $total_commission = "0.00"; } $payout_resultset = $wpdb->get_row("select SUM(payout_payment) AS total from $aff_payouts_table where refid = '" . $_SESSION['user_id'] . "' AND date BETWEEN '$start_date' AND '$end_date'", OBJECT); $total_payout = round($payout_resultset->total, 2); if (empty($total_payout)) { $total_payout = '0.00'; } $wp_aff_affiliates_db = $wpdb->get_row("SELECT * FROM $affiliates_table_name WHERE refid = '" . $_SESSION['user_id'] . "'", OBJECT); $commission_level = $wp_aff_affiliates_db->commissionlevel; $currency = get_option('wp_aff_currency'); echo ' <table id="reports" width="300"> <tbody>'; echo '<tr class="wpap_mo_total_clicks_row">'; echo '<td><strong>' . AFF_TOTAL_CLICKS . ' : </strong></td>'; echo '<td>' . $total_clicks . '</td>'; echo '</tr>'; if($wp_aff_platform_config->getValue('wp_aff_show_leads_to_affiliates')!=''){//Leads showing is enabled. $query = $wpdb->get_row("SELECT count(*) as total_record FROM $aff_leads_table WHERE refid = '" . $_SESSION['user_id'] . "' AND date BETWEEN '$start_date' AND '$end_date'", OBJECT); $number_of_leads = $query->total_record; if (empty($number_of_leads)) { $number_of_leads = "0"; } echo '<tr class="wpap_mo_leads_number_row">'; echo '<td><strong>' . AFF_NUMBER_OF_LEADS . ' : </strong></td>'; echo '<td>' . $number_of_leads . '</td>'; echo '</tr>'; } echo '<tr class="wpap_mo_comm_level_row">'; echo '<td><strong>' . AFF_COMMISSION_LEVEL . ' : </strong></td>'; echo '<td>' . $commission_level . '</td>'; echo '<tr class="wpap_mo_sales_number_row">'; echo '<td><strong>' . AFF_NUMBER_OF_SALES . ' : </strong></td>'; echo '<td>' . $number_of_sales . '</td>'; echo '</tr>'; echo '<tr class="wpap_mo_sales_amt_row">'; echo '<td><strong>' . AFF_TOTAL_SALES_AMOUNT . ' : </strong></td>'; echo '<td>' . $total_sales . '</td>'; echo '<td>' . $currency . '</td>'; echo '</tr>'; echo '<tr class="wpap_mo_commission_amt_row">'; echo '<td><strong>' . AFF_TOTAL_COMMISSION . ' : </strong></td>'; echo '<td>' . $total_commission . '</td>'; echo '<td>' . $currency . '</td>'; echo '</tr>'; echo '<tr class="wpap_mo_payout_amt_row">'; echo '<td><strong>' . AFF_PAYOUT_AMOUNT . ' : </strong></td>'; echo '<td>' . $total_payout . '</td>'; echo '<td>' . $currency . '</td>'; echo '</tr>'; echo '<tr class="wpap_mo_comm_level_row">'; echo '<td><strong>' . AFF_COMMISSION_LEVEL . ' : </strong></td>'; echo '<td>' . $commission_level . '</td>'; if (get_option('wp_aff_use_fixed_commission')) { echo '<td>' . $currency . '</td>'; } else { echo '<td>%</td>'; } echo '</tr>'; if (get_option('wp_aff_use_2tier')) { $second_tier_commission_level = $wp_aff_affiliates_db->sec_tier_commissionlevel; if (empty($second_tier_commission_level)) { $second_tier_commission_level = get_option('wp_aff_2nd_tier_commission_level'); } echo '<tr class="wpap_mo_tier_comm_level_row">'; echo '<td><strong>' . AFF_2ND_TIER_COMMISSION_LEVEL . ' : </strong></td>'; echo '<td>' . $second_tier_commission_level . '</td>'; if (get_option('wp_aff_use_fixed_commission')) { echo '<td>' . $currency . '</td>'; } else { echo '<td>%</td>'; } echo '</tr>'; } echo '</tbody></table>'; } Desde Já Agradeço a vcs pela ajuda e vamos tentar novamente não é mesmo.. No Caso ai o switch e o if só o retorna o ultimo texto.."não tem permissão e executa esse bloco" Mesmo eu sendo nivel 5
-
Certo Agora Vamos trocar de problema, Pedindo Mais uma vez generosamente sua ajuda : Esse Cod. Aqui echo '<tr class="wpap_mo_comm_level_row">'; echo '<td><strong>' . AFF_COMMISSION_LEVEL . ' : </strong></td>'; echo '<td>' . $commission_level . '</td>'; Quando roda a página em $commission_level ele retorna o valor 5 agora eu quero que ele identifique esse valor e sabendo que é 5 mostre um texto também porem o processo que fizemos acima já não funciona aqui. Tem Como Me Ajuda ps: Sou Leigo...
-
No Meu Caso o código todo está em inglês isso se aplicaria ? A Coluna a Ser Consultada é commissionlevel e tabela é wpsp_affiliates_tbl Acha que se aplicaria isto ? eu tentei porem n funcionou ..
-
Seguinte Galera, Sou Novo Aqui. Tenho o Seguinte Problema : Preciso Ocultar um texto para Certos Clientes Porém para outros não, de forma automática, Tem uma Coluna na minha tabela que é preenchida com 5 ou com 2 gostaria de mostrar apenas para os usuário que estão preenchido com 5. Alguém Poderia Me Ajudar ? Desde Já Agradeço!