MA

[Resolvido] Barra de progresso em QuestView

Por Marshmello, 21 de out. de 2018 em Resolvidos

6
2.1k
MarshmelloM
21 de outubro de 2018 às 23:27

Salve Pessoal, alguem ae pode me ajudar a por essa progressbar nas quest ??

 

image.png.9cdff6f023ad347924098ec319f3d5ae.png

 

 

Minha Script de questView

 

Spoiler

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

        <div class='title'>
        <div class='Content'>

        <td>

    <fieldset>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$characterPageQuests = array();
/* A list of quests for character/view page. It will be listed on the page as a table to show acomplished missions.
Array contains array of quests which includes STORAGE ID, STORAGE VALUE (Required to finish quest) and NAME 
To create new quest copy line accross and change values.
*/
$player = $GLOBALS['player'];
// $characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Stone Quest'); 
$characterPageQuests[] = array('storage'=>31441546, 'value'=>1, 'name'=>'First');
$characterPageQuests[] = array('storage'=>2353462, 'value'=>1, 'name'=>'Dark');
$characterPageQuests[] = array('storage'=>2353463, 'value'=>1, 'name'=>'Earth');
$characterPageQuests[] = array('storage'=>32542354, 'value'=>1, 'name'=>'Punch');
$characterPageQuests[] = array('storage'=>2353464, 'value'=>1, 'name'=>'Rock');
$characterPageQuests[] = array('storage'=>2353465, 'value'=>1, 'name'=>'Venom');
$characterPageQuests[] = array('storage'=>20112015, 'value'=>1, 'name'=>'Crystal');
$characterPageQuests[] = array('storage'=>2353466, 'value'=>1, 'name'=>'Boost Ice');
$characterPageQuests[] = array('storage'=>2353468, 'value'=>1, 'name'=>'Boost Free');
$characterPageQuests[] = array('storage'=>2353467, 'value'=>1, 'name'=>'Boost hell');
$characterPageQuests[] = array('storage'=>20112016, 'value'=>1, 'name'=>'Celebi');
$characterPageQuests[] = array('storage'=>2436754423, 'value'=>1, 'name'=>'Halloween');
$characterPageQuests[] = array('storage'=>243654651, 'value'=>1, 'name'=>'Shedinja');
$characterPageQuests[] = array('storage'=>314250, 'value'=>1, 'name'=>'Porygon');
$characterPageQuests[] = array('storage'=>98767, 'value'=>1, 'name'=>'Jungle');
$characterPageQuests[] = array('storage'=>90030, 'value'=>1, 'name'=>'Burned');
$characterPageQuests[] = array('storage'=>243243, 'value'=>1, 'name'=>'Rayquaza');
$characterPageQuests[] = array('storage'=>596148, 'value'=>1, 'name'=>'Joker');
$characterPageQuests[] = array('storage'=>9876575, 'value'=>1, 'name'=>'Mutation');
$characterPageQuests[] = array('storage'=>978524350, 'value'=>1, 'name'=>'Ultra ball');
$characterPageQuests[] = array('storage'=>88185428, 'value'=>1, 'name'=>'Unown');
$characterPageQuests[] = array('storage'=>20112027, 'value'=>1, 'name'=>'Lugia');
$characterPageQuests[] = array('storage'=>314172, 'value'=>1, 'name'=>'Tyrogue');
$characterPageQuests[] = array('storage'=>20112020, 'value'=>1, 'name'=>'Dragons Den');
$characterPageQuests[] = array('storage'=>314143, 'value'=>1, 'name'=>'Milotic');
$characterPageQuests[] = array('storage'=>550982398, 'value'=>1, 'name'=>'Farol');
$characterPageQuests[] = array('storage'=>314164, 'value'=>1, 'name'=>'Fossil');
$characterPageQuests[] = array('storage'=>95148455, 'value'=>1, 'name'=>'Conquest');
$characterPageQuests[] = array('storage'=>44587465, 'value'=>1, 'name'=>'Natal');
$characterPageQuests[] = array('storage'=>325423665, 'value'=>1, 'name'=>'Policial Jenny');
$characterPageQuests[] = array('storage'=>243654649, 'value'=>1, 'name'=>'Pesadelo');
$characterPageQuests[] = array('storage'=>724878, 'value'=>1, 'name'=>'Milenar');
$characterPageQuests[] = array('storage'=>314150, 'value'=>1, 'name'=>'Misterious');
$characterPageQuests[] = array('storage'=>20112018, 'value'=>1, 'name'=>'Specilist');
$characterPageQuests[] = array('storage'=>9876599, 'value'=>1, 'name'=>'Remembrance');


 if(count($characterPageQuests) != 0) {
     
     // echo "<legend><div class='title'>Quests</div><br></legend>";
     
      echo "<legend>+ Quests</legend>";
          
        echo "<div width='100%' class='quest_viwer'>";
        
        echo '<div class="pTable" title="15%" style="border: 0px solid #000;"><div style="background: #43a047; font-size: 10px; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; color: #FFF; width: 15%"><center><b>15%</b></center></div></div>';
        
        $SQL = POT::getInstance()->getDBHandle();
        foreach($characterPageQuests as $value) {
            $quest = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = '".$value['storage']."' AND `value` = '".$value['value']."'")->fetch();
            $status = ($quest) ? "true" : "false";
            echo "<div class='quest $status'><center>".$value['name']."</td><td><center><img src='../../../public/images/$status.gif'></center></div>";
        }
        echo "</div>";
    }
