Aiuto "No postgressql link" e "Uncaught Error"

di il
1 risposte

Aiuto "No postgressql link" e "Uncaught Error"

Chiedo aiuto per risolvere questi errori (Uso xampp v3.2.4)

Warning: pg_query(): No PostgreSQL link opened yet in C:\xampp\htdocs\painel\pages\alltickets.php on line 2

Warning: pg_num_rows() expects parameter 1 to be resource, bool given in C:\xampp\htdocs\painel\pages\alltickets.php on line 2

Warning: pg_query(): No PostgreSQL link opened yet in C:\xampp\htdocs\painel\pages\alltickets.php on line 3

Warning: pg_num_rows() expects parameter 1 to be resource, bool given in C:\xampp\htdocs\painel\pages\alltickets.php on line 3

Warning: pg_query(): No PostgreSQL link opened yet in C:\xampp\htdocs\painel\pages\alltickets.php on line 4

Warning: pg_num_rows() expects parameter 1 to be resource, bool given in C:\xampp\htdocs\painel\pages\alltickets.php on line 4

Fatal error: Uncaught Error: Class 'Ranking' not found in C:\xampp\htdocs\painel\pages\alltickets.php:6 Stack trace: #0 {main} thrown in C:\xampp\htdocs\painel\pages\alltickets.php on line 6
<?php
$rank =  pg_query("SELECT * FROM suporte");$total = pg_num_rows($rank);
$rank1 =  pg_query("SELECT * FROM suporte WHERE status='0'");$news = pg_num_rows($rank1);
$rank2 =  pg_query("SELECT * FROM suporte WHERE status='1'");$resps = pg_num_rows($rank2);

$rank = new Ranking();
			  	
$pagina=$_GET['pagina']; 
if ($pagina == null) {
	$pc = "1"; 
}else{ 
	$pc = $pagina; 
}
			
$inicio = $pc - 1; 
$inicio = $inicio * 12;

$anterior = $pc - 1; 
$proximo = $pc + 1;
$pags = $rank->Totaltickets();
?>

<div class="page-title">
	<div class="title-env">
		<h1 class="title">Tickets</h1>
		<p class="description">Sempre ultilize de educação ao responder um ticket.</p>
	</div>
	
	<div class="breadcrumb-env">
		<ol class="breadcrumb bc-1">
			<li>
				<a href="index.php"><i class="fa-home"></i>Home</a>
			</li>
			<li class="active">
				<strong>Tickets</strong>
			</li>
		</ol>
	</div>
</div>

<section class="mailbox-env">
	<div class="row">					
		<div class="col-sm-3 mailbox-left">
			<div class="mailbox-sidebar">
				<ul class="list-unstyled mailbox-list" style="margin-top: 13px;">
					<li class="active">
						<a href="#">Todos os Tickets
						<span class="badge badge-blue pull-right"><?php echo $total; ?></span></a>
					</li>
					<li>
						<a href="?pg=newtickets">Novos Tickets
						<span class="badge badge-red pull-right"><?php echo $news; ?></span></a>
					</li>
					<li>
						<a href="?pg=resptickets">Tickets respondidos
						<span class="badge badge-green pull-right"><?php echo $resps; ?></span></a>
					</li>
				</ul>			
			</div>
		</div>
		
		<div class="col-sm-9 mailbox-right">
			<div class="mail-env">
				<table class="table mail-table" style="font-size: 13px;">
					<thead>
						<tr>
							<th class="col-cb"></th>
							<th colspan="4" class="col-header-options">
								<div class="mail-select-options">Mostrando de <strong><?php echo $inicio+1; ?> até <?php if($pc*12 > $total){echo $total;}else{echo $pc*12;} ?></strong>
								de <strong><?php echo $total; ?></strong> Tickets</div>
						
								<div class="mail-pagination">	
									<div class="next-prev">
									<?php
										if ($pc>1){ 
											echo "<a href='?pg=alltickets&pagina=$anterior'><i class='fa-angle-left'></i></a>"; 
										}else{
											echo "<a><i class='fa-angle-left'></i></a>"; 
										}
										if ($pc<$pags){ 
											echo "<a href='?pg=alltickets&pagina=$proximo'><i class='fa-angle-right'></i></a>"; 
										}else{
											echo "<a><i class='fa-angle-right'></i></a>"; 
										}
										?>
									</div>
								</div>
							</th>
						</tr>
					</thead>
					
					<tbody>
					<?php
						for($b = 0; $b < 12; $b++){
							if ($rank->tickets($inicio)[$b]['status'] == 0){
								echo "<tr class='unread'>";
								echo "<td style='padding: 0 0 1px 35px;'><span class='label label-red'>Pendente</span></td>";
								echo "<td class='col-name'><a href='?pg=responder&id=".$rank->tickets($inicio)[$b]['id_suporte']."' class='col-name' style='display: block;max-width: 80px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;'>".$rank->tickets($inicio)[$b]['titulo']."</a></td>";
								echo "<td class='col-subject'><a style='display: block;max-width: 255px;max-height: 16px;' href='?pg=responder&id=".$rank->tickets($inicio)[$b]['id_suporte']."' class='col-name'>".$rank->tickets($inicio)[$b]['mensagem']."</a></td>";
							}
							if ($rank->tickets($inicio)[$b]['status'] == 1){
						        echo "<tr class='unread'>";
								echo "<td style='padding: 0 0 1px 35px;'><span class='label label-secondary'>Respondido</span></td>";
								echo "<td class='col-name'><a href='?pg=responder&id=".$rank->tickets($inicio)[$b]['id_suporte']."' class='col-name' style='display: block;max-width: 80px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;'>".$rank->tickets($inicio)[$b]['titulo']."</a></td>";
								echo "<td class='col-subject'><a style='display: block;max-width: 255px;max-height: 16px;' href='?pg=responder&id=".$rank->tickets($inicio)[$b]['id_suporte']."' class='col-name'>".$rank->tickets($inicio)[$b]['mensagem']."</a></td>";
							}
							if ($rank->tickets($inicio)[$b]['status'] == 2){
								echo "<tr>";
								echo "<td style='padding: 0 0 1px 29px;'><span class='label label-red'>Fechado</span></td>";
								echo "<td class='col-name'><a href='?pg=lerticket&id=".$rank->tickets($inicio)[$b]['id_suporte']."' class='col-name' style='display: block;max-width: 80px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;'>".$rank->tickets($inicio)[$b]['titulo']."</a></td>";
								echo "<td class='col-subject'><a style='display: block;max-width: 255px;max-height: 16px;' href='?pg=lerticket&id=".$rank->tickets($inicio)[$b]['id_suporte']."' class='col-name'>".$rank->tickets($inicio)[$b]['mensagem']."</a></td>";
							}
							echo "<td class='col-options hidden-sm hidden-xs'></td>";
							echo "<td style='width:22%; text-align:center;'>".$rank->tickets($inicio)[$b]['nickname']."</td>";
                                   
							$atual = count($rank->tickets($inicio));
							if($b > $atual - 2){ break; }
							echo "</tr>";				
						}
					?>
					</tbody>
				</table>				
			</div>
		</div>
		
	</div>		
</section>

1 Risposte

Devi accedere o registrarti per scrivere nel forum
1 risposte