예제 #1
0
 function save_post($cp, $tabela)
 {
     global $dd, $acao, $path;
     if (isset($dd[0]) and strlen($dd[0]) > 0 and strlen($cp[0][1]) > 0) {
         $sql = "update " . $tabela . " set ";
         $cz = 0;
         for ($k = 1; $k < 100; $k++) {
             if (strlen($cp[$k][1]) > 0 and $cp[$k][4] == True) {
                 if ($cz++ > 0) {
                     $sql = $sql . ', ';
                 }
                 if (substr($cp[$k][0], 0, 2) == '$D') {
                     $dd[$k] = brtos($dd[$k]);
                 }
                 $sql = $sql . $cp[$k][1] . '=' . chr(39) . $dd[$k] . chr(39) . ' ';
             }
         }
         $sql = $sql . ' where ' . $cp[0][1] . "='" . $dd[0] . "'";
         if (strlen($tabela) > 0) {
             $result = db_query($sql) or die("<P><FONT COLOR=RED>ERR 002:Query failed<HR>" . $sql);
         }
         $acao = null;
         $saved = 1;
     } else {
         $sql = "insert into " . $tabela . " (";
         $sql2 = "";
         $tt = 0;
         for ($k = 1; $k < 100; $k++) {
             if (strlen(trim($cp[$k][1]))) {
                 if ($tt++ > 0) {
                     $sql = $sql . ', ';
                     $sql1 = $sql1 . ', ';
                 }
                 $sql = $sql . $cp[$k][1];
                 if (substr($cp[$k][0], 0, 2) == '$D') {
                     $dd[$k] = brtos($dd[$k]);
                 }
                 $sql1 = $sql1 . chr(39) . $dd[$k] . chr(39);
             }
         }
         $sql = $sql . ') values (' . $sql1 . ')';
         //		echo $sql;
         $sqlc = $sql;
         if (strlen($tabela) > 0) {
             $result = db_query($sql);
         }
         //				$dd[1] = null;
         $acao = null;
         $saved = 2;
     }
     return $saved;
 }
예제 #2
0
}
$cp = array();
array_push($cp, array('$H8', '', '', false, true));
array_push($cp, array('$D8', '', '<nobr>' . msg('scheduled_meeting'), True, true));
array_push($cp, array('$[6-20]', '', '<nobr>' . msg('works_for_page'), True, true));
array_push($cp, array('$B8', '', msg('show'), False, true));
if (strlen($acao) == 0 or strlen($dd[1]) < 10) {
    echo '<h2>' . msg('agenda_for_meeting') . '</h2>';
    echo '<TABLE width="400" border=0 class="tabela01" >
			<TR><TH colspan=2 align="center" class="tabela00">
			' . msg('inform_the_data') . '
			<TR><TD>';
    $tela = $form->editar($cp, $tabela);
    echo '</table>';
} else {
    $form->saved = 1;
}
if ($form->saved > 0) {
    echo $tela;
    $data = brtos($dd[1]);
    echo $mt->mostra($data, $dd[2]);
} else {
    echo $tela;
}
echo $mt->mostra_proximas();
echo '</div>';
echo $hd->foot();
?>
<script>
	
</script>
예제 #3
0
 $msg_ok = '<font color="green">' . msg('validated') . '</font>';
 $msg_nok = '<font color="red">' . msg('no_validated') . '</font>';
 if ($clinic == 0 and $ref == 'CLINIC') {
     $cont = 'ok';
 }
 if ($obrig == 1 and ($ativo == 1 or strlen($ativo) == 0)) {
     $link = '<A HREF="submit.php?dd91=' . $line['sub_pag'] . '#' . $line['sub_codigo'] . '">';
     switch ($ref) {
         /*
          * Enrollment
          */
         case 'ENROLL':
             if ($LANG == 'en_US') {
                 $date = ustos($cont);
             } else {
                 $date = brtos($cont);
             }
             echo '<TR>';
             echo '<TD>';
             echo msg($line['sub_descricao']) . ' - ' . $cont;
             /* CHECK DATE THE EROLLMENT */
             if ($date < date("Ymd")) {
                 $cont = '';
             }
             if (strlen($cont) > 0) {
                 echo '<TD align="center">' . $msg_ok;
             } else {
                 /* ISSUE #89# */
                 echo ' <font color="red">';
                 echo msg('date_less_than_current');
                 echo '</font>';