?>
</fieldset>

</div></div>

 

MarshmelloM
22 de outubro de 2018 às 21:50
2 horas atrás, Naruse disse:

Não gosto de falar de coisas que não tem relação ao tópico,mas, Num pode ser,o maior scripter do mundo pedindo ajuda. ' - '

Fazer oque jovem, Tentei fazer mais n deu certo, tem ate as divs ali , porem n funfou, então tive que pedir um apelo :/  

GengoG
25 de outubro de 2018 às 10:41
Melhor resposta

Vamos ver se eu consigo ajudar ou até mesmo mostrar o caminho das pedras de como você pode resolver.

Veja se ajuda.

Spoiler
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

        <div class='title'>
        <div class='Content'>

        <td>

    <fieldset>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$characterPageQuests = array();
/* A list of quests for character/view page. It will be listed on the page as a table to show acomplished missions.
Array contains array of quests which includes STORAGE ID, STORAGE VALUE (Required to finish quest) and NAME 
To create new quest copy line accross and change values.
*/
$player = $GLOBALS['player'];
// $characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Stone Quest'); 
$characterPageQuests[] = array('storage'=>31441546, 'value'=>1, 'name'=>'First');
$characterPageQuests[] = array('storage'=>2353462, 'value'=>1, 'name'=>'Dark');
$characterPageQuests[] = array('storage'=>2353463, 'value'=>1, 'name'=>'Earth');
$characterPageQuests[] = array('storage'=>32542354, 'value'=>1, 'name'=>'Punch');
$characterPageQuests[] = array('storage'=>2353464, 'value'=>1, 'name'=>'Rock');
$characterPageQuests[] = array('storage'=>2353465, 'value'=>1, 'name'=>'Venom');
$characterPageQuests[] = array('storage'=>20112015, 'value'=>1, 'name'=>'Crystal');
$characterPageQuests[] = array('storage'=>2353466, 'value'=>1, 'name'=>'Boost Ice');
$characterPageQuests[] = array('storage'=>2353468, 'value'=>1, 'name'=>'Boost Free');
$characterPageQuests[] = array('storage'=>2353467, 'value'=>1, 'name'=>'Boost hell');
$characterPageQuests[] = array('storage'=>20112016, 'value'=>1, 'name'=>'Celebi');
$characterPageQuests[] = array('storage'=>2436754423, 'value'=>1, 'name'=>'Halloween');
$characterPageQuests[] = array('storage'=>243654651, 'value'=>1, 'name'=>'Shedinja');
$characterPageQuests[] = array('storage'=>314250, 'value'=>1, 'name'=>'Porygon');
$characterPageQuests[] = array('storage'=>98767, 'value'=>1, 'name'=>'Jungle');
$characterPageQuests[] = array('storage'=>90030, 'value'=>1, 'name'=>'Burned');
$characterPageQuests[] = array('storage'=>243243, 'value'=>1, 'name'=>'Rayquaza');
$characterPageQuests[] = array('storage'=>596148, 'value'=>1, 'name'=>'Joker');
$characterPageQuests[] = array('storage'=>9876575, 'value'=>1, 'name'=>'Mutation');
$characterPageQuests[] = array('storage'=>978524350, 'value'=>1, 'name'=>'Ultra ball');
$characterPageQuests[] = array('storage'=>88185428, 'value'=>1, 'name'=>'Unown');
$characterPageQuests[] = array('storage'=>20112027, 'value'=>1, 'name'=>'Lugia');
$characterPageQuests[] = array('storage'=>314172, 'value'=>1, 'name'=>'Tyrogue');
$characterPageQuests[] = array('storage'=>20112020, 'value'=>1, 'name'=>'Dragons Den');
$characterPageQuests[] = array('storage'=>314143, 'value'=>1, 'name'=>'Milotic');
$characterPageQuests[] = array('storage'=>550982398, 'value'=>1, 'name'=>'Farol');
$characterPageQuests[] = array('storage'=>314164, 'value'=>1, 'name'=>'Fossil');
$characterPageQuests[] = array('storage'=>95148455, 'value'=>1, 'name'=>'Conquest');
$characterPageQuests[] = array('storage'=>44587465, 'value'=>1, 'name'=>'Natal');
$characterPageQuests[] = array('storage'=>325423665, 'value'=>1, 'name'=>'Policial Jenny');
$characterPageQuests[] = array('storage'=>243654649, 'value'=>1, 'name'=>'Pesadelo');
$characterPageQuests[] = array('storage'=>724878, 'value'=>1, 'name'=>'Milenar');
$characterPageQuests[] = array('storage'=>314150, 'value'=>1, 'name'=>'Misterious');
$characterPageQuests[] = array('storage'=>20112018, 'value'=>1, 'name'=>'Specilist');
$characterPageQuests[] = array('storage'=>9876599, 'value'=>1, 'name'=>'Remembrance');

