Exemplo n.º 1
0
function get_cat_progucts($cat_id)
{
    db_connect();
    $query = "SELECT * FROM products WHERE cat='{$cat_id}'";
    $query_result = mysql_query($query);
    $result = db_result_to_array($query_result);
    return $result;
}
Exemplo n.º 2
0
function get_info_rout($where)
{
    /* інформація про маршрут */
    $connection = db_connect();
    $query = " SELECT * FROM dump WHERE {$where} ";
    $query = mysqli_query($connection, $query);
    $result = db_result_to_array($query);
    return $result;
}
Exemplo n.º 3
0
function get_books($catid)
{
    $conn = db_connect();
    $query = "SELECT isbn, author, title FROM books WHERE catid='" . $catid . "'";
    $result = $conn->query($query);
    if (!$result) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 4
0
 function get_data($sql)
 {
     if ($sql != '') {
         $query = $sql;
         $result = $this->dbconn->query($query);
         if (!$result) {
             return false;
         }
         $num = @$result->num_rows;
         if ($num == 0) {
             return false;
         }
         $result = db_result_to_array($result);
         return $result;
     }
 }
Exemplo n.º 5
0
function getdata($sqlstr)
{
    //参数为sql查询语句,存储过程调用.
    $conn = db_connect();
    $sql = $sqlstr;
    $result = @$conn->query($sql);
    if (!$result) {
        return false;
    }
    $num_from = @$result->num_rows;
    if ($num_from == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    //转换成数组
    return $result;
}
Exemplo n.º 6
0
function get_foods_of_category($search_key)
{
    // query database for the books in a category
    if (!$search_key || $search_key == '') {
        return false;
    }
    $conn = db_connect();
    $query = "select * from food where catogery_name = '" . $search_key . "'";
    $result = @$conn->query($query);
    if (!$result) {
        return false;
    }
    $num_books = @$result->num_rows;
    if ($num_books == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 7
0
function get_food_details($food_id)
{
    // query database for the books in a category
    if (!$food_id || $food_id == '') {
        return false;
    }
    $conn = db_connect();
    $query = "select * from food where food_id = '" . $food_id . "'";
    $result = @$conn->query($query);
    if (!$result) {
        return false;
    }
    $num_books = @$result->num_rows;
    if ($num_books == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
function get_books($catid)
{
    // query database for the books in a category
    if (!$catid || $catid == '') {
        return false;
    }
    $conn = db_connect();
    $query = "select * from books where catid='{$catid}'";
    $result = @mysql_query($query);
    if (!$result) {
        return false;
    }
    $num_books = @mysql_num_rows($result);
    if ($num_books == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 9
0
function get_food_details($food_id)
{
    // query database for the books in a category
    if (!$food_id || $food_id == '') {
        return false;
    }
    $conn = db_connect();
    // $query = "select * from food where food_id = '".$food_id."'";
    $query = "select food_id, description, food.name as food_name, catogery_name, merchant.name as merchant_name, price, food.popularity_level as popularity_level\n\t\t\t from food, merchant\n\t\t\t where food.merchant_id = merchant.merchant_id and food_id = '" . $food_id . "'";
    $result = @$conn->query($query);
    if (!$result) {
        return false;
    }
    $num_books = @$result->num_rows;
    if ($num_books == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 10
0
 function get_spotposition()
 {
     $query = "select spotpositionid,position from t_spotposition where portid =" . $this->portid . "  order by ordervalue";
     $result = $this->dbconn->query($query);
     if (!$result) {
         return false;
     }
     $num_from = @$result->num_rows;
     if ($num_from == 0) {
         return false;
     }
     $result = db_result_to_array($result);
     $this->spotposition = $result;
 }
Exemplo n.º 11
0
	function get_currency()
	{
		db_connect();
		
		$query=" SELECT * FROM currency ORDER BY id ";

		$result = mysql_query($query);
			
		$result = db_result_to_array($result);

		return $result;
	}
Exemplo n.º 12
0
function create_match_games($match_id){
   //load up all signed up players and arrange in order
   $tmp_teams = mysql_query("SELECT * FROM matches WHERE match_id = '$match_id'");
   $teams = db_result_to_array($tmp_teams);
   $team1 = $teams[0][1];
   $team2 = $teams[0][2];
   $boards = $teams[0][6];
   //load up player IDs for team 1
   $tmp_players = mysql_query("SELECT playerID FROM match_players WHERE match_id = '$match_id' AND teamID = '$team1'");
   $team1_players = db_result_to_array($tmp_players);
   for ($i=0;$i<$boards;$i++){
      $tmp_player_info = mysql_query("SELECT rating FROM {$db_prefix}players WHERE playerID = ".$team1_players[$i][0]);
      $tmp_rating = mysql_fetch_array($tmp_player_info);
      $rating=$tmp_rating[0];
      $team1_players[$i][1] = $rating;
#      echo "Player team 1, player $i: ".$team1_players[$i][0]." rating = ".$team1_players[$i][1]."<br>";
   }
   usort ($team1_players, 'compare');//sort in rank order

   //load up player IDs for team 2
   $tmp_players = mysql_query("SELECT playerID FROM match_players WHERE match_id = '$match_id' AND teamID = '$team2'");
   $team2_players = db_result_to_array($tmp_players);
   for ($i=0;$i<$boards;$i++){
      $tmp_player_info = mysql_query("SELECT rating FROM {$db_prefix}players WHERE playerID = ".$team2_players[$i][0]);
      $tmp_rating = mysql_fetch_array($tmp_player_info);
      $rating=$tmp_rating[0];
      $team2_players[$i][1] = $rating;
#      echo "Player team 2, player $i: ".$team2_players[$i][0]." rating = ".$team2_players[$i][1]."<br>";
   }
   usort ($team2_players, 'compare');//sort in rank order

   //debug line
#   echo "<br>".$team1_players[0][0]." : ".$team1_players[0][1]."<br>".$team1_players[1][0]." : ".$team1_players[1][1]."<br>".$team2_players[0][0]." : ".$team2_players[0][1]."<br>".$team2_players[1][0]." : ".$team2_players[1][1];


//for each pair, create first game
$tmpColor = 'white';//set first team 1 player to white
for ($i=0;$i<$boards;$i++){
   $tmpQuery = "INSERT INTO {$db_prefix}games (white_player, black_player, status, message_from, dateCreated, lastMove, ratingWhite, ratingBlack, ratingWhiteM, ratingBlackM, oficial, PVBlack, PVWhite, timelimit, teamMatch, team) VALUES (";
   if ($tmpColor == 'white'){
      $white = $team1_players[$i][0];
      $black = $team2_players[$i][0];
      $tmpColor = 'black';
   }else{
      $white = $team2_players[$i][0];
        $black = $team1_players[$i][0];
        $tmpColor = 'white';
    }
   $tmpQuery .= "$white, $black, '', '', NOW(), NOW(),".getRating($white).",".getRating($black).",".getRatingMonth($white).",".getRatingMonth($black).",'1',".getPV($black).",".getPV($white).",".getMatchTimeLimit($match_id).",'1',$match_id)";
   mysql_query($tmpQuery);

   /* if email notification is activated... */
#   if ($CFG_USEEMAILNOTIFICATION){
#      /* if opponent is using email notification... */
#      $tmpOpponentEmail = mysql_query("SELECT value FROM ch_preferences WHERE playerID = ".$_POST['opponent']." AND preference = 'emailNotification'");
#      if (mysql_num_rows($tmpOpponentEmail) > 0){
#         $opponentEmail = mysql_result($tmpOpponentEmail, 0);
#         if ($opponentEmail != ''){
#            /* notify opponent of invitation via email */
#            webchessMail('invitation', $opponentEmail, '', $_SESSION['nick']);
#         }
#      }
#   }

   // setup new board
   $game_id = mysql_insert_id();//   get ID of new game
   $_SESSION['game_id'] = $game_id;
   createNewGame($game_id);
   saveGame();
}
//for each pair, create second game
$tmpColor = 'black';//set first team 1 player to white
for ($i=0;$i<$boards;$i++){
   $tmpQuery = "INSERT INTO {$db_prefix}games (white_player, black_player, status, message_from, dateCreated, lastMove, ratingWhite, ratingBlack, ratingWhiteM, ratingBlackM, oficial, PVBlack, PVWhite, timelimit, teamMatch, team) VALUES (";
   if ($tmpColor == 'black'){
      $black = $team1_players[$i][0];
      $white = $team2_players[$i][0];
      $tmpColor = 'white';
   }else{
      $black = $team2_players[$i][0];
        $white = $team1_players[$i][0];
        $tmpColor = 'black';
    }
    $tmpQuery .= "$white, $black, '', '', NOW(), NOW(),".getRating($white).",".getRating($black).",".getRatingMonth($white).",".getRatingMonth($black).",'1',".getPV($black).",".getPV($white).",".getMatchTimeLimit($match_id).",'1',$match_id)";
   mysql_query($tmpQuery);

   /* if email notification is activated... */
#   if ($CFG_USEEMAILNOTIFICATION){
#      /* if opponent is using email notification... */
#      $tmpOpponentEmail = mysql_query("SELECT value FROM ch_preferences WHERE playerID = ".$_POST['opponent']." AND preference = 'emailNotification'");
#      if (mysql_num_rows($tmpOpponentEmail) > 0){
#         $opponentEmail = mysql_result($tmpOpponentEmail, 0);
#         if ($opponentEmail != ''){
#            /* notify opponent of invitation via email */
#            webchessMail('invitation', $opponentEmail, '', $_SESSION['nick']);
#         }
#      }
#   }

   // setup new board
   $game_id = mysql_insert_id();//   get ID of new game
   $_SESSION['game_id'] = $game_id;
   createNewGame($game_id);
   saveGame();
}
  //update match table
   mysql_query("UPDATE matches SET status = '' WHERE match_id = '$match_id'");
}
Exemplo n.º 13
0
function select_filter($areavalue, $kindvalue, $stuffvalue)
{
    $conn = db_connect();
    $filtervalue = "";
    if ($areavalue != 0) {
        $areafilter = " and p.portid =" . $areavalue;
        $filtervalue = $areafilter;
    }
    if ($kindvalue != 0) {
        $kindfilter = " and p.kindid =" . $kindvalue;
        if (strlen($filtervalue) > 0) {
            $filtervalue = $filtervalue . $kindfilter;
        } else {
            $filtervalue = $kindfilter;
        }
    }
    if ($stuffvalue != 0) {
        $stufffilter = " and p.stuffid =" . $stuffvalue;
        if (strlen($filtervalue) > 0) {
            $filtervalue = $filtervalue . $stufffilter;
        } else {
            $filtervalue = $stufffilter;
        }
    }
    $query = "select carnum,kindname,stuffname,phone,portname,updatetime,productlen,goodstatusid   " . "from t_product p,t_kind k,t_stuff s,t_port r,t_user u " . " where p.userid = u.userid and p.kindid = k.kindid and p.stuffid = s.stuffid and p.portid =r.portid";
    if (strlen(trim($filtervalue)) > 0) {
        $query = $query . $filtervalue;
    }
    $result = @$conn->query($query);
    if (!$result) {
        return false;
    }
    $num_cats = @$result->num_rows;
    if ($num_cats == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 14
0
function show_media($id = '', $tabla = '', $mode = '', $simple = 0, $array = '', $disableExtras = false, $destacarBtn = false)
{
    global $config;
    if ($disableExtras) {
        $disable = 'disabled="disabled"';
    }
    // -------------------------------------------------------------------------------------------
    // MODE VIDEOS -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'videos') {
        if ($array) {
            $media = $array;
        } else {
            $media = q("SELECT * FROM files WHERE item_id=" . $id . " AND (tipo = 'videos' OR tipo = 'youtube') AND tabla='" . $tabla . "' order by orden");
        }
        if ($simple == 0) {
            init_sort_galeria('files');
        }
        if (!$media) {
            noHayContenidosNota();
        } else {
            echo '<div class="sort_galeria">';
            foreach ($media as $row) {
                $tags = show_tags($row['id'], 'files');
                if ($row['tipo'] == 'youtube') {
                    $path = $row['youtube_id'];
                    $preview = 'http://i.ytimg.com/vi/' . validarYoutubeUrl($row['youtube_id']) . '/hqdefault.jpg';
                    $video = urldecode($path);
                } else {
                    $path = '_uploads/' . $row['tabla'] . '/' . $row['nombre'];
                    if (!$config['convertVideo']) {
                        if (!$row['fuente']) {
                            $preview = '_uploads/no_disp.jpg';
                        } else {
                            $preview = '_uploads/' . $row['tabla'] . '/' . $row['fuente'];
                        }
                        $video = $path;
                    } else {
                        $preview = substr(trim($path), 0, strlen(trim($path)) - 4) . '-converted.flv1.jpg';
                        $video = substr(trim($path), 0, strlen(trim($path)) - 4) . '-converted.flv';
                    }
                }
                $prefijo = $row['id'];
                // ---- si existe video convertido y existe el preview poner el player ---------------------------- //
                if ($row['youtube_id'] || file_exists($video) && file_exists($preview)) {
                    if ($array) {
                        echo '<div class="video_galeria" id="item_' . $row['id'] . '">';
                    } else {
                        echo '<div id="item_' . $row['id'] . '">';
                    }
                    if ($row['titulo']) {
                        echo '<h3>' . cortar($row['titulo'], 50, 0, '...') . '</h3>';
                    } else {
                        echo '<h3>' . cortar($row['nombre'], 50, 0, '...') . '</h3>';
                    }
                    // PAYER
                    echo '<div class="player" style="background: #000;">
        					<div id="s' . $prefijo . '"></div>
        						<script type="text/javascript">
        							var s' . $prefijo . ' = new SWFObject("player.swf","ply","346","268","9","#000000");
        							s' . $prefijo . '.addParam("allowfullscreen","true");
        							s' . $prefijo . '.addParam("allowscriptaccess","always");
                                    s' . $prefijo . '.addParam("wmode","transparent");
        							s' . $prefijo . '.addVariable("file","' . $video . '");
        							s' . $prefijo . '.addVariable("image","' . $preview . '");
                                    s' . $prefijo . '.addVariable("skin","modieus.swf");
        							//s' . $prefijo . '.addVariable("duration","' . get_duration($row['id'], $id, $row['tabla'], $video) . '");
        							s' . $prefijo . '.write("s' . $prefijo . '");   
        						</script>';
                    echo '</div>';
                    //BOTONES
                    echo '<div class="buttons">';
                    //BORRAR
                    borrarMediaBtn($row);
                    if ($simple == 0) {
                        //MOVER
                        moverBtn();
                        //DESTACAR
                        if ($destacarBtn) {
                            destacarBtn($row, $mode);
                        }
                        //INFO
                        infoBtn($row, $mode, $disable, $tags);
                    }
                    echo '</div>';
                    echo '</div>';
                }
                // ------------------ si se necesita convertir el video ------------------------------------------- //
                if (file_exists($path) && $row['nombre'] != '' && !file_exists($preview) && !file_exists($video)) {
                    if ($array) {
                        echo '<div class="video_galeria" id="item_' . $row['id'] . '">';
                    }
                    echo '<p><a href="javascript:convertVideo(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $row['tabla'] . '\')">Existe un video para este Item. Sin embargo, debe convertir este video para que obtener una imagen de previsualización y un formato apropiado para el sitio. Haga click en este enlace para comenzar la conversión (Esto puede tardar unos minutos).</a></p>';
                    // BOTONES
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'videos\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/film_delete.png" alt="' . lang('borrar') . '" title="' . lang('borrar') . '"/></a>';
                    // CONVERTIR
                    echo '<a href="javascript:convertVideo(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $row['tabla'] . '\')"><img class="buttons" src="img/admin/film_go.png" alt="Convertir" title="Convertir"/></a>';
                    echo '</div>';
                    if ($array) {
                        echo '</div>';
                    }
                }
            }
            echo '<div style="clear:both;"></div>';
            echo '</div>';
        }
    }
    // -------------------------------------------------------------------------------------------
    // MODE AUDIOS -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'audios') {
        if ($array) {
            $media = $array;
        } else {
            $media = db_result_to_array(mysql_query("SELECT * FROM files WHERE item_id=" . $id . " AND tipo = 'audios' AND tabla='" . $tabla . "' order by orden"));
        }
        init_sort_galeria('files');
        if ($media) {
            echo '<div class="sort_galeria">';
            foreach ($media as $row) {
                $tags = show_tags($row['id'], 'files');
                $path = '_uploads/' . $tabla . '/' . $row['nombre'];
                $audio = substr(trim($path), 0, strlen(trim($path)) - 4) . '-converted.flv';
                if (extension($path) == 'mp3') {
                    $audio = $path;
                }
                $prefijo = substr(md5(uniqid(rand())), 0, 2);
                // ---------------------- si existe audio convertido o existe archivo con formato mp3, poner el player -------------------------------- //
                if (file_exists($audio)) {
                    if ($array) {
                        echo '<div class="video_galeria" id="item_' . $row['id'] . '">';
                    }
                    if ($row['titulo']) {
                        echo '<h3>' . cortar($row['titulo'], 60, 0, '...') . '</h3>';
                    } else {
                        echo '<h3>' . cortar($row['nombre'], 60, 0, '...') . '</h3>';
                    }
                    echo '<div class="player" style="color: #000;">
				<div id="s' . $prefijo . '"></div>
					<script type="text/javascript">
						var s' . $prefijo . ' = new SWFObject("player.swf","mpl","346","20","9","#000000");
						s' . $prefijo . '.addParam("allowfullscreen","true");
						s' . $prefijo . '.addParam("allowscriptaccess","always");
                        s' . $prefijo . '.addParam("wmode","rtansparent");
						s' . $prefijo . '.addVariable("file","' . $audio . '");
						//s' . $prefijo . '.addVariable("duration","' . get_duration($row['id'], $id, $tabla, $audio) . '");
                        s' . $prefijo . '.addVariable("skin","modieus.swf");
						s' . $prefijo . '.write("s' . $prefijo . '");
					</script>';
                    echo '</div>';
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'audios\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/audio/sound_delete.png" alt="' . lang('borrar') . '" title="' . lang('borrar') . '"/></a>';
                    //DESTACAR
                    if ($row['destacar'] == 1) {
                        echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'no_destacar\',\'' . $tabla . '\',\'audios\',\'' . $row['item_id'] . '\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/destacar.png" alt="no destacar" title="no destacar"/></a>';
                    } else {
                        echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'destacar\',\'' . $tabla . '\',\'audios\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/no_destacar.png" alt="destacar" title="destacar"/></a>';
                    }
                    // MOVER
                    echo '<a href="#" class="mover"><img class="buttons" src="img/admin/move.png" alt="mover" title="mover"/></a>';
                    // EDIT
                    echo '<a href="#edit" class="edit"><img class="buttons" src="img/admin/eye.png" alt="info" title="info"/></a>';
                    echo '<div class="edit_box" style="position:inherit;margin:5px 0 0 0;">';
                    echo '<h3>Audio Original</h3>';
                    echo '<p>' . ROOT . 'admin/_uploads/' . $tabla . '/' . substr($row['nombre'], 6, strlen($row['nombre'])) . ' <span style="color:#f00">Convertido, Borrado!</span></p>';
                    // EDIT FORM
                    echo '<p><input type="hidden" name="valores_' . $row['id'] . '" id="valores_' . $row['id'] . '" value="titulo_' . $row['id'] . ',texto_' . $row['id'] . ',fuente_' . $row['id'] . ',tags_' . $row['id'] . '" class="galeria_desc" /></p>';
                    echo '<p>Titulo</p>';
                    echo '<p><input type="text" name="titulo_' . $row['id'] . '" id="titulo_' . $row['id'] . '" value="' . htmlspecialchars_decode($row['titulo']) . '" class="galeria_desc" /></p>';
                    echo '<p>Descripción</p>';
                    echo '<p><input type="text" name="texto_' . $row['id'] . '" id="texto_' . $row['id'] . '" value="' . htmlspecialchars_decode($row['texto']) . '" class="galeria_desc" /></p>';
                    echo '<p>Fuente</p>';
                    echo '<p><input type="text" name="fuente_' . $row['id'] . '" id="fuente_' . $row['id'] . '" value="' . htmlspecialchars_decode($row['fuente']) . '" class="galeria_desc" /></p>';
                    echo '<p>Etiquetas (tags)</p>';
                    echo '<p><input type="text" name="tags_' . $row['id'] . '" id="tags_' . $row['id'] . '" value="' . htmlspecialchars_decode($tags) . '" class="galeria_desc" /></p>';
                    echo '<p><a href="javascript:guardarInfo(\'valores_' . $row['id'] . '\',\'' . $row['id'] . '\',\'files\',\'' . $tabla . '\',\'audios\');"><img class="buttons" src="img/admin/aprobar.png" alt="guardar" title="guardar"/></a></p>';
                    // END EDIT FORM
                    echo '<h3>Audio Convertido</h3>';
                    echo '<p><a href="' . ROOT . 'admin/' . $audio . '">' . ROOT . 'admin/' . $audio . '</a></p>';
                    echo '<h3>+ Info</h3>';
                    echo get_data_audio($row['id'], $row['item_id'], $tabla, $audio);
                    echo '</div>';
                    echo '</div>';
                }
                // --------------------------------- si se necesita convertir el audio ------------------------------------------- //
                if (file_exists($path) && $row['nombre'] != '' && !file_exists($audio)) {
                    echo '<p><a href="javascript:convertAudio(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $tabla . '\')">Existe un audio para este Item. Sin embargo, debe convertir este audio para obtener un formato apropiado para el sitio. Haga click en este enlace para comenzar la conversión (Esto puede tardar unos minutos).</a></p>';
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'audios\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/audio/sound_delete.png" alt="' . lang('borrar') . '" title="' . lang('borrar') . '"/></a>';
                    // CONVERT
                    echo '<a href="javascript:convertAudio(\'' . $row['id'] . '\',\'' . $id . '\',\'' . $tabla . '\')"><img class="buttons" src="img/admin/audio/audio_go.png" alt="Convertir" title="Convertir"/></a>';
                    echo '</div>';
                }
                if ($array) {
                    echo '</div>';
                }
            }
            echo '</div>';
        } else {
            // --------------------------------- si no existe audio subido ------------------------------------------- //
            echo '<div class="player"><p><img src="_plugins/phpt/phpThumb.php?src=../../_uploads/no_disp.jpg&amp;w=346&amp;h=50" border="0" alt="no existen audios cargados" title="no existen audios cargados" /></p></div>';
        }
    }
    // -------------------------------------------------------------------------------------------
    // MODE BANNERS -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'banners') {
        $banners = db_result_to_array(mysql_query("SELECT * FROM files WHERE item_id=" . $id . " AND tipo = '" . $mode . "' AND tabla='" . $tabla . "' ORDER BY orden"));
        //echo "SELECT * FROM files WHERE item_id=".$id." AND tipo = '".$mode."' AND tabla='".$tabla."' ORDER BY orden";
        //pr($imagenes);
        init_sort_galeria('files');
        if ($banners) {
            echo '<div class="sort_galeria">';
            foreach ($banners as $row) {
                //$tags = show_tags($row['id'],'files');
                if (file_exists('_uploads/' . $row['tabla'] . '/' . $row['nombre']) && !empty($row['nombre'])) {
                    echo '<div class="imagenes_galeria" id="item_' . $row['id'] . '">';
                    if (extension($row['nombre']) == 'swf') {
                        $prefijo = substr(md5(uniqid(rand())), 0, 2);
                        echo '<div id="s' . $prefijo . '"></div>
						<script type="text/javascript">
						var s' . $prefijo . ' = new SWFObject("' . ROOT . 'admin/_uploads/' . $row['tabla'] . '/' . $row['nombre'] . '","mpl","163","127","9","#FFFFFF");
						s' . $prefijo . '.addParam("allowfullscreen","false");
						s' . $prefijo . '.addParam("allowscriptaccess","always");
						s' . $prefijo . '.addParam("quality", "high");
						s' . $prefijo . '.addParam("wmode","opaque");
						s' . $prefijo . '.addParam("menu", "false");
						s' . $prefijo . '.addParam("salign", "t");
						s' . $prefijo . '.write("s' . $prefijo . '");
						</script>';
                    } else {
                        echo '<p><img src="_plugins/phpt/phpThumb.php?src=../../_uploads/' . $row['tabla'] . '/' . $row['nombre'] . '&amp;w=163&amp;h=127&amp;zc=0" alt="' . $row['titulo'] . '" title="' . $row['titulo'] . '" /></p>';
                    }
                    echo '<div class="buttons">';
                    //BORRAR
                    echo '<a href="javascript:borrar(\'' . $row['id'] . '\',\'files\',\'delete_item\',\'' . $row['tabla'] . '\',\'banners\')" onclick="return boton_borrar();"><img class="buttons" src="img/admin/delete.png" alt="borrar" title="borrar"/></a>';
                    if ($simple == 0) {
                        //DESTACAR
                        if ($row['destacar'] == 1) {
                            echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'no_destacar\',\'' . $row['tabla'] . '\',\'' . $mode . '\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/destacar.png" alt="no destacar" title="no destacar"/></a>';
                        } else {
                            echo '<a href="javascript:destacar(\'' . $row['id'] . '\',\'files\',\'destacar\',\'' . $row['tabla'] . '\',\'' . $mode . '\',\'' . $row['item_id'] . '\')"><img class="buttons" src="img/admin/no_destacar.png" alt="destacar" title="destacar"/></a>';
                        }
                    }
                    // MOVER
                    echo '<a href="#move" class="mover"><img class="buttons" src="img/admin/move.png" alt="mover" title="mover"/></a>';
                    //INFO
                    /* echo '<a href="#info" class="edit"><img class="buttons" src="img/admin/editar_datos.png" alt="info" title="info"/></a>';
                    
                                          echo '<div class="edit_box" style="position:inherit;border:none;padding:0;">';
                    
                                          echo '<p><input type="hidden" name="valores_'.$row['id'].'" id="valores_'.$row['id'].'" value="titulo_'.$row['id'].',texto_'.$row['id'].',fuente_'.$row['id'].',tags_'.$row['id'].'" class="galeria_desc" /></p>';
                    
                                          //echo '<h3>Foto Original</h3>';
                                          //echo '<p>'.ROOT.'admin/_uploads/'.$tabla.'/'.substr($row['nombre'],6,strlen($row['nombre'])).' <span style="color:#f00">Convertido, Borrado!</span></p>';
                    
                                          echo '<p>Titulo</p>';
                                          echo '<p><input type="text" name="titulo_'.$row['id'].'" id="titulo_'.$row['id'].'" value="'.htmlspecialchars_decode($row['titulo']).'" class="galeria_desc" /></p>';
                                          echo '<p>Descripción</p>';
                                          echo '<p><input type="text" name="texto_'.$row['id'].'" id="texto_'.$row['id'].'" value="'.htmlspecialchars_decode($row['texto']).'" class="galeria_desc" /></p>';
                                          echo '<p>Fuente</p>';
                                          echo '<p><input type="text" name="fuente_'.$row['id'].'" id="fuente_'.$row['id'].'" value="'.htmlspecialchars_decode($row['fuente']).'" class="galeria_desc" /></p>';
                                          echo '<p>Etiquetas (tags)</p>';
                                          echo '<p><input type="text" name="tags_'.$row['id'].'" id="tags_'.$row['id'].'" value="'.htmlspecialchars_decode($tags).'" class="galeria_desc" /></p>';
                                          echo '<p><a href="javascript:guardarInfo(\'valores_'.$row['id'].'\',\''.$row['id'].'\',\'files\',\''.$row['tabla'].'\',\''.$mode.'\');"><img class="buttons" src="img/admin/aprobar.png" alt="guardar" title="guardar"/></a></p>';
                                          echo '</div>'; */
                    echo '</div>';
                    echo '</div>';
                }
            }
            echo '</div>';
        } else {
            // --------------------------------- si no existe imagen subida ------------------------------------------- //
            echo '<div class="player"><p><img src="_plugins/phpt/phpThumb.php?src=../../_uploads/no_disp.jpg&amp;w=346&amp;h=50" border="0" alt="no existen imagenes cargadas" title="no existen imagenes cargadas" /></p></div>';
        }
    }
    // -------------------------------------------------------------------------------------------
    // MODE PDF -------------------------------------------------------------------------------
    // -------------------------------------------------------------------------------------------
    if ($mode == 'pdf') {
        if ($array) {
            $pdf = $array;
        } else {
            $pdf = q("SELECT * FROM files WHERE item_id=" . $id . " AND tipo = '" . $mode . "' AND tabla='" . $tabla . "' ORDER BY orden");
        }
        if ($simple == 0) {
            init_sort_galeria('files');
        }
        if (!$pdf) {
            noHayContenidosNota();
        } else {
            echo '<div class="sort_galeria">';
            foreach ($pdf as $row) {
                $row['titulo'] = f($row['titulo']);
                $tags = show_tags($row['id'], 'files');
                if (file_exists('_uploads/' . $row['tabla'] . '/' . $row['nombre']) && !empty($row['nombre'])) {
                    echo '<div class="imagenes_galeria" id="item_' . $row['id'] . '">';
                    echo '<img src="_plugins/phpt/phpThumb.php?src=../../_uploads/pdf_file.png&amp;w=163&amp;h=127&amp;zc=1" alt="' . $row['titulo'] . '" title="' . $row['titulo'] . '" />';
                    //BOTONES
                    echo '<div class="buttons">';
                    //BORRAR
                    borrarBtn($row, $mode, 'delete.png', 'files');
                    if ($simple == 0) {
                        //MOVER
                        moverBtn();
                        //DESTACAR
                        if ($destacarBtn) {
                            destacarBtn($row, $mode);
                        }
                        //INFO
                        infoBtn($row, $mode, $disable, $tags);
                    }
                    echo '</div>';
                    echo '</div>';
                }
            }
            echo '<div style="clear:both;"></div>';
            echo '</div>';
        }
    }
}
Exemplo n.º 15
0
function get_student_details($student_id)
{
    include_once 'db_fns.php';
    // query database for the books in a category
    if (!$student_id || $student_id == '') {
        return false;
    }
    $conn = db_connect();
    // $query = "select * from food where food_id = '".$food_id."'";
    $query = "select *\n\t\t\t\t from student\n\t\t\t\t where student_id = '" . $student_id . "'";
    $result = @$conn->query($query);
    if (!$result) {
        return false;
    }
    $num_info = @$result->num_rows;
    if ($num_info == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 16
0
function get_file_content_search_result($filename)
{
    if (!$filename || $filename == '') {
        return false;
    }
    $conn = db_connect();
    $objid = get_objid_from_location($filename);
    $query = "select * from object where objid='" . $objid . "'";
    $result = @$conn->query($query);
    if (!$result) {
        return false;
    }
    $num_objects = @$result->num_rows;
    if ($num_objects == 0) {
        return false;
    }
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 17
0
function buyer_order($number)
{
    db_connect();
    $query = "SELECT  * FROM orders WHERE number = '{$number}'";
    $result = mysql_query($query);
    $result = db_result_to_array($result);
    return $result;
}
Exemplo n.º 18
0
}
//*********************************
$query = "select buyid ," . "kindname,stuffname,phone,portname,updatetime,title,content,price " . " from t_buy p,t_kind k,t_stuff s,t_port r,t_user u " . " where p.userid = u.userid and p.kindid = k.kindid and " . " p.stuffid = s.stuffid and p.portid =r.portid  ";
if (strlen(trim($filtervalue)) > 0) {
    $query = $query . $filtervalue;
}
if ($type == 1) {
    $query = $query . " order by updatetime desc limit " . ($page - 1) * $pagesize . ",{$pagesize}";
}
$result = @$conn->query($query);
if (!$result) {
    echo "<meta http-equiv='Content-Type'' content='text/html; charset=utf-8'>";
    echo $noconnect;
    return;
}
$result = db_result_to_array($result);
$outputstr = "";
foreach ($result as $row) {
    $outputstr = $outputstr . "<dt>标题:" . $row['title'] . "<span class='noticeBuy'>购</span></dt>" . "<dd><a href='buyInfo.php?buyid=" . $row['buyid'] . "'>" . "<ul class='panel-col-3 clearfix'>" . "<li>货种:" . $row['kindname'] . "</li>" . "<li>材种:" . $row['stuffname'] . "</li>" . "<li>价格:" . $row['price'] . "</li>" . "<li class='panel-row-2'>目标口岸:" . $row['portname'] . "</li>" . "<li class='panel-row-2'>时间:" . $row['updatetime'] . "</li>" . "</ul>" . "</a></dd>";
}
if ($type == 1) {
    //**************页码导航栏**************
    if ($page > 1) {
        $prepage = $page - 1;
    } else {
        $prepage = 1;
    }
    if ($page < $pagecount) {
        $nextpage = $page + 1;
    } else {
        $nextpage = $pagecount;
Exemplo n.º 19
0
	$color1 = "#E5F2FF"; 
    	$color2 = "#DDDDDD"; 
    	$row_count = 0; 

	$mt = mysql_query("SELECT * FROM games WHERE team = '$tm[match_id]'");

	while($rw = mysql_fetch_array($mt)){


	$w = mysql_query("SELECT * FROM players WHERE playerID = '$rw[whitePlayer]'"); 
	$pt = db_result_to_array($w); 
	$opt = $pt[0][2]; 

	$s = mysql_query("SELECT * FROM players WHERE playerID = '$rw[blackPlayer]'"); 
	$vp = db_result_to_array($s); 
	$yls = $vp[0][2]; 

	$row_color = ($row_count % 2) ? $color1 : $color2;

	echo "<tr><td>".$opt." vs ".$yls."</td><td><input cursor:hand' type=button value='".$MSG_LANG['analyze']."' onClick=window.open('analyze.php?game=".$rw[gameID]."','_blank','toolbar=no,status=no,menubar=no,scrollbars=no,width=800,height=625')></td>";

$gameID = $rw[gameID];

$result = mysql_query("SELECT p1.firstName AS player1_name, p2.firstName AS
player2_name FROM games g LEFT JOIN players p1 ON (g.whitePlayer =
p1.playerID) LEFT JOIN players p2 ON (g.blackPlayer = p2.playerID) WHERE
g.gameID = $gameID");
if(mysql_error()) die(mysql_error());

$row = mysql_fetch_array($result);