Escolar Documentos
Profissional Documentos
Cultura Documentos
RESUMO
SUMRIO
1
INTRODUO.......................................................................................................6
JUSTIFICATIVA.....................................................................................................7
OBJETIVOS...........................................................................................................8
REFERENCIAL TERICO....................................................................................9
METODOLOGIA..................................................................................................11
TECNOLOGIA.....................................................................................................13
LEVANTAMENTO DE REQUISITOS..................................................................14
DIAGRAMAS.......................................................................................................15
1 INTRODUO
2 JUSTIFICATIVA
Atualmente este controle de chamados realizado no momento em
que o cliente entra em contato com a empresa atravs de ligaes telefnicas, o
atendente encarregado de protocolar o chamado em formulrios, assim podendo
extraviar essas anotaes informais, apresentando tambm alguma inconsistncia
nos dados solicitados ao abrir um chamado, tornando o processo pouco confivel e
to pouco gil, prejudicando o bom funcionamento da empresa. O controle de visitas
aos clientes realizado por meio dos vendedores da empresa, onde os mesmos
preenchem formulrios por escrito, descrevendo os acontecimentos ocorridos
durante a visita. Todos os formulrios de chamados e visitas aps analisados pelo
administrador so armazenados em gavetas.
Analisando o atual sistema de trabalho descrito acima, observou-se
que de tal forma o servio no realizado com confiana e agilidade tornando todo o
processo inseguro, tendo em vista a ampliao da rea de trabalho e tomando
novos ramos em que um controle de chamado e visitas sem dvida muito
importante para um desenvolvimento saudvel da empresa. Com o desenvolvimento
do sistema que estamos propondo desenvolver, os usurios tero maior
confiabilidade, agilidade e facilidade para tratar com essas informaes. A motivao
maior por se tratar de um software de controle baseado em tecnologias web que
vai disponibilizar ao usurio e o administrador um acesso remoto a estas
informaes descritas, permitindo que os mesmos possam utilizar o sistema apartir
de qualquer lugar que possua um acesso a internet. Por ser um sistema web ele ira
proporcionar inmeras vantagens para ambas as partes como, por exemplo, a
portabilidade que ns permite um sistema on-line 24 horas, 7 dias por semana, de
fcil manuseio, reduzindo gastos com a infra-estrutura da empresa e de fcil
manuteno.
3 OBJETIVOS
4 REFERENCIAL TERICO
Segundo Gonalves et all, (1993, p. 109).
Atravs dos tempos, o homem tem buscado mtodos e processos de
trabalho que minimizem o esforo e aperfeioem o resultado na produo
dos bens que necessita. Assim, se no incio da atividade laboral o trabalho
era executado com as mos, a evoluo ocorreu no sentido da utilizao de
ferramentas, mquinas de acionamento mecnico e, atualmente,
equipamentos automatizados. A tecnologia pode ser considerada, ento,
como uma potente fora no sentido de poder estender as capacidades
humanas. Capacidades fsicas, com a revoluo industrial, e capacidades
mentais, com a revoluo da informtica.
10
11
5 METODOLOGIA
A pesquisa feita para executar este trabalho foi uma pesquisa
exploratria. Conforme Oliveira, pesquisa exploratria: a nfase dada
descoberta de praticas ou diretrizes que precisam modificar-se na elaborao de
alternativas que possam ser substitudas. A pesquisa teve como objetivo,
proporcionar maior familiaridade com o problema, para com isso torn-lo mais
evidente, aprofundou-se em uma realidade especifica, e procurou captar as
explicaes e interpretaes do que ocorre na realidade da empresa. Antes de
iniciar o trabalho, para colocar em prtica o procedimento de um sistema de
informao para controle de chamados e visitas, foi feito uma pesquisa para saber
os problemas: A empresa no tinha uma segurana e agilidade na hora de realizar
suas rotinas de chamados e visitas aos clientes. Os primeiros contatos com a
empresa foram realizados atravs de encontros, onde neles foram estipulados as
necessidades que a empresa possua no momento. Ao longo da jornada realizamos
diversas reunies onde nelas, desenvolvemos o levantamento de dados, extrao
de requisitos, leitura de artigos, matrias e desenvolvimento dos diagramas de caso
de uso e de classe. Atualmente na forma de trabalho exercida na empresa
encontramos algumas deficincias, tais como:
a) Anotaes realizadas em papeis;
b) Deslocamento desnecessrio do encarregado do setor at a empresa;
c) Muitas ligaes para celular, aumentando os custos;
d) Perda de tempo na execuo das tarefas;
e) Dificuldades em especificar consultas;
O sistema dever corrigir essas e outras deficincias que no
decorrer do projeto possam ser constatadas no modo de trabalho que atualmente a
empresa utiliza, aprimorando esses controles.
12
13
7 TECNOLOGIA
Tendo em vista as inmeras vantagens que o software livre nos
proporciona decidimos utilizar em nosso trabalho apenas tecnologias livres, citadas
a seguir.
Personal Home Page (PHP) como linguagem de programao sobre
um servidor web Apache e um banco de dados Mysql como sistema gerenciador de
banco de dados (SGBD).
As pginas do sistema so estruturadas em Extensible Hyper Text
Markup Language (XHTML) e Cascading Style Sheet (CSS), utilizamos a bilioteca
Jquery do JavaScript para validar informaes provindas dos formulrios.
Usamos, tambm, a tecnologia AJAX que ns permite uma aplicao
assncrona.
Para a modelagem UML usamos o software JUDE, para editorao
dos textos o pacote OpenOffice.
Para a edio grfica o Gimp e para a criao de cronogramas o
Gannt Project.
14
8 LEVANTAMENTO DE REQUISITOS
Atualmente o processo que a empresa usa para gerenciar os seus
chamados e visitas ao cliente geram uma srie de preocupaes quanto a
segurana, confiabilidade e agilidade nas operaes, pois todo o sistema de trabalho
armazenado em formulrios, posteriormente guardados em fichrios.
Existe um gasto muito alto em ligaes telefnicas, perda de tempo
na execuo das tarefas e dificuldades em especificar consultas e gerar relatrios.
Com base nessas informaes pretendemos amenizar essas
deficincias com um sistema web totalmente dinmico que ir nos permitir realizar
cadastro dos chamados, das visitas, dos funcionrios, dos clientes e das mquinas.
Possibilitar que atravs do sistema o cliente possa realizar a abertura de um
chamado e at mesmo acompanhar a situao do chamado.
O administrador ter uma viso geral do sistema e ainda poder
gerar relatrios e consultas sobre qualquer informao desejada.
15
9 DIAGRAMAS
Encerra
Chamado:
este
processo
permitido
somente
ao
16
j)
17
18
19
20
21
22
10 CRONOGRAMA
Atividades
1 Visita empresa
Extrao dos Requisitos
Anlise dos Requisitos
Modelagem dos Dados
Fundamentao da Proposta
Elaborao do Projeto
Reviso do Projeto
Entrega do Projeto
Ago.
Set.
Out.
Nov.
23
11 CONCLUSO
A idia de se criar um sistema de chamados e visitas para web,
surgiu como desafio e contribuio para toda esta histria do mundo computacional.
O sistema fornece ao administrador informaes especficas sobre a
empresa, essas informaes podem ser usadas para o acompanhamento, controle e
destina-se a apresent-las ao administrador, de forma grfica e de fcil visualizao,
melhorar o processo da tomada de decises, dimensionamento de agilidade na
prestao de qualquer informao solicitada pelo cliente.
Considera-se que o objetivo principal do trabalho foi atingido:
Desenvolver um Sistema Web utilizando apenas software livre. O sistema possibilita
o gerenciamento do andamento dos chamados atravs dos vrios relatrios, para
que o gestor tenha um melhor controle sobre eles. Possibilita o acompanhamento do
desempenho dos tcnicos com a diviso dos chamados em tarefas.
Com isto existe a possibilidade de saber o que cada tcnico fez no
chamado sendo possvel ter um controle maior de nvel gerencial sobre os
chamados.
Os objetivos de aprendizagem do trabalho foram alcanados, pois o
desenvolvimento do trabalho permitiu a aplicao dos conceitos estudados durante o
curso, o aprofundamento sobre o estudo de sistemas de informaes, o estudo de
novas ferramentas e tecnologias de desenvolvimento.
24
REFERNCIAS
CAMPOS, A. O que software livre, Florianpolis, maro de 2006. Disponvel em
http://br-linux.org/linux/faq-softwarelivre. Acesso em 10 de setembro de 2010.
CARNEIRO, t.; LEAL s. Sig e sua importncia para tomada de decises,
Rondnia,
Dezembro
de
2007.
Disponvel
em
http://www.administradores.com.br/informe-se/artigos/sig-e-sua-importancia-paratomada-de-decisoes/26869/. Acesso em 21 de outubro de 2010.
CENTRO DE EDUCAO PROFISSIONALIZANTE, A importncia de a sua
empresa ter um Site, 2005. Disponvel em http://escoladeprotese.com.br/noti.
Acesso em 15 de Outubro de 2010.
COLHO, A. V. S. ; FERNEDA, E. ; MARTINS, A. de S. ; BARROS, M. A. ;
GORGNIO, F. L. E. Help Desk inteligente em gesto do conhecimento: Um
tratamento integrador de paradigmas. Inesc Em Revista, Una, v. 1, p. 46-51,
2003.
Disponvel
em:
http://www.exercito.gov.br/06OMs/gabcmtex/PEGEB/artigopdf/help.PDF. Acesso em 15 Setembro de 2010.
GONALVES. Revoluo da Informtica, Florianpolis, Junho de 1993. Disponvel
em (Gonalves et all, 1993, p. 109). Acesso em 12 de Outubro de 2010.
MAGALHES, Luizio; PINHEIRO Walfrido B. Gerenciamento de servios de TI na
prtica: Uma abordagem com base na ITIL. So Paulo: Novatec, 2007. Acesso em
01 de Outubro de 2010.
SILVA, Jaime J. Help Desk com sistema RBC para as gerncias de aplicativos
do Banco do Brasil. 2004. 45 f. Trabalho de Concluso de Curso (Curso de
Especializao e Desenvolvimento, segurana e Qualidade a Internet) Instituto de
Informtica, Universidade Federal do Rio Grande do Sul, Porto Alegre. Acesso em
01 de Outubro de 2010.
TAPIAS, D. Internet. 2006. Disponvel em http://www.infonova.com.br. Acesso em 26
de outubro de 2010.
UNIPRESS, Software Inc. O Help Desk baseado na web: O que ele pode fazer
por sua empresa e porque voc precisa dele. NM Brasil, [So Paulo], n.15, fev.,
2001.Disponvel
em:
http://www.mmbrasil.com.br/images/stories/solucoes/doc/footprints.pdf. Acesso em:
25 setembro de 2010.
UNIVERSIDADE FEDERAL DE SANTA CATARINA, Tecnologia, 2008. Disponvel
em http://www.eps.ufsc.br/teses96/proenca/cap2/capitulo2.html . Acesso em 10 de
Abril de 2010.
25
em
26
ANEXOS
27
28
29
30
31
32
33
34
1.0
Transitional//EN"
<?php require_once("libs/conn.php");
@session_start();
?>
<script language= 'javascript'>
function printPage()
{
print(document);
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Copiadoras</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
35
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var ncopiadora = $("#ncopiadora").val();
var descdefeito = $("#descdefeito").val();
var obsdefeito = $("#obsdefeito").val();
// Exibe mensagem de carregamento
$("#status").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax com o arquivo tratacadcop.php e
enviamos os valores de cada campo atravs do mtodo POST
$.post('tratacadcha.php',
{ncopiadora:
ncopiadora,
descdefeito:
descdefeito, obsdefeito: obsdefeito }, function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#status").slideDown();
// Se a resposta um erro
if (resposta != false) {
// Exibe o erro na div
$("#status").html(resposta);
}
// Se resposta for false, ou seja, no ocorreu nenhum
erro
else {
// Exibe mensagem de sucesso
$("#status").html("Cadastro
Efetuado
com
Sucesso!");
// Limpando todos os campos
$("#ncopiadora").val("");
$("descdefeito").val("");
}
});
});
});
</script>
<!-- Funo que mostra pessoa fisica e pessoa juridica -->
<script>
$(document).ready(function(){
// Divs 1
$("#dachamado").hide();
$("#achamado").click(function () {
$("#dachamado").slideToggle("slow");
});
// Div 2
$("#dvchamado").hide();
$("#vchamado").click(function () {
$("#dvchamado").slideToggle("slow");
36
});
$("#ddnota").hide();
$("#dnota").click(function () {
$("#ddnota").slideToggle("slow");
});
});
</script>
</head>
<body>
<div id="geral">
<?php
$nome= $_SESSION["nome"];
$id= $_SESSION["id"];
$categoria = $_SESSION["categoria"];
$email= $_SESSION["email"];
//if($categoria != '0'){
//
echo "<strong>De:</strong> $nome<br/>";
//}
?>
<?php
//guarda a data atual
$d= date("d/m/Y");//dia/mes/ano
$t = date('h:i');//hora:minutos
$data = "$d $t";
?>
<div id="saudacao"><?php include 'topo.php';?> </div>
<div id="escrever">
<fieldset>
<legend class="legendfield">Seus Chamados</legend>
<!-- Div que mostra as mensagens de confirmao e erro -->
<div id="status"></div>
<div>
<form id="formulario" action="javascript:func()" method="post">
<br />
<fieldset><legend>O que Voc Deseja:</legend>
<input type="button" name="tcliente" id="achamado" value="Abrir Chamado">
<input
type="button" name="tcliente" id="vchamado" value="Visualizar
Chamados">
<input type="button" name="tcliente" id="dnota" value="Notas">
<a href="desloga.php">
<input type="button" name="sair" id="sair" value="Encerrar Sesso">
</a>
37
</fieldset><br />
<div id="dachamado">
<strong>Data:</strong><?php echo" $d ";?>
<strong>Hora: </strong> <?php echo" $t ";?> <br />
<br /><table>
<tr><td
class="fundolabel"><label
for="nome"><strong>Nome:</strong></label></td>
<td class="fundolabel"><?php echo"$nome" ?></td></tr>
<tr><td class="fundolabel"><label for="ncopiadora"><strong>Modelo do
Equipamento:</strong></label></td>
<td><select name="ncopiadora" id="ncopiadora">
<option>
<!--SELECIONA O NOME DAS COPIADORAS E EXIBE DENTRO DO
SELECT -->
<?php
$consulta
=
mysql_query("SELECT
id,modelo
FROM
copiadoras");
while( $row = mysql_fetch_array($consulta) )
{
echo
"<option
value=\"{$row['modelo']}\">{$row['modelo']}</option>\n";
}
?>
</option>
</select></td></tr>
<tr><td class="fundolabel"><label for="nome"><strong>Descrio do
Defeito:</strong></label></td>
<td><input name="descdefeito" type="text" id="descdefeito" size="85"
maxlength="40"></td></tr>
<tr><td
class="fundolabel"><label
for="obsdefeito"><strong>Observaes:</strong></label></td>
<td><textarea name="obsdefeito" cols="82" rows="15" id="obsdefeito"
method="post"><?php echo"$data"?></textarea></td></tr>
</table>
<br /><center>
<input type="submit" value="Salvar" >
<input type="reset" name="Reset" value="Cancelar"><br /><br /></center>
</form>
</div>
38
<div id="dvchamado">
<br/ >
<fieldset>
<legend>Acompanhe seus Chamados!</legend>
<table width="850" align="center" bgcolor="#F4FFF4">
<tr>
<td width="14" height="22" bordercolor="#003300" bgcolor="#295696"><div
align="center" class="style13 style1">N°</div></td>
<td width="166" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">NOME</div></td>
<td width="165" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">DEFEITO</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">SITUAO</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">IMPRIMIR</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">LER</div></td>
</tr>
<?php
$sql = "select id,nome,descdefeito,situacao from chamados WHERE nome =
'$nome'";
$resultado = mysql_query($sql) or die (mysql_error());
while ($linha = mysql_fetch_array($resultado)){
echo "<tr>";
echo '<td align="center">';
echo $linha["id"];
echo '</td>';
echo '<td align="center">';
echo $linha["nome"];
echo '</td>';
echo '<td align="center">';
echo $linha["descdefeito"];
echo '</td>';
echo '<td align="center">';
echo $linha["situacao"];
echo '</td>';
echo '<td align="center">';
echo '<img src="img/print.png" onclick="printPage()">';
echo '</td>';
echo '<td align="center">';
echo '<a href="vchamado.php">';
echo "<img src='img/visualizar.png'>";
echo '</a>';
echo '</td>';
39
echo '</tr>';
}
echo '</table>';
?>
</fieldset>
</div>
<div id="ddnota">
<?php include('nota.php');?>
</div>
</div>
</div>
</body>
</html>
CADVISITA.PHP
<?php require_once("libs/conn.php");
@session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Copiadoras</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var nomecliente = $("#nomecliente").val();
var datavisita = $("#datavisita").val();
var descvisita = $("#descvisita").val();
// Exibe mensagem de carregamento
$("#status").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax com o arquivo tratacadcop.php e enviamos
os valores de cada campo atravs do mtodo POST
$.post('tratacadvisita.php', {nomecliente: nomecliente, datavisita:
datavisita, descvisita: descvisita }, function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#status").slideDown();
// Se a resposta um erro
if (resposta != false) {
40
41
<option>
<!--SELECIONA O NOME DOS CLIENTES E EXIBE DENTRO DO
SELECT -->
<?php
$consulta = mysql_query("SELECT id,nome FROM usuarios
WHERE categoria = 'cliente'");
while( $row = mysql_fetch_array($consulta) )
{
echo
"<option
value=\"{$row['nome']}\">{$row['nome']}</option>\n";
}
?>
</option>
</select>
</td></tr>
<tr><td
class="fundolabel"><label
for="datavisita"><strong>Data:</strong></label></td>
<td><input name="datavisita" type="text" id="datavisita" size="15"
maxlength="10" /></td></tr>
<tr><td
class="fundolabel"><label
for="descvisita"><strong>Descrio:</strong></label></td>
<td><textarea name="descvisita" cols="82" rows="15" id="descvisita"
method="post"><?php echo"$data"?></textarea></td></tr>
</table> <br />
<center>
<input type="submit" value="Salvar" />
<input type="reset" name="Reset" value="Cancelar"><br /><br /></center>
</form>
</fieldset>
</div>
</body>
</html>
CHASECRETARIA.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require_once("libs/conn.php");
@session_start();
?>
<script language= 'javascript'>
function printPage()
{
print(document);
1.0
Transitional//EN"
42
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Copiadoras</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var ncopiadora = $("#ncopiadora").val();
var descdefeito = $("#descdefeito").val();
var obsdefeito = $("#obsdefeito").val();
// Exibe mensagem de carregamento
$("#status").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax com o arquivo tratacadcop.php e
enviamos os valores de cada campo atravs do mtodo POST
$.post('tratacadcha.php',
{ncopiadora:
ncopiadora,
descdefeito:
descdefeito, obsdefeito: obsdefeito }, function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#status").slideDown();
// Se a resposta um erro
if (resposta != false) {
// Exibe o erro na div
$("#status").html(resposta);
}
// Se resposta for false, ou seja, no ocorreu nenhum
erro
else {
// Exibe mensagem de sucesso
$("#status").html("Cadastro
Efetuado
com
Sucesso!");
// Limpando todos os campos
$("#ncopiadora").val("");
$("descdefeito").val("");
}
});
});
});
</script>
<!-- Funo que mostra pessoa fisica e pessoa juridica -->
43
<script>
$(document).ready(function(){
// Divs 1
$("#dachamado").hide();
$("#achamado").click(function () {
$("#dachamado").slideToggle("slow");
});
// Div 2
$("#dvchamado").hide();
$("#vchamado").click(function () {
$("#dvchamado").slideToggle("slow");
});
$("#ddvisita").hide();
$("#dvisita").click(function () {
$("#ddvisita").slideToggle("slow");
});
});
</script>
</head>
<body>
<div id="geral">
<?php
$nome= $_SESSION["nome"];
$id= $_SESSION["id"];
$categoria = $_SESSION["categoria"];
$email= $_SESSION["email"];
//if($categoria != '0'){
//
echo "<strong>De:</strong> $nome<br/>";
//}
?>
<?php
//guarda a data atual
$d= date("d/m/Y");//dia/mes/ano
$t = date('h:i');//hora:minutos
$data = "$d $t";
?>
<div id="saudacao"><?php include 'topo.php';?> </div>
<div id="escrever">
<fieldset>
<legend class="legendfield">Painel Administrativo</legend>
44
45
</table>
<br /><center>
<input type="submit" value="Salvar" >
<input type="reset" name="Reset" value="Cancelar"><br /><br /></center>
</form>
</div>
<div id="dvchamado">
<br/ >
<fieldset>
<legend>Acompanhe seus Chamados!</legend>
<table width="850" align="center" bgcolor="#F4FFF4">
<tr>
<td width="14" height="22" bordercolor="#003300" bgcolor="#295696"><div
align="center" class="style13 style1">N°</div></td>
<td width="166" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">NOME</div></td>
<td width="165" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">DEFEITO</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">SITUAO</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">IMPRIMIR</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">LER</div></td>
</tr>
<?php
$sql = "select id,nome,descdefeito,situacao from chamados";
$resultado = mysql_query($sql) or die (mysql_error());
while ($linha = mysql_fetch_array($resultado)){
echo "<tr>";
echo '<td align="center">';
echo $linha["id"];
echo '</td>';
echo '<td align="center">';
echo $linha["nome"];
echo '</td>';
echo '<td align="center">';
echo $linha["descdefeito"];
46
echo '</td>';
echo '<td align="center">';
echo $linha["situacao"];
echo '</td>';
echo '<td align="center">';
echo '<img src="img/print.png" onclick="printPage()">';
echo '</td>';
echo '<td align="center">';
echo '<a href="vchamado.php">';
echo "<img src='img/visualizar.png'>";
echo '</a>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
?>
</fieldset>
</div>
<div id="ddvisita">
<br/ >
<fieldset>
<legend>Acompanhe as Visitas!</legend>
<table width="850" align="center" bgcolor="#F4FFF4">
<tr>
<td width="14" height="22" bordercolor="#003300" bgcolor="#295696"><div
align="center" class="style13 style1">N°</div></td>
<td width="166" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">NOME</div></td>
<td width="165" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">CLIENTE</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">DATA</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">DESCRICAO</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">IMPRIMIR</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">LER</div></td>
</tr>
<?php
$sql = "select idvisita,nomevendedor,nomecliente,datavisita,descvisita from visitas";
$resultado = mysql_query($sql) or die (mysql_error());
while ($linha = mysql_fetch_array($resultado)){
echo "<tr>";
47
1.0
Transitional//EN"
48
{
print(document);
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Copiadoras</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var ncopiadora = $("#ncopiadora").val();
var descdefeito = $("#descdefeito").val();
var obsdefeito = $("#obsdefeito").val();
// Exibe mensagem de carregamento
$("#status").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax com o arquivo tratacadcop.php e
enviamos os valores de cada campo atravs do mtodo POST
$.post('tratacadcha.php',
{ncopiadora:
ncopiadora,
descdefeito:
descdefeito, obsdefeito: obsdefeito }, function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#status").slideDown();
// Se a resposta um erro
if (resposta != false) {
// Exibe o erro na div
$("#status").html(resposta);
}
// Se resposta for false, ou seja, no ocorreu nenhum
erro
else {
// Exibe mensagem de sucesso
$("#status").html("Cadastro
Efetuado
com
Sucesso!");
// Limpando todos os campos
$("#ncopiadora").val("");
$("descdefeito").val("");
}
});
});
});
</script>
49
50
<fieldset>
<legend class="legendfield">Seus Chamados</legend>
<!-- Div que mostra as mensagens de confirmao e erro -->
<div id="status"></div>
<div>
<form id="formulario" action="javascript:func()" method="post">
<br />
<fieldset><legend>O que Voc Deseja:</legend>
<input type="button" name="tcliente" id="vchamado" value="Visualizar
Chamados">
<a href="desloga.php">
<input type="button" name="sair" id="sair" value="Encerrar Sesso">
</a>
</fieldset><br />
<div id="dvchamado">
<br/ >
<fieldset>
<legend>Acompanhe seus Chamados!</legend>
<table width="850" align="center" bgcolor="#F4FFF4">
<tr>
<td width="14" height="22" bordercolor="#003300" bgcolor="#295696"><div
align="center" class="style13 style1">N°</div></td>
<td width="166" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">NOME</div></td>
<td width="165" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">DEFEITO</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">SITUAO</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">IMPRIMIR</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">LER</div></td>
</tr>
<?php
$sql = "select id,nome,descdefeito,situacao,atecnico from chamados
atecnico = '$nome'";
$resultado = mysql_query($sql) or die (mysql_error());
while ($linha = mysql_fetch_array($resultado)){
echo "<tr>";
echo '<td align="center">';
echo $linha["id"];
echo '</td>';
echo '<td align="center">';
echo $linha["nome"];
echo '</td>';
echo '<td align="center">';
WHERE
51
echo $linha["descdefeito"];
echo '</td>';
echo '<td align="center">';
echo $linha["situacao"];
echo '</td>';
echo '<td align="center">';
echo '<img src="img/print.png" onclick="printPage()">';
echo '</td>';
echo '<td align="center">';
echo '<a href="vchamado.php">';
echo "<img src='img/visualizar.png'>";
echo '</a>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
?>
</fieldset>
</div>
<div id="ddnota">
<?php include('nota.php');?>
</div>
</div>
</div>
</body>
</html>
CONCOP.PHP
<?php require_once("libs/conn.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Consulta Geral de Copiadoras</title>
<script type="text/javascript" src="libs/funcconcop.js"></script>
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
</head>
<body>
<fieldset>
<legend class="legendfield">Consulta de Copiadoras</legend>
<strong>Digite o Modelo:</strong><br />
<input type="text" id="busca" onkeyup="buscarcopiadoras(this.value)" />
<div id="resultado"></div>
52
53
54
55
EXIBECONCOP.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language='javascript'>
function teste(id,modelo){ //funcao testa pega o id e o nome
if ( confirm('Deseja Excluir o '+modelo) ) { // abre janela de confirmao
location.href="delcop.php?id="+id;
}else{
location.href="exibeconcop.php";
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Consulta Geral de Copiadoras</title>
<script type="text/javascript" src="libs/funcconcop.js"></script>
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
</head>
<body>
<?php
// Incluir aquivo de conexo
require_once("libs/conn.php");
// Recebe a id enviada no mtodo GET
$id = $_GET['id'];
?>
<fieldset>
<legend>Consulta de Copiadoras!</legend>
<table width="850" align="center" bgcolor="#F4FFF4">
<tr>
<td width="166" bordercolor="#003300" bgcolor="#295696"><div
class="style13 style1">CDIGO</div></td>
<td width="165" bordercolor="#003300" bgcolor="#295696"><div
class="style13 style1">N DE SERIE</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div
class="style13 style1">MODELO</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div
class="style13 style1">NUMERADOR</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div
class="style13 style1">EXCLUIR</div></td>
</tr>
align="center"
align="center"
align="center"
align="center"
align="center"
<?php
$sql = "select id,nserie,modelo,numerador from copiadoras WHERE id
56
= '".$id."'";
$resultado = mysql_query($sql) or die (mysql_error());
while ($linha = mysql_fetch_array($resultado)){
echo "<tr>";
echo '<td align="center">';
echo $linha["id"];
echo '</td>';
echo '<td align="center">';
echo $linha["nserie"];
echo '</td>';
echo '<td align="center">';
echo $linha["modelo"];
echo '</td>';
echo '<td align="center">';
echo $linha["numerador"];
echo '</td>';
echo '<td align="center">';
echo '<a href="javascript:teste('.$linha['id'].',\''.$linha['modelo'].'\');">
<img src=img/exit.png border=0></a>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
mysql_free_result($resultado);
?>
</fieldset>
</body>
</html
INDEX.PHP
<?php require_once("libs/conn.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Copiadoras</title>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
</head>
<body>
<form
action="loga.php"
method="post"
urlencoded" name="form1" id="form1">
<tr>
<td width="320" height="133">
<p> </p>
enctype="application/x-www-form-
57
58
/></font><img
LOGA.PHP
<?php
session_start();
if(!empty($_POST['email']) || !empty($_POST['senha'])){
$email = 'admin@admin.com.br';
$Senha = 'admin';
$_SESSION["nome"] = 'Administrador';
header("Location:admin/index.php");
}
if(!empty($_POST['email']) || !empty($_POST['senha'])){
$email = trim($_POST['email']);
$Senha = trim($_POST['senha']);
//Conexo com o banco de dados
include("conn.php");
//Busca Usuario
$sqlLogin = "SELECT id,nome,senha,email,categoria
FROM usuarios
WHERE senha = '$Senha' AND email = '$email'";
$FindUser = mysql_query($sqlLogin) or die('erro o conectar');
$dados = mysql_fetch_row($FindUser);
//Dados corretos registra
if($dados['0'] != 0){
//Criando SESSION
$_SESSION["id"] = $dados[0];
$_SESSION["nome"] = $dados[1];
$_SESSION["email"] = $email;
$_SESSION["senha"] = $Senha;
$_SESSION["categoria"] = $dados[4];
if($dados['4'] == "cliente"){
header("Location: cadcha.php");
exit();
}
59
if($dados['4'] == "vendedor"){
header("Location: cadvisita.php");
exit();
}
if($dados['4'] == "tecnico"){
header("Location: chatecnico.php");
exit();
}
if($dados['4'] == "secretaria"){
header("Location: chasecretaria.php");
exit();
}
}
else{
echo "<br/><br/><br/><br/><br/><br/><p align=center><font
color='#FF0000'>Usurio / Senha Invlidos<br/>Desculpe, Voc no tem permisso
para acessar esta area.<br/><br/><br/>";
echo "Redirecionando...";
echo
'<meta
http-equiv="refresh"
content="5;
url=index.php"></center>';
exit();
}
}
?>
NOTA.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require_once("libs/conn.php");
@session_start();
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Notas</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
60
a manipulao
var nota = $("#nota").val();
var id = $("#id").val();
// Exibe mensagem de carregamento
$("#statusn").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax com o arquivo tratacadcop.php e
enviamos os valores de cada campo atravs do mtodo POST
$.post('tratanota.php', {nota: nota}, function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#statusn").slideDown();
// Se a resposta um erro
if (resposta != false) {
// Exibe o erro na div
$("#statusn").html(resposta);
}
// Se resposta for false, ou seja, no ocorreu nenhum
erro
else {
// Exibe mensagem de sucesso
$("#statusn").html("Cadastro
Efetuado
com
Sucesso!");
// Limpando todos os campos
$("#nota").val("");
}
});
});
});
</script>
</head>
<body>
<br/ >
<div>
<form id="formulario" action="javascript:func()" method="post">
<fieldset>
<legend>Classifique seu Atendimento!</legend>
<div id="statusn"></div>
<table width="850" align="center" bgcolor="#F4FFF4">
<tr>
<td width="14" height="22" bordercolor="#003300" bgcolor="#295696"><div
align="center" class="style13 style1">N°</div></td>
<td width="166" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">NOME</div></td>
<td width="165" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">DEFEITO</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">SITUAO</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
61
class="style13 style1">NOTA</div></td>
<?php
$sql = "select id,nome,descdefeito,situacao from chamados WHERE
nome = '$nome'";
$resultado = mysql_query($sql) or die (mysql_error());
while ($linha = mysql_fetch_array($resultado)){
echo "<tr>";
echo '<td align="center">';
echo $linha["id"];
echo '</td>';
echo '<td align="center">';
echo $linha["nome"];
echo '</td>';
echo '<td align="center">';
echo $linha["descdefeito"];
echo '</td>';
echo '<td align="center">';
echo $linha["situacao"];
echo '</td>';
echo '<td align="center">';
echo
'<select
name="nota"
id="nota"><option
value="sem
nota"></option><option
value="ruim">Ruim</option><option
value="razoavel">Razovel</option><option
value="bom">Bom</option><option
value="excelente">Excelente</option></select>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
?>
</fieldset>
<br /><center>
<input type="submit" value="Salvar" >
<input type="reset" name="Reset" value="Cancelar"><br /><br /></center>
</form>
</div>
</body>
</html>
TOPO.PHP
<?php
$nome = $_SESSION['nome'];
echo '<div align="center">';
$hora = date("H");
if($hora >= 0 && $hora < 6){
echo 'Boa Madrugada </font>';
}elseif ($hora >= 6 && $hora < 12){
echo 'Bom Dia </font>';
62
63
require_once("libs/conn.php");
@session_start();
// Recuperamos os valores dos campos atravs do mtodo POST utizando o TRIM
para retirar os espaos entre os caracteres
$nomevendedor= $_SESSION["nome"];
$nomecliente = trim($_POST["nomecliente"]);
$datavisita = trim($_POST["datavisita"]);
$descvisita = trim($_POST["descvisita"]);
64
$nota = trim($_POST["nota"]);
$id = $_SESSION["id"];
if (empty($nota)) {
echo "Escolha uma Nota para o seu Atendimento";
}
65
//nome
$pdf->SetFont('arial','B',12);
$pdf->Cell(70,20,"Cliente:",0,0,'L');
$pdf->setFont('arial','',12);
$pdf->Cell(70,20,$nome,0,1,'L');
//Defeito
$pdf->SetFont('arial','B',12);
$pdf->Cell(70,20,"Defeito:",0,0,'L');
$pdf->setFont('arial','',12);
$pdf->Cell(70,20,$descdefeito,0,1,'L');
//Situao
$pdf->SetFont('arial','B',12);
$pdf->Cell(70,20,"Situacao:",0,0,'L');
$pdf->setFont('arial','',12);
$pdf->Cell(70,20,$situacao,0,1,'L');
$pdf->Output("arquivo.pdf","D");
?>
FUNCCONCOP.JS
var req;
// FUNO PARA BUSCA NOTICIA
function buscarcopiadoras(valor) {
// Verificando Browser
if(window.XMLHttpRequest) {
req = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
// Arquivo PHP juntamente com o valor digitado no campo (mtodo GET)
var url = "buscaconcop.php?valor="+valor;
// Chamada do mtodo open para processar a requisio
req.open("Get", url, true);
// Quando o objeto recebe o retorno, chamamos a seguinte funo;
req.onreadystatechange = function() {
// Exibe a mensagem "Buscando Noticias..." enquanto carrega
if(req.readyState == 1) {
document.getElementById('resultado').innerHTML
=
Copiadoras...';
}
// Verifica se o Ajax realizou todas as operaes corretamente
'Buscando
66
67
req.send(null);
}
JQUERY.JS
/*!
* jQuery JavaScript Library v1.3.2
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
* Revision: 6246
*/
(function(){
var
// Will speed up references to window, and allows munging its name.
window = this,
// Will speed up references to undefined, and allows munging its name.
undefined,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
jQuery = window.jQuery = window.$ = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
// Is it a simple selector
isSimple = /^.[^:#\[\.,]*$/;
jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
// Make sure that a selection was provided
selector = selector || document;
// Handle $(DOMElement)
if ( selector.nodeType ) {
this[0] = selector;
this.length = 1;
this.context = selector;
return this;
}
// Handle HTML strings
68
69
70
71
72
},
wrap: function( html ) {
return this.each(function(){
jQuery( this ).wrapAll( html );
});
},
append: function() {
return this.domManip(arguments, true, function(elem){
if (this.nodeType == 1)
this.appendChild( elem );
});
},
prepend: function() {
return this.domManip(arguments, true, function(elem){
if (this.nodeType == 1)
this.insertBefore( elem, this.firstChild );
});
},
before: function() {
return this.domManip(arguments, false, function(elem){
this.parentNode.insertBefore( elem, this );
});
},
after: function() {
return this.domManip(arguments, false, function(elem){
this.parentNode.insertBefore( elem, this.nextSibling );
});
},
end: function() {
return this.prevObject || jQuery( [] );
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: [].push,
sort: [].sort,
splice: [].splice,
find: function( selector ) {
if ( this.length === 1 ) {
var ret = this.pushStack( [], "find", selector );
ret.length = 0;
jQuery.find( selector, this[0], ret );
return ret;
73
} else {
return
function(elem){
this.pushStack(
jQuery.unique(jQuery.map(this,
jQuery\d+="(?:\d+|
74
i++;
});
}
// Return the cloned set
return ret;
},
filter: function( selector ) {
return this.pushStack(
jQuery.isFunction( selector ) &&
jQuery.grep(this, function(elem, i){
return selector.call( elem, i );
}) ||
jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
return elem.nodeType === 1;
}) ), "filter", selector );
},
closest: function( selector ) {
var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) :
null,
closer = 0;
return this.map(function(){
var cur = this;
while ( cur && cur.ownerDocument ) {
if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) {
jQuery.data(cur, "closest", closer);
return cur;
}
cur = cur.parentNode;
closer++;
}
});
},
not: function( selector ) {
if ( typeof selector === "string" )
// test special case where just one selector is passed in
if ( isSimple.test( selector ) )
return this.pushStack( jQuery.multiFilter( selector, this,
true ), "not", selector );
else
selector = jQuery.multiFilter( selector, this );
var isArrayLike = selector.length && selector[selector.length - 1] !==
undefined && !selector.nodeType;
75
return this.filter(function() {
return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this !=
selector;
});
},
add: function( selector ) {
return this.pushStack( jQuery.unique( jQuery.merge(
this.get(),
typeof selector === "string" ?
jQuery( selector ) :
jQuery.makeArray( selector )
)));
},
is: function( selector ) {
return !!selector && jQuery.multiFilter( selector, this ).length > 0;
},
hasClass: function( selector ) {
return !!selector && this.is( "." + selector );
},
val: function( value ) {
if ( value === undefined ) {
var elem = this[0];
if ( elem ) {
if( jQuery.nodeName( elem, 'option' ) )
return (elem.attributes.value ||
elem.value : elem.text;
{}).specified
76
value = jQuery(option).val();
// We don't need an array for one
selects
if ( one )
return value;
// Multi-Selects return an array
values.push( value );
}
}
return values;
}
// Everything else, we just grab the value
return (elem.value || "").replace(/\r/g, "");
}
return undefined;
}
if ( typeof value === "number" )
value += '';
return this.each(function(){
if ( this.nodeType != 1 )
return;
if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
this.checked = (jQuery.inArray(this.value, value) >= 0 ||
jQuery.inArray(this.name, value) >= 0);
else if ( jQuery.nodeName( this, "select" ) ) {
var values = jQuery.makeArray(value);
jQuery( "option", this ).each(function(){
this.selected = (jQuery.inArray( this.value, values )
>= 0 ||
jQuery.inArray( this.text, values ) >= 0);
});
if ( !values.length )
this.selectedIndex = -1;
} else
this.value = value;
});
},
77
78
return this;
function root( elem, cur ) {
return table && jQuery.nodeName(elem, "table")
jQuery.nodeName(cur, "tr") ?
(elem.getElementsByTagName("tbody")[0] ||
&&
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
elem;
}
}
};
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;
function evalScript( i, elem ) {
if ( elem.src )
jQuery.ajax({
url: elem.src,
async: false,
dataType: "script"
});
else
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML ||
"" );
if ( elem.parentNode )
elem.parentNode.removeChild( elem );
}
function now(){
return +new Date;
}
jQuery.extend = jQuery.fn.extend = function() {
// copy reference to target object
var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false,
options;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
79
80
window.jQuery = _jQuery;
return jQuery;
},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return toString.call(obj) === "[object Function]";
},
isArray: function( obj ) {
return toString.call(obj) === "[object Array]";
},
// check if an element is in a (or is an) XML document
isXMLDoc: function( elem ) {
return elem.nodeType === 9 && elem.documentElement.nodeName !
== "HTML" ||
!!elem.ownerDocument
&&
jQuery.isXMLDoc( elem.ownerDocument );
},
// Evalulates a script in a global context
globalEval: function( data ) {
if ( data && /\S/.test(data) ) {
// Inspired by code by Andrea Giammarchi
//
http://webreflection.blogspot.com/2007/08/global-scopeevaluation-and-dom.html
var head = document.getElementsByTagName("head")[0] ||
document.documentElement,
script = document.createElement("script");
script.type = "text/javascript";
if ( jQuery.support.scriptEval )
script.appendChild( document.createTextNode( data ) );
else
script.text = data;
// Use insertBefore instead of appendChild to circumvent an IE6
bug.
// This arises when a base node is used (#2709).
head.insertBefore( script, head.firstChild );
head.removeChild( script );
}
},
nodeName: function( elem, name ) {
return elem.nodeName &&
elem.nodeName.toUpperCase()
==
81
name.toUpperCase();
},
// args is for internal usage only
each: function( object, callback, args ) {
var name, i = 0, length = object.length;
if ( args ) {
if ( length === undefined ) {
for ( name in object )
if ( callback.apply( object[ name ], args ) === false )
break;
} else
for ( ; i < length; )
if ( callback.apply( object[ i++ ], args ) === false )
break;
// A special, fast, case for the most common use of each
} else {
if ( length === undefined ) {
for ( name in object )
if ( callback.call( object[ name ], name,
object[ name ] ) === false )
break;
} else
for ( var value = object[0];
i < length && callback.call( value, i, value ) !==
false; value = object[++i] ){}
}
return object;
},
prop: function( elem, value, type, i, name ) {
// Handle executable functions
if ( jQuery.isFunction( value ) )
value = value.call( elem, i );
// Handle passing in a number to a CSS property
return typeof value === "number" && type == "curCSS" && !
exclude.test( name ) ?
value + "px" :
value;
},
className: {
// internal only, use addClass("class")
add: function( elem, classNames ) {
jQuery.each((classNames || "").split(/\s+/), function(i, className)
{
82
if
(
elem.nodeType
==
1
&&
!
jQuery.className.has( elem.className, className ) )
elem.className += (elem.className ? " " : "") +
className;
});
},
// internal only, use removeClass("class")
remove: function( elem, classNames ) {
if (elem.nodeType == 1)
elem.className = classNames !== undefined ?
jQuery.grep(elem.className.split(/\s+/),
function(className){
return !jQuery.className.has( classNames,
className );
}).join(" ") :
"";
},
// internal only, use hasClass("class")
has: function( elem, className ) {
return elem && jQuery.inArray( className, (elem.className ||
elem).toString().split(/\s+/) ) > -1;
}
},
// A method for quickly swapping in/out CSS properties to get correct
calculations
swap: function( elem, options, callback ) {
var old = {};
// Remember the old values, and insert the new ones
for ( var name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
callback.call( elem );
// Revert the old values
for ( var name in options )
elem.style[ name ] = old[ name ];
},
css: function( elem, name, force, extra ) {
if ( name == "width" || name == "height" ) {
var val, props = { position: "absolute", visibility: "hidden",
display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
function getWH() {
val = name
==
"width"
elem.offsetWidth
83
elem.offsetHeight;
if ( extra === "border" )
return;
jQuery.each( which, function() {
if ( !extra )
val -= parseFloat(jQuery.curCSS(
elem,
-=
parseFloat(jQuery.curCSS(
elem,
84
elem.currentStyle[
name
||
85
context[0]
&&
function(all,
front, tag){
return tag.match(/^(abbr|br|col|img|input|link|meta|
param|hr|area|embed)$/i) ?
all :
front + "></" + tag + ">";
});
// Trim whitespace, otherwise indexOf won't work as
expected
var
tags
elem.replace(/^\s+/,
"").substring(0,
10).toLowerCase();
var wrap =
// option or optgroup
!tags.indexOf("<opt") &&
[ 1, "<select multiple='multiple'>", "</select>" ] ||
!tags.indexOf("<leg") &&
[ 1, "<fieldset>", "</fieldset>" ] ||
tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
86
[ 1, "<table>", "</table>" ] ||
!tags.indexOf("<tr") &&
[ 2, "<table><tbody>", "</tbody></table>" ] ||
// <thead> matched above
(!tags.indexOf("<td") || !tags.indexOf("<th")) &&
[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ]
||
!tags.indexOf("<col") &&
[
2,
"<table><tbody></tbody><colgroup>",
"</colgroup></table>" ] ||
// IE can't serialize <link> and <script> tags
normally
!jQuery.support.htmlSerialize &&
[ 1, "div<div>", "</div>" ] ||
[ 0, "", "" ];
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + elem + wrap[2];
// Move to the right depth
while ( wrap[0]-- )
div = div.lastChild;
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious
<tbody>
var hasBody = /<tbody/i.test(elem),
tbody = !tags.indexOf("<table") && !hasBody
?
div.firstChild
&&
div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
wrap[1] == "<table>" && !hasBody ?
div.childNodes :
[];
for ( var j = tbody.length - 1; j >= 0 ; --j )
if ( jQuery.nodeName( tbody[ j ], "tbody" ) &&
!tbody[ j ].childNodes.length )
tbody[ j ].parentNode.removeChild( tbody[ j ] );
87
}
// IE completely kills leading whitespace when innerHTML
is used
if
!jQuery.support.leadingWhitespace
&&
/^\s/.test( elem ) )
div.insertBefore(
div.firstChild );
context.createTextNode(
elem.match(/^\s*/)[0]
),
88
jQuery.nodeName(
elem,
"form"
&&
89
90
},
trim: function( text ) {
return (text || "").replace( /^\s+|\s+$/g, "" );
},
makeArray: function( array ) {
var ret = [];
if( array != null ){
var i = array.length;
// The window, strings (and functions) also have 'length'
if( i == null || typeof array === "string" || jQuery.isFunction(array)
|| array.setInterval )
ret[0] = array;
else
while( i )
ret[--i] = array[i];
}
return ret;
},
inArray: function( elem, array ) {
for ( var i = 0, length = array.length; i < length; i++ )
// Use === because on IE, window == document
if ( array[ i ] === elem )
return i;
return -1;
},
merge: function( first, second ) {
// We have to loop this way because IE & Opera overwrite the length
// expando of getElementsByTagName
var i = 0, elem, pos = first.length;
// Also, we need to make sure that the correct elements are being
returned
// (IE returns comment nodes in a '*' query)
if ( !jQuery.support.getAll ) {
while ( (elem = second[ i++ ]) != null )
if ( elem.nodeType != 8 )
first[ pos++ ] = elem;
} else
while ( (elem = second[ i++ ]) != null )
first[ pos++ ] = elem;
return first;
},
91
92
93
94
}, function(name, fn){
jQuery.fn[ name ] = function(){
return this.each( fn, arguments );
};
});
// Helper function used by the dimensions and offset modules
function num(elem, prop) {
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
var expando = "jQuery" + now(), uuid = 0, windowData = {};
jQuery.extend({
cache: {},
data: function( elem, name, data ) {
elem = elem == window ?
windowData :
elem;
var id = elem[ expando ];
// Compute a unique ID for the element
if ( !id )
id = elem[ expando ] = ++uuid;
// Only generate the data cache if we're
// trying to access or manipulate it
if ( name && !jQuery.cache[ id ] )
jQuery.cache[ id ] = {};
// Prevent overriding the named cache with undefined values
if ( data !== undefined )
jQuery.cache[ id ][ name ] = data;
// Return the named cache data, or the ID for the element
return name ?
jQuery.cache[ id ][ name ] :
id;
},
removeData: function( elem, name ) {
elem = elem == window ?
windowData :
elem;
var id = elem[ expando ];
// If we want to remove a specific section of the element's data
if ( name ) {
95
if ( jQuery.cache[ id ] ) {
// Remove the section of cache data
delete jQuery.cache[ id ][ name ];
// If we've removed all the data, remove the element's
cache
name = "";
for ( name in jQuery.cache[ id ] )
break;
if ( !name )
jQuery.removeData( elem );
}
// Otherwise, we want to remove all of the element's data
} else {
// Clean up the element expando
try {
delete elem[ expando ];
} catch(e){
// IE has trouble directly removing the expando
// but it's ok with using removeAttribute
if ( elem.removeAttribute )
elem.removeAttribute( expando );
}
// Completely remove the data cache
delete jQuery.cache[ id ];
}
},
queue: function( elem, type, data ) {
if ( elem ){
type = (type || "fx") + "queue";
var q = jQuery.data( elem, type );
if ( !q || jQuery.isArray(data) )
q = jQuery.data( elem, type, jQuery.makeArray(data) );
else if( data )
q.push( data );
}
return q;
},
dequeue: function( elem, type ){
var queue = jQuery.queue( elem, type ),
fn = queue.shift();
96
this.trigger("setData"
parts[1]
"!",
[parts[0],
97
});
},
dequeue: function(type){
return this.each(function(){
jQuery.dequeue( this, type );
});
}
});/*!
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\
[\\]+)+|[>+~])(\s*,\s*)?/g,
done = 0,
toString = Object.prototype.toString;
var Sizzle = function(selector, context, results, seed) {
results = results || [];
context = context || document;
if ( context.nodeType !== 1 && context.nodeType !== 9 )
return [];
if ( !selector || typeof selector !== "string" ) {
return results;
}
var parts = [], m, set, checkSet, check, mode, extra, prune = true;
// Reset the position of the chunker regexp (start from head)
chunker.lastIndex = 0;
while ( (m = chunker.exec(selector)) !== null ) {
parts.push( m[1] );
if ( m[2] ) {
extra = RegExp.rightContext;
break;
}
}
if ( parts.length > 1 && origPOS.exec( selector ) ) {
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
set = posProcess( parts[0] + parts[1], context );
} else {
set = Expr.relative[ parts[0] ] ?
98
[ context ] :
Sizzle( parts.shift(), context );
while ( parts.length ) {
selector = parts.shift();
if ( Expr.relative[ selector ] )
selector += parts.shift();
set = posProcess( selector, set );
}
}
} else {
var ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
Sizzle.find(
parts.pop(),
parts.length
===
context.parentNode ? context.parentNode : context, isXML(context) );
set = Sizzle.filter( ret.expr, ret.set );
if ( parts.length > 0 ) {
checkSet = makeArray(set);
} else {
prune = false;
}
while ( parts.length ) {
var cur = parts.pop(), pop = cur;
if ( !Expr.relative[ cur ] ) {
cur = "";
} else {
pop = parts.pop();
}
if ( pop == null ) {
pop = context;
}
Expr.relative[ cur ]( checkSet, pop, isXML(context) );
}
}
if ( !checkSet ) {
checkSet = set;
}
if ( !checkSet ) {
throw "Syntax error, unrecognized expression: " + (cur || selector);
}
&&
99
||
100
}
for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
var type = Expr.order[i], match;
if ( (match = Expr.match[ type ].exec( expr )) ) {
var left = RegExp.leftContext;
if ( left.substr( left.length - 1 ) !== "\\" ) {
match[1] = (match[1] || "").replace(/\\/g, "");
set = Expr.find[ type ]( match, context, isXML );
if ( set != null ) {
expr = expr.replace( Expr.match[ type ], "" );
break;
}
}
}
}
if ( !set ) {
set = context.getElementsByTagName("*");
}
return {set: set, expr: expr};
};
Sizzle.filter = function(expr, set, inplace, not){
var old = expr, result = [], curLoop = set, match, anyFound,
isXMLFilter = set && set[0] && isXML(set[0]);
while ( expr && set.length ) {
for ( var type in Expr.filter ) {
if ( (match = Expr.match[ type ].exec( expr )) != null ) {
var filter = Expr.filter[ type ], found, item;
anyFound = false;
if ( curLoop == result ) {
result = [];
}
if ( Expr.preFilter[ type ] ) {
match = Expr.preFilter[ type ]( match, curLoop,
inplace, result, not, isXMLFilter );
if ( !match ) {
anyFound = found = true;
} else if ( match === true ) {
continue;
}
}
101
if ( match ) {
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match,
curLoop );
var pass = not ^ !!found;
if ( inplace && found != null ) {
if ( pass ) {
anyFound = true;
} else {
curLoop[i] = false;
}
} else if ( pass ) {
result.push( item );
anyFound = true;
}
}
}
}
if ( found !== undefined ) {
if ( !inplace ) {
curLoop = result;
}
expr = expr.replace( Expr.match[ type ], "" );
if ( !anyFound ) {
return [];
}
break;
}
}
}
// Improper expression
if ( expr == old ) {
if ( anyFound == null ) {
throw "Syntax error, unrecognized expression: " + expr;
} else {
break;
}
}
old = expr;
}
i,
102
return curLoop;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
ATTR:
/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)
(.*?)\3|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)
+)\2\))?/
},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function(elem){
return elem.getAttribute("href");
}
},
relative: {
"+": function(checkSet, part, isXML){
var isPartStr = typeof part === "string",
isTag = isPartStr && !/\W/.test(part),
isPartStrNotTag = isPartStr && !isTag;
if ( isTag && !isXML ) {
part = part.toUpperCase();
}
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
if ( (elem = checkSet[i]) ) {
while ( (elem = elem.previousSibling)
elem.nodeType !== 1 ) {}
checkSet[i]
isPartStrNotTag
||
elem
&&
&&
103
}
},
">": function(checkSet, part, isXML){
var isPartStr = typeof part === "string";
if ( isPartStr && !/\W/.test(part) ) {
part = isXML ? part : part.toUpperCase();
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
var parent = elem.parentNode;
checkSet[i] = parent.nodeName === part ?
parent : false;
}
}
} else {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
checkSet[i] = isPartStr ?
elem.parentNode :
elem.parentNode === part;
}
}
if ( isPartStr ) {
Sizzle.filter( part, checkSet, true );
}
}
},
"": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
if ( !part.match(/\W/) ) {
var nodeCheck
part
isXML
part
part.toUpperCase();
checkFn = dirNodeCheck;
}
checkFn("parentNode", part, doneName, checkSet, nodeCheck,
isXML);
},
"~": function(checkSet, part, isXML){
var doneName = done++, checkFn = dirCheck;
if ( typeof part === "string" && !part.match(/\W/) ) {
var nodeCheck = part = isXML
part.toUpperCase();
checkFn = dirNodeCheck;
part
104
}
checkFn("previousSibling",
part,
doneName,
checkSet,
nodeCheck, isXML);
}
},
find: {
ID: function(match, context, isXML){
if ( typeof context.getElementById !== "undefined" && !isXML ) {
var m = context.getElementById(match[1]);
return m ? [m] : [];
}
},
NAME: function(match, context, isXML){
if ( typeof context.getElementsByName !== "undefined" ) {
var
ret
=
[],
results
=
context.getElementsByName(match[1]);
for ( var i = 0, l = results.length; i < l; i++ ) {
if ( results[i].getAttribute("name") === match[1] ) {
ret.push( results[i] );
}
}
return ret.length === 0 ? null : ret;
}
},
TAG: function(match, context){
return context.getElementsByTagName(match[1]);
}
},
preFilter: {
CLASS: function(match, curLoop, inplace, result, not, isXML){
match = " " + match[1].replace(/\\/g, "") + " ";
if ( isXML ) {
return match;
}
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
if ( elem ) {
if ( not ^ (elem.className &&
elem.className + " ").indexOf(match) >= 0) ) {
if ( !inplace )
result.push( elem );
} else if ( inplace ) {
curLoop[i] = false;
}
}
}
("
"
105
return false;
},
ID: function(match){
return match[1].replace(/\\/g, "");
},
TAG: function(match, curLoop){
for ( var i = 0; curLoop[i] === false; i++ ){}
return curLoop[i] && isXML(curLoop[i]) ? match[1] :
match[1].toUpperCase();
},
CHILD: function(match){
if ( match[1] == "nth" ) {
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1',
'-n+6'
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
match[2] == "even" && "2n" || match[2] == "odd" &&
"2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] ||
match[2]);
// calculate the numbers (first)n+(last) including if they are
negative
match[2] = (test[1] + (test[2] || 1)) - 0;
match[3] = test[3] - 0;
}
// TODO: Move to normal caching system
match[0] = done++;
return match;
},
ATTR: function(match, curLoop, inplace, result, not, isXML){
var name = match[1].replace(/\\/g, "");
if ( !isXML && Expr.attrMap[name] ) {
match[1] = Expr.attrMap[name];
}
if ( match[2] === "~=" ) {
match[4] = " " + match[4] + " ";
}
return match;
},
PSEUDO: function(match, curLoop, inplace, result, not){
if ( match[1] === "not" ) {
// If we're dealing with a complex expression, or a simple
one
if
match[3].match(chunker).length
>
||
106
/^\w/.test(match[3]) ) {
match[3] = Sizzle(match[3], null, null, curLoop);
} else {
var ret = Sizzle.filter(match[3], curLoop, inplace,
true ^ not);
if ( !inplace ) {
result.push.apply( result, ret );
}
return false;
}
}
else
if
(
Expr.match.CHILD.test( match[0] ) ) {
return true;
}
Expr.match.POS.test(
match[0]
return match;
},
POS: function(match){
match.unshift( true );
return match;
}
},
filters: {
enabled: function(elem){
return elem.disabled === false && elem.type !== "hidden";
},
disabled: function(elem){
return elem.disabled === true;
},
checked: function(elem){
return elem.checked === true;
},
selected: function(elem){
// Accessing this property makes selected-by-default
// options in Safari work properly
elem.parentNode.selectedIndex;
return elem.selected === true;
},
parent: function(elem){
return !!elem.firstChild;
},
empty: function(elem){
return !elem.firstChild;
},
has: function(elem, i, match){
return !!Sizzle( match[3], elem ).length;
},
header: function(elem){
return /h\d/i.test( elem.nodeName );
},
||
107
text: function(elem){
return "text" === elem.type;
},
radio: function(elem){
return "radio" === elem.type;
},
checkbox: function(elem){
return "checkbox" === elem.type;
},
file: function(elem){
return "file" === elem.type;
},
password: function(elem){
return "password" === elem.type;
},
submit: function(elem){
return "submit" === elem.type;
},
image: function(elem){
return "image" === elem.type;
},
reset: function(elem){
return "reset" === elem.type;
},
button: function(elem){
return "button" === elem.type || elem.nodeName.toUpperCase()
=== "BUTTON";
},
input: function(elem){
return /input|select|textarea|button/i.test(elem.nodeName);
}
},
setFilters: {
first: function(elem, i){
return i === 0;
},
last: function(elem, i, match, array){
return i === array.length - 1;
},
even: function(elem, i){
return i % 2 === 0;
},
odd: function(elem, i){
return i % 2 === 1;
},
lt: function(elem, i, match){
return i < match[3] - 0;
},
gt: function(elem, i, match){
return i > match[3] - 0;
108
},
nth: function(elem, i, match){
return match[3] - 0 == i;
},
eq: function(elem, i, match){
return match[3] - 0 == i;
}
},
filter: {
PSEUDO: function(elem, match, i, array){
var name = match[1], filter = Expr.filters[ name ];
if ( filter ) {
return filter( elem, i, match, array );
} else if ( name === "contains" ) {
return
(elem.textContent
||
"").indexOf(match[3]) >= 0;
} else if ( name === "not" ) {
var not = match[3];
elem.innerText
||
109
110
111
112
113
div.appendChild( document.createComment("") );
// Make sure no comments are found
if ( div.getElementsByTagName("*").length > 0 ) {
Expr.find.TAG = function(match, context){
var results = context.getElementsByTagName(match[1]);
// Filter out possible comments
if ( match[1] === "*" ) {
var tmp = [];
for ( var i = 0; results[i]; i++ ) {
if ( results[i].nodeType === 1 ) {
tmp.push( results[i] );
}
}
results = tmp;
}
return results;
};
}
// Check to see if an attribute returns normalized href attributes
div.innerHTML = "<a href='#'></a>";
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
div.firstChild.getAttribute("href") !== "#" ) {
Expr.attrHandle.href = function(elem){
return elem.getAttribute("href", 2);
};
}
})();
if ( document.querySelectorAll ) (function(){
var oldSizzle = Sizzle, div = document.createElement("div");
div.innerHTML = "<p class='TEST'></p>";
// Safari can't handle uppercase or unicode characters when
// in quirks mode.
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
return;
}
Sizzle = function(query, context, extra, seed){
context = context || document;
// Only use querySelectorAll on non-XML documents
// (ID selectors don't work in non-HTML documents)
if ( !seed && context.nodeType === 9 && !isXML(context) ) {
114
try {
return
makeArray(
context.querySelectorAll(query),
extra );
} catch(e){}
}
return oldSizzle(query, context, extra, seed);
};
Sizzle.find = oldSizzle.find;
Sizzle.filter = oldSizzle.filter;
Sizzle.selectors = oldSizzle.selectors;
Sizzle.matches = oldSizzle.matches;
})();
if
(
document.getElementsByClassName
document.documentElement.getElementsByClassName ) (function(){
var div = document.createElement("div");
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
&&
115
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 && !isXML ){
elem.sizcache = doneName;
elem.sizset = i;
}
if ( elem.nodeName === cur ) {
match = elem;
break;
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
var sibDir = dir == "previousSibling" && !isXML;
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
if ( sibDir && elem.nodeType === 1 ) {
elem.sizcache = doneName;
elem.sizset = i;
}
elem = elem[dir];
var match = false;
while ( elem ) {
if ( elem.sizcache === doneName ) {
match = checkSet[elem.sizset];
break;
}
if ( elem.nodeType === 1 ) {
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
116
match = true;
break;
}
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
match = elem;
break;
}
}
elem = elem[dir];
}
checkSet[i] = match;
}
}
}
var contains = document.compareDocumentPosition ? function(a, b){
return a.compareDocumentPosition(b) & 16;
} : function(a, b){
return a !== b && (a.contains ? a.contains(b) : true);
};
var isXML = function(elem){
return elem.nodeType === 9 && elem.documentElement.nodeName !==
"HTML" ||
!!elem.ownerDocument && isXML( elem.ownerDocument );
};
var posProcess = function(selector, context){
var tmpSet = [], later = "", match,
root = context.nodeType ? [context] : context;
// Position selectors must be done after the filter
// And so must :not(positional) so we move all PSEUDOs to the end
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
later += match[0];
selector = selector.replace( Expr.match.PSEUDO, "" );
}
selector = Expr.relative[selector] ? selector + "*" : selector;
for ( var i = 0, l = root.length; i < l; i++ ) {
Sizzle( selector, root[i], tmpSet );
}
return Sizzle.filter( later, tmpSet );
};
117
// EXPOSE
jQuery.find = Sizzle;
jQuery.filter = Sizzle.filter;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
Sizzle.selectors.filters.hidden = function(elem){
return elem.offsetWidth === 0 || elem.offsetHeight === 0;
};
Sizzle.selectors.filters.visible = function(elem){
return elem.offsetWidth > 0 || elem.offsetHeight > 0;
};
Sizzle.selectors.filters.animated = function(elem){
return jQuery.grep(jQuery.timers, function(fn){
return elem === fn.elem;
}).length;
};
jQuery.multiFilter = function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return Sizzle.matches(expr, elems);
};
jQuery.dir = function( elem, dir ){
var matched = [], cur = elem[dir];
while ( cur && cur != document ) {
if ( cur.nodeType == 1 )
matched.push( cur );
cur = cur[dir];
}
return matched;
};
jQuery.nth = function(cur, result, dir, elem){
result = result || 1;
var num = 0;
for ( ; cur; cur = cur[dir] )
if ( cur.nodeType == 1 && ++num == result )
break;
return cur;
};
jQuery.sibling = function(n, elem){
118
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType == 1 && n != elem )
r.push( n );
}
return r;
};
return;
window.Sizzle = Sizzle;
})();
/*
* A number of helper functions used for managing events.
* Many of the ideas behind this code originated from
* Dean Edwards' addEvent library.
*/
jQuery.event = {
// Bind an event to an element
// Original by Dean Edwards
add: function(elem, types, handler, data) {
if ( elem.nodeType == 3 || elem.nodeType == 8 )
return;
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
if ( elem.setInterval && elem != window )
elem = window;
// Make sure that the function being executed has a unique ID
if ( !handler.guid )
handler.guid = this.guid++;
// if data is passed, bind to handler
if ( data !== undefined ) {
// Create temporary function pointer to original handler
var fn = handler;
// Create unique handler function, wrapped around original
handler
handler = this.proxy( fn );
// Store data in unique handler
handler.data = data;
}
119
&&
jQuery.event.triggered ?
jQuery.event.handle.apply(arguments.callee.elem,
arguments) :
undefined;
});
// Add elem as a property of the handle function
// This is to prevent a memory leak with non-native
// event in IE.
handle.elem = elem;
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
jQuery.each(types.split(/\s+/), function(index, type) {
// Namespaced event handlers
var namespaces = type.split(".");
type = namespaces.shift();
handler.type = namespaces.slice().sort().join(".");
// Get the current list of functions bound to this event
var handlers = events[type];
if ( jQuery.event.specialAll[type] )
jQuery.event.specialAll[type].setup.call(elem,
data,
namespaces);
// Init the event handler queue
if (!handlers) {
handlers = events[type] = {};
// Check for a special event handler
// Only use addEventListener/attachEvent if the special
// events handler returns false
if
(
!jQuery.event.special[type]
||
jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
// Bind the global event handler to the element
if (elem.addEventListener)
elem.addEventListener(type, handle, false);
else if (elem.attachEvent)
elem.attachEvent("on" + type, handle);
}
}
120
if ( events[type] ) {
// remove the given handler for the given
type
if ( handler )
delete events[type][handler.guid];
121
of
namespaced events
if
( namespace.test(events[type][handle].type) )
delete
events[type]
[handle];
if ( jQuery.event.specialAll[type] )
jQuery.event.specialAll[type].teardown.call(elem, namespaces);
// remove generic event handler if no more
handlers exist
for ( ret in events[type] ) break;
if ( !ret ) {
if ( !jQuery.event.special[type] ||
jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
if (elem.removeEventListener)
elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
else if (elem.detachEvent)
elem.detachEvent("on"
+ type, jQuery.data(elem, "handle"));
}
ret = null;
delete events[type];
}
}
});
}
// Remove the expando if it's no longer used
for ( ret in events ) break;
if ( !ret ) {
var handle = jQuery.data( elem, "handle" );
if ( handle ) handle.elem = null;
jQuery.removeData( elem, "events" );
jQuery.removeData( elem, "handle" );
}
}
},
// bubbling is internal
trigger: function( event, data, elem, bubbling ) {
// Event object or event type
var type = event.type || event;
122
if( !bubbling ){
event = typeof event === "object" ?
// jQuery.Event object
event[expando] ? event :
// Object literal
jQuery.extend( jQuery.Event(type), event ) :
// Just the event type (string)
jQuery.Event(type);
if ( type.indexOf("!") >= 0 ) {
event.type = type = type.slice(0, -1);
event.exclusive = true;
}
// Handle a global trigger
if ( !elem ) {
// Don't bubble custom events when global (to avoid too
much overhead)
event.stopPropagation();
// Only trigger if we've ever bound an event for it
if ( this.global[type] )
jQuery.each( jQuery.cache, function(){
if ( this.events && this.events[type] )
jQuery.event.trigger( event,
this.handle.elem );
});
}
// Handle triggering a single element
// don't do events on text and comment nodes
if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
return undefined;
// Clean up in case it is reused
event.result = undefined;
event.target = elem;
// Clone the incoming data, if any
data = jQuery.makeArray(data);
data.unshift( event );
}
event.currentTarget = elem;
// Trigger the event, it is assumed that "handle" is a function
var handle = jQuery.data(elem, "handle");
if ( handle )
handle.apply( elem, data );
data,
123
RegExp("(^|\\.)"
124
125
126
specialAll: {
live: {
setup: function( selector, namespaces ){
jQuery.event.add( this, namespaces[0], liveHandler );
},
teardown: function( namespaces ){
if ( namespaces.length ) {
var remove = 0, name = RegExp("(^|\\.)" +
namespaces[0] + "(\\.|$)");
jQuery.each( (jQuery.data(this, "events").live || {}),
function(){
if ( name.test(this.type) )
remove++;
});
if ( remove < 1 )
jQuery.event.remove( this, namespaces[0],
liveHandler );
}
}
}
}
};
jQuery.Event = function( src ){
// Allow instantiation without the 'new' keyword
if( !this.preventDefault )
return new jQuery.Event(src);
// Event object
if( src && src.type ){
this.originalEvent = src;
this.type = src.type;
// Event type
}else
this.type = src;
// timeStamp is buggy for some events on Firefox(#3843)
// So we won't rely on the native value
this.timeStamp = now();
// Mark it as fixed
this[expando] = true;
};
function returnFalse(){
return false;
}
127
function returnTrue(){
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language
Binding
//
http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-scriptbinding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if( !e )
return;
// if preventDefault exists run it on the original event
if (e.preventDefault)
e.preventDefault();
// otherwise set the returnValue property of the original event to false
(IE)
e.returnValue = false;
},
stopPropagation: function() {
this.isPropagationStopped = returnTrue;
var e = this.originalEvent;
if( !e )
return;
// if stopPropagation exists run it on the original event
if (e.stopPropagation)
e.stopPropagation();
// otherwise set the cancelBubble property of the original event to true
(IE)
e.cancelBubble = true;
},
stopImmediatePropagation:function(){
this.isImmediatePropagationStopped = returnTrue;
this.stopPropagation();
},
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse
};
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function(event) {
// Check if mouse(over|out) are still within the same parent element
var parent = event.relatedTarget;
// Traverse up the tree
while ( parent && parent != this )
128
129
130
jQuery.readyList.push( fn );
return this;
},
live: function( type, fn ){
var proxy = jQuery.event.proxy( fn );
proxy.guid += this.selector + type;
jQuery(document).bind( liveConvert(type, this.selector), this.selector,
proxy );
return this;
},
die: function( type, fn ){
jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid:
fn.guid + this.selector + type } : null );
return this;
}
});
function liveHandler( event ){
var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
stop = true,
elems = [];
jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
if ( check.test(fn.type) ) {
var elem = jQuery(event.target).closest(fn.data)[0];
if ( elem )
elems.push({ elem: elem, fn: fn });
}
});
elems.sort(function(a,b) {
return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest");
});
jQuery.each(elems, function(){
if ( this.fn.call(this.elem, event, this.fn.data) === false )
return (stop = false);
});
return stop;
}
function liveConvert(type, selector){
return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
}
131
jQuery.extend({
isReady: false,
readyList: [],
// Handle when the DOM is ready
ready: function() {
// Make sure that the DOM is not already loaded
if ( !jQuery.isReady ) {
// Remember that the DOM is ready
jQuery.isReady = true;
// If there are functions bound, to execute
if ( jQuery.readyList ) {
// Execute all of them
jQuery.each( jQuery.readyList, function(){
this.call( document, jQuery );
});
// Reset the list of functions
jQuery.readyList = null;
}
// Trigger any bound ready events
jQuery(document).triggerHandler("ready");
}
}
});
var readyBound = false;
function bindReady(){
if ( readyBound ) return;
readyBound = true;
// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", function(){
document.removeEventListener(
"DOMContentLoaded",
arguments.callee, false );
jQuery.ready();
}, false );
// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent("onreadystatechange", function(){
if ( document.readyState === "complete" ) {
document.detachEvent(
"onreadystatechange",
132
arguments.callee );
jQuery.ready();
}
});
// If IE and not an iframe
// continually check to see if the document is ready
if ( document.documentElement.doScroll && window == window.top )
(function(){
if ( jQuery.isReady ) return;
try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch( error ) {
setTimeout( arguments.callee, 0 );
return;
}
// and execute any waiting functions
jQuery.ready();
})();
}
// A fallback to window.onload, that will always work
jQuery.event.add( window, "load", jQuery.ready );
}
jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mousel
eave," +
"change,select,submit,keydown,keypress,keyup,error").split(","),
function(i,
name){
// Handle event binding
jQuery.fn[name] = function(fn){
return fn ? this.bind(name, fn) : this.trigger(name);
};
});
// Prevent memory leaks in IE
// And prevent errors on refresh with events like mouseover in other browsers
// Window isn't included so as not to unbind existing unload events
jQuery( window ).bind( 'unload', function(){
for ( var id in jQuery.cache )
// Skip the window
if ( id != 1 && jQuery.cache[ id ].handle )
jQuery.event.remove( jQuery.cache[ id ].handle.elem );
});
133
(function(){
jQuery.support = {};
var root = document.documentElement,
script = document.createElement("script"),
div = document.createElement("div"),
id = "script" + (new Date).getTime();
div.style.display = "none";
div.innerHTML
=
'
<link/><table></table><a
href="/a"
style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><o
bject><param/></object>';
var all = div.getElementsByTagName("*"),
a = div.getElementsByTagName("a")[0];
// Can't get basic test support
if ( !all || !all.length || !a ) {
return;
}
jQuery.support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: div.firstChild.nodeType == 3,
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName("tbody").length,
// Make sure that you can get all elements in an <object> element
// IE 7 always returns no results
objectAll: !!div.getElementsByTagName("object")[0]
.getElementsByTagName("*").length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName("link").length,
// Get the style information from getAttribute
// (IE uses .cssText insted)
style: /red/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: a.getAttribute("href") === "/a",
// Make sure that element opacity exists
// (IE uses filter instead)
opacity: a.style.opacity === "0.5",
134
+ id +
135
136
url: url,
type: type,
dataType: "html",
data: params,
complete: function(res, status){
// If successful, inject the HTML into all the matched
elements
if ( status == "success" || status == "notmodified" )
// See if a selector was specified
self.html( selector ?
// Create a dummy div to hold the results
jQuery("<div/>")
// inject the contents of the document
in, removing the scripts
// to avoid any 'Permission Denied'
errors in IE
.append(res.responseText.replace(/<
script(.|\s)*?\/script>/g, ""))
// Locate the specified elements
.find(selector) :
// If not, just inject the full result
res.responseText );
if( callback )
self.each(
callback,
[res.responseText,
status,
res] );
}
});
return this;
},
serialize: function() {
return jQuery.param(this.serializeArray());
},
serializeArray: function() {
return this.map(function(){
return this.elements ? jQuery.makeArray(this.elements) : this;
})
.filter(function(){
return this.name && !this.disabled &&
(this.checked || /select|textarea/i.test(this.nodeName) ||
/text|hidden|password|search/i.test(this.type));
})
.map(function(i, elem){
var val = jQuery(this).val();
return val == null ? null :
jQuery.isArray(val) ?
jQuery.map( val, function(val, i){
137
138
type: "POST",
url: url,
data: data,
success: callback,
dataType: type
});
},
ajaxSetup: function( settings ) {
jQuery.extend( jQuery.ajaxSettings, settings );
},
ajaxSettings: {
url: location.href,
global: true,
type: "GET",
contentType: "application/x-www-form-urlencoded",
processData: true,
async: true,
/*
timeout: 0,
data: null,
username: null,
password: null,
*/
// Create the request object; Microsoft failed to properly
// implement the XMLHttpRequest in IE7, so we use the ActiveXObject
when it is available
// This function can be overriden by calling jQuery.ajaxSetup
xhr:function(){
return
window.ActiveXObject
?
new
ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
},
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
script: "text/javascript, application/javascript",
json: "application/json, text/javascript",
text: "text/plain",
_default: "*/*"
}
},
// Last-Modified header cache for next request
lastModified: {},
ajax: function( s ) {
// Extend the settings, but re-extend 's' so that it can be
// checked again later (in the test suite, specifically)
s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings,
139
s));
var jsonp, jsre = /=\?(&|$)/g, status, data,
type = s.type.toUpperCase();
// convert data if not already a string
if ( s.data && s.processData && typeof s.data !== "string" )
s.data = jQuery.param(s.data);
// Handle JSONP Parameter Callbacks
if ( s.dataType == "jsonp" ) {
if ( type == "GET" ) {
if ( !s.url.match(jsre) )
s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp ||
"callback") + "=?";
} else if ( !s.data || !s.data.match(jsre) )
s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback")
+ "=?";
s.dataType = "json";
}
// Build temporary JSONP function
if ( s.dataType == "json" && (s.data && s.data.match(jsre) ||
s.url.match(jsre)) ) {
jsonp = "jsonp" + jsc++;
// Replace the =? sequence both in the query string and the data
if ( s.data )
s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
s.url = s.url.replace(jsre, "=" + jsonp + "$1");
// We need to make sure
// that a JSONP style response is executed properly
s.dataType = "script";
// Handle JSONP-style loading
window[ jsonp ] = function(tmp){
data = tmp;
success();
complete();
// Garbage collect
window[ jsonp ] = undefined;
try{ delete window[ jsonp ]; } catch(e){}
if ( head )
head.removeChild( script );
};
}
if ( s.dataType == "script" && s.cache == null )
s.cache = false;
140
||
141
s.dataType
&&
142
xhr,
s.url ) ? "notmodified" :
"success";
if ( status == "success" ) {
// Watch for, and catch, XML document parse
errors
try {
// process the data (runs the xml through
httpData regardless of callback)
143
144
145
active: 0,
// Determines if an XMLHttpRequest was successful or not
httpSuccess: function( xhr ) {
try {
// IE error sometimes returns 1223 when it should be 204 so
treat it as success, see #1450
return !xhr.status && location.protocol == "file:" ||
( xhr.status >= 200 && xhr.status < 300 ) || xhr.status ==
304 || xhr.status == 1223;
} catch(e){}
return false;
},
// Determines if an XMLHttpRequest returns NotModified
httpNotModified: function( xhr, url ) {
try {
var xhrRes = xhr.getResponseHeader("Last-Modified");
// Firefox always returns 200. check Last-Modified date
return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
} catch(e){}
return false;
},
httpData: function( xhr, type, s ) {
var ct = xhr.getResponseHeader("content-type"),
xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.tagName == "parsererror" )
throw "parsererror";
// Allow a pre-filtering function to sanitize the response
// s != null is checked to keep backwards compatibility
if( s && s.dataFilter )
data = s.dataFilter( data, type );
// The filter can actually parse the response
if( typeof data === "string" ){
// If the type is "script", eval it in global context
if ( type == "script" )
jQuery.globalEval( data );
// Get the JavaScript object, if JSON is used.
if ( type == "json" )
data = window["eval"]("(" + data + ")");
}
146
return data;
},
// Serialize an array of form elements or a set of
// key/values into a query string
param: function( a ) {
var s = [ ];
function add( key, value ){
s[ s.length ] =
encodeURIComponent(value);
};
encodeURIComponent(key)
'='
147
148
hide: function(speed,callback){
if ( speed ) {
return this.animate( genFx("hide", 3), speed, callback);
} else {
for ( var i = 0, l = this.length; i < l; i++ ){
var old = jQuery.data(this[i], "olddisplay");
if ( !old && old !== "none" )
jQuery.data(this[i], "olddisplay", jQuery.css(this[i],
"display"));
}
// Set the display of the elements in a second loop
// to avoid the constant reflow
for ( var i = 0, l = this.length; i < l; i++ ){
this[i].style.display = "none";
}
return this;
}
},
// Save the old toggle function
_toggle: jQuery.fn.toggle,
toggle: function( fn, fn2 ){
var bool = typeof fn === "boolean";
return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
this._toggle.apply( this, arguments ) :
fn == null || bool ?
this.each(function(){
var state = bool ? fn : jQuery(this).is(":hidden");
jQuery(this)[ state ? "show" : "hide" ]();
}) :
this.animate(genFx("toggle", 3), fn, fn2);
},
fadeTo: function(speed,to,callback){
return this.animate({opacity: to}, speed, callback);
},
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
return this[ optall.queue === false ? "each" : "queue" ](function(){
var opt = jQuery.extend({}, optall), p,
hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
self = this;
149
for ( p in prop ) {
if ( prop[p] == "hide" && hidden || prop[p] == "show" && !
hidden )
return opt.complete.call(this);
if ( ( p == "height" || p == "width" ) && this.style ) {
// Store display property
opt.display = jQuery.css(this, "display");
// Make sure that nothing sneaks out
opt.overflow = this.style.overflow;
}
}
if ( opt.overflow != null )
this.style.overflow = "hidden";
opt.curAnim = jQuery.extend({}, prop);
jQuery.each( prop, function(name, val){
var e = new jQuery.fx( self, opt, name );
if ( /toggle|show|hide/.test(val) )
e[ val == "toggle" ? hidden ? "show" : "hide" : val ]
( prop );
else {
var parts = val.toString().match(/^([+-]=)?([\d+-.]+)
(.*)$/),
start = e.cur(true) || 0;
if ( parts ) {
var end = parseFloat(parts[2]),
unit = parts[3] || "px";
// We need to compute starting value
if ( unit != "px" ) {
self.style[ name ] = (end || 1) + unit;
start = ((end || 1) / e.cur(true)) * start;
self.style[ name ] = start + unit;
}
// If a +=/-= token was provided, we're doing
a relative animation
if ( parts[1] )
end = ((parts[1] == "-=" ? -1 : 1) *
end) + start;
e.custom( start, end, unit );
} else
150
151
152
null
&&
(!this.elem.style
||
153
}
}, 13);
}
},
// Simple 'show' function
show: function(){
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any
// flash of content
this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0,
this.cur());
// Start by showing the element
jQuery(this.elem).show();
},
// Simple 'hide' function
hide: function(){
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
this.options.hide = true;
// Begin the animation
this.custom(this.cur(), 0);
},
// Each step of an animation
step: function(gotoEnd){
var t = now();
if ( gotoEnd || t >= this.options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
this.options.curAnim[ this.prop ] = true;
var done = true;
for ( var i in this.options.curAnim )
if ( this.options.curAnim[i] !== true )
done = false;
if ( done ) {
if ( this.options.display != null ) {
// Reset the overflow
154
this.elem.style.overflow = this.options.overflow;
// Reset the display
this.elem.style.display = this.options.display;
if ( jQuery.css(this.elem, "display") == "none" )
this.elem.style.display = "block";
}
// Hide the element if the "hide" operation was done
if ( this.options.hide )
jQuery(this.elem).hide();
// Reset the properties, if the item has been hidden or
shown
if ( this.options.hide || this.options.show )
for ( var p in this.options.curAnim )
jQuery.attr(this.elem.style,
p,
this.options.orig[p]);
// Execute the complete function
this.options.complete.call( this.elem );
}
return false;
} else {
var n = t - this.startTime;
this.state = n / this.options.duration;
// Perform the easing function, defaults to swing
this.pos
=
jQuery.easing[this.options.easing
(jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
this.now = this.start + ((this.end - this.start) * this.pos);
// Perform the next step of the animation
this.update();
}
return true;
}
};
jQuery.extend( jQuery.fx, {
speeds:{
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
||
155
opacity: function(fx){
jQuery.attr(fx.elem.style, "opacity", fx.now);
},
_default: function(fx){
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
else
fx.elem[ fx.prop ] = fx.now;
}
}
});
if ( document.documentElement["getBoundingClientRect"] )
jQuery.fn.offset = function() {
if ( !this[0] ) return { top: 0, left: 0 };
if
(
this[0]
===
this[0].ownerDocument.body
)
return
jQuery.offset.bodyOffset( this[0] );
var
box
=
this[0].getBoundingClientRect(),
doc
=
this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
clientTop = docElem.clientTop || body.clientTop || 0, clientLeft =
docElem.clientLeft || body.clientLeft || 0,
top = box.top + (self.pageYOffset || jQuery.boxModel &&
docElem.scrollTop || body.scrollTop ) - clientTop,
left = box.left + (self.pageXOffset || jQuery.boxModel &&
docElem.scrollLeft || body.scrollLeft) - clientLeft;
return { top: top, left: left };
};
else
jQuery.fn.offset = function() {
if ( !this[0] ) return { top: 0, left: 0 };
if
(
this[0]
===
this[0].ownerDocument.body
)
return
jQuery.offset.bodyOffset( this[0] );
jQuery.offset.initialized || jQuery.offset.initialize();
var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent =
elem,
doc = elem.ownerDocument, computedStyle, docElem =
doc.documentElement,
body = doc.body, defaultView = doc.defaultView,
prevComputedStyle = defaultView.getComputedStyle(elem, null),
top = elem.offsetTop, left = elem.offsetLeft;
while ( (elem = elem.parentNode) && elem !== body && elem !==
docElem ) {
computedStyle = defaultView.getComputedStyle(elem, null);
top -= elem.scrollTop, left -= elem.scrollLeft;
if ( elem === offsetParent ) {
top += elem.offsetTop, left += elem.offsetLeft;
if
(
jQuery.offset.doesNotAddBorder
&&
156
(jQuery.offset.doesAddBorderForTableAndCells
&&
/^t(able|d|h)
$/i.test(elem.tagName)) )
top += parseInt( computedStyle.borderTopWidth,
10) || 0,
left += parseInt( computedStyle.borderLeftWidth,
10) || 0;
prevOffsetParent
=
offsetParent,
offsetParent
=
elem.offsetParent;
}
if ( jQuery.offset.subtractsBorderForOverflowNotVisible &&
computedStyle.overflow !== "visible" )
top += parseInt( computedStyle.borderTopWidth, 10) || 0,
left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
prevComputedStyle = computedStyle;
}
if
(
prevComputedStyle.position
prevComputedStyle.position === "static" )
top += body.offsetTop,
left += body.offsetLeft;
===
"relative"
||
157
158
&&
159
or
offset[Width/Height],
whichever is greater
Math.max(
document.documentElement["client" + name],
document.body["scroll"
+
name],
document.documentElement["scroll" + name],
document.body["offset"
+
name],
document.documentElement["offset" + name]
):
// Get or set width or height on the element
size === undefined ?
// Get width or height on the element
(this.length ? jQuery.css( this[0], type ) : null) :
// Set the width or height on the element (default to
pixels if value is unitless)
this.css( type, typeof size === "string" ? size : size
160
+ "px" );
};
});
})();
STILO.CSS
body {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 13px;
color: #000;
}
input, textarea, select{
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 13px;
padding: 5px;
border: 1px #999 solid;
background: #F9F9F9;
}
img{
border:0px;
}
fieldset{
//width:450px;
border-bottom:4px solid #666;
border-right:4px solid #666;
}
label{
color:#000;
}
#status {
padding: 5px 0 15px 0;
display: none;
color: #900;
font-weight: bold;
}
.fundolabel{
background-color: #f0f0f0;
}
.legendfield{
font-size: 18px;
font-family: verdana;
background:#295696;
161
color:#ffffff;
margin-left: 10px;
}
.td{
background:#295696;
}
td{
color:#000;
}
th{
font-family:tahoma;
font-size:16px;
background:#009acd;
color:#000066;
text-decoration:none;
font-weight:normal;
text-indent:4px;
height:30px
}
a:link {
color: #999;
}
a:visited {
color: #999;
}
a:hover {
color: #999;
font-weight: bold;
}
a:active {
color: #999;
}
#conteudo {
width: 400px;
text-align:justify;
}
#saudacao{
padding-top:5px;
margin-bottom:3px;
height:25px;
border-bottom:dotted 1px;
162
background:#009;
color:#FFF;
}
#escrever{
background:#bcd2ee;
}
#topo{
background:#CCC;
}
CADCLIF.PHP
<?php require_once("../libs/conn.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Clientes</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="../libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="../libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var cpf = $("#cpf").val();
var rg = $("#rg").val();
var nome = $("#nome").val();
var cnpj = $("#cnpj").val();
var rsocial = $("#rsocial").val();
var nfantasia = $("#nfantasia").val();
var endereco = $("#endereco").val();
var numero = $("#numero").val();
var complemento = $("#complemento").val();
var telefone1 = $("#telefone1").val();
var telefone2 = $("#telefone2").val();
var email = $("#email").val();
var cidade = $("#cidade").val();
var senha = $("#senha").val();
// Exibe mensagem de carregamento
$("#status").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax p e enviamos os valores de cada campo
atravs do mtodo POST
$.post('tratacadcli.php', {cpf: cpf, rg: rg, nome: nome, cnpj: cnpj,
rsocial: rsocial, nfantasia: nfantasia, endereco: endereco, numero: numero,
163
164
// Div 2
$("#dpjuridica").hide();
$("#pjuridica").click(function () {
$("#dpjuridica").slideToggle("slow");
});
});
</script>
</head>
<body>
<div id="escrever">
<fieldset>
<legend class="legendfield">Cadastro de Clientes</legend>
<!-- Div que mostra as mensagens de confirmao e erro -->
<div id="status"></div>
<div>
<form id="formulario" action="javascript:func()" method="post">
<br />
<fieldset><legend>Escolha um Tipo:</legend>
<input type="radio" name="tcliente" id="pfisica" />Pessoa Fisica
<input type="radio" name="tcliente" id="pjuridica">Pessoa Juridica
</fieldset><br />
<div id="dpfisica">
<table>
<tr><td
class="fundolabel"><label
for="cpf"><strong>CPF:</strong></label></td>
<td><input name="cpf" type="text" id="cpf" size="15" maxlength="11" />
</td></tr>
<tr><td
class="fundolabel"><label
for="rg"><strong>RG:</strong></label></td>
<td><input name="rg" type="text" id="rg" size="15" maxlength="10" /> </td></tr>
<tr><td
class="fundolabel"><label
for="nome"><strong>Nome:</strong></label></td>
<td><input name="nome" type="text" id="nome" size="40" /> </td></tr>
<tr><td
class="fundolabel"><label
for="endereco"><strong>Endereo:</strong></label></td>
<td><input name="endereco" type="text" id="endereco" size="40" /></td>
<tr><td
class="fundolabel"><label
for="numero"><strong>Nmero:</strong></label></td>
<td><input name="numero" type="text" id="numero" size="5" maxlength="5"
/></td></tr>
<tr><td
class="fundolabel"><label
for="complemento"><strong>Complemento:</strong></label></td>
<td><input name="complemento" type="text" id="complemento" size="15"
/></td></tr>
165
<tr><td
class="fundolabel"><label
for="telefone1"><strong>Telefone1:</strong></label></td>
<td><input name="telefone1" type="text" id="telefone1" size="15"
maxlength="15" /></td></tr>
<tr><td
class="fundolabel"><label
for="telefone2"><strong>Telefone2:</strong></label></td>
<td><input name="telefone2" type="text" id="telefone2" size="15"
maxlength="15" /></td></tr>
<tr><td
class="fundolabel"><label
for="email"><strong>Email:</strong></label></td>
<td><input name="email" type="text" id="email" size="30" /></td></tr>
<tr><td
class="fundolabel"><label
for="cidade"><strong>Cidade:</strong></label></td>
<td><select name="cidade" id="cidade">
<option value="Indefinida">Selecione uma Cidade</option>
<option value="Alegrete">Alegrete</option>
<option value="Manoel Viana">Manoel Viana</option>
<option value="Itaqui">Itaqui</option>
<option value="Quarai">Quarai</option>
<option value="Sao Borja">So Borja</option>
<option
value="Santana
do
Livramento">Santana
do
Livramento</option>
<option value="Uruguaiana">Uruguaiana</option>
</td></tr>
<tr><td
class="fundolabel"><label
for="senha"><strong>Senha:</strong></label></td>
<td><input name="senha" type="password" id="senha" size="20"
maxlength="10" /></td></tr>
</table>
</div>
<div id="dpjuridica">
<table>
<tr><td
class="fundolabel"><label
for="cnpj"><strong>CNPJ:</strong></label></td>
<td><input name="cnpj" type="text" id="cnpj" size="20" maxlength="15" />
</td></tr>
<tr><td class="fundolabel"><label for="rsocial"><strong>Razao
Social:</strong></label></td>
<td><input name="rsocial" type="text" id="rsocial" size="40" /> </td></tr>
166
<tr><td
class="fundolabel"><label
for="nfantasia"><strong>Nome
Fantasia:</strong></label></td>
<td><input name="nfantasia" type="text" id="nfantasia" size="40"
/></td></tr>
<tr><td
class="fundolabel"><label
for="endereco"><strong>Endereo:</strong></label></td>
<td><input name="endereco" type="text" id="endereco" size="40" /></td>
<tr><td
class="fundolabel"><label
for="numero"><strong>Nmero:</strong></label></td>
<td><input name="numero" type="text" id="numero" size="5" maxlength="5"
/></td></tr>
<tr><td
class="fundolabel"><label
for="complemento"><strong>Complemento:</strong></label></td>
<td><input name="complemento" type="text" id="complemento" size="15"
/></td></tr>
<tr><td
class="fundolabel"><label
for="telefone1"><strong>Telefone1:</strong></label></td>
<td><input name="telefone1" type="text" id="telefone1" size="15"
maxlength="15" /></td></tr>
<tr><td
class="fundolabel"><label
for="telefone2"><strong>Telefone2:</strong></label></td>
<td><input name="telefone2" type="text" id="telefone2" size="15"
maxlength="15" /></td></tr>
<tr><td
class="fundolabel"><label
for="email"><strong>Email:</strong></label></td>
<td><input name="email" type="text" id="email" size="30" /></td></tr>
<tr><td
class="fundolabel"><label
for="cidade"><strong>Cidade:</strong></label></td>
<td><select name="cidade" id="cidade">
<option value="Indefinida">Selecione uma Cidade</option>
<option value="Alegrete">Alegrete</option>
<option value="Manoel Viana">Manoel Viana</option>
<option value="Itaqui">Itaqui</option>
<option value="Quarai">Quarai</option>
<option value="Sao Borja">So Borja</option>
<option
value="Santana
do
Livramento">Santana
do
Livramento</option>
<option value="Uruguaiana">Uruguaiana</option>
</td></tr>
<tr><td
class="fundolabel"><label
167
for="senha"><strong>Senha:</strong></label></td>
<td><input name="senha" type="password" id="senha" size="20"
maxlength="10" /></td></tr>
</table>
</div>
<br />
<center>
<input type="submit" value="Salvar" />
<input type="reset" name="Reset" value="Cancelar"><br /><br /></center>
</form>
</fieldset>
</div>
</body>
</html>
CADCOP.PHP
<?php require_once("../libs/conn.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Copiadoras</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="../libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="../libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var nserie = $("#nserie").val();
var modelo = $("#modelo").val();
var numerador = $("#numerador").val();
// Exibe mensagem de carregamento
$("#status").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax com o arquivo tratacadcop.php e enviamos
os valores de cada campo atravs do mtodo POST
$.post('tratacadcop.php', {nserie: nserie, modelo: modelo, numerador:
numerador }, function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#status").slideDown();
// Se a resposta um erro
if (resposta != false) {
168
169
CADFUNC.PHP
<?php require_once("../libs/conn.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Funcionrios</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="../libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="../libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var nome = $("#nome").val();
var endereco = $("#endereco").val();
var numero = $("#numero").val();
var complemento = $("#complemento").val();
var telefone1 = $("#telefone1").val();
var telefone2 = $("#telefone2").val();
var dnasc = $("#dnasc").val();
var cpf = $("#cpf").val();
var rg = $("#rg").val();
var email = $("#email").val();
var categoria = $("#categoria").val();
var senha = $("#senha").val();
// Exibe mensagem de carregamento
$("#status").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax p e enviamos os valores de cada campo
atravs do mtodo POST
$.post('tratacadfunc.php', {nome: nome, endereco: endereco, numero:
numero, complemento: complemento, telefone1: telefone1, telefone2: telefone2,
dnasc: dnasc, cpf: cpf, rg: rg, email: email, categoria: categoria, senha: senha },
function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#status").slideDown();
// Se a resposta um erro
if (resposta != false) {
// Exibe o erro na div
$("#status").html(resposta);
}
// Se resposta for false, ou seja, no ocorreu nenhum erro
else {
// Exibe mensagem de sucesso
170
$("#status").html("Cadastro
Efetuado
com
Sucesso!");
// Limpando todos os campos
$("#nome").val("");
$("#endereco").val("");
$("#numero").val("");
$("#complemento").val("");
$("#telefone1").val("");
$("#telefone2").val("");
$("#dnasc").val("");
$("#cpf").val("");
$("#rg").val("");
$("#email").val("");
$("#categoria").val("");
$("#senha").val("");
}
});
});
});
</script>
</head>
<body>
<div id="escrever">
<fieldset>
<legend class="legendfield">Cadastro de Funcionrios</legend>
<!-- Div que mostra as mensagens de confirmao e erro -->
<div id="status"></div>
<form id="formulario" action="javascript:func()" method="post">
<br />
<table>
<tr><td
class="fundolabel"><label
for="nome"><strong>Nome:</strong></label></td>
<td><input name="nome" type="text" id="nome" size="40" /> </td></tr>
<tr><td
class="fundolabel"><label
for="endereco"><strong>Endereo:</strong></label></td>
<td><input name="endereco" type="text" id="endereco" size="40" /></td>
<td
class="fundolabel"><label
for="numero"><strong>Nmero:</strong></label></td>
<td><input name="numero" type="text" id="numero" size="5" maxlength="5"
/></td></tr>
<tr><td
class="fundolabel"><label
for="complemento"><strong>Complemento:</strong></label></td>
<td><input name="complemento" type="text" id="complemento" size="15"
/></td></tr>
171
<tr><td
class="fundolabel"><label
for="telefone1"><strong>Telefone1:</strong></label></td>
<td><input name="telefone1" type="text" id="telefone1" size="15"
maxlength="15" /></td></tr>
<tr><td
class="fundolabel"><label
for="telefone2"><strong>Telefone2:</strong></label></td>
<td><input name="telefone2" type="text" id="telefone2" size="15"
maxlength="15" /></td></tr>
<tr><td
class="fundolabel"><label
for="dnasc"><strong>Data
Nascimento:</strong></label></td>
<td><input name="dnasc" type="text" id="dnasc" size="15"
maxlength="10" /></td></tr
><tr><td
class="fundolabel"><label
for="cpf"><strong>CPF:</strong></label></td>
<td><input name="cpf" type="text" id="cpf" size="15" maxlength="11" />
</td></tr>
<tr><td
class="fundolabel"><label
for="rg"><strong>RG:</strong></label></td>
<td><input name="rg" type="text" id="rg" size="15" maxlength="10" /> </td></tr>
<tr><td
class="fundolabel"><label
for="email"><strong>Email:</strong></label></td>
<td><input name="email" type="text" id="email" size="30" /></td></tr>
<tr><td
class="fundolabel"><label
for="categoria"><strong>Categoria:</strong></label></td>
<td><select name="categoria" id="categoria">
<option value="secretaria">Secretria</option>
<option value="tecnico">Tcnico</option>
<option value="vendedor">Vendedor</option>
</td></tr>
<tr><td
class="fundolabel"><label
for="senha"><strong>Senha:</strong></label></td>
<td><input name="senha" type="text" id="senha" size="20"
maxlength="10" /></td></tr>
</table>
<br />
172
<center>
<input type="submit" value="Salvar" />
<input type="reset" name="Reset" value="Cancelar"><br /><br /></center>
</form>
</fieldset>
</div>
</body>
</html>
ENCATECNICO.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
1.0
Transitional//EN"
<?php require_once("../libs/conn.php");
@session_start();
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Notas</title>
<!-- Incluimos a biblioteca do jquery -->
<script type="text/javascript" language="javascript" src="../libs/jquery.js"></script>
<!-- Incluimos a folha de estilo css -->
<link type="text/css" rel="stylesheet" href="../libs/stilo.css">
<!-- Criamos as funes necessrias para envio do formulrio -->
<script type="text/javascript" language="javascript">
$(function($) {
// Quando o formulrio for enviado, essa funo chamada
$("#formulario").submit(function() {
// Colocamos os valores de cada campo em uma vriavel para facilitar
a manipulao
var nota = $("#nota").val();
var id = $("#id").val();
// Exibe mensagem de carregamento
$("#statusn").html("<img src='../img/loader.gif' alt='Enviando' />");
// Fazemos a requiso ajax com o arquivo tratacadcop.php e
enviamos os valores de cada campo atravs do mtodo POST
$.post('trataencatecnico.php', {nota: nota}, function(resposta) {
// Quando terminada a requisio
// Exibe a div status
$("#statusn").slideDown();
// Se a resposta um erro
if (resposta != false) {
// Exibe o erro na div
$("#statusn").html(resposta);
}
// Se resposta for false, ou seja, no ocorreu nenhum
erro
173
else {
// Exibe mensagem de sucesso
$("#statusn").html("Cadastro
Efetuado
com
Sucesso!");
// Limpando todos os campos
$("#nota").val("");
}
});
});
});
</script>
</head>
<body>
<br/ >
<div>
<form id="formulario" action="javascript:func()" method="post">
<fieldset>
<legend>Encaminha Chamado a Tecnico!</legend>
<div id="statusn"></div>
<table width="850" align="center" bgcolor="#F4FFF4">
<tr>
<td width="14" height="22" bordercolor="#003300" bgcolor="#295696"><div
align="center" class="style13 style1">N°</div></td>
<td width="166" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">NOME</div></td>
<td width="165" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">DEFEITO</div></td>
<td width="92" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">SITUAO</div></td>
<td width="22" bordercolor="#003300" bgcolor="#295696"><div align="center"
class="style13 style1">TECNICO</div></td>
<?php
$sql = "select id,nome,descdefeito,situacao from chamados WHERE
nome = '$nome'";
$resultado = mysql_query($sql) or die (mysql_error());
while ($linha = mysql_fetch_array($resultado)){
echo "<tr>";
echo '<td align="center">';
echo $linha["id"];
echo '</td>';
echo '<td align="center">';
echo $linha["nome"];
echo '</td>';
echo '<td align="center">';
echo $linha["descdefeito"];
echo '</td>';
echo '<td align="center">';
174
echo $linha["situacao"];
echo '</td>';
echo '<td align="center">';
echo '<select name="ncopiadora" id="ncopiadora"><option><?php
$consulta = mysql_query("SELECT id,modelo FROM copiadoras"); while( $row =
mysql_fetch_array($consulta))<option
value=\"{$row['modelo']}\">{$row['modelo']}</option>\n";}?></option>';
echo '</td>';
echo '</tr>';
}
echo '</table>';
?>
</fieldset>
<br /><center>
<input type="submit" value="Salvar" >
<input type="reset" name="Reset" value="Cancelar"><br /><br /></center>
</form>
</div>
</body>
</html>
INFO.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<p> </p>
<p align="center"><b><font color="#FF0000" face="Verdana" size="2">
Voc no est conectado no site.</font></b></p>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>SISCHA</title>
<?php
include("..\libs\conn.php");
@session_start();
$buscauser = mysql_query ("SELECT * FROM usuarios");
$result = mysql_fetch_assoc($buscauser);
$buscachamados = mysql_query ("SELECT * FROM chamados");
$result2 = mysql_fetch_assoc($buscachamados);
//___________________________________________________________Mais
Chamou______________________________________________________
$sql_mais = mysql_query("SELECT MAX(id), count(*) AS max_cons FROM
chamados GROUP BY id ORDER BY nome DESC");
$sql_mais2 = mysql_result($sql_mais, 0, 0);
175
de
<tr>
<td colspan="5"> </td>
</tr>
<tr>
<td colspan="2">
<div align="center"><fieldset>
<legend>Mais enviou chamados <strong>(Geral) </strong> </legend>
<p>
<?php
#__________________________________NUMERO DE QUEM MAIS TEVE
CHAMADOS P/ SITUACAO__________________________________
for($i=1;$i<6;$i++)
{
$calc = mysql_query("SELECT MAX(id), count(*) AS id FROM chamados
WHERE nome = $i GROUP BY id ORDER BY id DESC");
$calc = mysql_fetch_row($calc);
176
$calc = $calc[0];
$result = mysql_query("SELECT nome FROM usuarios where id = $calc");
if($result != '')
{
$result = mysql_fetch_row($result);
$result = $result[0];
}
</p>
</fieldset></div>
</td>
<td colspan="3"><div align="left" class="style3">
<div align="center">
<fieldset>
<legend>Mais enviou chamados <strong>(este Mês)</strong></legend>
<p>
<?php
#__________________________________________NUMERO DE QUEM
MAIS TEVE CHAMADOS P/ SITUACAO_______________________________
for($i=1;$i<6;$i++)
{
$mes_atual = date("m");
$calc = mysql_query("SELECT MAX(id_user), count(*) AS max_cons FROM
chamados WHERE MONTH(data_ini) = $mes_atual AND andamento = $i GROUP
BY id_user ORDER BY max_cons DESC");
$calc = mysql_fetch_row($calc);
$calc = $calc[0];
$result = mysql_query("SELECT nome FROM usuarios where id_user =
$calc");
if($result != '')
{
$result = mysql_fetch_row($result);
$result = $result[0];
}
//QUANTIDADE DE CHAMADOS FECHADOS O USUARIO TEVE
$qnt = mysql_query("SELECT count(*) AS max_cons FROM chamados
WHERE MONTH(data_ini) = $mes_atual AND andamento = $i GROUP BY id_user
ORDER BY max_cons DESC");
$qnt = mysql_fetch_row($qnt);
$qnt = $qnt[0];
$situa[1]='Concluidos';
$situa[2]='Em Espera';
$situa[3]='Cancelados';
$situa[4]='Em Andamento';
$situa[5]='Fechados';
177
if(!empty($result))
{
echo "<p align='left'><strong>$situa[$i]</strong> $result - $qnt</p>";
}else
{
echo "<p align='left'> <strong>$situa[$i]</strong> 0</p>";
}
}
?>
</p>
</fieldset>
</div>
</div></td>
</tr>
<tr>
<td colspan="2"> </td>
<td width="135"> </td>
<td width="135"> </td>
<td width="136"> </td>
</tr>
<tr>
</table>
<?php }?>
</body>
</html>
INDEX.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php require_once("../libs/conn.php");
@session_start();
?>
1.0
Transitional//EN"
178
color: #000000;
}
#site{
width: 900px;
height:600px;
background: #FFFFFF;
margin: 0 auto;
border: 2px solid #000000;
text-align: left;
}
#menu{
height:150px;
margin-top:5px;
margin-left:100px;
}
#mostraconteudo{
height:262px;
}
</style>
</head>
<body>
<div id="site">
<div id="topo">
<img src="../img/topo.png" width="900" height="150" /></div>
<div id="saudacao">
<?php include '../topo.php';?>
</div>
<div id="menu" align="center">
<?php include 'menu.php';?>
</div>
<div id="mostraconteudo">
<?php include 'info.php';?>
</div>
179
</div>
</body>
</html>
MENU.PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Testando o menu drop-down</title>
<style type="text/css">
body { font: normal 62.5% verdana; }
ul.menubar{
margin: 0px;
padding: 0px;
background-color: #FFFFFF; /* IE6 Bug */
font-size: 100%;
}
ul.menubar .submenu{
margin: 0px;
padding: 0px;
list-style: none;
background-color: #FFFFFF;
border: 1px solid #ccc;
float:left;
}
ul.menubar ul.menu{
display: none;
position: absolute;
margin: 0px;
}
ul.menubar a{
padding: 5px;
display:block;
text-decoration: none;
color: #777;
padding: 5px;
}
ul.menu, ul.menu ul{
margin: 0;
padding: 0;
border-bottom: 1px solid #ccc;
width: 150px; /* Width of Menu Items */
background-color: #FFFFFF; /* IE6 Bug */
180
}
ul.menu li{
position: relative;
list-style: none;
border: 0px;
}
ul.menu li a{
display: block;
text-decoration: none;
border: 1px solid #ccc;
border-bottom: 0px;
color: #777;
padding: 5px 10px 5px 5px;
}
ul.menu li sup{
font-weight:bold;
font-size:7px;
color: red;
}
/* Fix IE. Hide from IE Mac \*/
* html ul.menu li { float: left; height: 1%; }
* html ul.menu li a { height: 1%; }
/* End */
ul.menu ul{
position: absolute;
display: none;
left: 149px; /* Set 1px less than menu width */
top: 0px;
}
ul.menu li.submenu ul { display: none; } /* Hide sub-menus initially */
ul.menu li.submenu { background: transparent url(arrow.gif) right center no-repeat; }
ul.menu li a:hover { color: #E2144A; }
</style>
<script type="text/javascript">
function horizontal() {
var
navItems
document.getElementById("menu_dropdown").getElementsByTagName("li");
for (var i=0; i< navItems.length; i++) {
181
if(navItems[i].className == "submenu")
{
if(navItems[i].getElementsByTagName('ul')[0] != null)
{
navItems[i].onmouseover=function() {this.getElementsByTagName('ul')
[0].style.display="block";this.style.backgroundColor = "#f9f9f9";}
navItems[i].onmouseout=function() {this.getElementsByTagName('ul')
[0].style.display="none";this.style.backgroundColor = "#FFFFFF";}
}
}
}
}
</script>
<script type="text/javascript">
try{
xmlhttp = new XMLHttpRequest();
}
catch(ee){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E){
xmlhttp = false;
}
}
}
div_base = "";
valor = 0;
function abre(arquivo,metodo,div){
div_base = div;
valor++;
xmlhttp.open(metodo,arquivo+"?valor="+valor);
xmlhttp.onreadystatechange=conteudo
xmlhttp.send(null)
}
function conteudo() {
nova_div = div_base;
document.getElementById(nova_div).innerHTML="<div
style='top:50%;left:50%;position:absolute;'>carregando...</div>"
if (xmlhttp.readyState==4){
document.getElementById(nova_div).innerHTML=xmlhttp.responseText
}
182
}
</script>
</head>
<body onload="horizontal();">
<ul id="menu_dropdown" class="menubar">
<li class="submenu"><a href="#"> C A D A S T R O</a>
<ul class="menu">
<li><a
abre('cadcha.php','GET','mostraconteudo');">abre</a></li>
<li><a href="#">Funcionarios</a></li>
<li><a href="#">Copiadoras</a></li>
<li><a href="#">Chamados</a></li>
<li><a href="#">Visitas</a></li>
</ul>
</li>
href="javascript:
183
</ul>
</body>
</html>
TRATACADCLI.PHP
<?php
// Incluimos o arquivo de conexo
require_once("../libs/conn.php");
// Recuperamos os valores dos campos atravs do mtodo POST utizando o TRIM
para retirar os espaos entre os caracteres
$cpf = trim($_POST["cpf"]);
$rg = trim($_POST["rg"]);
$nome = trim($_POST["nome"]);
$cnpj = trim($_POST["cnpj"]);
$rsocial = trim($_POST["rsocial"]);
$nfantasia = trim($_POST["nfantasia"]);
$endereco = trim($_POST["endereco"]);
$numero = trim($_POST["numero"]);
$complemento = trim($_POST["complemento"]);
$telefone1 = trim($_POST["telefone1"]);
$telefone2 = trim($_POST["telefone2"]);
$email = trim($_POST["email"]);
$cidade = trim($_POST["cidade"]);
$senha = trim($_POST["senha"]);
$categoria = 'cliente';
// Verifica as validaes
if($cnpj == '' and $rsocial == '' and $nfantasia == ''){
$cnpj = 'nulo';
$rsocial = 'nulo';
$nfantasia = 'nulo';
}
if($cpf == '' and $rg == '' and $nome == ''){
$cpf = 'nulo';
$rg = 'nulo';
$nome = 'nulo';
}
if (empty($cpf)) {
echo "Digite o seu CPF";
}
elseif (empty($rg)) {
echo "Digite o seu RG";
}
184
elseif (empty($nome)) {
echo "Digite o seu Nome";
}
elseif (empty($cnpj)) {
echo "Digite o CNPJ da Empresa";
}
elseif (empty($rsocial)) {
echo "Digite a Razo Social da Empresa";
}
elseif (empty($nfantasia)) {
echo "Digite o nome fantasia de Empresa";
}
elseif (empty($endereco)) {
echo "Digite o endereco ";
}
elseif (empty($numero)) {
echo "Digite o Nmero da Residncia";
}
elseif (empty($telefone1)) {
echo "Informe pelo menos um Nmero de Telefone";
}
elseif (empty($cidade)) {
echo "Selecione uma Cidade";
}
elseif (empty($senha)) {
echo "Digite uma Senha";
}
// Se no houver nenhum erro
else {
// Inserimos no banco de dados
$query
=
mysql_query(
"INSERT
INTO
usuarios
(nome,cnpj,rsocial,nfantasia,endereco,numero,complemento,telefone1,telefone2,cpf,
rg,email,categoria,senha,cidade)
VALUES
('$nome','$cnpj','$rsocial','$nfantasia','$endereco','$numero','$complemento','$telefon
e1','$telefone2','$cpf','$rg','$email','$categoria','$senha','$cidade')")or die("No foi
185
186
$cpf = trim($_POST["cpf"]);
$rg = trim($_POST["rg"]);
$email = trim($_POST["email"]);
$categoria = trim($_POST["categoria"]);
$senha = trim($_POST["senha"]);
// INICIA TODAS AS VALIDAES
if (empty($nome)) {
echo "Digite o seu Nome";
}
elseif (empty($endereco)) {
echo "Digite o Endereo";
}
elseif (empty($numero)) {
echo "Digite o Nmero de sua Residencia";
}
elseif (empty($telefone1)) {
echo "Informe pelo menos um Telefone";
}
elseif (empty($dnasc)) {
echo "Informe a Data do seu Nascimento";
}
elseif (empty($cpf)) {
echo "Digite seu CPF";
}
elseif (empty($rg)) {
echo "Digite seu RG";
}
elseif (empty($email)) {
echo "Digite seu Email";
}
elseif ($categoria == "") {
echo "Escolha uma categoria";
}
187
elseif (empty($senha)) {
echo "Digite uma Senha";
}
// FIM DAS VALIDAES
// Se no houver nenhum erro
else {
// Inserimos no banco de dados
$query
=
mysql_query(
"INSERT
INTO
usuarios
(nome,endereco,numero,complemento,telefone1,telefone2,dnasc,cpf,rg,email,catego
ria,senha)
VALUES
('$nome','$endereco','$numero','$complemento','$telefone1','$telefone2','$dnasc','$cp
f','$rg','$email','$categoria','$senha')")or die("No foi possvel realizar o Cadastro no
momento:");
}
?>
TRATAENCATECNICO.PHP
<?php
// Incluimos o arquivo de conexo
require_once("../libs/conn.php");
// Recuperamos os valores dos campos atravs do mtodo POST utizando o TRIM
para retirar os espaos entre os caracteres
$nome = trim($_POST["nome"]);
$endereco = trim($_POST["endereco"]);
$numero = trim($_POST["numero"]);
$complemento = trim($_POST["complemento"]);
$telefone1 = trim($_POST["telefone1"]);
$telefone2 = trim($_POST["telefone2"]);
$dnasc = trim($_POST['dnasc']);
$cpf = trim($_POST["cpf"]);
$rg = trim($_POST["rg"]);
$email = trim($_POST["email"]);
$categoria = trim($_POST["categoria"]);
$senha = trim($_POST["senha"]);
// INICIA TODAS AS VALIDAES
if (empty($nome)) {
echo "Digite o seu Nome";
}
elseif (empty($endereco)) {
echo "Digite o Endereo";
}
elseif (empty($numero)) {
188
elseif (empty($senha)) {
echo "Digite uma Senha";
}
// FIM DAS VALIDAES
// Se no houver nenhum erro
else {
// Inserimos no banco de dados
$query
=
mysql_query(
"INSERT
INTO
usuarios
(nome,endereco,numero,complemento,telefone1,telefone2,dnasc,cpf,rg,email,catego
ria,senha)
VALUES
('$nome','$endereco','$numero','$complemento','$telefone1','$telefone2','$dnasc','$cp
f','$rg','$email','$categoria','$senha')")or die("No foi possvel realizar o Cadastro no
momento:");
}
189
?>
190
SISCHA.BD
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--- Servidor: localhost
-- Tempo de Gerao: Nov 19, 2010 as 04:06 AM
-- Verso do Servidor: 5.1.36
-- Verso do PHP: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- Banco de Dados: `sischa`
-- --------------------------------------------------------- Estrutura da tabela `chamados`
CREATE TABLE IF NOT EXISTS `chamados` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ncopiadora` varchar(25) COLLATE latin1_bin NOT NULL,
`nome` varchar(40) COLLATE latin1_bin NOT NULL,
`atecnico` varchar(40) COLLATE latin1_bin DEFAULT NULL,
`data` char(15) COLLATE latin1_bin NOT NULL,
`descdefeito` varchar(40) COLLATE latin1_bin NOT NULL,
`situacao` varchar(15) COLLATE latin1_bin DEFAULT NULL,
`obsdefeito` tinytext COLLATE latin1_bin,
`nota` varchar(15) COLLATE latin1_bin DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE=MyISAM
DEFAULT CHARSET=latin1
AUTO_INCREMENT=16 ;
COLLATE=latin1_bin
191
192