当前位置: 首页>>代码示例>>PHP>>正文


PHP start_db函数代码示例

本文整理汇总了PHP中start_db函数的典型用法代码示例。如果您正苦于以下问题:PHP start_db函数的具体用法?PHP start_db怎么用?PHP start_db使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了start_db函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     //Include database connection details
     require_once 'system-db.php';
     start_db();
     initialise_db();
 }
开发者ID:prodigyworks,项目名称:Service-Call,代码行数:7,代码来源:sqlprocesstoarray.php

示例2: __construct

 function __construct($orientation, $metric, $size, $datefrom)
 {
     $dynamicY = 0;
     $this->dateFrom = $datefrom;
     start_db();
     parent::__construct($orientation, $metric, $size);
     $this->SetAutoPageBreak(true, 30);
     $this->AddPage();
     try {
         $startdate = convertStringToDate($this->dateFrom);
         $sql = "SELECT A.name, C.amount,\n\t\t\t\t\t    (\n\t\t\t\t\t   \t\tSELECT SUM(B.amount) * D.retailprice\n\t\t\t\t\t   \t\tFROM {$_SESSION['DB_PREFIX']}eventtransaction B \n\t\t\t\t\t   \t\tINNER JOIN {$_SESSION['DB_PREFIX']}product D\n\t\t\t\t\t   \t\tON D.id = B.productid \n\t\t\t\t\t   \t\tWHERE B.eventid = A.id \n\t\t\t\t\t   \t\tAND B.eventdate = '{$startdate}' \n\t\t\t\t\t   \t\tAND B.type = 'S'\n\t\t\t\t\t    ) AS sold\n\t\t\t\t\t    FROM {$_SESSION['DB_PREFIX']}event A \n\t\t\t\t\t    LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}eventforecast C\n\t\t\t\t\t    ON C.eventid = A.id\n\t\t\t\t\t    AND C.forecastdate = '{$startdate}' \n\t\t\t\t\t\tORDER BY A.name";
         $result = mysql_query($sql);
         if ($result) {
             while ($member = mysql_fetch_assoc($result)) {
                 $sold = $member['sold'] != "" ? $member['sold'] : 0;
                 $line = array("Event" => $member['name'], "Takings" => "£ " . number_format($sold, 2), "Expected" => "£ " . number_format($member['amount'], 2));
                 $this->addLine($this->GetY(), $line, 6.2);
             }
         } else {
             logError($sql . " - " . mysql_error());
         }
     } catch (Exception $e) {
         logError($e->getMessage());
     }
 }
开发者ID:prodigyworks,项目名称:schokolat,代码行数:25,代码来源:reportdailycostslibdata.php

示例3: __construct

 function __construct()
 {
     require_once 'system-db.php';
     start_db();
     initialise_db();
     if (isset($_GET['from'])) {
         $this->fromrow = $_GET['from'];
     }
     if (isset($_GET['to'])) {
         $this->torow = $_GET['to'];
     }
     if (isset($_GET['direction'])) {
         $this->sortdirection = $_GET['direction'];
     }
     if (isset($_GET['sort'])) {
         $this->sortby = $_GET['sort'];
     }
     $this->pagesize = $this->torow - $this->fromrow;
 }
开发者ID:prodigyworks,项目名称:schokolat,代码行数:19,代码来源:crud.php

示例4: start_db

<?php

//Include database connection details
require_once 'system-db.php';
start_db();
logout();
header("location: system-login.php");
开发者ID:prodigyworks,项目名称:Service-Call,代码行数:7,代码来源:system-logout.php

示例5: __construct

 function __construct($orientation, $metric, $size)
 {
     parent::__construct($orientation, $metric, $size);
     require_once 'system-db.php';
     start_db();
     initialise_db();
     $this->B = 0;
     $this->I = 0;
     $this->U = 0;
     $this->HREF = '';
     $this->fontlist = array('arial', 'times', 'courier', 'helvetica', 'symbol');
     $this->issetfont = false;
     $this->issetcolor = false;
 }
开发者ID:prodigyworks,项目名称:FA,代码行数:14,代码来源:pdfreport.php

