Example #1
0
<?php

// initialize
include_once '../../../common/init.php';
if (!isLoggedInAdmin()) {
    redirect('');
} else {
    include_once $BASE_PATH . 'database/operators.php';
    // fetch data
    $operator = getOperator($_GET['id']);
    // send data to smarty
    $smarty->assign('operator', $operator);
    // display smarty template
    $smarty->display('manager/operators/form_edit_operator.tpl');
}
Example #2
0
             // kredit
             $nom = intval(getuang($_POST[$sub . '_nominal' . $v . 'TB']));
             $nomKredit += $nom;
             $s2 = 'INSERT INTO keu_jurnal SET transaksi =' . $id . ', rek =' . $_POST[$sub . '_rek' . $v . 'H'] . ', kredit =' . $nom;
             $e2 = mysql_query($s2);
         }
     }
     if (!$stat2) {
         $stat = 'gagal_insert_jurnal';
     } else {
         // 3. update saldo rekening
         if ($sub != 'ju') {
             // selain jurnal umum
             if ($nominal != '0') {
                 $s5 = 'UPDATE keu_saldorekening SET nominal2 =nominal2 ' . getOperator($_POST['rekkasH']) . ' ' . $nominal . ' WHERE rekening =' . $_POST['rekkasH'] . ' AND tahunbuku=' . getTahunBuku('replid');
                 $s6 = 'UPDATE keu_saldorekening SET nominal2 =nominal2 ' . getOperator($_POST['rekitemH']) . ' ' . $nominal . ' WHERE rekening =' . $_POST['rekitemH'] . ' AND tahunbuku=' . getTahunBuku('replid');
                 // var_dump($s6);exit();
                 $e5 = mysql_query($s5);
                 $e6 = mysql_query($s6);
                 $stat = ($e5 or $e6) ? 'sukses' : 'gagal_update_saldorekening';
             } else {
                 $stat = 'sukses';
             }
         } else {
             $stat = 'sukses';
         }
     }
 }
 $out = json_encode(array('status' => $stat));
 break;
 // add / edit -----------------------------------------------------------------
Example #3
0
<?php

// initialize
include_once '../../../common/init.php';
if (!isLoggedInAdmin()) {
    redirect('');
} else {
    // include needed database functions
    include_once $BASE_PATH . 'database/operators.php';
    include_once $BASE_PATH . 'database/sales.php';
    $id = $_GET['id'];
    // fetch data
    $operator = getOperator($id);
    // send data to smarty
    $smarty->assign('operator', $operator);
    $smarty->assign('graph', getOperatorSalesGraph($id));
    // display smarty template
    $smarty->display('manager/operators/view_operator.tpl');
}