Exemple #1
0
	public function markup() {
		$hayDB=true;
		try {
			\cDb::conf(_DB_HOST_,_DB_USER_,_DB_PASSWD_,_DB_NAME_);
		} catch (\Exception $e) {
			$hayDB=false;
		}
		$arrStdObjTableInfo=array();
		if ($hayDB) {
			$mysqli=\cDb::getInstance();
			if ($result = $mysqli->query("show full tables where Table_Type = 'BASE TABLE'")) {
				while ($table = $result->fetch_array()) {
					$stdObjTableInfo=$this->getTableInfo($table[0]);
					array_push($arrStdObjTableInfo,$stdObjTableInfo);
					unset($stdObjTableInfo);
				}
			} else {
				echo $mysqli->error;
			}
		}
		require_once( str_replace("//","/",dirname(__FILE__)."/")."markup/markup.php");
	}
Exemple #2
0
 public function acCrearClase()
 {
     list($db, $class) = split(self::DB_NAME_TABLE_NAME_SEPARATOR, $_REQUEST['class']);
     $arrDbs = unserialize(DBS);
     \cDb::conf($arrDbs[$db]['_DB_HOST_'], $arrDbs[$db]['_DB_USER_'], $arrDbs[$db]['_DB_PASSWD_'], $arrDbs[$db]['_DB_NAME_']);
     $rutaLogic = SKEL_ROOT_DIR . $_POST['rutaLogic'];
     $this->CrearClase($class, $rutaLogic);
 }
Exemple #3
0
     try {
         $ancho = isset($_GET["ancho"]) ? $_GET["ancho"] : 640;
         $alto = isset($_GET["alto"]) ? $_GET["alto"] : 480;
         $categoria = isset($_GET["fichero"]) ? "/" . $_GET["fichero"] : "";
         $url = "http://lorempixel.com/" . $ancho . "/" . $alto . $categoria;
         //$firephp->info($url,"URL: ");
         $objImg = Imagen::fromString(file_get_contents($url));
     } catch (Exception $e) {
         error_log($e->getMessage());
         $file = BASE_IMGS_DIR . 'imgErr.png';
         $objImg = Imagen::fromFile($file);
     }
     break;
 case "DB":
     try {
         \cDb::conf(_DB_HOST_, _DB_USER_, _DB_PASSWD_, _DB_NAME_);
         $db = cDb::getInstance();
         list($tabla, $campoId, $valorId, $campoData) = explode('.', $_GET["fichero"]);
         $sql = "SELECT " . $campoId . ", " . $campoData . " FROM " . $tabla . " WHERE id='" . $db->real_Escape_String($valorId) . "'";
         //$GLOBALS['firephp']->info($sql);
         $rslSet = $db->query($sql);
         if ($rslSet->num_rows > 0) {
             $data = $rslSet->fetch_object();
             $data = $data->{$campoData};
         }
         $objImg = Imagen::fromString($data);
         //$objImg->marcaAgua("");
         //$objImg->marcaAgua("",1,1,"center");
     } catch (Exception $e) {
         error_log(print_r($e, true));
         $file = BASE_IMGS_DIR . 'imgErr.png';