Ir para conteúdo
Fórum Script Brasil

Adriano Bispo

Membros
  • Total de itens

    7
  • Registro em

  • Última visita

Sobre Adriano Bispo

Adriano Bispo's Achievements

0

Reputação

  1. Adriano Bispo

    O.s

    Pessoal alguém pode dar uma idéia, do que possa ta acontecendo?! Tenho uma O.S e não to conseguindo fazer alteração nela. O que esta acontecendo é o seguinte: Abro uma nova O.S e preencho as informações (empresa, projeto e usuario) o campo da O.S é preenchido automatico..., tem um outro campo que é DATA e HORA que esta me dando problemas apesar de ser preenchido no primeiro momento...., depois disso salvo. Ate aqui OK.... Quando preciso fazer a alteração é que da problema no campo DATA HORA...quando peço pra alterar a O.S que abri, ela me tras os campos todos peenchidos com execessão do campo DATA HORA . alguém pode dar uma dica?! Adriano Bispo
  2. Adriano Bispo

    Debug Php

    Ai galera valeu pelas dicas....obrigado! Baixei aqui o Zend Studio e agora estou com outra duvida Gente alguém sabe como funciona ?! Tenho aqui um programanha com uns 8 fontes mais index é claro...hehehe...pergunta: alguém saberia dizer se posso por exemplo debugar o 5º fonte do programinha, ou se tenho que debugar todo o programa apartir do INdex?! Ah, se alguém souber, tiver, ou possa indicar de algum site que tenha o tutorial ou o manual do Zend Studio eu agradeço. Abraço, Adriano Bispo
  3. Adriano Bispo

    Debug Php

    Valeu galera, obrigado! já estou baixando aqui o Zend
  4. Adriano Bispo

    Debug Php

    Pessoal alguém conhece alguma ferramenta pra "debugar" programas PHP?! Alguma dica! Obrigado Adriano
  5. Adriano Bispo

    Função Date No Php

    Pô cara ate assino embaixo de tudo o que você disse..., com uma resalva. Eu ate sei algumas coisas mais não o bastante pra arrumar esse problema. Como disse estou começand agora..., não tenho a "manha" de ver onde esta o problema pra poder arrumar. Estou tentando, já olhei esse codigo fonte muitas vezes e não sei onde pode estar o problema. Ate você teve duvidas um dia e alguém te mostrou onde estava o problema......, não estou parada esperando ajudar, estou tentando! Mesmo assim valeu pelo toque!
  6. Adriano Bispo

    Função Date No Php

    é dificil né gente!!!!! Realmente é ta complicado...., quem sabe num lance de sorte eu não encontre o erro! Bom, valeu pra vocês que tentarm me ajudar.
  7. Adriano Bispo

    Função Date No Php

    O codigo é esse!!!! <?php /* $Id: addedit.php,v 1.4 2003/12/03 01:05:02 gregorerhardt Exp $ */ $serviceorder_id = defVal( @$_GET["serviceorder_id"], 0); // check permissions if (!$canEdit) { $AppUI->redirect( "m=public&a=access_denied" ); } // format dates $df = $AppUI->getPref('SHDATEFORMAT'); $serviceorder_date = intval( $obj->serviceorder_date ) ? new CDate( $obj->serviceorder_date ) : null; //Time arrays for selects $start = $AppUI->getConfig('cal_day_start'); $end = $AppUI->getConfig('cal_day_end'); $inc = $AppUI->getConfig('cal_day_increment'); if ($start === null ) $start = 8; if ($end === null ) $end = 17; if ($inc === null) $inc = 15; $hours = array(); for ( $current = $start; $current < $end + 1; $current++ ) { if ( $current < 10 ) { $current_key = "0" . $current; } else { $current_key = $current; } if ( stristr($AppUI->getPref('TIMEFORMAT'), "%p") ){ //User time format in 12hr $hours[$current_key] = ( $current > 12 ? $current-12 : $current ); } else { //User time format in 24hr $hours[$current_key] = $current; } } $minutes = array(); $minutes["00"] = "00"; for ( $current = 0 + $inc; $current < 60; $current += $inc ) { $minutes[$current] = $current; } $action = @$_REQUEST["action"]; if($action) { $serviceorder_description = $_POST["serviceorder_description"]; $serviceorder_project = $_POST["serviceorder_project"]; $serviceorder_company = $_POST["serviceorder_company"]; $serviceorder_start_time = $_POST["serviceorder_start_time"]; $serviceorder_finish_time = $_POST["serviceorder_finish_time"]; $serviceorder_type = $_POST["serviceorder_type"]; $serviceorder_date = $_POST["serviceorder_date"]; // convert dates to SQL format first $date = new CDate( $obj->serviceorder_date ); $obj->serviceorder_date = $date->format( FMT_DATETIME_MYSQL ); $userid = $AppUI->user_id; if( $action == "add" ) { //$sql = "INSERT INTO serviceorders (serviceorder_date, serviceorder_description, serviceorder_user, serviceorder_project, serviceorder_start_time, serviceorder_finish_time, serviceorder_type, serviceorder_company) VALUES (now(),'"+$serviceorder_description+"', $userid, $serviceorder_project, $serviceorder_start_time, $serviceorder_finish_time, $serviceorder_type, $serviceorder_company)"; $sql = "INSERT INTO serviceorders (serviceorder_date, serviceorder_description, serviceorder_user, serviceorder_project, serviceorder_start_time, serviceorder_finish_time, serviceorder_type, serviceorder_company) VALUES ('$serviceorder_date', '$serviceorder_description', '$userid', '$serviceorder_project', '$serviceorder_start_time', '$serviceorder_finish_time', '$serviceorder_type','$serviceorder_company')"; $okMsg = "Service Order added"; } else if ( $action == "update" ) { $sql = "UPDATE serviceorders SET serviceorder_description = '$serviceorder_description', serviceorder_project = '$serviceorder_project', serviceorder_date = '$serviceorder_date' WHERE serviceorder_id = $serviceorder_id"; $okMsg = "Service Order updated"; } else if ( $action == "del" ) { $sql = "DELETE FROM serviceorders WHERE serviceorder_id = $serviceorder_id"; $okMsg = "Service Order deleted"; } if(!db_exec($sql)) { $AppUI->setMsg( db_error() ); } else { $AppUI->setMsg( $okMsg ); } $AppUI->redirect(); } // pull the history $sql = "SELECT * FROM serviceorders WHERE serviceorder_id = $serviceorder_id"; db_loadHash( $sql, $serviceorders ); ?> <script language=JavaScript"> var calendarField = ''; var calWin = null; function delIt() { AddEdit.action.value = "del"; AddEdit.submit(); } function setAMPM( field) { if ( field.value > 11 ){ document.AddEdit[field.name + "_ampm].value = "pm"; } else { document.AddEdit[field.name + "_ampm"].value = "am"; } } function popCalendar( field ){ calendarField = field; idate = eval( 'document.AddEdit.serviceorder_' + field + '.value' ); window.open( 'index.php?m=public&a=calendar&dialog=1&callback=setCalendar&date= + idate, 'calwin', 'top=250,left=250,width=250, height=220, scollbars=false' ); } /** * @param string Input date in the format YYYYMMDD * @param string Formatted date */ function setCalendar( idate, fdate ) { fld_date = eval( 'document.AddEdit.serviceorder_' + calendarField ); fld_fdate = eval( 'document.AddEdit.' + calendarField ); fld_date.value = idate; fld_fdate.value = fdate; } </script> <form name="AddEdit" method="post"> <table width="100%" border="0" cellpadding="0" cellspacing="1"> <input name="action" type="hidden" value="<?php echo $serviceorder_id ? "update" : "add" ?>"> <tr> <td><img src="./images/icons/calendar.gif" alt="" border="0"></td> <td align="left" nowrap="nowrap" width="100%"><h1><?php echo $AppUI->_( $serviceorder_id ? 'Edit service order' : 'New service order' );?></h1></td> </tr> </table> <table border="0" cellpadding="4" cellspacing="0" width="98%"> <tr> <td width="50%" align="right"> <a href="javascript:delIt()"><img align="absmiddle" src="./images/icons/trash.gif" width="16" height="16" alt="" border="0"><?php echo $AppUI->_('delete service order');?></a> </td> </tr> </table> <table border="1" cellpadding="4" cellspacing="0" width="98%" class="std"> <tr> <!-- data--> <td align="right" nowrap="nowrap"><?php echo $AppUI->_( 'Date' );?></td> <td nowrap="nowrap"> <input type="hidden" name="serviceorder_date" value="<?php echo $serviceorder_date ? $serviceorder_date->format( FMT_TIMESTAMP_DATE ) : "" ;?>" /> <input type="text" name="date" value="<?php echo $serviceorder_date ? $serviceorder_date->format( $df ) : "" ;?>" class="text" disabled="disable" /> <a href="#" onClick="popCalendar('date')"> <img src="./images/calendar.gif" width="24" height="12" alt="<?php echo $AppUI->_('Calendar');?>" border="0"> </a> </td> <!--empresa--> <td align="left" nowrap="nowrap"><?php echo $AppUI->_( 'Company' );?>:</td> <td width="30%"> <?php // pull the companies list $sql = "SELECT company_id,company_name FROM companies ORDER BY company_name"; $companies = arrayMerge( array( 0 => '('.$AppUI->_('any').')' ), db_loadHashList( $sql ) ); echo arraySelect( $companies, 'serviceorder_company', 'class="text"', $serviceorders["serviceorder_company] ); ?> </td> <!-- projeto --> <td align="left" nowrap="nowrap"><?php echo $AppUI->_( 'Project' );?>:</td> <td width="30%"> <?php // pull the projects list $sql = "SELECT project_id,project_name FROM projects ORDER BY project_name"; $projects = arrayMerge( array( 0 => '('.$AppUI->_('any').')' ), db_loadHashList( $sql ) ); echo arraySelect( $projects, 'serviceorder_project', 'class="text"', $serviceorders["serviceorder_project"] ); ?> </td> </tr> <tr> <td colspan=6> <table border=0> <tr> <td width=100%" align="left" nowrap="nowrap"><?php echo $AppUI->_( 'Description' );?>:</td> </tr> <tr> <td width="100%"> <textarea name="serviceorder_description" class="textarea" cols="130" rows="15" wrap="virtual"><?php echo $serviceorders["serviceorder_description];?></textarea> </td> </tr> </table> </td> </tr> <tr> <td align="left" nowrap="nowrap"><?php echo $AppUI->_( 'Start Time' );?></td> <td cellpadding=0> <table> <tr> <?php echo "<td>" . arraySelect($hours, "start_hour",'size="1" onchange="setAMPM(this)" class="text"', $serviceorder_date ? $serviceorder_date->getHour() : $start ) . "</td><td>" . " : " . "</td>"; echo "<td>" . arraySelect($minutes, "start_minute",'size="1" class="text"', $serviceorder_date ? $serviceorder_date->getMinute() : "0" ) . "</td>"; if ( stristr($AppUI->getPref('TIMEFORMAT'), "%p") ) { echo '<td><input type="text" name="start_hour_ampm" value="' . ( $serviceorder_date ? $serviceorder_date->getAMPM() : ( $start > 11 ? "pm" : "am" ) ) . '" disabled="disabled" class="text" size="2" /></td>'; } ?> </tr> </table> </td> <td align="left" nowrap="nowrap"><?php echo $AppUI->_( 'End Time' );?></td> <td cellpadding=0> <table> <tr> <?php echo "<td>" . arraySelect($hours, "end_hour",'size="1" onchange="setAMPM(this)" class="text"', $serviceorder_date ? $serviceorder_date->getHour() : $start ) . "</td><td>" . " : " . "</td>"; echo "<td>" . arraySelect($minutes, "end_minute",'size="1" class="text"', $serviceorder_date ? $serviceorder_date->getMinute() : "0" ) . "</td>"; if ( stristr($AppUI->getPref('TIMEFORMAT'), "%p") ) { echo '<td><input type="text" name="end_hour_ampm" value="' . ( $serviceorder_date ? $serviceorder_date->getAMPM() : ( $end > 11 ? "pm" : "am" ) ) . '" disabled="disabled" class="text" size="2" /></td>'; } ?> </tr> </table> </td> <td> </td> <td> </td> </tr> <table border="0" cellspacing="0" cellpadding="3" width="98%"> <tr> <td height="40" width="30%">&nbsp;</td> <td height="40" width="35%" align="right"> <table> <tr> <?php echo $serviceorder_date?> <td> <input class="button" type="button" name="cancel" value="<?php echo $AppUI->_('cancel'); ?>" onClick="javascript:if(confirm('Are you sure you want to cancel.')){location.href = '?<?php echo $AppUI->getPlace();?>';}"> </td> <td> <input class="button" type="button" name="btnFuseAction" value="<?php echo $AppUI->_('save'); ?>" onClick="submit()"> </td> </tr> </table> </td> </tr> </table> </table> </form> </body> </html>
×
×
  • Criar Novo...