コード例 #1
0
ファイル: master_department.php プロジェクト: sayniki/test
<?php

include 'page_header.php';
if (!empty($_POST['submit_btn'])) {
    $department = $_POST['department'];
    $result = insertMaker('master_department_file', array('department'), array($department));
}
?>
<form name=form1 id=form1 method=post></form>
<table style='width:400px' class='form_css'>
    <tr>
        <th style='text-align:left'><h2>Department</h2></th>
    </tr>
    <?php 
echo textMaker('Department Name', 'department');
echo "<tr>";
echo "<td colspan=2 style='text-align:center'>";
echo "<input type='submit' name='submit_btn' value='Submit' style='margin:15px'>";
echo "<input type='button' value='Cancel' style='margin:15px'>";
echo "</td>";
echo "</tr>";
?>
</table>
コード例 #2
0
ファイル: user_file.php プロジェクト: sayniki/finance
        } else {
            $select = "select department from master_address_file as a inner join master_department_file  as k\n                on a.department_id=k.department_id\n                where account_id='" . $account_executive_id . "' and account_type='account_executive' limit 1";
            $result = $conn->query($select);
            $row = $result->fetch_assoc();
            $department = $row['department'];
        }
        $id = getId('master_address_file', 'account_id');
        $add_array = array('account_type', "account_id", 'first_name', 'last_name', 'department_id', 'account_executive_id', 'phone_number', 'date_created');
        $value_array = array($user_type, $id, $first_name, $last_name, $department, $account_executive_id, $phone_number, 'now()');
        $result = insertMaker('master_address_file', $add_array, $value_array);
        //$result=insertMaker('master_address_file',array('secretary','secretary_id','account_executive_id'),array($name,$id,$account_executive_id));
    }
    if ($department == 'Choose') {
        $department = "";
    }
    $result = insertMaker('user_file', array('user_name', 'password', 'first_name', 'last_name', 'user_type', 'department', 'finance_head', 'phone_number'), array($username, 'password123', $first_name, $last_name, $user_type, $department, $finance_head, $phone_number));
    echo "<script>alert('Successfully added New User')</script>";
}
?>
<form name='form1' id='form1' method=post>
<table style='width:300px' class='form_css'>
    <tr>
        <th style='text-align:left'><h2>User File</h2></th>
    </tr>
    <?php 
