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


PHP getWidth函数代码示例

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


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

示例1: getTemplateSize

function getTemplateSize($type, $width, $height, $type)
{
    global $nativeTeamplateConfig;
    echo $type . ' ' . $width . ' ' . $height . '<br>';
    $teamplateNum = getTemplatePath($type, $width, $height);
    //echo $teamplateNum.' |';
    $size = array('w' => '0', 'h' => '0');
    $config = $nativeTeamplateConfig[$teamplateNum];
    $size['w'] = getWidth($width, $config['minWidth'], $config['padding'], $height, $type);
    //var_dump($config);
    $size['h'] = $height + $config['addHeight'];
    //var_dump($size);
    return $size;
}
开发者ID:yaodayizi,项目名称:test3,代码行数:14,代码来源:create.php

示例2: changeAvatar

function changeAvatar()
{
    $post = isset($_POST) ? $_POST : array();
    $max_width = "500";
    $userId = isset($post['hdn-profile-id']) ? intval($post['hdn-profile-id']) : 0;
    $path = 'images/tmp';
    $valid_formats = array("jpg", "png", "gif", "bmp", "jpeg");
    $name = $_FILES['photoimg']['name'];
    $size = $_FILES['photoimg']['size'];
    if (strlen($name)) {
        list($txt, $ext) = explode(".", $name);
        if (in_array($ext, $valid_formats)) {
            if ($size < 1024 * 1024) {
                $actual_image_name = 'avatar' . '_' . $userId . '.' . $ext;
                $filePath = $path . '/' . $actual_image_name;
                $tmp = $_FILES['photoimg']['tmp_name'];
                if (move_uploaded_file($tmp, $filePath)) {
                    $width = getWidth($filePath);
                    $height = getHeight($filePath);
                    //Scale the image if it is greater than the width set above
                    if ($width > $max_width) {
                        $scale = $max_width / $width;
                        $uploaded = resizeImage($filePath, $width, $height, $scale);
                    } else {
                        $scale = 1;
                        $uploaded = resizeImage($filePath, $width, $height, $scale);
                    }
                    /*$res = saveAvatar(array(
                      'userId' => isset($userId) ? intval($userId) : 0,
                                              'avatar' => isset($actual_image_name) ? $actual_image_name : '',
                      ));*/
                    //mysql_query("UPDATE users SET profile_image='$actual_image_name' WHERE uid='$session_id'");
                    echo "<img id='photo' file-name='" . $actual_image_name . "' class='' src='" . $filePath . '?' . time() . "' class='preview'/>";
                } else {
                    echo "failed";
                }
            } else {
                echo "Image file size max 1 MB";
            }
        } else {
            echo "Invalid file format..";
        }
    } else {
        echo "Please select image..!";
    }
    exit;
}
开发者ID:riteshtandon23,项目名称:WeRHR,代码行数:47,代码来源:profile12.php

