Example #1
0
        $cart_id = $row['cart_id'];
        $grocery_id = $row['grocery_id'];
        $grocery_qty = $row['grocery_qty'];
        $cart_qty = $row['cart_qty'];
        $sales_cost = $row['grocery_cost'];
        //decrease stock
        $grocery_qty = $grocery_qty - $cart_qty;
        $form_data = array('grocery_qty' => $grocery_qty);
        dbRowUpdate('tblgrocery', $form_data, " WHERE grocery_id =  {$grocery_id}");
        //$cal_comm = round((  $sales_cost  ( 3 /100 ) ) * $cart_qty);
        //insert into sales
        $form_data = array('grocery_id' => $grocery_id, 'sales_qty' => $cart_qty, 'ref_no' => $ref_no, 'email' => $session_cus_email, 'sales_cost' => $sales_cost);
        //inser
        dbRowInsert('tblsales', $form_data);
        //delete from the tblcart
        dbRowDelete('tblcart', " WHERE cart_id = {$cart_id}");
    }
    redirect_to("account.php");
}
//
require_once 'includes/template-top.php';
?>

                     <!-- row -->
                       <div class="row">
                       <h1 class="title">My Cart</h1>
                       
                       <table id="table1">
                       <thead>
                       <tr style="background:#000;">
                       <th>#</th>
Example #2
0
<?php

require_once '../includes/connection.php';
require_once '../includes/session.php';
//confirm user has logged in
Confirm_admin_session();
if (isset($_GET['deleteID'])) {
    $deleteId = $_GET['deleteID'];
    //delete
    dbRowDelete('tblcustomers', " WHERE customer_id = {$deleteId}");
    redirect_to("customers.php");
}
require_once 'includes/template-top.php';
?>

                       <!-- row -->
                       <div class="row">
                       <h1 class="title">Registered Customers' Report</h1>
                       <input type="button" value="Print Report" onclick="javascript:printDiv('print')" />
                       <div id="print" style="padding-top:10px;">
                       <table id="table1">
                       <thead>
                       <tr style="background:#222;">
                       <th>#</th>
                       <th>Reg. Date</th>
                       <th>Customer Names</th>
                       <th>Email</th>
                       <th>Phone No</th>
                       <th>Action</th>
                       </tr>
                       </thead>
