コード例 #1
0
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'];
    $phone_number = $row['phone_number'];
    echo "<input type='hidden' id='slot_id' name='slot_id' value='{$slot_id}'>";
}
コード例 #2
0
ファイル: wo_po_form.php プロジェクト: sayniki/finance_gsmsep
     $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";
 }
 $trans_num = $trans_no;
 if ($status != 'Save' && $status != 'pending') {
     // $text=urlencode($text);
     send_text($text, $phone_number);
     //    echo $response;
     echo "<br>Trans_num" . $trans_num . " " . $trans_no;
     $trans_no = "";
     $trans_num = "";
     $number_code = "";
     echo "<script>alert('Successfull Transaction');</script>";
 }
コード例 #3
0
ファイル: master_department.php プロジェクト: sayniki/finance
<?php

include 'page_header.php';
echo "<form name=form1 id=form1 method=post>";
if (!empty($_POST['submit_btn'])) {
    $department = $_POST['department'];
    $result = insertMaker('master_department_file', array('department'), array($department));
    echo "<script>alert('Successfully Added New Department');\n       \n       document.getElementById('form1').action = 'department_list.php';\n            document.form1.submit();\n    </script>";
}
if (!empty($_POST['update_btn'])) {
    $department = $_POST['department'];
    $department_id = $_POST['department_id'];
    $result = updateMaker('master_department_file', array('department'), array($department), " where department_id='{$department_id}'");
    // echo $result;
    echo "<script>alert('Successfully Updated New Department');\n        document.getElementById('form1').action = 'department_list.php';\n            document.form1.submit();\n    </script>";
}
$trans_num = "";
$department = "";
if (!empty($_REQUEST['trans_num'])) {
    $department_id = $_REQUEST['trans_num'];
    $select = "select department from master_department_file where department_id='{$department_id}' limit 1";
    $result = $conn->query($select);
    $row = $result->fetch_assoc();
    $department = $row['department'];
    echo "<input type='hidden' id='department_id' name='department_id' value='{$department_id}'>";
}
?>

<table style='width:400px' class='form_css'>
    <tr>
        <th style='text-align:left'><h2>Department</h2></th>
コード例 #4
0
ファイル: wo_po_form.php プロジェクト: sayniki/test
 $letter_code = get_letter_code($number_code);
 $columns = array('requestor', 'title', 'company_name', 'secretary', 'supplier', 'payment_type', 'status', 'jo', 'po', 'engineer', 'page');
 $val = array($requestor, $title, $company_name, $secretary, $supplier, $payment_type, $status, $jo, $po, $engineer, $page);
 $result = updateMaker($table, $columns, $val, "where trans_no='{$trans_num}'");
 //$result=insertMaker($table,$columns,$val);
 $item_no = $_POST['item_no'];
 for ($a = 1; $a <= $item_no; $a++) {
     $item = $_POST['item' . $a];
     $unit_price = $_POST['unit_price' . $a];
     $description = $_POST['description' . $a];
     $quantity = $_POST['quantity' . $a];
     if (empty($_POST['id' . $a])) {
         $result = insertMaker('po_item_file', array('trans_no', 'item', 'description', 'quantity', 'unit_price'), array($trans_num, $item, $description, $quantity, $unit_price));
     } else {
         $id = $_POST['id' . $a];
         $result = updateMaker('po_item_file', array('item', 'description', 'quantity', 'unit_price'), array($item, $description, $quantity, $unit_price), "where id='{$id}' and trans_no='{$trans_num}' ");
     }
     $type1 = "type=1";
     if ($type == "withoutpo") {
         $type1 = "";
     }
     echo "<script>alert('Successfull Transaction');";
     if ($status != 'Save') {
         $text = "Letter Code:" . $letter_code . "\n           Requestor:" . $requestor . "\n           Title:" . $title . "\n           Company Name:" . $company_name . "\n           Secretary:" . $secretary . "\n           Engineer:" . $engineer . "\n           Supplier:" . $supplier . "\n           Payment Type:" . $payment_type . "\n            Jo:" . $jo . "\n            Po#" . $po . "\n            Page:" . $page;
         $select = "select phone_number from master_address_file where account_type='Account Executive' and mas_status=1 and account_id='{$requestor}' limit 1";
         $result = $conn->query($select);
         $row = $result->fetch_assoc();
         $response = file_get_contents("http://127.0.0.1:13013/cgi-bin/sendsms?user=sms-app&pass=app125&text={$text}&to=" . $row['phone_number']);
         echo "document.getElementById('form1').action='view_data.php?" . $type1 . "';";
     }
     echo "document.form1.submit();\n               </script>";
コード例 #5
0
ファイル: masters.php プロジェクト: sayniki/finance_gsmsep
//$addType=$_REQUEST['add_type'];
//$title=get_title($addType);
echo "<form name=form1 id=form1 method=post>";
$trans_no = "";
if (!empty($_POST['update_btn'])) {
    $account_id = $_REQUEST['trans_num'];
    $type = $_POST['account_type'];
    $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', 'first_name', 'last_name', 'department_id', 'account_executive_id', 'phone_number', 'date_created');
    $value_array = array($type, $first_name, $last_name, $department, $account_executive, $phone_number, 'now()');
    //   $result= updateMaker('po_item_file',array('item','description','quantity','unit_price'),array($item,$description,$quantity,$unit_price), "where id='$id' and trans_no='$trans_num' ");
    $result = updateMaker('master_address_file', $add_array, $value_array, "where account_id='{$account_id}'");
    echo "<script>alert('Successfully Update {$type}');\n    document.getElementById('form1').action = 'list_view.php'\n            document.form1.submit();\n                                             \n    </script>";
}
$type = "";
$first_name = "";
$last_name = "";
$department = "";
$account_executive = "";
$phone_number = "";
$account_id = "";
if (!empty($_REQUEST['trans_num'])) {
    $account_id = $_REQUEST['trans_num'];
    $select = "select * from master_address_file where account_id='{$account_id}' limit 1";
    $result = $conn->query($select);
    $row = $result->fetch_assoc();
    $type = $row['account_type'];