示例6: __construct

 function __construct($orientation, $metric, $size, $id)
 {
     $dynamicY = 0;
     start_db();
     parent::__construct($orientation, $metric, $size);
     try {
         $sql = "SELECT \n\t\t\t\t\t\t A.*, \n\t\t\t\t\t\t DATE_FORMAT(A.matchdate, '%d/%m/%Y') AS matchdate,\n\t\t\t\t\t\t B.name AS refereename, C.name AS submittedteamname, D.name AS oppositionname, \n\t\t\t\t\t\t E.name AS agegroupname, E.age\n\t\t\t\t\t\t FROM  {$_SESSION['DB_PREFIX']}matchdetails A\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}referee B\n\t\t\t\t\t\t ON B.id = A.refereeid\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}team C\n\t\t\t\t\t\t ON C.id = A.teamid\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}team D\n\t\t\t\t\t\t ON D.id = A.oppositionid\n\t\t\t\t\t\t LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}teamagegroup E\n\t\t\t\t\t\t ON E.id = A.agegroupid\n\t\t\t\t\t\t WHERE A.id = {$id}";
         $result = mysql_query($sql);
         if ($result) {
             while ($this->headermember = mysql_fetch_assoc($result)) {
                 $dynamicY = $this->newPage() + 2;
                 $sql = "SELECT A.*, B.firstname, B.lastname, B.registrationnumber\n\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}matchplayerdetails A \n\t\t\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}player B \n\t\t\t\t\t\t\t\tON B.id = A.playerid\n\t\t\t\t\t\t\t\tWHERE A.matchid = {$id} \n\t\t\t\t\t\t\t\tORDER BY B.firstname, B.lastname";
                 $itemresult = mysql_query($sql);
                 $index = 1;
                 if ($itemresult) {
                     while ($itemmember = mysql_fetch_assoc($itemresult)) {
                         $this->addText(15, $dynamicY, $index++, 10, 4, '');
                         $this->addText(25, $dynamicY, $itemmember['firstname'] . " " . $itemmember['lastname'], 10, 4, '');
                         $dynamicY = $this->addText(110, $dynamicY, $itemmember['registrationnumber'], 10, 4, '');
                     }
                 } else {
                     logError($qry . " - " . mysql_error());
                 }
                 $dynamicY = 153 + $this->margin;
                 $dynamicY = $this->addText(15, $dynamicY, "CLUB / MANAGERS REPORT (Including the FA Respect Codes of Conduct)", 10, 4, 'B') + 2;
                 if ($this->headermember['age'] < 12) {
                     $this->addText(15, $dynamicY, "Referee", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratereferee']), 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Opponent players", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['rateplayers']), 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Opponent Management", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratemanagement']), 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Opponent Spectators", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratespectators']), 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Pitch Size", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratepitchsize']), 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Pitch Condition", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratepitchcondition']), 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Goal Size", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['rategoalsize']), 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Changing Rooms", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->getRateDescription($this->headermember['ratechangingrooms']), 10, 4, '') + 1;
                 } else {
                     $this->addText(15, $dynamicY, "Did the pitch have the required barriers, cones and markings", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->headermember['requiredbarriers'] == 1 ? "Yes" : "No", 10, 4, '') + 1;
                     $this->addText(15, $dynamicY, "Was the pitch size/condition, goals and changing rooms adequate", 10, 4, '');
                     $dynamicY = $this->addText(150, $dynamicY, $this->headermember['pitchsize'] == 1 ? "Yes" : "No", 10, 4, '') + 1;
                 }
                 $this->addText(15, $dynamicY, "Did your opponent players, management and spectators comply with the Codes", 10, 4, '');
                 $dynamicY = $this->addText(150, $dynamicY, $this->headermember['complycodes'] == 1 ? "Yes" : "No", 10, 4, '') + 1;
                 $this->addText(15, $dynamicY, "Did you check your opponent players ID cards", 10, 4, '');
                 $dynamicY = $this->addText(150, $dynamicY, $this->headermember['opponentids'] == 1 ? "Yes" : "No", 10, 4, '') + 1;
                 $this->Line(15, $dynamicY, 195, $dynamicY);
                 $dynamicY = $this->addText(15, $dynamicY + 2, "REFEREE SECTION", 10, 4, 'B') + 3;
                 $this->addText(15, $dynamicY, "Referee", 10, 4, 'B');
                 $this->addText(45, $dynamicY, $this->headermember['referee'], 10, 4, '');
                 if ($this->headermember['refereescore'] > 0) {
                     $this->addText(105, $dynamicY, "Appointed by League", 10, 4, 'B');
                     $dynamicY = $this->addText(145, $dynamicY, $this->headermember['refappointedbyleague'] == "Y" ? "Yes" : "No", 10, 4, '') + 3;
                     $this->addText(15, $dynamicY, "Marks out of 100", 10, 4, 'B');
                     $dynamicY = $this->addText(45, $dynamicY, $this->headermember['refereescore'], 10, 4, '') + 3;
                     $this->addText(15, $dynamicY, "Remarks", 10, 4, 'B');
                     $dynamicY = $this->addText(45, $dynamicY, $this->headermember['refereeremarks'], 10, 4, '', 150) + 2;
                 } else {
                     $dynamicY = $this->addText(145, $dynamicY, " ", 10, 4, '');
                 }
                 $this->Line(15, $dynamicY, 195, $dynamicY);
                 $dynamicY = $this->addText(15, $dynamicY + 3, "SIGNED", 10, 4, 'B') + 2;
                 $this->DynamicImage($this->headermember['imageid'], 15, $dynamicY);
             }
         } else {
             logError($sql . " - " . mysql_error());
         }
     } catch (Exception $e) {
         logError($e->getMessage());
     }
     $this->AliasNbPages();
 }