Example #3
0
    redirect_to("index.php?submitted=true");
} elseif (isset($_GET['done'])) {
    $action = mysql_prep($_GET['done']);
    $id = mysql_prep($_GET['id']);
    if ($action == 1) {
        //done
        $form_data = array('todo_status' => 'Done');
    } else {
        //not done
        $form_data = array('todo_status' => 'Not Done');
    }
    dbRowUpdate('todo_list', $form_data, " WHERE id = {$id} ");
    redirect_to("index.php");
} elseif (isset($_GET['deleteid'])) {
    $id = mysql_prep($_GET['deleteid']);
    dbRowDelete('todo_list', " WHERE id = {$id} ");
    redirect_to("index.php");
} elseif (isset($_POST['edit_btn'])) {
    $id = mysql_prep($_POST['id']);
    $todo = mysql_prep($_POST['todo_edit']);
    $form_data = array('todo_item' => $todo);
    dbRowUpdate('todo_list', $form_data, " WHERE id = {$id} ");
    redirect_to("index.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>ToDo</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
Example #4
0
if (isset($_GET['paymentID'])) {
    //
    $selected_paymentID = $_GET['paymentID'];
    $verify = $_GET['verify'];
    if ($verify == "no") {
        $update_verify = "verified";
    } else {
        $update_verify = "no";
    }
    $form_data = array('verified' => $update_verify);
    //update
    dbRowUpdate('tblpayments', $form_data, " WHERE payment_id = {$selected_paymentID}");
} elseif (isset($_GET['deleteID'])) {
    $deleteId = $_GET['deleteID'];
    //delete
    dbRowDelete('tblpayments', " WHERE payment_id = {$deleteId}");
    redirect_to("index.php");
}
require_once 'includes/template-top.php';
?>


                       
                      
                       <!-- row -->
                       <div class="row">
                        <h1 class="title">Customers' Payments</h1>
                       <table id="table1">
                       <thead>
                       <tr style="background:#000;">
                       <th>#</th>
function deleteEmployer($employerId)
{
    try {
        $status = 'fail';
        $id = $employerId;
        $tableName = "department_info";
        $where_clause = "where id = {$id} ";
        $result = dbRowDelete($tableName, $where_clause);
        if ($result >= 1) {
            $status = "ok";
        }
    } catch (Exception $ex) {
        echo "<script>\n      var msg = '<b>* Error Occured While Updating Employer ...</b>';\n      showWarning(msg);\n    </script>";
        echo "fail";
    }
    echo $status;
}
Example #6
0
                move_uploaded_file($_FILES["file1"]["tmp_name"], "../images/grocery/" . $newfilename);
                $img_dir = "images/grocery/" . $newfilename;
                //form data
                $form_data = array('grocery_img' => $img_dir);
                //update
                dbRowUpdate('tblgrocery', $form_data, " WHERE grocery_id = {$selectedID}");
            }
        }
    }
} elseif (isset($_GET['deleteID'])) {
    $selectedID = $_GET['deleteID'];
    $image_url = '../' . $_GET['image_url'];
    //remove image
    unlink("{$image_url}");
    //delete grocerys
    dbRowDelete('tblgrocery', " WHERE grocery_id = {$selectedID}");
    redirect_to("groceries.php");
} else {
    redirect_to("groceries.php");
}
//fetch
$query = "SELECT * FROM tblgrocery WHERE grocery_id = {$selectedID}";
$result = mysql_query($query, $connection);
confirm_query($result);
while ($row = mysql_fetch_array($result)) {
    $groceryname = $row['grocery_name'];
    $grocerycost = $row['grocery_cost'];
    $groceryimg = $row['grocery_img'];
    $groceryqty = $row['grocery_qty'];
}
require_once 'includes/template-top.php';
     $res = dbRowInsert($_POST['t_name'], $data, $con);
     if (!$res) {
         die("failed");
     }
     exit;
 }
 if (strcmp($op, 'update') == 0) {
     $res = dbRowupdate($_POST['t_name'], $data, $_POST['clause'], $con);
     if (!$res) {
         die("failed");
     }
     exit;
 }
 if (strcmp($op, 'delete') == 0) {
     echo "in delete";
     $res = dbRowDelete($_POST['t_name'], $_POST['clause'], $con);
     if (!$res) {
         die("failed");
     }
     exit;
 }
 if (strcmp($op, 'select') == 0) {
     $res = dbRowSelect($_POST['t_name'], $_POST['fields'], $_POST['clause'], $con);
     if (!$res) {
         die("failed");
     } else {
         while ($r[] = mysqli_fetch_array($res)) {
         }
         echo json_encode($r);
     }
     exit;
Example #8
0
    $phone = mysql_prep($_POST['phone']);
    //form data
    $form_data = array('store_name' => $storename, 'store_location' => $location, 'store_phone' => $phone);
    //update
    dbRowUpdate('tblstore', $form_data, " WHERE store_id = {$selectedID} ");
} elseif (isset($_GET['resetID'])) {
    $selectedID = $_GET['resetID'];
    $password = md5("1234");
    //form data
    $form_data = array('store_password' => $password);
    //update
    dbRowUpdate('tblstore', $form_data, " WHERE store_id = {$selectedID} ");
} elseif (isset($_GET['deleteID'])) {
    $selectedID = $_GET['deleteID'];
    //delete
    dbRowDelete('tblstore', " WHERE store_id = {$selectedID} ");
    redirect_to("stores.php");
} else {
    redirect_to("stores.php");
}
//fetch
$query = "SELECT * FROM tblstore WHERE store_id = {$selectedID}   ";
$result = mysql_query($query, $connection);
confirm_query($result);
while ($row = mysql_fetch_array($result)) {
    $storename = $row['store_name'];
    $location = $row['store_location'];
    $phone = $row['store_phone'];
}
require_once 'includes/template-top.php';
?>