本文整理汇总了PHP中is_chauffeur函数的典型用法代码示例。如果您正苦于以下问题:PHP is_chauffeur函数的具体用法?PHP is_chauffeur怎么用?PHP is_chauffeur使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_chauffeur函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: choisir_chauffeur
public function choisir_chauffeur()
{
global $connection;
$query = "SELECT DISTINCT ";
$query .= "pseudo ";
$query .= "FROM courses ";
if (is_chauffeur()) {
$query .= "WHERE chauffeur ='{$_SESSION['nom']}' ";
}
$query .= "ORDER BY pseudo DESC ";
}
示例2: confirm_logged_in
<?php
require_once '../includes/initialize.php';
confirm_logged_in();
if (is_chauffeur()) {
redirect_to('manage_program.php');
}
?>
<?php
if (isset($_GET["url"])) {
$url = $_GET["url"];
} else {
$url = "mylinks.php";
}
$errors = array();
$missing = array();
$missing_Categ = array();
if (isset($_POST['submit_category'])) {
$expected = array("category_group");
$required_fields = array("category_group");
// require(LIB_PATH . DS . 'validation_functions_2.php');
foreach ($_POST as $key => $value) {
$temp = is_array($value) ? $value : trim($value);
if (empty($temp) && in_array($key, $required_fields)) {
$missing_Categ[] = $key;
${$key} = '';
} elseif (in_array($key, $expected)) {
${$key} = mysql_prep($temp);
示例3: get_output_panel_program
function get_output_panel_program($string_date = 'now')
{
$date_unix = strtotime($string_date);
$day_no = day_eng_no(strftime("%A", $date_unix));
$date_formatted = strftime("%d %b %Y", $date_unix);
$day_name_french = day_fr($day_no);
$date_sql = strftime("%Y-%m-%d", $date_unix);
$full_date_formatted = $day_name_french . " " . $date_formatted;
$Dif = count_prog_by_date($date_sql) - count_modele_by_day($day_no);
$glyph_ok = "<span class='glyphicon glyphicon-ok'style='color:red;' aria-hidden='true'></span>";
$count_valid = " <span class='badge'>" . "{$glyph_ok} " . count_prog_by_date_validated_chauffeur($date_sql) . "</span> ";
$count_prog = " <span class='badge'>" . count_prog_by_date($date_sql) . "</span>";
if (!is_chauffeur()) {
if ($Dif == 0) {
$count_mod = "";
} else {
$count_mod = "<span class='badge'>" . "M " . count_modele_by_day($day_no) . "</span> ";
}
} else {
$count_mod = "";
}
$output = "";
if ($string_date == "now") {
$text = "Aujourdhui ";
} elseif ($string_date == "yesterday") {
$text = "Hier ";
} elseif ($string_date == "tomorrow") {
$text = "demain ";
} elseif ($string_date == "2 day ago") {
$text = "{$string_date}";
} else {
$text = "{$string_date}";
}
//$output.="<div class='row'>" ;
//$output.="<div class='col-md-3 '>" ;
if (isset($_GET["validation_chauffeur"])) {
$valid_chauffeur = $_GET["validation_chauffeur"];
if ($valid_chauffeur == 1) {
$color = "success";
} elseif ($valid_chauffeur == 2) {
$color = "danger";
} elseif ($valid_chauffeur == 0) {
$color = "info";
} else {
$color = "primary";
}
} else {
$valid_chauffeur = 3;
$color = "primary";
}
$output .= "<div class='panel panel-{$color}'>";
//<!-- Default panel contents -->
$output .= "<div class='panel-heading text-center'>";
$output .= "<h3 class='panel-title text-center'>{$count_mod}{$text} {$count_prog}{$count_valid}</h3>";
$output .= "</div>";
$output .= output_program_day($string_date);
$output .= "</div>";
// $output.="</div>" ;
// $output.="</div>" ;
return $output;
}
示例4: htmlentities
<div class="col-sm-9">
<select class="form-control" name="chauffeur" id="chauffeur" >
<option value=
"<?php
echo htmlentities($modele['chauffeur'], ENT_COMPAT, 'utf-8');
?>
">
<?php
echo htmlentities($modele['chauffeur'], ENT_COMPAT, 'utf-8');
?>
</option>
<?php
if (!is_chauffeur()) {
?>
<?php
if (isset($chauffeur)) {
echo selection_chauffeurs($chauffeur);
} else {
echo selection_chauffeurs();
}
?>
<?php
}
?>
</select>
</div></div>
示例5:
</ul>
</div>
</nav>
</div>
<?php
// echo "<p class='text-left'><small>".$complete_date."</small></p>";
?>
<?php
if (isset($_SESSION['user_type_id']) && (is_manager() || is_admin() || is_chauffeur())) {
?>
<?php
if ($layout_context == "admin") {
?>
<ol class="breadcrumb">
<li
<?php
if (isset($javascript) && $javascript == "admin_course") {
echo "class=\"active \"";
}
示例6: find_course_by_id
function find_course_by_id($course_id)
{
global $connection;
$safe_course_id = mysqli_real_escape_string($connection, $course_id);
$query = "SELECT * ";
$query .= "FROM courses ";
$query .= "WHERE id = {$safe_course_id} ";
$restrict = is_chauffeur();
if ($restrict) {
$query .= " AND chauffeur ='{$_SESSION['nom']}' ";
}
$query .= "LIMIT 1";
$course_set = mysqli_query($connection, $query);
confirm_query($course_set);
if ($course = mysqli_fetch_assoc($course_set)) {
return $course;
} else {
return null;
}
}
示例7: output_clients_select_list_all
function output_clients_select_list_all()
{
global $connection;
$table_name = 'clients';
$liste_rank = true;
if (is_chauffeur()) {
$liste_restrictive = true;
} else {
$liste_restrictive = false;
}
$output = "";
// $output_form = "";
$query = "SELECT ";
$query .= " * ";
$query .= "FROM {$table_name} ";
if ($liste_restrictive) {
$query .= "WHERE liste_restrictive = 1 ";
}
$query .= "ORDER BY liste_rank ASC, liste_restrictive DESC, pseudo ASC ";
$return_query_set = mysqli_query($connection, $query);
confirm_query($return_query_set);
while ($return_query = mysqli_fetch_assoc($return_query_set)) {
$data = htmlentities($return_query['pseudo'], ENT_COMPAT, 'utf-8');
$web_view = htmlentities($return_query['web_view'], ENT_COMPAT, 'utf-8');
$output .= "<option value= '{$data}'>";
$output .= $web_view;
$output .= "</option>";
}
mysqli_free_result($return_query);
return $output;
}
示例8: redirect_to
// admin ID was missing or invalid or
// admin couldn't be found in database
$_SESSION["message"] = "La course a déjà été validé. Veuillez la reactiver puis l'annuller.";
redirect_to($url);
}
$chauffeur_existing = $program["chauffeur"];
$chauffeur = $_SESSION["nom"];
// todo error report kevin course on another page
validate_chauffeur_by_name($chauffeur);
if (!empty($errors)) {
$_SESSION["errors"] = $errors;
redirect_to($url);
}
$safe_chauffeur = mysql_prep($chauffeur);
$validated_chauffeur = $program["validated_chauffeur"];
if (is_chauffeur() && ($validated_chauffeur == 1 || $validated_chauffeur == 2)) {
if ($_SESSION['nom'] !== $chauffeur_existing) {
$_SESSION["message"] = " La course a déjà été validé ou Annullé par " . htmlentities($chauffeur_existing, ENT_COMPAT, 'utf-8');
redirect_to($url);
}
}
if (empty($errors)) {
$id = $program["id"];
if ($validated_chauffeur == 1 || $validated_chauffeur == 0) {
$id_valid = 2;
} else {
$id_valid = 0;
}
$query = "UPDATE programmed_courses SET" . " ";
$query .= "validated_chauffeur = {$id_valid}, ";
$query .= "chauffeur = '{$safe_chauffeur}' ";
示例9: redirect_to
$_SESSION["message"] = "Program Course does not exist in database.";
// redirect_to("manage_program.php");
redirect_to($url);
}
$chauffeur_existing = $program["chauffeur"];
$chauffeur = $_SESSION["nom"];
// todo error report kevin course on another page
validate_chauffeur_by_name($chauffeur);
if (!empty($errors)) {
$_SESSION["errors"] = $errors;
// redirect_to("manage_program.php");
redirect_to($url);
}
$safe_chauffeur = mysql_prep($chauffeur);
$validated_chauffeur = $program["validated_chauffeur"];
if (is_chauffeur() && $validated_chauffeur == 1) {
if ($_SESSION['nom'] !== $chauffeur_existing) {
$_SESSION["message"] = " La course a déjà été validé par " . htmlentities($chauffeur_existing, ENT_COMPAT, 'utf-8');
// redirect_to("manage_program.php");
redirect_to($url);
}
}
if (empty($errors)) {
$id = $program["id"];
if ($validated_chauffeur == 1) {
$id_valid = 0;
} else {
$id_valid = 1;
}
$query = "UPDATE programmed_courses SET" . " ";
$query .= "validated_chauffeur = {$id_valid}, ";
示例10: output_historical_program_details
function output_historical_program_details()
{
$output = "";
$program_set = find_all_programmed_courses();
$output .= "<div class='table-responsive'>";
$output .= "<table class='table table-striped table-bordered table-hover table-condensed'>";
$output .= "<tr>";
// $output .= "<td class='text-center alert-danger'>Jour</td>"; //Heure
// $output .= "<th class='text-center' style='vertical-align:middle;'>Année</th>";
// $output .= "<th class='text-center' style='vertical-align:middle;'>Mois</th>";
// $output .= "<th class='text-center' style='vertical-align:middle;'>Semaine</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Validation</th>";
if (!is_chauffeur()) {
$output .= "<th class='text-center' style='vertical-align:middle;'>Val Mgr</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Val Final</th>";
}
$output .= "<th class='text-center' style='vertical-align:middle;'>ID</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Date</th>";
// $output .= "<th class='text-center' style='vertical-align:middle;'>Client ID</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Pseudo</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Heure</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Chauffeur</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>départ</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Arrivée</th>";
if (!is_chauffeur()) {
$output .= "<th class='text-center' style='vertical-align:middle;'>Prix Course</th>";
}
$output .= "<th class='text-center' style='vertical-align:middle;'>Pseudo Autres</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Nom Patient</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Bon_no</th>";
$output .= "<th class='text-center' style='vertical-align:middle;'>Action</th>";
$output .= "</tr>";
$prev_year = "";
$prev_mth = "";
$prev_wk = "";
while ($program = mysqli_fetch_assoc($program_set)) {
foreach ($program as $key => $val) {
${$key} = htmlentities(trim($val), ENT_COMPAT, 'utf-8');
}
$today_date_sql = strftime("%Y-%m-%d", time());
$tomorrow_date_sql = strftime("%Y-%m-%d", strtotime("tomorrow"));
$yesterday_date_sql = strftime("%Y-%m-%d", strtotime("yesterday"));
// var_dump($date["course_date"]);
// var_dump($tomorrow_date_sql);
// var_dump($yesterday_date_sql);
if ($today_date_sql == $program["course_date"]) {
$color = "success";
} elseif ($tomorrow_date_sql == $program["course_date"]) {
$color = "warning";
} elseif ($yesterday_date_sql == $program["course_date"]) {
$color = "danger";
} else {
$color = "";
}
$href = $_SERVER['PHP_SELF'];
// $query_string=$_SERVER['QUERY_STRING'];
// $query_string=str_replace("str_time","str_time_old",$query_string);
// var_dump($query_string);
if (isset($course_date)) {
$href .= "?str_time=" . urlencode($course_date);
$href .= "&historical_course_date=" . urlencode($course_date);
$href .= "&submit=" . urlencode("historical_details");
}
$output .= "<tr class='{$color}'>";
// if (isset($year)) {
// if($year==$prev_year){
// $output.="<td></td>";
// } else {
// $output .="<td class='text-center' style='vertical-align: middle;'>";
// $output .="";
// $output .=$year;
// $output .="</td>";
// $prev_year=$year;
// }
//
// } else {$output.="<td></td>";}
//
// if (isset($monthname)) {
// if($monthname==$prev_mth){
// $output.="<td></td>";
// } else {
// $output .= "<td class='text-center' style='vertical-align: middle;'>";
// $output .= $monthname;
// $output .= "</td>";
// $prev_mth=$monthname;
// }
//
// }else {$output.="<td></td>";}
//
// if (isset($week)) {
// if($week==$prev_wk){
// $output.="<td></td>";
// } else {
// $output .= "<td class='text-center' style='vertical-align: middle;'>";
// $output .= "";
// $output .= $week;
// $output .= "</td>";
// }
// $prev_wk=$week;
// }else {$output.="<td></td>";}
//.........这里部分代码省略.........