开发者ID:prodigyworks,项目名称:Coast-Guard,代码行数:78,代码来源:matchcardreport.php

示例7: __construct

 function __construct($orientation, $metric, $size, $id)
 {
     $dynamicY = 0;
     start_db();
     parent::__construct($orientation, $metric, $size);
     try {
         $sql = "SELECT A.*, DATE_FORMAT(A.invoicedate, '%d/%m/%Y') AS invoicedate,\n\t\t\t\t\t\tD.name AS customername, D.accountnumber, D.invoiceaddress1, D.invoiceaddress2, D.invoiceaddress3, \n\t\t\t\t\t\tD.invoicecity, D.invoicepostcode, B.deliveryaddress1, B.deliveryaddress2, \n\t\t\t\t\t\tB.deliveryaddress3, B.deliverycity, B.deliverypostcode, D.firstname, B.lastname,\n\t\t\t\t\t\tE.fullname AS takenbyname\n\t\t\t\t\t    FROM  {$_SESSION['DB_PREFIX']}invoice A\n\t\t\t\t\t    INNER JOIN  {$_SESSION['DB_PREFIX']}customerclientsite B\n\t\t\t\t\t    ON B.id = A.siteid\n\t\t\t\t\t    INNER JOIN  {$_SESSION['DB_PREFIX']}customerclient C\n\t\t\t\t\t    ON C.id = B.clientid\n\t\t\t\t\t    INNER JOIN  {$_SESSION['DB_PREFIX']}customer D\n\t\t\t\t\t    ON D.id = C.customerid\n\t\t\t\t\t    LEFT OUTER JOIN  {$_SESSION['DB_PREFIX']}members E\n\t\t\t\t\t    ON E.member_id = A.takenbyid\n\t\t\t\t\t    WHERE A.id = {$id}\n\t\t\t\t\t    ORDER BY A.id DESC";
         $result = mysql_query($sql);
         if ($result) {
             while ($this->headermember = mysql_fetch_assoc($result)) {
                 $shipping = $this->headermember['deliverycharge'];
                 $discount = $this->headermember['discount'];
                 $total = 0;
                 $dynamicY = $this->newPage() + 7;
                 $sql = "SELECT A.*, B.productcode, B.description\n\t\t\t\t\t\t\t\tFROM {$_SESSION['DB_PREFIX']}invoiceitem A \n\t\t\t\t\t\t\t\tINNER JOIN {$_SESSION['DB_PREFIX']}product B \n\t\t\t\t\t\t\t\tON B.id = A.productid \n\t\t\t\t\t\t\t\tWHERE A.invoiceid = {$id} \n\t\t\t\t\t\t\t\tORDER BY A.sequence";
                 $itemresult = mysql_query($sql);
                 if ($itemresult) {
                     while ($itemmember = mysql_fetch_assoc($itemresult)) {
                         $line = array("Quantity" => $itemmember['quantity'], "Code" => $itemmember['productcode'], "Description" => $itemmember['description'], "Price Each" => number_format($itemmember['priceeach'], 2), "Line Total" => number_format($itemmember['priceeach'] * $itemmember['quantity'], 2));
                         $size = $this->addLine($dynamicY, $line);
                         $dynamicY += $size + 1;
                         if ($dynamicY > 225) {
                             $dynamicY = $this->newPage();
                             $dynamicY = 102;
                         }
                         $total = $total + $itemmember['priceeach'] * $itemmember['quantity'];
                         $totalvat += $itemmember['vat'];
                     }
                 } else {
                     logError($qry . " - " . mysql_error());
                 }
                 $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Goods Net:", "Line Total" => number_format($total, 2));
                 $size = $this->addLine(236, $line);
                 $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Delivery:", "Line Total" => number_format($shipping, 2));
                 $size = $this->addLine(242, $line);
                 $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Invoice Net:", "Line Total" => number_format($shipping + $total, 2));
                 $size = $this->addLine(248, $line);
                 $totalvat += $shipping * (getSiteConfigData()->vatrate / 100);
                 $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "VAT:", "Line Total" => number_format($totalvat, 2));
                 $size = $this->addLine(254, $line);
                 $line = array("Quantity" => " ", "Code" => " ", "Description" => " ", "Price Each" => "Total:", "Line Total" => number_format($totalvat + $shipping + $total - $discount, 2));
                 $size = $this->addLine(260, $line);
                 $this->addText(162, 265, "Pounds Sterling", 6, 3);
             }
         } else {
             logError($sql . " - " . mysql_error());
         }
     } catch (Exception $e) {
         logError($e->getMessage());
     }
     $this->AliasNbPages();
 }
