Пример #1
0
/** There are two options to print a batch of PDF statements:
 *  1.  The original statement, a text based statement, using CezPDF
 *      Altering this statement is labor intensive, but capable of being altered any way desired...
 *
 *  2.  Branded Statement, whose core is build from 1., the original statement, using HTML2PDF.
 *
 *      To customize 2., add your practice location/images/practice_logo.gif
 *      In the base/default install this is located at '/openemr/sites/default/images/practice_logo.gif',
 *      Adjust directory paths per your installation.
 *      Further customize 2. manually in functions report_2() and create_HTML_statement(), below.
 *
 */
function make_statement($stmt) {
  if ($GLOBALS['statement_appearance'] == "1") {
    return create_HTML_statement($stmt);
  } else {
    return create_statement($stmt);
  }
}
Пример #2
0
     if ($intnotes) {
         $intnotes .= "\n";
     }
     $intnotes = addslashes($intnotes . "Statement sent {$today}");
     if (!$DEBUG && !$_POST['form_without']) {
         SLQuery("UPDATE ar SET intnotes = '{$intnotes}' WHERE id = " . $row['id']);
         if ($sl_err) {
             die($sl_err);
         }
     }
 }
 // end for
 if (!empty($stmt)) {
     ++$stmt_count;
 }
 fwrite($fhprint, create_statement($stmt));
 fclose($fhprint);
 sleep(1);
 // Download or print the file, as selected
 if ($_POST['form_download']) {
     upload_file_to_client($STMT_TEMP_FILE);
 } elseif ($_POST['form_pdf']) {
     upload_file_to_client_pdf($STMT_TEMP_FILE);
 } else {
     // Must be print!
     if ($DEBUG) {
         $alertmsg = xl("Printing skipped; see test output in") . ' ' . $STMT_TEMP_FILE;
     } else {
         exec("{$STMT_PRINT_CMD} {$STMT_TEMP_FILE}");
         if ($_POST['form_without']) {
             $alertmsg = xl('Now printing') . ' ' . $stmt_count . ' ' . xl('statements; invoices will not be updated.');
Пример #3
0
    public function editprof()
    {
        if (!$this->session->userdata('logged_in')) {
            redirect('login', 'refresh');
        } else {
            $session_data = $this->session->userdata('logged_in');
            $idu = $session_data['id'];
            $kol = $this->db->list_fields('user');
            $exckosong = array();
            $nk = count($kol);
            for ($x = 0; $x < $nk; $x++) {
                $input = $this->input->post($kol[$x]);
                $cekin = rtrim($input);
                if (!$cekin || empty($cekin) || strlen($cekin) === 0) {
                    $exckosong[] = $kol[$x];
                }
            }
            $gettd = getttduser($idu);
            $trttd = rtrim($gettd);
            if (!empty($trttd) && strlen($trttd) > 0 && $trttd !== '0') {
                array_push($exckosong, 'ttd');
            }
            $listkosong = create_statement('user', $exckosong);
            $field = explode(',', $listkosong);
            $n = count($field);
            $isif = array();
            for ($t = 0; $t < $n; $t++) {
                switch ($field[$t]) {
                    case 'password':
                        $isif[] = sha1($this->input->post($field[$t]));
                        break;
                    case 'ttd':
                        $settd = $this->input->post($field[$t]);
                        if ($settd) {
                            $config['upload_path'] = FCPATH . 'uploads/';
                            $config['allowed_types'] = 'gif|jpg|png';
                            //load the upload library
                            $this->upload->initialize($config);
                            $this->upload->set_allowed_types('*');
                            $data['upload_data'] = '';
                            //if not successful, set the error message
                            if (!$this->upload->do_upload('userfile')) {
                                redirect(site_url('gudang/profile?tab=3&e=1'), 'refresh');
                            } else {
                                //else, set the success message
                                $dataimg = $this->upload->data();
                                $dtimg = array('idimg' => '', 'src' => $dataimg['full_path'], 'desc' => 'ttd|' . $idu);
                                $setimg = $this->mweb->setimage($dtimg);
                                $settd = $setimg;
                            }
                        } else {
                            $settd = '0';
                        }
                        $isif[] = $settd;
                        break;
                    default:
                        $isif[] = $this->input->post($field[$t]);
                        break;
                }
            }
            $data = array_combine($field, $isif);
            $query = $this->db->where('id', $idu)->update('user', $data);
            if ($query) {
                ?>
					<script type="text/javascript">
						alert("update profil anda berhasil :)");
					</script>
					<?php 
                redirect(site_url('gudang/profile?tab=1'), 'refresh');
            } else {
                ?>
					<script type="text/javascript">
						alert("maaf terjadi kesalahan pada system :(");
					</script>
					<?php 
                redirect('login', 'refresh');
            }
        }
    }
Пример #4
0
function table_dump($table_name, $fp)
{
    global $dbh;
    fwrite($fp, "#" . $table_name . "\r\n");
    fwrite($fp, "drop table if exists " . $table_name . ";\r\n");
    //Get strucutre
    fwrite($fp, create_statement($table_name) . "\n");
    //enumerate tables
    $update_a_faire = 0;
    /* permet de gérer les id auto_increment qui auraient pour valeur 0 */
    //parse the field info first
    $res2 = mysql_query("select * from {$table_name} order by 1 ", $dbh);
    if ($res2) {
        $nf = mysql_num_fields($res2);
        $nr = mysql_num_rows($res2);
    }
    $fields = '';
    $values = '';
    if ($nf) {
        for ($b = 0; $b < $nf; $b++) {
            $fn = mysql_field_name($res2, $b);
            $ft = mysql_fieldtype($res2, $b);
            $fs = mysql_field_len($res2, $b);
            $ff = mysql_field_flags($res2, $b);
            $is_numeric = false;
            switch (strtolower($ft)) {
                case "int":
                    $is_numeric = true;
                    break;
                case "blob":
                    $is_numeric = false;
                    break;
                case "real":
                    $is_numeric = true;
                    break;
                case "string":
                    $is_numeric = false;
                    break;
                case "unknown":
                    switch (intval($fs)) {
                        case 4:
                            // little weakness here...
                            // there is no way (thru the PHP/MySQL interface)
                            // to tell the difference between a tinyint and a year field type
                            $is_numeric = true;
                            break;
                        default:
                            $is_numeric = true;
                            break;
                    }
                    break;
                case "timestamp":
                    // Afin de résoudre le pb des timestamp pas corrects en restauration $is_numeric=true;
                    $is_numeric = false;
                    break;
                case "date":
                    $is_numeric = false;
                    break;
                case "datetime":
                    $is_numeric = false;
                    break;
                case "time":
                    $is_numeric = false;
                    break;
                default:
                    //future support for field types that are not recognized
                    //(hopefully this will work without need for future modification)
                    $is_numeric = true;
                    //I'm assuming new field types will follow SQL numeric syntax..
                    // this is where this support will breakdown
                    break;
            }
            (string) $fields != "" ? $fields .= ', ' . $fn : ($fields .= $fn);
            $fna[$b] = $fn;
            $ina[$b] = $is_numeric;
        }
    }
    //parse out the table's data and generate the SQL INSERT statements in order to replicate the data itself...
    if ($nr) {
        for ($c = 0; $c < $nr; $c++) {
            $row = mysql_fetch_row($res2);
            $values = '';
            for ($d = 0; $d < $nf; $d++) {
                $data = strval($row[$d]);
                if ($ina[$d] == true) {
                    (string) $values != "" ? $values .= ', ' . $data : ($values .= $data);
                } else {
                    (string) $values != "" ? $values .= ", \"" . mysql_escape_string($data) . "\"" : ($values .= "\"" . mysql_escape_string($data) . "\"");
                }
            }
            fwrite($fp, "insert into {$table_name} ({$fields}) values ({$values});\r\n");
            if ($update_a_faire == 1) {
                $update_a_faire = 0;
                fwrite($fp, "update {$table_name} set " . $cle_update . "='0' where " . $cle_update . "='1';\r\n");
            }
        }
    }
    if ($res2) {
        mysql_free_result($res2);
    }
}