$totalQuest = 35;

 if(count($characterPageQuests) != 0) {
     
     // echo "<legend><div class='title'>Quests</div><br></legend>";
     
      echo "<legend>+ Quests</legend>";
          
        echo "<div width='100%' class='quest_viwer'>";
        
        echo '<div class="pTable" title="15%" style="border: 0px solid #000;"><div style="background: #43a047; font-size: 10px; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; color: #FFF; width: 15%"><center><b>15%</b></center></div></div>';
        
        $SQL = POT::getInstance()->getDBHandle();
		$count = 0;
        foreach($characterPageQuests as $value) {
            $quest = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = '".$value['storage']."' AND `value` = '".$value['value']."'")->fetch();
            if ($quest){
				$status = "true";
				$count++;
			}
			else
				$status = "false";
			
            echo "<div class='quest $status'><center>".$value['name']."</td><td><center><img src='../../../public/images/$status.gif'></center></div>";
        }
        echo "</div>";
		echo "<div> <progress value='".round(($count*100)/$totalQuest)."' max='100'></progress></div>";
    }
?>
</fieldset>

</div>
</div>

 

 

MarshmelloM
25 de outubro de 2018 às 13:20

@luis700 Consegue por ela na parte de cima como na img? ela ficou assim 

image.png.4450c2c9bca9d3ce38152d20843649c8.png

 

CODE :  \/

Spoiler

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

        <div class='title'>
        <div class='Content'>

        <td>

    <fieldset>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$characterPageQuests = array();