开发者ID:prodigyworks,项目名称:Coast-Guard,代码行数:52,代码来源:invoicereportlib.php

示例8: logout

function logout()
{
    start_db();
    if (isAuthenticated()) {
        $qry = "UPDATE {$_SESSION['DB_PREFIX']}loginaudit SET " . "timeoff = NOW(), metamodifieddate = NOW(), metamodifieduserid = " . getLoggedOnMemberID() . " " . "WHERE id = " . $_SESSION['SESS_LOGIN_AUDIT'] . "";
        $result = mysql_query($qry);
    }
    session_unset();
    $_SESSION['ROLES'][] = 'PUBLIC';
}
开发者ID:prodigyworks,项目名称:schokolat,代码行数:10,代码来源:system-db.php

示例9: initialise

 public static function initialise()
 {
     //Start session
     start_db();
     $_SESSION['pagename'] = substr($_SERVER["PHP_SELF"], strripos($_SERVER["PHP_SELF"], "/") + 1);
     if ($_SESSION['pagename'] == "dynamicpage.php") {
         $_SESSION['pagename'] .= "?page=" . $_GET['page'];
     }
     BreadCrumbManager::initialise();
     self::initialiseDB();
     self::initialisePageData();
     BreadCrumbManager::calculate();
 }
开发者ID:prodigyworks,项目名称:Service-Call,代码行数:13,代码来源:system-config.php

