本文整理汇总了PHP中Connector::prepare方法的典型用法代码示例。如果您正苦于以下问题:PHP Connector::prepare方法的具体用法?PHP Connector::prepare怎么用?PHP Connector::prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connector
的用法示例。
在下文中一共展示了Connector::prepare方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Insert
function Insert()
{
include './connector.php';
$con = new Connector();
$NameOfLogin = $_SESSION['NameOfLogin'];
$SurnameOfLogin = $_SESSION['SurnameOfLogin'];
$ProgrammThatUserClick = $_SESSION['ProgrammThatUserClick'];
$res = $con->prepare("INSERT INTO history VALUES('{$NameOfLogin}', '{$SurnameOfLogin}', '{$ProgrammThatUserClick}','null')");
}
示例2: getGroups
public function getGroups($aDatabase, $aPrefix, $aUser, $aPass, $aThrow)
{
$Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow);
if ($Connector != null) {
// only test if we can read the user table
$TestQuery = $Connector->prepare('SELECT user_id FROM `' . $aPrefix . 'users` LIMIT 1');
$Connector->run($TestQuery, $aThrow);
}
return null;
}
示例3: getGroups
public function getGroups($aDatabase, $aPrefix, $aUser, $aPass, $aThrow)
{
$Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow);
if ($Connector != null) {
$GroupQuery = $Connector->prepare('SELECT id, title FROM `' . $aPrefix . 'usergroups` ORDER BY title');
$Groups = array();
$GroupQuery->loop(function ($Group) use(&$Groups) {
array_push($Groups, array('id' => $Group['id'], 'name' => $Group['title']));
}, $aThrow);
return $Groups;
}
return null;
}
示例4: getGroups
public function getGroups($aDatabase, $aPrefix, $aUser, $aPass, $aThrow)
{
$Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow);
if ($Connector != null) {
$OptionsQuery = $Connector->prepare('SELECT option_value FROM `' . $aPrefix . 'options` WHERE option_name = "' . $aPrefix . 'user_roles" LIMIT 1');
$Option = $OptionsQuery->fetchFirst($aThrow);
$Groups = array();
$Roles = unserialize($Option['option_value']);
if (is_array($Roles)) {
foreach ($Roles as $Role => $Options) {
array_push($Groups, array('id' => strtolower($Role), 'name' => $Role));
}
}
return $Groups;
}
return null;
}
示例5: Connector
}
$result = $con->prepare("SELECT * FROM nameoftext");
while ($r = $result->fetch()) {
$ArrayOfTitlesInGreek[$IndexArrayOfTilesInGreek] = $r['Name'];
$IndexArrayOfTilesInGreek++;
}
$ArrayOfTitles[0] = $NameAndSurnameOfEmployee[1];
$ArrayOfTitles[1] = $NameAndSurnameOfEmployee[0];
// echo "ArrayOfTitles array"."<br>";
// print_r($ArrayOfTitles);
// echo "<br>ArrayOfTitlesInGreek array<br>";
// print_r($ArrayOfTitlesInGreek);
$_SESSION["SurnameOfEmployee"] = $ArrayOfTitles[1];
$_SESSION["NameOfEmployee"] = $ArrayOfTitles[0];
$con = new Connector();
$result = $con->prepare("SELECT * FROM kataxorisiuser WHERE Surname=? AND Name=?", array($ArrayOfTitles[1], $ArrayOfTitles[0]));
$doc = "<html>" . "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <link href=\"css/Table_Style.css\" rel=\"stylesheet\">\n <link href=\"css/Input_Buttons.css\" rel=\"stylesheet\">" . "<body>" . "<table border='1' style='border-collapse: collapse'>" . "<tr>" . "<th colspan='2'>" . "<font size='4'>Στοιχεία Υπαλλήλου</font>" . "</th>" . "<th>" . "<font size='4'>Φωτογραφία υπαλλήλου</font>" . "</th>" . "</tr>" . "<tr>" . "<td>" . "<strong>Επώνυμο</strong>" . "</td>" . "<td>" . $ArrayOfTitles[1] . "</td>" . "<td style='text-align:center; vertical-align:middle;' rowspan=" . count($ArrayOfTitles) . ">" . "<img align='center' src='http://{$ServerName}/Kataxorisis/{$UploaddFileToShow}' width='132' height='174' style='display:inline-block;'/>" . "</td>" . "</tr>" . "<tr>" . "<td>" . "<strong>Όνoμα</strong>" . "</td>" . "<td>" . $ArrayOfTitles[0] . "</td>" . "</tr>";
while ($row1 = $result->fetch()) {
for ($i = 3; $i <= 25; $i++) {
$doc = $doc . "<tr>" . "<td>" . "<strong>" . $ArrayOfTitlesInGreek[$CheckIfIndex] . "</strong>" . "</td>" . "<td>" . $row1[$ArrayOfTitles[$i]] . "</td>" . "</tr>";
$CheckIfIndex++;
}
}
$doc = $doc . "</table></body></html>";
echo $doc;
if (isset($_POST['PrintInfoOfEmployee'])) {
// header("Locaton: StoixeiaEpilegmenouIpalilouWithoutCSS.php");
// header("Content-Type: application/vnd.msword charset='utf-8'");
// header("Expires: 0");//no-cache
// header("Cache-Control: must-revalidate, post-check=0, pre-check=0");//no-cache
// header("content-disposition: attachment;filename=".$_SESSION["SurnameOfEmployee"]." ".$_SESSION["NameOfEmployee"].".doc");
示例6: Connector
<?php
include "{$_SERVER['DOCUMENT_ROOT']}/kataxorisis/connector.php";
$username = $_POST['username'];
$password = $_POST['password'];
var_dump($_POST);
$con = new Connector();
$res = $con->prepare('select * from login where UserName=? and Password=?', array($username, $password));
if ($row = $res->fetch()) {
session_start();
$_SESSION['username'] = $username;
$_SESSION['password'] = $password;
//header("Location:$_SERVER[DOCUMENT_ROOT]/kataxorisis/"); exit;
echo "<script>window.location.replace('http://192.168.1.184/kataxorisis');</script>";
} else {
echo "wrong";
echo "<script>window.location.replace('http://192.168.1.184/kataxorisis/Login/index.php?error=1');</script>";
//header("Location:$_SERVER[DOCUMENT_ROOT]/kataxorisis/Login?error=1");exit;
}
示例7: array
$NewBranch = null;
$TeamBlood = null;
$UploadFile = null;
$UploadFilePNG = null;
$NewFileUpload = null;
$DetectEncodeOfUploadFile = null;
$PathToSaveForegroundImage = null;
$PathToSaveBackgroundImage = null;
$UploadFileΤοToShow = null;
$LengthTeamBlood = 0;
$SurnameOfEmployee = $_SESSION["SurnameOfEmployee"];
$NameOfEmployee = $_SESSION["NameOfEmployee"];
// echo "Surname Of Employee is: ".$SurnameOfEmployee."<br>Name Of Employee is: ".$NameOfEmployee."<br><br>";
$UploadFileSplit = array();
$UploadFileΤοToShowArray = array();
$res = $con->prepare("SELECT PathOfEmployeeImageToSave, PathOfEmployeeImageToShow FROM kataxorisiuser WHERE Surname='{$SurnameOfEmployee}' AND Name='{$NameOfEmployee}'");
$row = $res->fetch();
$TeamBlood = $_SESSION['TeamBlood'];
$UploadFile = $row['PathOfEmployeeImageToSave'];
$TypeOfFile = $_SESSION['TypeOfFile'];
$UploadFileΤοToShow = $row['PathOfEmployeeImageToShow'];
// echo "UploadFile is: ".$UploadFile."<br>";
// echo "UploadFile to show is: ".$UploadFileΤοToShow."<br>";
// print_r($UploadFileSplit);
// echo "<br>";
//echo strlen($TeamBlood);
$BranchArray = array();
// echo $SurnameOfEmployee." ".$NameOfEmployee."<br>";
$OmadaAimatosGrammaKaiSimbolo = array();
if (mb_detect_encoding($TeamBlood) == 'UTF-8') {
$LengthTeamBlood = mb_strlen($TeamBlood);
示例8: die
echo '<span style="color:red;text-align:center;">Το πεδίο Τηλέφωνο πρέπει να έχει μήκος 10</span>' . "<br>";
}
if ($CTB->PhoneStirngFailed == true) {
echo '<span style="color:red;text-align:center;">Το πεδίο Τηλέφωνο πρέπει να είναι συμβολοσειρά</span>' . "<br>";
}
if ($CTB->EmailFailed == true) {
echo '<span style="color:red;text-align:center;">Εισάγετε ένα έγκυρο email</span>' . "<br>";
}
echo "<br>";
die("<strong><font size='4'>Η εφαρμογή δεν μπορεί να συνεχίσει την λειτουργία της λόγω των παραπάνω προβλημάτων πουπαρουσιάστηκαν!Παρακαλώ για την σωστή λειτουργία της εφαρμογής πατήσε το κουμπί 'Επαναφώρτωση σελίδας' και επαναλάβεται την διαδικασία καταχώρησης</font></strong>");
} else {
if ($Situation == "Μετάταξη" && $Node != "Τίποτα" && $Service != "Τίποτα") {
$IndexOfNodeArray = 0;
for ($i = 0; $i < $LengthOfServicesArray; $i++) {
if ($Service == $ServicesArray[$i]) {
$res = $con->prepare("SELECT * FROM services WHERE value=?", array($Service));
while ($row = $res->fetch()) {
$id = $row['id'];
$res = $con->prepare("SELECT services.value, select_service_table.value FROM services INNER JOIN select_service_table ON " . "services.id=select_service_table.id AND services.id='{$id}';");
while ($row1 = $res->fetch()) {
$WhichTable = $row1['value'];
$res = $con->prepare("SELECT * from " . $WhichTable);
while ($row2 = $res->fetch()) {
$NodeArray[$IndexOfNodeArray] = $row2['value'];
//Create array with Node for each Service users select
$IndexOfNodeArray++;
}
}
}
}
}
示例9: CheckUser
<?php
echo 'add Fields<br>';
include './connector.php';
session_start();
//Εμφάνηση ώρα Ελλάδος
date_default_timezone_set('Europe/Athens');
$Connector = new Connector();
$NumOfFieldsToAdd = 0;
$NameOfLogin = $_SESSION['NameOfLogin'];
$SurnameOfLogin = $_SESSION['SurnameOfLogin'];
$ProgrammThatUserClick = $_SESSION['ProgrammThatUserClick'];
$description = "Ο/Η χρήστης (ον) " . $_SESSION['NameOfLogin'] . " (επ) " . $_SESSION['SurnameOfLogin'] . " εκτέλεσε την λειτουργία " . "" . $_SESSION['AntistoixoKoumpi'] . " με την οποία πρόσθεσε " . $NumOfFieldsToAdd . " πεδία. . Η " . $_SESSION['AntistoixoKoumpi'] . " πραγματοποιήθηκε στις " . "" . ConvertEnglishDaysAndMonthToGreek(date("l jS \\of F Y")) . " και ώρα " . date("h:i:s") . "" . ". Ο χρήστης με (ον) " . $_SESSION['NameOfLogin'] . " και (επ) " . $_SESSION['SurnameOfLogin'] . " χαρακτιρίζεται ως " . CheckUser() . ".";
$res = $Connector->prepare("INSERT INTO history VALUES('{$NameOfLogin}', '{$SurnameOfLogin}', '{$ProgrammThatUserClick}','{$description}')");
function CheckUser()
{
$User = null;
if ($_SESSION['Permissions'] == 0) {
$User = "user";
}
if ($_SESSION['Permissions'] == 1) {
$User = "admin";
}
if ($_SESSION['Permissions'] == 2) {
$User = "topuser";
}
return $User;
}
function ConvertEnglishDaysAndMonthToGreek($date)
{
$DaysOfWeekInGeekArray = array(0 => "Δευτέρα", 1 => "Τρίτη", 2 => "Τετάρτη", 3 => "Πέμπτη", 4 => "Παρασκευή", 5 => "Σάββατο", 6 => "Κυριακή");
示例10: array
<td>
<input type="text" id="SurnameOfEmployeeText" name="SurnameOfEmployeeText" required>
</td>
</tr>
</table>
<br />
<label id="LabelToAsk" name="LabelToAsk"><strong>Επιλέξτε ενα ή περισσότερα πεδία απο τα παρακάτω, ώστε να μπορείτε να το επεξεργαστείτε.</strong></label>
<?php
$TitleInGreek = null;
$IndexArrayOfTiles = 0;
$i = 0;
$ArrayOfTitles = array();
$FieldsForChanging = array();
include 'connector.php';
$con = new Connector();
$result = $con->prepare("SHOW COLUMNS FROM kataxorisiuser");
while ($r = $result->fetch()) {
if ($i >= 3) {
$ArrayOfTitles[$IndexArrayOfTiles] = $r['Field'];
$IndexArrayOfTiles++;
}
$i++;
}
$i = 0;
$f = 0;
echo "<br>";
$result = $con->prepare("SELECT * FROM nameoftext");
while ($r = $result->fetch()) {
$TitleInGreek = $r['Name'];
?>
<input type="checkbox" id="<?php
示例11: Connector
<?php
include 'connector.php';
$con = new Connector();
$Value = null;
$doc_body = null;
$SinolikesThesis = null;
$SinolikesThesisINT = 0;
$PiasmenesThesis = null;
$PiasmenesThesisINT = 0;
$ServiceSelectionTable = null;
$EleutheresThesis = null;
$EleutheresThesisINT = 0;
$ServiceSelection = $_COOKIE['ServiceSelection'];
//Set ServiceSelection from user choise
echo $ServiceSelection;
$result = $con->prepare("SELECT value FROM services");
//Return rows with Services
while ($row = $result->fetch()) {
if ($ServiceSelection == $row['value']) {
$result1 = $con->prepare("SELECT services.value, select_service_table.value FROM services INNER JOIN select_service_table ON services.id=select_service_table.id " . "AND services.value='{$ServiceSelection}';");
while ($row1 = $result1->fetch()) {
$ServiceSelectionTable = $row1['value'];
}
$result2 = $con->prepare("SELECT * FROM " . $ServiceSelectionTable);
$doc_body = "<html>\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n <body>\n <table border='1'>\n <tr>\n <th colspan='4'>\n <div align='cente'>\n <h3><strong>" . $ServiceSelection . "</strong></h3>\n </div>\n </th>\n </tr>\n <tr>\n <td>\n <strong>Κλαδος</strong>\n </td>\n <td width='140' align='center'>\n <strong>Σύνολο οργανικών θέσεων</strong>\n </td>\n <td width='125' align='center'>\n <strong>Δεσμευμένες θέσεις</strong>\n </td>\n <td align='center'>\n <strong>Κενές θέσεις</strong>\n </td>\n </tr>";
while ($row2 = $result2->fetch()) {
$Value = $row2['value'];
$SinolikesThesis = $row2['sinolikes_thesis'];
$PiasmenesThesis = $row2['piasmenes_thesis'];
$EleutheresThesis = $row2['eleutheres_thesis'];
$doc_body = $doc_body . "<tr>" . "<td>" . $Value . "</td>" . "<td align='center'>" . $SinolikesThesis . "</td>" . "<td align='center'>" . $PiasmenesThesis . "</td>" . "<td align='center'>" . $EleutheresThesis . "</td>" . "</tr>";
示例12: imagepng
$RelativePathToSaveImage = "images/" . $NameForFolderOfEmployee . "/";
if ($_FILES['file']['type'] != "image/png") {
if (file_exists($RelativePathToSaveImage . $CreateFileName)) {
echo '<span style="color:red;text-align:center;">Το αρχείο που προσπαθείτε να ανεβάσετε υπάρχει ήδη στον φάκελο images </span>' . "<br>";
die;
exit;
}
move_uploaded_file($_FILES['file']['tmp_name'], $RelativePathToSaveImage . $CreateFileName);
imagepng(imagecreatefromstring(file_get_contents($RelativePathToSaveImage . $CreateFileName)), $RelativePathToSaveImage . ConvertEncoding($temp[0]) . ".png");
//$_SESSION['UploadFile'] = $RelativePathToSaveImage.ConvertEncoding($temp[0]).".png";
$UploadFile = $RelativePathToSaveImage . ConvertEncoding($temp[0]) . ".png";
$UploadFileToShow = str_replace(' ', '%20', "images/" . $_POST['SurnameOfEmployeeText'] . "/" . $_FILES['file']['name']);
// echo str_replace(' ', '%20', "images/".$_POST['SurnameOfEmployeeText']."/".$_FILES['file']['name']);
$UploadFileΤοToShow = $RelativePathToSaveImage . $_FILES['file']['name'];
// echo $UploadFile."<br>";
$res = $con->prepare("UPDATE kataxorisiuser SET PathOfEmployeeImageToSave=?, UploadImageTF=?," . " PathOfEmployeeImageToShow=? " . "WHERE Surname=? AND Name=?", array("images/" . $_POST['SurnameOfEmployeeText'] . "/" . $temp[0] . ".png", 'true', $UploadFileToShow, $SurnameOfEmployeeArray[0], $SurnameOfEmployeeArray[1]));
} else {
if (file_exists($RelativePathToSaveImage . $CreateFileName)) {
echo '<span style="color:red;text-align:center;">Το αρχείο που προσπαθείτε να ανεβάσετε υπάρχει ήδη στον φάκελο images </span>' . "<br>";
exit;
}
move_uploaded_file($_FILES['file']['tmp_name'], $RelativePathToSaveImage . $CreateFileName);
//$_SESSION['UploadFile'] =$RelativePathToSaveImage.ConvertEncoding($temp[0]).".png";
$UploadFile = $RelativePathToSaveImage . $CreateFileName;
$UploadFileToShow = str_replace(' ', '%20', "images/" . $_POST['SurnameOfEmployeeText'] . "/" . $_FILES['file']['name']);
// echo str_replace(' ', '%20', "images/".$_POST['SurnameOfEmployeeText']."/".$_FILES['file']['name'])."<br>";
$UploadFileΤοToShow = $RelativePathToSaveImage . $_FILES['file']['name'];
// echo $UploadFile."<br>";
$res = $con->prepare("UPDATE kataxorisiuser SET PathOfEmployeeImageToSave=?, UploadImageTF=?," . " PathOfEmployeeImageToShow=? " . "WHERE Surname=? AND Name=?", array("images/" . $_POST['SurnameOfEmployeeText'] . "/" . $temp[0] . ".png", 'true', $UploadFileToShow, $SurnameOfEmployeeArray[0], $SurnameOfEmployeeArray[1]));
if ($res) {
echo "<strong><font size='4'>Επιτυχής καταχώρηση υπαλλήλου!!</font></strong>" . "<br>";
示例13: foreach
foreach ($_POST['check_list'] as $selected) {
// echo $selected."</br>";
$SplitSelected = explode("_", $selected);
$_SESSION['PediaGiaAllagi' . $i] = $SplitSelected[1];
$i++;
// echo $SplitSelected[0]."<br>";
if ($SplitSelected[0] == "Situation") {
?>
<tr>
<td>
<label id="Κατάσταση" name="Κατάσταση"><strong>Κατάσταση</strong></label>
</td>
<td>
<select name="Situation" id="Situation">
<?php
$res = $con->prepare("SELECT * FROM selection_option");
while ($r = $res->fetch()) {
if ($r['Situation'] == "null") {
continue;
}
?>
<option value="<?php
echo $r['Situation'];
?>
"><?php
echo $r['Situation'];
?>
</option>
<?php
}
?>
示例14: getUsers
public function getUsers($aDatabase, $aPrefix, $aUser, $aPass, $aThrow)
{
$Connector = new Connector(SQL_HOST, $aDatabase, $aUser, $aPass, $aThrow);
if ($Connector != null) {
$Users = array();
$UserQuery = $Connector->prepare('SELECT userID, username FROM `wcf' . $aPrefix . '_user` ' . 'ORDER BY username');
$UserQuery->loop(function ($User) use(&$Users) {
array_push($Users, array('id' => $User['userID'], 'name' => $User['username']));
}, $aThrow);
return $Users;
}
return null;
}
示例15: Connector
}
$result = $con->prepare("SELECT * FROM nameoftext");
while ($r = $result->fetch()) {
$ArrayOfTitlesInGreek[$IndexArrayOfTilesInGreek] = $r['Name'];
$IndexArrayOfTilesInGreek++;
}
$ArrayOfTitles[0] = $NameAndSurnameOfEmployee[1];
$ArrayOfTitles[1] = $NameAndSurnameOfEmployee[0];
// echo "ArrayOfTitles array"."<br>";
// print_r($ArrayOfTitles);
// echo "<br>ArrayOfTitlesInGreek array<br>";
// print_r($ArrayOfTitlesInGreek);
$_SESSION["SurnameOfEmployee"] = $ArrayOfTitles[1];
$_SESSION["NameOfEmployee"] = $ArrayOfTitles[0];
$con = new Connector();
$result = $con->prepare("SELECT * FROM kataxorisiuser WHERE Surname=? AND Name=?", array($ArrayOfTitles[1], $ArrayOfTitles[0]));
$doc = "<html>" . "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">" . "<body>" . "<table border='1' style='border-collapse: collapse'>" . "<tr>" . "<th colspan='2'>" . "<font size='4'>Στοιχεία Υπαλλήλου</font>" . "</th>" . "<th>" . "<font size='4'>Φωτογραφία υπαλλήλου</font>" . "</th>" . "</tr>" . "<tr>" . "<td>" . "<strong>Επώνυμο</strong>" . "</td>" . "<td>" . $ArrayOfTitles[1] . "</td>" . "<td style='text-align:center; vertical-align:middle;' rowspan=" . count($ArrayOfTitles) . ">" . "<img align='center' src='http://{$ServerName}/Kataxorisis/{$UploaddFileToShow}' width='132' height='174' style='display:inline-block;'/>" . "</td>" . "</tr>" . "<tr>" . "<td>" . "<strong>Όνoμα</strong>" . "</td>" . "<td>" . $ArrayOfTitles[0] . "</td>" . "</tr>";
while ($row1 = $result->fetch()) {
for ($i = 3; $i <= 25; $i++) {
$doc = $doc . "<tr>" . "<td>" . "<strong>" . $ArrayOfTitlesInGreek[$CheckIfIndex] . "</strong>" . "</td>" . "<td>" . $row1[$ArrayOfTitles[$i]] . "</td>" . "</tr>";
$CheckIfIndex++;
}
}
$doc = $doc . "</table></body></html>";
echo $doc;
header("Content-Type: application/vnd.msword charset='utf-8'");
header("Expires: 0");
//no-cache
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
//no-cache
header("content-disposition: attachment;filename=" . $_SESSION["SurnameOfEmployee"] . " " . $_SESSION["NameOfEmployee"] . ".doc");
开发者ID:GeorgeKaraxalios,项目名称:Management-of-Employees,代码行数:31,代码来源:StoixeiaEpilegmenouIpalilouWithoutCSS.php