/* A list of quests for character/view page. It will be listed on the page as a table to show acomplished missions.
Array contains array of quests which includes STORAGE ID, STORAGE VALUE (Required to finish quest) and NAME 
To create new quest copy line accross and change values.
*/
$player = $GLOBALS['player'];
// $characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Stone Quest'); 
$characterPageQuests[] = array('storage'=>31441546, 'value'=>1, 'name'=>'First');
$characterPageQuests[] = array('storage'=>2353462, 'value'=>1, 'name'=>'Dark');
$characterPageQuests[] = array('storage'=>2353463, 'value'=>1, 'name'=>'Earth');
$characterPageQuests[] = array('storage'=>32542354, 'value'=>1, 'name'=>'Punch');
$characterPageQuests[] = array('storage'=>2353464, 'value'=>1, 'name'=>'Rock');
$characterPageQuests[] = array('storage'=>2353465, 'value'=>1, 'name'=>'Venom');
$characterPageQuests[] = array('storage'=>20112015, 'value'=>1, 'name'=>'Crystal');
$characterPageQuests[] = array('storage'=>2353466, 'value'=>1, 'name'=>'Boost Ice');
$characterPageQuests[] = array('storage'=>2353468, 'value'=>1, 'name'=>'Boost Free');
$characterPageQuests[] = array('storage'=>2353467, 'value'=>1, 'name'=>'Boost hell');
$characterPageQuests[] = array('storage'=>20112016, 'value'=>1, 'name'=>'Celebi');
$characterPageQuests[] = array('storage'=>2436754423, 'value'=>1, 'name'=>'Halloween');
$characterPageQuests[] = array('storage'=>243654651, 'value'=>1, 'name'=>'Shedinja');
$characterPageQuests[] = array('storage'=>314250, 'value'=>1, 'name'=>'Porygon');
$characterPageQuests[] = array('storage'=>98767, 'value'=>1, 'name'=>'Jungle');
$characterPageQuests[] = array('storage'=>90030, 'value'=>1, 'name'=>'Burned');
$characterPageQuests[] = array('storage'=>243243, 'value'=>1, 'name'=>'Rayquaza');
$characterPageQuests[] = array('storage'=>596148, 'value'=>1, 'name'=>'Joker');
$characterPageQuests[] = array('storage'=>9876575, 'value'=>1, 'name'=>'Mutation');
$characterPageQuests[] = array('storage'=>978524350, 'value'=>1, 'name'=>'Ultra ball');
$characterPageQuests[] = array('storage'=>88185428, 'value'=>1, 'name'=>'Unown');
$characterPageQuests[] = array('storage'=>20112027, 'value'=>1, 'name'=>'Lugia');
$characterPageQuests[] = array('storage'=>314172, 'value'=>1, 'name'=>'Tyrogue');
$characterPageQuests[] = array('storage'=>20112020, 'value'=>1, 'name'=>'Dragons Den');
$characterPageQuests[] = array('storage'=>314143, 'value'=>1, 'name'=>'Milotic');
$characterPageQuests[] = array('storage'=>550982398, 'value'=>1, 'name'=>'Farol');
$characterPageQuests[] = array('storage'=>314164, 'value'=>1, 'name'=>'Fossil');
$characterPageQuests[] = array('storage'=>95148455, 'value'=>1, 'name'=>'Conquest');
$characterPageQuests[] = array('storage'=>44587465, 'value'=>1, 'name'=>'Natal');
$characterPageQuests[] = array('storage'=>325423665, 'value'=>1, 'name'=>'Policial Jenny');
$characterPageQuests[] = array('storage'=>243654649, 'value'=>1, 'name'=>'Pesadelo');
$characterPageQuests[] = array('storage'=>724878, 'value'=>1, 'name'=>'Milenar');
$characterPageQuests[] = array('storage'=>314150, 'value'=>1, 'name'=>'Misterious');
$characterPageQuests[] = array('storage'=>20112018, 'value'=>1, 'name'=>'Specilist');
$characterPageQuests[] = array('storage'=>9876599, 'value'=>1, 'name'=>'Remembrance');

$totalQuest = 35;

 if(count($characterPageQuests) != 0) {
     
     // echo "<legend><div class='title'>Quests</div><br></legend>";
     
      echo "<legend>+ Quests</legend>";
          
        echo "<div width='100%' class='quest_viwer'>";
                
        $SQL = POT::getInstance()->getDBHandle();
        $count = 0;
        foreach($characterPageQuests as $value) {
            $quest = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = '".$value['storage']."' AND `value` = '".$value['value']."'")->fetch();
            if ($quest){
                $status = "true";
                $count++;
            }
            else
                $status = "false";
            
            echo "<div class='quest $status'><center>".$value['name']."</td><td><center><img src='../../../public/images/$status.gif'></center></div>";
        }
        echo "</div>";
        
        echo '<div class="pTable" title="'.round(($count*100)/$totalQuest).'%" style="border: 0px solid #000;"><div style="background: #00ff0c; font-size: 10px; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; color: #FFF; width: '.round(($count*100)/$totalQuest).'%"><center><b>'.round(($count*100)/$totalQuest).'%</b></center></div></div>';

    }
?>
</fieldset>

</div>
</div>

 

GengoG
25 de outubro de 2018 às 13:58

No meu ver até que está bacana ali em baixo, mas se você quer em cima vamos lá.

 