示例10: __construct

 function __construct($orientation, $metric, $size, $id)
 {
     global $member;
     global $top;
     parent::__construct($orientation, $metric, $size);
     $this->SetAutoPageBreak(true, 0);
     //Include database connection details
     start_db();
     $margin = 7;
     $sql = "SELECT A.*, " . "DATE_FORMAT(A.creditdate, '%d/%m/%Y') AS creditdate, " . "DATE_FORMAT(A.paymentdate, '%d/%m/%Y') AS paymentdate, " . "DATE_FORMAT(A.createddate, '%d/%m/%Y') AS createddate, " . "DATE_FORMAT(B.datedelivered, '%d/%m/%Y') AS datedelivered, " . "A.deladdress, A.toaddress, B.plaintiff, B.casenumber, B.transcripttype, B.j33number, B.depositamount, " . "D.name AS courtname, D.vatapplicable, D.address, D.fax AS courtfax, D.cellphone AS courtmobile, " . "D.email AS courtemail, D.telephone AS courttelephone, D.contact AS courtcontact, " . "E.name AS provincename, F.name AS terms, G.firstname, G.lastname, G.mobile, G.landline, G.email, G.fax, " . "I.name AS clientcourtname, " . "O.privatebankingdetails, O.bankingdetails, " . "O.address AS officeaddress, O.email AS officeemail, O.telephone, O.contact, O.fax AS officefax, O.name AS officename  " . "FROM {$_SESSION['DB_PREFIX']}invoices A " . "INNER JOIN {$_SESSION['DB_PREFIX']}cases B " . "ON B.id = A.caseid " . "INNER JOIN {$_SESSION['DB_PREFIX']}courts D " . "ON D.id = B.courtid " . "INNER JOIN {$_SESSION['DB_PREFIX']}province E " . "ON E.id = D.provinceid " . "LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}caseterms F " . "ON F.id = A.termsid " . "INNER JOIN {$_SESSION['DB_PREFIX']}members G " . "ON G.member_id = A.contactid " . "LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}courts I " . "ON I.id = B.clientcourtid " . "LEFT OUTER JOIN {$_SESSION['DB_PREFIX']}offices J " . "ON J.id = A.officeid " . "INNER JOIN {$_SESSION['DB_PREFIX']}offices O " . "ON O.id = A.officeid " . "WHERE A.caseid = {$id} " . "ORDER BY B.id";
     $result = mysql_query($sql);
     if ($result) {
         $total = 0;
         $subtotal = 0;
         $shipping = 0;
         $totalvat = 0;
         $depositamount = 0;
         $vatapplicable = "N";
         while ($member = mysql_fetch_assoc($result)) {
             $this->newPage();
             $first = false;
             $y = $top;
             $vatapplicable = $member['vatapplicable'];
             $invoiceid = $member['id'];
             //					$description = $this->stripHTML($member['description']);
             $description = $member['description'];
             if ($member['depositamount'] != null) {
                 $depositamount = $member['depositamount'];
             }
             $sql = "SELECT C.id, C.description, C.qty, C.vat, C.vatrate, C.total, C.unitprice, " . "H.name AS templatename " . "FROM {$_SESSION['DB_PREFIX']}invoiceitems C " . "INNER JOIN {$_SESSION['DB_PREFIX']}invoiceitemtemplates H " . "ON H.id = C.templateid " . "WHERE C.invoiceid = {$invoiceid} " . "ORDER BY C.id";
             $itemresult = mysql_query($sql);
             if ($itemresult) {
                 while ($itemmember = mysql_fetch_assoc($itemresult)) {
                     $line = array("Quantity" => number_format($itemmember['qty'], 0), "Description" => $itemmember['templatename'], "Unit Price" => "R " . number_format($itemmember['unitprice'], 2), "Total" => "R " . number_format($itemmember['total'], 2));
                     $size = $this->addLine($y, $line);
                     $y += $size;
                     if ($y > 235) {
                         $this->newPage();
                         $y = $top;
                     }
                     $subtotal += $itemmember['total'] - $member['vat'];
                     $shipping = $itemmember['shippinghandling'];
                     $totalvat += $itemmember['vat'];
                     $total += $itemmember['total'];
                 }
                 $y += 4;
                 if ($y > 175) {
                     $this->newPage();
                     $y = $top;
                 }
                 $line = array("Quantity" => " ", "Description" => $description, "Unit Price" => " ", "Total" => " ");
                 $size = $this->addLine($y, $line);
                 $y += $size;
                 if ($y > 235) {
                     $this->newPage();
                     $y = $top;
                 }
             } else {
                 logError($sql . " - " . mysql_error());
             }
         }
     } else {
         logError($sql . " - " . mysql_error());
     }
     if ($vatapplicable == "Y") {
         $this->Line(121, 240, 200, 240);
         $this->Line(121, 245, 200, 245);
         $this->Line(121, 250, 200, 250);
     }
     $this->Line(121, 255, 200, 255);
     if ($vatapplicable == "Y") {
         $line = array("Quantity" => " ", "Description" => " ", "Unit Price" => "VAT (" . number_format(getSiteConfigData()->vatrate, 0) . "%)", "Total" => "R " . number_format($totalvat, 2));
         $size = $this->addLine(242, $line);
         $line = array("Quantity" => " ", "Description" => " ", "Unit Price" => "TOTAL", "Total" => "R " . number_format($total, 2));
         $size = $this->addLine(247, $line);
         $line = array("Quantity" => " ", "Description" => " ", "Unit Price" => "DEPOSIT", "Total" => "R " . number_format($depositamount, 2));
         $size = $this->addLine(252, $line);
         $line = array("Quantity" => " ", "Description" => " ", "Unit Price" => "TOTAL DUE", "Total" => "R " . number_format($total - $depositamount, 2));
         $size = $this->addLine(258, $line, 0, 'B');
     } else {
         $line = array("Quantity" => " ", "Description" => " ", "Unit Price" => "TOTAL", "Total" => "R " . number_format($total, 2));
         $size = $this->addLine(258, $line, 0, 'B');
     }
 }
开发者ID:prodigyworks,项目名称:Coast-Guard,代码行数:84,代码来源:creditreportlib.php


注:本文中的start_db函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。