本文整理汇总了PHP中Supplier::runQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::runQuery方法的具体用法?PHP Supplier::runQuery怎么用?PHP Supplier::runQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::runQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Supplier
<?php
include_once 'dbconfig.php';
if (!$user->is_loggedin()) {
$user->redirect('index.php');
}
$supplier_code = $_SESSION['user_session'];
$stmt = $DB_con->prepare("SELECT * FROM suppliers WHERE supplier_code=:supplier_code");
$stmt->execute(array(":supplier_code" => $supplier_code));
$userRow = $stmt->fetch(PDO::FETCH_ASSOC);
include_once 'class.suppliers.php';
$supplier = new Supplier();
$code = $userRow['supplier_code'];
$sql = "SELECT * FROM `suppliers` WHERE supplier_code = {$code}";
$getdata = $supplier->runQuery($sql);
$getdata->execute();
if (!empty($code)) {
if ($getdata->rowCount() > 0) {
while ($row = $getdata->FETCH(PDO::FETCH_ASSOC)) {
$name = $row['f_name'] . " " . $row['l_name'];
$addr = $row['address_1'];
$mobile = $row['mobile_no'];
$email = $row['e_mail'];
}
}
}
if (isset($_POST['sendmsg'])) {
$selectservice = $_POST['selectservice'];
$amount = $_POST['amount'];
$qty = $_POST['qty'];
$category = $_POST['category'];
示例2: trim
$nic = trim($_POST['nic']);
$iCheck = trim($_POST['iCheck']);
$email = trim($_POST['uemail']);
$address_1 = trim($_POST['address_1']);
$mobile = trim($_POST['mobile']);
$estate = trim($_POST['estate']);
$estate_name = trim($_POST['estate_name']);
$reg_no = trim($_POST['reg_no']);
$size_of_estate = trim($_POST['size_of_estate']);
$estate_address = trim($_POST['estate_address']);
$bankn = trim($_POST['bankn']);
$branch = trim($_POST['branch']);
$account = trim($_POST['account']);
$bankacc = trim($_POST['bankacc']);
$editor = $row['id'];
$stmt = $supplier->runQuery("SELECT * FROM suppliers WHERE supplier_code=:sup_code");
$stmt->execute(array(":sup_code" => $scode));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($stmt->rowCount() > 0) {
$msg = '<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4> <i class="icon fa fa-check"></i> Sorry!</h4>
supplier allready exists , Please Try another one.
</div>';
// $msg = "
// <div class='alert alert-error'>
// <button class='close' data-dismiss='alert'>×</button>
// <strong>Sorry !</strong> email allready exists , Please Try another one
// </div>
// ";
} else {
示例3: myTotalSupplyOf6Months
function myTotalSupplyOf6Months($code)
{
//to get total supply for perticular supplier in LAST 6 months
$resarr = array();
$curyear = substr($formateddate, 0, 4);
$curmonth = substr($formateddate, 5, 7);
$lstrunningmonth = substr($formateddate, 5, 7);
for ($i = 1; $i < 7; $i++) {
$lstrunningmonth = $curmonth - $i;
$m = $curmonth - $i;
if ($lstrunningmonth == "0") {
$curyear = $curyear - 1;
$m = 12 + ($curmonth - $i);
}
if ($lstrunningmonth < 0) {
$m = 12 + ($curmonth - $i);
}
if (strlen($m) == 1) {
$m = "0" . $m;
}
$startday = $curyear . "-" . $m . "-01";
$enddate = $curyear . "-" . $m . "-31";
$condition = "SELECT *FROM daily_supply WHERE supplier_code='" . $code . "' AND date BETWEEN '" . $startday . "' AND '" . $enddate . "'";
$getdata = Supplier::runQuery($sql);
$getdata->execute();
$total = 0;
if ($getdata->rowCount() > 0) {
while ($row = $getdata->FETCH(PDO::FETCH_ASSOC)) {
$total = $total + $row['approved_kgs'];
}
$resarr[$i - 1] = $total;
} else {
$resarr[$i - 1] = 0;
}
}
return $resarr;
}