示例3: chmod

            chmod($large_image_location, 0777);
            $width = getWidth($large_image_location);
            $height = getHeight($large_image_location);
            //Scale the image if it is greater than the width set above
            if ($width > $max_width) {
                $scale = $max_width / $width;
                $uploaded = resizeImage($large_image_location, $width, $height, $scale);
            } else {
                $scale = 1;
                $uploaded = resizeImage($large_image_location, $width, $height, $scale);
            }
            //Delete the thumbnail file so the user can create a new one
            /*if (file_exists($thumb_image_location)) {
            			unlink($thumb_image_location);
            		}*/
            echo "success|" . str_replace(JPATH_ROOT . '/', JURI::root(), $large_image_location) . "|" . getWidth($large_image_location) . "|" . getHeight($large_image_location);
        }
    } else {
        echo "error|" . $error;
    }
}
########################################################
#	CREATE THE THUMBNAIL							   #
########################################################
if (JRequest::getVar('save_thumb') == "Save Thumbnail") {
    //Get the new coordinates to crop the image.
    $x1 = $_POST["x1"];
    $y1 = $_POST["y1"];
    $x2 = $_POST["x2"];
    $y2 = $_POST["y2"];
    $w = $_POST["w"];
开发者ID:psytronica,项目名称:zygoprofile,代码行数:31,代码来源:avatar_process.php

示例4: number_format

     $pdf->cMargin = $prop['padding'];
     $pdf->SetFont('Arial', 'B', 10);
     $pdf->Cell(getWidth(21, $prop['width']), 6, "Total", 'LBR', 0, 'C', false);
     $pdf->Cell(getWidth(7, $prop['width']), 6, number_format($totals['total']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['jan']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['feb']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['mar']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['apr']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['may']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['jun']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['jul']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['aug']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['sep']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['oct']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['nov']), 'LBR', 0, 'R', false);
     $pdf->Cell(getWidth(6, $prop['width']), 6, number_format($totals['dec']), 'LBR', 0, 'R', false);
     $pdf->cMargin = $_cMargin;
     $pdf->Ln();
     $pdf->Output("monthly_exp.pdf", "D");
 } else {
     if ($_GET['report'] == 'xls') {
         require_once '../includes/Classes/PHPExcel.php';
         $padding = 0.71;
         $objPHPExcel = new PHPExcel();
         $objPHPExcel->getProperties()->setCreator("imranzahid+nexexcel@gmail.com")->setLastModifiedBy("Imran Zahid")->setTitle("Monthly Expenses")->setSubject("Monthly Expenses")->setDescription("Monthly Expenses")->setKeywords("Monthly Expenses")->setCategory("Reports");
         $rtitle = "{$title} ({$startDate} to {$endDate})";
         $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader('&C&18&B' . $rtitle . '&R&U&D');
         $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&C&IPage &P/&N');
         $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
         $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
         $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 1);
开发者ID:kashifnasim,项目名称:nexexcel,代码行数:31,代码来源:monthly_exp.php

示例5: getWidth

<table border="1" align="center" cellpadding="0" cellspacing="0" style=" color:#4c391b;">
	<tr>
		<td align="center" valign="middle"><div id="showpic"><img id = "bigimg" src="<?php 
        echo 'uppics/' . $picarr[0]['picpath'];
        ?>
" width="<?php 
        echo getWidth('uppics/' . $picarr[0]['picpath'], 640, 480);
        ?>
" height="<?php 
        echo getHeight('uppics/' . $picarr[0]['picpath'], 640, 480);
        ?>
" style="cursor:hand;" onclick="lookpic()" /><div style="line-height:25px;">ͼƬÃû³Æ£º&nbsp;<?php 
        echo $picarr[0]['picname'];
        ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ͼƬ¸ñʽ£º<?php 
        echo getWidth('uppics/' . $picarr[0]['picpath']);
        ?>
 * <?php 
        echo getHeight('uppics/' . $picarr[0]['picpath']);
        ?>
&nbsp;&nbsp;</div><div align="left" style="line-height:25px; text-indent:20px;">ͼƬÃèÊö£º&nbsp;<?php 
        echo $picarr[0]['bewrite'];
        ?>
</div></div></td>
	</tr>
	<tr>
		<td height="25" align="center" valign="middle">&nbsp;<?php 
        $albumsql = "select * from tb_album where typename = " . $smallact;
        $num = $conne->getRowsNum($albumsql);
        if ($num == 1) {
            ?>
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:pics.php

示例6: getUebersetzung

</option>
                                <?php 
        }
        ?>
                            </select>
                        </div>
                        <div class="col-sm-offset-4 col-sm-3">
                            <div class="alert alert-info" style="width: auto;">
                                <label class="control-label">
                                    <?php 
        echo getUebersetzung("vorheriger Wert", $sprache, $link);
        ?>
:
                                </label>
                                <?php 
        echo getWidth($style);
        ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <hr>
                    </div>
                <?php 
    }
    ?>

                <div class="row">
                    <div class="col-sm-offset-9 col-sm-3" style="text-align: right;">

                        <button name="submit4" type="submit" class="btn btn-success" id="submit4">
开发者ID:utilo-web-app-development,项目名称:REZERVI,代码行数:31,代码来源:styles.php

示例7: Photo

<form name="photo" enctype="multipart/form-data" action="<?php 
    echo $_SERVER["PHP_SELF"];
    ?>
" method="post">
Photo (jpg o gif) <input type="file" name="image" size="30" /> <input type="submit" name="upload" value="Carica" />
</form>