$select = "select department from master_department_file where mas_status=1 order by department";
$result = $conn->query($select);
$departments = array();
while ($row = $result->fetch_assoc()) {
    $departments[] = $row['department'];
}
コード例 #3
0
if ($user_type == 'Choose') {
    $user_type = "";
}
if (!empty($_REQUEST['submit_btn'])) {
    $menu = $_POST['menu'];
    $delete = "delete from user_access_file where user_type='{$user_type}'";
    $conn->query($delete);
    $delete = "delete from user_access_type_file where user_type='{$user_type}'";
    $conn->query($delete);
    for ($a = 0; $a < count($menu); $a++) {
        if (!empty($_POST['menuType' . $menu[$a]]) && count($_POST['menuType' . $menu[$a]]) > 0) {
            $men_type = $_POST['menuType' . $menu[$a]];
            for ($k = 0; $k < count($men_type); $k++) {
                $result = insertMaker('user_access_type_file', array('user_type', 'menu_id', 'type'), array($user_type, $menu[$a], $men_type[$k]));
            }
            $result = insertMaker('user_access_file', array('user_type', 'menu_id'), array($user_type, $menu[$a]));
        }
    }
}
$select = "select * from menu_file where mas_status=1 and menu_head!=16 order by menu_head,menu_type,  menu_order";
$result = $conn->query($select);
echo "<h2>User Access </h2>";
echo "<table id='user_table'>";
echo selectMaker('User Type', 'user_type', array('Finance Head', 'Secretary', 'QA', 'Admin', 'Cash Release'), 'change_info()', $user_type);
echo "<tr><td colspan=2>";
echo "<table class='table_list'>";
$temp_head = -1;
while ($row = $result->fetch_assoc()) {
    echo "<tr>";
    if ($row['menu_type'] == 1) {
        if ($temp_head != $row['menu_head']) {
コード例 #4
0
<?php

include 'page_header.php';
echo "<form name=form1 id=form1 method=post>";
if (!empty($_POST['submit_btn'])) {
    $sms_slot = $_POST['sms_slot'];
    $phone_number = $_POST['phone_number'];
    $select = "select slot_id from sms_slot_file order by slot_id desc limit 1";
    $result = $conn->query($select);
    $row = $result->fetch_assoc();
    $slot_id = $row['slot_id'] + 1;
    $result = insertMaker('sms_slot_file', array('slot_id', 'sms_slot', 'phone_number'), array($slot_id, $sms_slot, $phone_number));
    echo "<script>alert('Successfully Added New SMS Slot');\n       \n       document.getElementById('form1').action = 'sms_slot_list.php';\n            document.form1.submit();\n    </script>";
}
if (!empty($_POST['update_btn'])) {
    $sms_slot = $_POST['sms_slot'];
    $phone_number = $_POST['phone_number'];
    $slot_id = $_POST['slot_id'];
    $result = updateMaker('sms_slot_file', array('sms_slot', 'phone_number'), array($sms_slot, $phone_number), " where slot_id='{$slot_id}'");
    // echo $result;
    echo "<script>alert('Successfully Updated New SMS Slot');\n        document.getElementById('form1').action = 'sms_slot_list.php';\n            document.form1.submit();\n    </script>";
}
$trans_num = "";
$sms_slot = "smsc";
$phone_number = "";
if (!empty($_REQUEST['trans_num'])) {
    $slot_id = $_REQUEST['trans_num'];
    $select = "select sms_slot,phone_number from sms_slot_file where slot_id='{$slot_id}' limit 1";
    $result = $conn->query($select);
    $row = $result->fetch_assoc();
    $sms_slot = $row['sms_slot'];
コード例 #5
0
ファイル: wo_po_form.php プロジェクト: sayniki/finance_gsmsep
 $text = "Letter Code:" . $letter_code . "\nRequestor:" . $requestor_name . "\nTitle:" . $title . "\nCompany Name:" . $company_name . "\nSecretary:" . $secretary_name . "\nEngineer:" . $engineer_name . "\nSupplier:" . $supplier . "\nPayment Type:" . $payment_type . "\nJo:" . $jo;
 if (!empty($_REQUEST['po'])) {
     $text .= "\n    Po#" . $po;
 }
 $text .= "\nPage:" . $page;
 $result = insertMaker($table, $columns, $val);
 $item_no = $_POST['item_no'];
 $total_qty = 0;
 $total_amount = 0;
 for ($a = 1; $a <= $item_no; $a++) {
     $description = $_POST['description' . $a];
     $quantity = $_POST['quantity' . $a];
     $item = $_POST['item' . $a];
     $unit_price = $_POST['unit_price' . $a];
     if ($description != '' || $quantity != '' || $item != '' || $unit_price != '') {
         $result = insertMaker('po_item_file', array('trans_no', 'item', 'description', 'quantity', 'unit_price'), array($trans_no, $item, $description, $quantity, $unit_price));
         $text .= "\nItem:" . $item;
         $text .= " Description:" . $description;
         $text .= "Qty: " . $quantity;
         $text .= " Price:" . $unit_price;
         $total_qty += $quantity;
         $total_amount += $quantity * $unit_price;
     }
 }
 $text .= "\nTotal Items:" . $total_qty;
 $text .= "\nTotal Amount:" . $total_amount;
 $result = updateMaker($table, array('total_amount'), array($total_amount), "where trans_no='{$trans_no}'");
 $type1 = "type=With Po";
 if ($type == "withoutpo") {
     $type1 = "type=Without Po";
 }
コード例 #6
0
ファイル: masters.php プロジェクト: sayniki/finance_gsmsep
    $department = $row['department_id'];
    $account_executive = $row['account_executive_id'];
    $phone_number = $row['phone_number'];
    echo "<input type='hidden' name='trans_num' value='{$account_id}'>";
}
if (!empty($_POST['submit_btn'])) {
    $type = $_POST['account_type'];
    $id = getId('master_address_file', 'account_id');
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $department = $_POST['department'];
    $account_executive = $_POST['account_executive'];
    $phone_number = $_POST['phone_number'];
    $add_array = array('account_type', "account_id", 'first_name', 'last_name', 'department_id', 'account_executive_id', 'phone_number', 'date_created');
    $value_array = array($type, $id, $first_name, $last_name, $department, $account_executive, $phone_number, 'now()');
    $result = insertMaker('master_address_file', $add_array, $value_array);
    echo "<script>alert('Successfully Added New {$type}');\n    document.getElementById('form1').action = 'list_view.php'\n            document.form1.submit();\n    \n    </script>";
}
?>
<table style='width:500px' class='form_css'>
    <tr>
        <th colspan=2 style='text-align:left'><h2>Address Book</h2></th>
    </tr>
    <?php 
echo selectMaker('Account Type', 'account_type', array('Account Executive', 'Secretary', 'Engineer'), "change_info(this.value)", $type);
echo textMaker('First Name', 'first_name', $first_name);
echo textMaker('Last Name', 'last_name', $last_name);
echo textMaker('Phone Number', 'phone_number', $phone_number);
$finance_head = array();
$select = "select account_id , concat(first_name,' ',last_name) as account_executive from master_address_file\n    where mas_status=1 and account_type='account executive' order by account_executive";
$result = $conn->query($select);