function GoReSize() { if (!file_exists($this->SrcFile)) { echo "图片不存在请检查!"; } else { $this->File = getimagesize($this->SrcFile); $Width = $this->File[0]; //得到图片宽度 $Height = $this->File[1]; //得到图片高度 $Type = $this->File[2]; //得到图片类型 , 1为gif 2为jpg 3为png switch ($Type) { case 1: $MyType = 'gif'; $SrcIm = imagecreatefromgif($this->SrcFile); break; case 2: $MyType = 'jpg'; $SrcIm = imagecreatefromjpeg($this->SrcFile); break; case 3: $MyType = 'png'; $SrcIm = imagecreatefrompng($this->SrcFile); break; } if (empty($MyType)) { echo "不支持此类型图片"; } else { $Im = imagecreatetruecolor($this->NewWidth, $this->NewHeiht); imagecopyresized($Im, $SrcIm, 0, 0, 0, 0, $this->NewWidth, $this->NewHeiht, $Width, $Height); if (!file_exists($this->Path)) { mk($this->Path); } else { $Name = $this->Path . "R_" . date("Ydmhis") . "." . $MyType; if ($MyType == "gif") { imagegif($Im, $Name); } else { if ($MyType == "jpg") { imagejpeg($Im, $Name); } else { imagepng($Im, $Name); } } } if (file_exists($Name)) { echo "<script>"; echo "alert('图片生成成功!');"; //echo "location.href='javascript:history.go(-1)';"; echo "</script>"; } else { echo "<script>"; echo "alert('图片失败');"; //echo "location.href='javascript:history.go(-1)';"; echo "</script>"; } } } }
public function test() { C1::__invoke(0, 1); D1::__invoke(0, 1); E1::__invoke(0, 1); call_user_func(mk('C1'), 0, 1); call_user_func(mk('D1'), 0, 1); call_user_func(mk('E1'), 0, 1); }
/** * get a template blockfile * format: tpl.<objtype>_<command>.html * * @param string command * @param string object type definition * @access public */ protected final function getTemplateFile($a_cmd, $a_type = "") { mk(); die("ilObjectGUI::getTemplateFile() is deprecated."); }
function obtenerDatos() { include 'conectar.php'; include 'makerutakml_1.php'; //adecuar ID usr //$nomInsti=$_SESSION['nomInsti']; //$_SESSION['idUsr']=$idUsr; //recuperar fecha $fechaExplode = explode('-', $_REQUEST['fecha']); //$fechaQuery=date('Y-m-d',mktime(0,0,0,$fechaExplode[1],$fechaExplode[0],$fechaExplode[2])); $fechaQuery = date('d-m-Y', mktime(0, 0, 0, $fechaExplode[1], $fechaExplode[0], $fechaExplode[2])); //echo $fechaQuery."<br>"; //print_r $fechaQuery; //obtener nombre Usr segun id /* $result=mysql_query("SELECT usuario FROM usuarios WHERE idusuarios='".$_SESSION['idUsr']."'") or die("error".mysql_error()); $row=mysql_fetch_array($result); $nomUsr=$row[0]; $_SESSION['nomUsr']=$nomUsr; */ //puntos segun idUsr /*consulta original $result=mysql_query("SELECT idpuntos,longitud,latitud,fecha,provider FROM puntos WHERE usuarios_idUsuarios='".$idUsr."' AND fecha='".$fechaQuery."'") or die("error".mysql_error()); */ $query = mysql_query("SELECT idpuntos,latitud,longitud,fecha,provider FROM puntos WHERE usuarios_idUsuarios='" . $_SESSION['idUsr'] . "' AND DATE_FORMAT(fecha,'%d-%m-%Y')='" . $fechaQuery . "'") or die("error" . mysql_error()); //echo "consulta SELECT idpuntos,longitud,latitud,fecha,provider FROM puntos WHERE usuarios_idUsuarios='".$idUsr."' AND DATE_FORMAT(fecha,'%d-%m-%Y')='".$fechaQuery."')"; $numRow = mysql_num_rows($query); if ($numRow != 0) { //creamos tabla echo "<table align='center' border = '1'> "; //nombre filas echo "<tr> "; echo "<td><b>ID</b></td> "; echo "<td><b>Latitud (y)</b></td> "; echo "<td><b>Longitud (x)</b></td> "; echo "<td><b>Fecha</b></td> "; echo "<td><b>Provedor</b></td> "; echo "</tr> "; while ($row = mysql_fetch_array($query)) { echo "<tr> "; echo "<td>{$row['0']}</td> "; echo "<td>{$row['1']}</td> "; echo "<td>{$row['2']}</td> "; echo "<td>{$row['3']}</td> "; $provider = preg_replace("(_PROVIDER)", "", $row[4]); echo "<td>{$provider}</td> "; echo "</tr> "; } echo "</table> "; //creamos KML y obtenemos nombre archivo $rutaKml = mk($_SESSION['idUsr'], $nomUsr, $nomInsti, $fechaQuery); if ($rutaKml != null) { echo "<br>nombre kml: " . $rutaKml; //pasamos valor a variable de javascript para mostrar kml echo '<script type="text/javascript">rutaKml="' . $rutaKml . '"</script>'; echo '<script type="text/javascript">existLoc=1;</script>'; } else { 'Error en KML<script type="text/javascript">existLoc=0;</script>'; } } else { echo '<script type="text/javascript">existLoc=0;</script>'; echo '<b><br>No existen localizaciones asociadas a esta fecha:</b>' . $fechaQuery; } }
public function __invoke($a0) { return $a0 > 10; } } $c = new C1(); $d = new D1(); $e = new E1(); $c(0, 1); $d(0, 1); $e(0, 1); call_user_func($c, 0, 1); call_user_func($d, 0, 1); call_user_func($e, 0, 1); call_user_func_array($c, array(0, 1)); call_user_func_array($d, array(0, 1)); call_user_func_array($e, array(0, 1)); $c->__invoke(0, 1); $d->__invoke(0, 1); $e->__invoke(0, 1); C1::__invoke(0, 1); D1::__invoke(0, 1); E1::__invoke(0, 1); function mk($n) { return $n . '::__invoke'; } call_user_func(mk('C1'), 0, 1); call_user_func(mk('D1'), 0, 1); call_user_func(mk('E1'), 0, 1); var_dump(array_filter(array(0, 1, 11, 13), new F1()));