Spoiler
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

        <div class='title'>
        <div class='Content'>

        <td>

    <fieldset>
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$characterPageQuests = array();
/* A list of quests for character/view page. It will be listed on the page as a table to show acomplished missions.
Array contains array of quests which includes STORAGE ID, STORAGE VALUE (Required to finish quest) and NAME 
To create new quest copy line accross and change values.
*/
$player = $GLOBALS['player'];
// $characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Stone Quest'); 
$characterPageQuests[] = array('storage'=>30000, 'value'=>1, 'name'=>'First');
$characterPageQuests[] = array('storage'=>30001, 'value'=>1, 'name'=>'Dark');
$characterPageQuests[] = array('storage'=>30002, 'value'=>1, 'name'=>'Earth');
$characterPageQuests[] = array('storage'=>30003, 'value'=>1, 'name'=>'Punch');
$characterPageQuests[] = array('storage'=>30004, 'value'=>1, 'name'=>'Rock');
$characterPageQuests[] = array('storage'=>30005, 'value'=>1, 'name'=>'Venom');
$characterPageQuests[] = array('storage'=>30006, 'value'=>1, 'name'=>'Crystal');
$characterPageQuests[] = array('storage'=>30007, 'value'=>1, 'name'=>'Boost Ice');
$characterPageQuests[] = array('storage'=>30008, 'value'=>1, 'name'=>'Boost Free');
$characterPageQuests[] = array('storage'=>30009, 'value'=>1, 'name'=>'Boost hell');
$characterPageQuests[] = array('storage'=>30010, 'value'=>1, 'name'=>'Celebi');
$characterPageQuests[] = array('storage'=>30011, 'value'=>1, 'name'=>'Halloween');
$characterPageQuests[] = array('storage'=>30012, 'value'=>1, 'name'=>'Shedinja');
$characterPageQuests[] = array('storage'=>30013, 'value'=>1, 'name'=>'Porygon');
$characterPageQuests[] = array('storage'=>30014, 'value'=>1, 'name'=>'Jungle');
$characterPageQuests[] = array('storage'=>30015, 'value'=>1, 'name'=>'Burned');
$characterPageQuests[] = array('storage'=>30019, 'value'=>1, 'name'=>'Rayquaza');
$characterPageQuests[] = array('storage'=>30017, 'value'=>1, 'name'=>'Joker');
$characterPageQuests[] = array('storage'=>30018, 'value'=>1, 'name'=>'Mutation');
$characterPageQuests[] = array('storage'=>30019, 'value'=>1, 'name'=>'Ultra ball');
$characterPageQuests[] = array('storage'=>30020, 'value'=>1, 'name'=>'Unown');
$characterPageQuests[] = array('storage'=>30021, 'value'=>1, 'name'=>'Lugia');
$characterPageQuests[] = array('storage'=>30022, 'value'=>1, 'name'=>'Tyrogue');
$characterPageQuests[] = array('storage'=>30023, 'value'=>1, 'name'=>'Dragons Den');
$characterPageQuests[] = array('storage'=>30024, 'value'=>1, 'name'=>'Milotic');
$characterPageQuests[] = array('storage'=>30025, 'value'=>1, 'name'=>'Farol');
$characterPageQuests[] = array('storage'=>30026, 'value'=>1, 'name'=>'Fossil');
$characterPageQuests[] = array('storage'=>30027, 'value'=>1, 'name'=>'Conquest');
$characterPageQuests[] = array('storage'=>30028, 'value'=>1, 'name'=>'Natal');
$characterPageQuests[] = array('storage'=>30029, 'value'=>1, 'name'=>'Policial Jenny');
$characterPageQuests[] = array('storage'=>30030, 'value'=>1, 'name'=>'Pesadelo');
$characterPageQuests[] = array('storage'=>30031, 'value'=>1, 'name'=>'Milenar');
$characterPageQuests[] = array('storage'=>30032, 'value'=>1, 'name'=>'Misterious');
$characterPageQuests[] = array('storage'=>30033, 'value'=>1, 'name'=>'Specilist');
$characterPageQuests[] = array('storage'=>30034, 'value'=>1, 'name'=>'Remembrance');

$totalQuest = 35;

 if(count($characterPageQuests) != 0) {
     
     // echo "<legend><div class='title'>Quests</div><br></legend>";
      $SQL = POT::getInstance()->getDBHandle();

      echo "<legend>+ Quests</legend>";
        $count = $SQL->query("SELECT count(*) FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `value` = 1 between 30000 and 30034 ")->fetch();
        
        echo '<div class="pTable" title="'.round(($count*100)/$totalQuest).'%" style="border: 0px solid #000;"><div style="background: #00ff0c; font-size: 10px; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; color: #FFF; width: '.round(($count*100)/$totalQuest).'%"><center><b>'.round(($count*100)/$totalQuest).'%</b></center></div></div>';

        echo "<div width='100%' class='quest_viwer'>";

        foreach($characterPageQuests as $value) {
            $quest = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = '".$value['storage']."' AND `value` = '".$value['value']."'")->fetch();
            $status = ($quest) ? "true" : "false";           
            echo "<div class='quest $status'><center>".$value['name']."</td><td><center><img src='../../../public/images/$status.gif'></center></div>";
        }
        echo "</div>";
    }
?>
</fieldset>

</div>
</div>

 

 

OBS: Troque suas storage para ser sequencial exemplo( 30000 à 30034), apesar de eu ter feito, não sei se elas já estão sendo utilizada no sistema e aproveite para conferir a SQL que é atribuido a variavel $count, para mim aqui está de tranquilo;

MarshmelloM
28 de outubro de 2018 às 05:44
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.