Jump to content
Fórum Script Brasil
  • 0

Acompanhamento de obra mês a mês


claytonprog

Question

Pessoal estou com um problema para resolver: Estou fazendo um site para uma construtora. E preciso fazer com os clientes da

construtora acompanhe as obras mês a mês. A idéia é o seguinte:

O Administrador do Sistema

1- Cadastra os clientes, depois oas obras para cada cliente os e envia as fotos das obras.

Até ai está tudo ok e funcionando.

Agora vem o problema:

1- O Cliente acessa um área administrativa.

2- Lá estarão cadastrados as obras que ele tem na construtora.

3- O Cliente seleciona a obra que ele deseja e em seguida será listado os meses em que foram enviadas as fotos das obras

para que o cliente possa acompanhar mês a mês.

isso é que precisa ser feito:

Segue abaixo as tabelas e como estou tentando fazer.

tabela: projetos

id

id_cliente

foto

data

descricao

----------------------------

tabela: upload_projetos

id

id_projeto

id_cliente

titulo

foto

data

--------------------------------

Exemplo: upload_projetos

id - id_projeto - id_cliente - foto - data

1 - 1 - 1 projeto_planta_baixa - 01-01-2012

1 - 1 - 1 projeto_planta_baixa1 - 03-01-2012

1 - 1 - 1 projeto_planta_baixa1 - 03-02-2012

1 - 1 - 1 projeto_planta_baixa1 - 03-02-2012

Agora é preciso fazer 2 coisas:

1- Em primeiro lugar: Eu Preciso que o sistema busque no banco de dados as fotos enviadas e gere os meses referentes os uploads

feitos no caso acima iria ser gerado os meses JANEIRO E FEVEREIRO 2012 pois foram envidas fotos nestes meses, caso tenham sido envidas

fotos nos 12 meses teria que gerar os 12 meses do referente ano e caso tenha ultrapassado os 12 meses do ano cteorrente o sistema geraria

também os meses do ano seguinte porque uma obra pode durar 2 anos ou mais.

2- Em segundo lugar: Eu preciso que esses meses gerados estejam dentro de colunas, pois quando o cliente clicar no mês que ele escolher

vai abrir abaixo ( estou usando um efeito toggle ) as fotos do projeto que foram postadas naquele mês, porque a idéia é que o cliente

acompanhe a sua obra mês a mês.

abaixo segue codigo de como estou tentando montar:

<!-- INICIO DO BOX MÊS  ---->

<table class="style1">
                            
<thead>
                            
<tr>
                                
<th>Thumbs</th>
                                
<th>Description</th>
                                
<th>Status</th>
                              
<th>M&ecirc;s</th>
                            
</tr>
                            
</thead>
                            
<tbody>

                            
<tr class="box-slide-head">
                                
<td><a href="#" title="preview"><img src="images/tmp/thumbnail1.jpg" alt="" class="thumb size48 clickable" /></a></td>
                                
<td>
                                
<p class="description"><h4>Nome da Obra</h4></p>
                                
</td>
                                
<td class="center vcenter"><img src="images/ico_active_16.png" class="icon16 block center" title="active" alt="" /></td>
                                
<td class="vcenter slide-but"><div align="center"><span></span>JANEIRO</div></td>
                            
</tr>
                            
                            
<tr>
                                
<td colspan="4" class="box-slide-body ln-normal">
                                    
<h5>Fotos da Obra</h5>
                                                                           
                                            
                                        
<div class="gallery gal-small">                                        
                                        
<ul class="clear">                                
                                        
<li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb"  /></a></li>
                                        
<li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb"  /></a></li>
                                        
<li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb"  /></a></li>
                                        
<li><a href="#" rel="group2" title="Ver foto"><img src="images/tmp/thumbnail1.jpg" alt="" width="56" height="58" class="thumb"  /></a></li>                                                        
                                    
                                        
</ul>
                                       
</div>   
                                                 
                                            
<p><small><strong>Postado em:</strong> by <a href="#">Arnold</a> | 20/03/2010</small></p>
                             
                                  
                                
</td>
                            
</tr>
                             
<!-- FINAL DO BOX MÊS ---->

<tr>
                              
<td colspan="4">&nbsp;</td>
                            
</tr>
                            
</tbody>
                            
</table>

Quem puder ajudar agradeço muito.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