<?php 
}
//Display error message if there are any
if (isset($error) && strlen($error) > 0) {
    echo "<ul style=\"margin:4px 0px 14px 0px;\"><li><strong>Errore!</strong></li><li>" . $error . "</li></ul>";
}
if (isset($immagineDaUsare) and strlen($immagineDaUsare) > 0 and (!isset($_POST["nStep"]) or $_POST["nStep"] != "3")) {
    // controllo se l'immagine caricata è più piccola della thumb
    $width_caricata = getWidth($immagineDaUsare);
    $height_caricata = getHeight($immagineDaUsare);
    if ($width_caricata <= $thumb_width && $height_caricata <= $thumb_height) {
        $x1_value = 0;
        $y1_value = 0;
        $x2_value = $x1_value + $width_caricata;
        $y2_value = $y1_value + $height_caricata;
        $w_value = $width_caricata;
        $h_value = $height_caricata;
        ?>
			<h2><u>Step <?php 
        print $nStep;
        ?>
</u>: <?php 
        print $creaImg;
        ?>
开发者ID:pnicorelli,项目名称:cms-startkit,代码行数:31,代码来源:upload_image.php

示例8: header

header("Content-Type:text/html;charset=gb2312");
include_once 'conn/conn.php';
include_once 'admin/inc/func.php';
$picpath = $_GET['picpath'];
$smallact = $_GET['smallact'];
$tmppath = substr(strrchr($picpath, '/'), 1);
$psql = "select id,picname,bewrite,upname from tb_photo where picpath = '" . $tmppath . "'";
$parr = $conne->getRowsRst($psql);
?>
<img id = "bigimg" src="<?php 
echo $picpath;
?>
" width="<?php 
echo getWidth($picpath, 640, 480);
?>
" height="<?php 
echo getHeight($picpath, 640, 480);
?>
" style="cursor:hand;" onclick="lookpic()" /><div style="line-height:25px;">ͼƬ���ƣ�&nbsp;<?php 
echo $parr['picname'];
?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ͼƬ��ʽ��<?php 
echo getWidth($picpath);
?>
 * <?php 
echo getHeight($picpath);
?>
&nbsp;&nbsp;</div><div align="left" style="line-height:25px; text-indent:20px;">ͼƬ������&nbsp;<?php 
echo $parr['bewrite'];
?>
</div>
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:showpic.php

示例9: form_file


//.........这里部分代码省略.........
                         $file_type = 1;
                     }
                 }
             }
             //JPG, PNG, GIF 가 아니라면
             if ($file_type == 1) {
                 $this->assigns['error_str'] = "그림파일이 아닙니다.";
                 return;
             }
             //이미지 허용 크기를 벗어남
             if ($userfile_size > $this->settings->max_file * 1048576) {
                 $this->assigns['error_str'] = "파일 사이즈 " . $this->settings->max_file . "MB 이하의 파일만 업로드 할 수 있습니다.";
                 return;
             }
         } else {
             //이미지에 에러가 있음
             $this->assigns['error_str'] = "이미지 데이터 오류가 났습니다. 다시 업로드해 주세요.";
             return;
         }
         //업로드를 변경 했다면
         if (isset($_FILES['file']['name'])) {
             if ($sub_dir == 'media/member/') {
                 $sub_large_image_location = 'media/temp/' . $tmp_filename;
             } else {
                 $minus_base_nm = str_replace(basename($sub_dir), '', $sub_dir);
                 if ($minus_base_nm == 'media/startup/') {
                     $sub_large_image_location = $minus_base_nm . $tmp_filename;
                 } else {
                     $sub_large_image_location = 'media/temp/' . $tmp_filename;
                 }
             }
             $large_image_location = $this->settings->root_path . $sub_large_image_location;
             move_uploaded_file($userfile_tmp, $large_image_location);
             $width = getWidth($large_image_location);
             $height = getHeight($large_image_location);
             if ($width > $max_width) {
                 $scale = $max_width / $width;
                 $uploaded = resizeImage($large_image_location, $width, $height, $scale);
             } else {
                 $scale = 1;
                 $uploaded = resizeImage($large_image_location, $width, $height, $scale);
             }
         }
         //이미지 사이즈가 작으면 선택영역을 최대로 한다.
         $temp_width = getWidth($uploaded);
         $temp_height = getHeight($uploaded);
         if ($thumb_height == $thumb_width) {
             if ($temp_width < $thumb_width) {
                 $resize_width = $temp_width;
             }
             if ($temp_height < $thumb_height) {
                 $resize_height = $temp_height;
             }
             if ($resize_width > $resize_height) {
                 $resize_width = $resize_height;
             } else {
                 $resize_height = $resize_width;
             }
         } else {
             //둘 다 현재 이미지 보다 큰 경우
             if ($resize_height > $temp_height && $resize_width > $temp_width) {
                 $resize_width = $temp_width;
                 $resize_height = $temp_height;
                 if ($resize_width > $resize_height) {
                     $resize_width = $resize_height * ($thumb_width / $thumb_height);
                 } else {
开发者ID:byyeong,项目名称:dc2016,代码行数:67,代码来源:ajax_front.php

示例10: if

}else if(way == 'left'){
	setInterval(fromrighttoleft,30);
}
</script>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
	<td height="600">&nbsp;</td>
	<td style="width:800px;"><div id="zero" style="width:800px; height:600px; top:100px; position:absolute;">
<?php 
foreach ($tmparr as $key => $value) {
    ?>
<div id="num<?php 
    echo $key;
    ?>
" style="position:absolute; vertical-align:middle; visibility:hidden; top:0px;"><img src="../uppics/<?php 
    echo $value;
    ?>
" width="<?php 
    echo getWidth('../uppics/' . $value, 800, 600);
    ?>
" height="<?php 
    echo getHeight('../uppics/' . $value, 800, 600);
    ?>
" border="0" /></div>
<?php 
}
?>
</div></td>
	<td>&nbsp;</td>
</tr>
</table>
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:try.php

示例11: getWidth

        ?>
		<a href="pics.php?smallact=<?php 
        echo $typevalue['id'];
        ?>
" target="showpic">
<?php 
    }
    ?>
		<img id = "indexpic<?php 
    echo $key;
    ?>
" src="<?php 
    echo $typevalue['level'] == 0 ? '../uppics/' . $typevalue['indexpic'] : '../images/mimi.jpg';
    ?>
 " width="<?php 
    echo getWidth($typevalue['level'] == 0 ? '../uppics/' . $typevalue['indexpic'] : '../images/mimi.jpg', 150, 100);
    ?>
" height="<?php 
    echo getHeight($typevalue['level'] == 0 ? '../uppics/' . $typevalue['indexpic'] : '../images/mimi.jpg', 150, 100);
    ?>
" border="0"/>
<?php 
    if ($num != 0) {
        ?>
	
		</a>
<?php 
    }
    ?>
		</td>
	</tr>
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:typelist.php

示例12: move_uploaded_file

        if ($file_ext != "jpg" && $file_ext != "gif") {
            $err .= "ONLY jpg images are accepted for upload";
        }
    } else {
        $err .= "Select a jpg image for upload";
    }
    echo $err;
    if ($err == "") {
        $image_loc = $upload_dir . $user_filename;
        if (isset($_FILES["image"]["name"])) {
            if (file_exists($upload_dir . $user_filename)) {
                echo $user_filename . " already exists. ";
            } else {
                move_uploaded_file($user_filename_temp, $image_loc);
                chmod($image_loc, 0777);
                $width = getWidth($image_loc);
                $height = getHeight($image_loc);
                echo "<img src='{$image_loc}' />";
                if ($width > $max_width) {
                    $scale = $max_width / $width;
                    $uploaded = resizeImage($image_loc, $width, $height, $scale);
                } else {
                    $scale = 1;
                    $uploaded = resizeImage($image_loc, $width, $height, $scale);
                }
            }
        }
    }
}
function getWidth($image)
{
开发者ID:hderanga,项目名称:snaptag,代码行数:31,代码来源:addItems.php

示例13: wpmudev_custom_homepage_admin


//.........这里部分代码省略.........
    // if upload with crop features
    ///////////////////////////////////////////////////////////////////////////////
    if (isset($_POST["upload"])) {
        //Get the file information
        $userfile_name = $_FILES['image']['name'];
        $userfile_type = $_FILES['image']['type'];
        $userfile_tmp = $_FILES['image']['tmp_name'];
        $userfile_size = $_FILES['image']['size'];
        $filename = basename($_FILES['image']['name']);
        $file_ext = substr($filename, strrpos($filename, '.') + 1);
        //Only process if the file is a JPG and below the allowed limit
        if (!empty($_FILES["image"]) && $_FILES['image']['error'] == 0) {
            foreach ($allowed_image_types as $mime_type => $ext) {
                //loop through the specified image types and if they match the extension then break out
                //everything is ok so go and check file size
                if ($file_ext == $ext && $userfile_type == $mime_type) {
                    $error = "";
                    break;
                } else {
                    $error = __("Only", TEMPLATE_DOMAIN) . "<strong>" . $image_ext . "</strong>" . __("images accepted for upload", TEMPLATE_DOMAIN) . "<br />";
                }
            }
            if ($userfile_size > $max_file) {
                $error = __("ONLY images under 1MB are accepted for upload", TEMPLATE_DOMAIN);
            }
        } else {
            $error = __("Select an image for upload", TEMPLATE_DOMAIN);
        }
        //Everything is ok, so we can upload the image.
        if (strlen($error) == 0) {
            if (isset($_FILES['image']['name'])) {
                move_uploaded_file($userfile_tmp, $large_image_location);
                chmod($large_image_location, 0777);
                $width = getWidth($large_image_location);
                $height = getHeight($large_image_location);
                //Scale the image if it is greater than the width set above
                if ($width > $max_width) {
                    $scale = $max_width / $width;
                    $uploaded = resizeImage($large_image_location, $width, $height, $scale);
                } else {
                    $scale = 1;
                    $uploaded = resizeImage($large_image_location, $width, $height, $scale);
                }
                //Delete the thumbnail file so the user can create a new one
                if (file_exists($thumb_image_location)) {
                    unlink($thumb_image_location);
                }
            }
            //Refresh the page to show the new uploaded image
            print '<meta http-equiv="Pragma" content="no-cache">';
            echo "<h4 id=\"loading-bar\">Please wait..Your Image Currently Processing</h4>";
            echo '<img src="' . get_template_directory_uri() . '/_inc/admin/loading_bar.gif' . '">';
            print "<meta http-equiv=\"refresh\" content=\"1;url={$ttpl_url}/wp-admin/themes.php?page=custom-homepage.php\">";
            print "<script>";
            print " self.location='{$ttpl_url}/wp-admin/themes.php?page=custom-homepage.php&#tab1';";
            print "</script>";
            exit;
        }
    }
    //echo admin_url( 'themes.php?page=custom-homepage#tab1' );
    ///////////////////////////////////////////////////////////////////////////////
    // if upload with no crop features
    ///////////////////////////////////////////////////////////////////////////////
    if (isset($_POST["normal-upload"])) {
        //Get the file information
        $userfile_name = $_FILES['image']['name'];
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:67,代码来源:options-functions.php

示例14: imagickCrop

                imagickCrop($image, '50%', '50%', $width, $height);
            }
        } else {
            $image->thumbnailImage($width, $height, $width && $height);
        }
    }
    $image->writeImage($newFilename);
}
// ------------------------ program -----------------------------------
$file = getFile();
if (isLocalFile($file)) {
    checkFilename($file);
    existsFile($file);
}
$height = getHeight();
$width = getWidth();
$exact = getExact();
$topCut = getTopCut();
if (isLocalFile($file)) {
    $newFilename = getResizedFilename($file, $height, $width, $exact, $topCut);
} else {
    $newFilename = getRemoteResizedFilename($file, $height, $width, $exact, $topCut);
}
if (!existsFile($newFilename, false)) {
    try {
        if (shouldSendOriginal($file, $height, $width, $exact || $topCut)) {
            sendFile($file);
        }
        requireImageClass();
        if (false && isLocalFile($file) && extension_loaded('imagick')) {
            processImagick($file, $newFilename, $height, $width, $exact, $topCut);
开发者ID:kysela-petr,项目名称:generator-kysela,代码行数:31,代码来源:min.php

示例15: getPlanning

function getPlanning($dotd, $h1begin, $h1end, $h2begin, $h2end, $epn, $salle)
{
    if ($h1begin == 0 and $h2begin > 0) {
        $h1begin = $h2begin;
    }
    if ($h2end == 0 and $h1begin > 0) {
        $h2end = $h1end;
    }
    if ($h1begin == 0 and $h2end == 0) {
        return FALSE;
        exit;
    }
    // Initialisation des variables
    $graf = "";
    $unit = getConfig("unit_config", "unit_default_config", $epn);
    // unité dans la table config
    $unitLabel = 30;
    // echelle de division du temps pour les labels des heures
    $h1begin = floor($h1begin / 60) * 60;
    // on recupere l"heure de debut ex : 9h15 =>9h => 540mn
    if ($h2end != floor($h2end / 60) * 60) {
        $h2end = floor($h2end / 60) * 60 + 60;
    }
    // on recupere l"heure de fin ex : 19h15 =>20h
    $nbTotM = $h2end - $h1begin;
    // nombre total de minute d'ouverture
    $widthPause = getWidth($h2begin - $h1end, $nbTotM, $unit) * (60 / $unit);
    $positionPause = getPosition($h1end, $h1begin, getWidthPerUnit($nbTotM, $unit)) * (60 / $unit);
    // selection des machines par salle
    $result = getAllMaterielDispo($salle);
    // affichage du resultat
    if (mysqli_num_rows($result) < 1) {
        $graf = "Aucun ordinateur dans la salle s&eacute;lection&eacute;e, veuillez choisir une autre salle";
    } else {
        // Creation du tableau
        $graf .= "<table  class=\"table table-condensed\">";
        // ligne des horaires - echelle au dessus des reservations
        $graf .= "<tr><td></td><td >";
        for ($i = 0; $i < $nbTotM / $unitLabel; $i++) {
            if ($i == $nbTotM / $unitLabel - 1) {
                $largeur = getWidth(60, $nbTotM, $unitLabel) - 2;
                if (strlen(getTime($h1begin + $i * $unitLabel)) <= 3) {
                    $graf .= "<div class=\"labelHor\" style=\"width:" . $largeur . "%;\">|" . getTime($h1begin + $i * $unitLabel) . "</div>";
                } else {
                    $graf .= "<div class=\"labelHor1\" style=\"width:" . $largeur . "%;\">|30</div>";
                }
            } else {
                $time = getTime($h1begin + $i * $unitLabel);
                if (strlen(getTime($h1begin + $i * $unitLabel)) <= 3) {
                    $graf .= "<div class=\"labelHor\" style=\"width:" . getWidth(60, $nbTotM, $unitLabel) . "%;\">|" . $time . "</div>";
                } else {
                    $graf .= "<div class=\"labelHor1\" style=\"width:" . getWidth(60, $nbTotM, $unitLabel) . "%;\">|30</div>";
                }
            }
        }
        $graf .= "</td></tr>";
        //affichage des machines + liste des reservations
        while ($row = mysqli_fetch_array($result)) {
            //old function affichage par usage//
            if ($row['NB'] == "") {
                $nbCritere = '';
            } else {
                $nbCritere = ' (' . $row['NB'] . ')';
            }
            ///
            if (strtotime($dotd) < strtotime(date("Y-m-d"))) {
                $graf .= "<tr><td class=\"computer\" >" . $row["nom_computer"] . "</td>\n                        <td class=\"horaire\">";
            } else {
                /*if(COUNT($usage)==$row['NB']) // si la recherche est exacte
                  {
                    $graf .= "<tr><td class=\"computer2\"><a href=\"index.php?m=7&idepn=".$epn."&idcomp=".$row["id_computer"]."&nomcomp=".$row["nom_computer"]."&date=".$dotd."\">".$row["nom_computer"]."".$nbCritere."</a></td>
                                <td class=\"horaire\">" ;
                    $lineExist = TRUE ;         
                                
                  }
                  else // sinon on affiche les resultats avec les autres criteres de recherche
                  {*/
                if (FALSE == checkInter($row["id_computer"])) {
                    //si pas d'intervention
                    $graf .= "<tr><td class=\"computer\"><a href=\"index.php?m=7&idepn=" . $epn . "&idcomp=" . $row["id_computer"] . "&nomcomp=" . $row["nom_computer"] . "&date=" . $dotd . "\">" . $row["nom_computer"] . "" . $nbCritere . "</a></td>\n                            <td class=\"horaire\">";
                } else {
                    $graf .= "<tr><td class=\"computer\"><span data-toggle=\"tooltip\" title=\"Une intervention est en cours sur ce poste, pas de réservation possible !\" class=\"text-red\">" . $row["nom_computer"] . "</span></td>\n                            <td class=\"horaire\">";
                }
                //  }
            }
            // affichage des horaires et des occupations
            $result2 = getResa($row["id_computer"], $dotd);
            $width = 0;
            $position = 0;
            $widthTmp = 0;
            $widthTmp2 = 0;
            $i = 0;
            while ($row2 = mysqli_fetch_array($result2)) {
                $i = 0;
                // largeur en % du div representant la resa
                $width = getWidth($row2["duree_resa"], $nbTotM, $unit) * (60 / $unit);
                // recupere la position absolue dans le tableau
                $positionTmp = getPosition($row2["debut_resa"], $h1begin, getWidthPerUnit($nbTotM, $unit));
                // position en % du div en cours (represente l'ecart avec celui de devant)
                $position = ($positionTmp - $widthTmp2) * (60 / $unit) - $unit / 60 * $i;
//.........这里部分代码省略.........
开发者ID:ctariel,项目名称:CyberGestionnaireLGB,代码行数:101,代码来源:fonction0.php


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