5 horas depois já quer uma resposta? Muita necessidade? Contrate um profissional, caso contrário espere alguém lhe ajudar e lembre-se que toda ajuda aqui vem de voluntários e que é proibido ups.

Link to comment
Share on other sites

  • 0

Pessoal começei a fazer está meio caminho andado, só falta fazer o scritp listar mês a mês:

segue abaixo o código:

<table class="style1">
                            <thead>
                            <tr>
                                <th>Obra</th>
                                <th>Nome da Obra</th>
                                <th><div align="center">Status da Obra</div></th>
                                <th><div align="center">Mês</div></th>
                            </tr>
                            </thead>
                            <tbody>
                                                                                
                        
                               <?php
                               
                                  include "../connections/conexao.php";
                        
                                  $id_projeto = $_GET["id_projeto"];
                                  $id_cliente = $_GET["id_cliente"];
                                        
                                                          
                                    $strSQL = mysql_query("SELECT * FROM upload_projetos where id_projeto='$id_projeto' and id_cliente='$id_cliente' order by data desc");
                                    
                                    
                                        while ($aux = mysql_fetch_array($strSQL)) {
                                                    
                                        $id = $aux['id'];   
                                        
                                        $_dt_not= $aux['data'];    
                                        $data    = explode("-",$_dt_not);
                                        $_dt_not = "$data[2]/$data[1]/$data[0]";    
                                                
                                                                
                            ?> 
                            
                            
                           <?php    
                
                          include "../connections/conexao.php";
                       
                        $id_projeto = $_GET["id_projeto"];
                        $id_cliente = $_GET["id_cliente"];
                        
                                          
                        $strSQL1 = mysql_query("SELECT * FROM projetos where id='$id_projeto' and id_cliente='$id_cliente' order by data desc");
                        while ($aux1 = mysql_fetch_array($strSQL1)) {
                                    
                         $nome_projeto= $aux1['nome']; 
                         $foto = $aux1["foto"];
                         $status_projeto= $aux1['status']; 
                         $id_cliente= $aux1['id_cliente'];     
                               
                        }    
                                                 
                        ?>
                            
                            <!-- INICIO DO BOX MÊS ---->
                            <tr class="box-slide-head">
                                <td><img src="../painel/<? echo $foto; ?>" alt="" class="thumb size48 clickable" /></td>
                                <td>
                                <p class="description"><h4><? echo $nome_projeto; ?></h4></p>
                                </td>
                                <td class="center vcenter"><? echo $status_projeto; ?></td>
                                
                                <td class="vcenter slide-but"><div align="center"><span></span>JANEIRO</div></td>
                            </tr>
                            
                            
                            <tr>
                                <td colspan="4" class="box-slide-body ln-normal">
                                    <h5>Fotos da Obra</h5>
                                                                          
                                       
                      <div class="gallery gal-small">                                        
                                        <ul class="clear">    
                                        
                                         <?php
                        
                                         $id_projeto = $_GET["id_projeto"];
                                         $id_cliente = $_GET["id_cliente"];
                                        
                                                          
                                        $strSQL = mysql_query("SELECT * FROM upload_projetos where id_projeto='$id_projeto' and id_cliente='$id_cliente' order by data desc");
                                        while ($aux = mysql_fetch_array($strSQL)) {
                                                    
                                        $id = $aux['id'];                       
                                        $titulo = $aux["titulo"];
                                        $foto = $aux["foto"];
                                        
                                        $_dt_not= $aux['data'];    
                                        $data    = explode("-",$_dt_not);
                                        $_dt_not = "$data[2]/$data[1]/$data[0]";    
                                                
                                                                
                                        ?>           
                                                                           
                                     <li>
                                     <a href="../painel/<? echo $foto; ?>" rel="group2" title="<? echo $aux['titulo']; ?>"><img src="../painel/<? echo $foto; ?>" alt="" width="56" height="58" class="thumb" /></a> 
                                     <br />
                                         <p><small><strong>Data:</strong><? echo $_dt_not; ?></small></p>
                                     </li>
                                       
                                    
                                       <?php
                                        }                                        
                                        ?> 
                        </ul>
                                       </div>   
                                                 
                                        
                             
                                  
                                </td>
                            </tr>
                             <!-- FINAL DO BOX MÊS ---->
                            
                             <?php
                            }                            
                            ?>  
                            
                            
                            <tr>
                              <td colspan="4">&nbsp;</td>
                            </tr>
                            </tbody>
                            </table>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...