Example #1
0
                        <h4 class="media-heading">
                          <?php 
            echo $nombreusers;
            ?>
                          <small><em class="icon wb-map margin-right-5" aria-hidden="true"></em><?php 
            $km = number_format($row["distance"], 2);
            echo $km . " Km.";
            ?>
&nbsp; <?php 
            echo $time;
            ?>
</small>
                        </h4>
                        <p>
                        <?php 
            $usuconfir = usuconfir($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $row["iduser"]);
            if ($usuconfir == 1) {
                if ($localizacion != "") {
                    ?>
                          <i class="icon icon-color wb-map" aria-hidden="true"></i> 
                          <?php 
                }
                echo $localizacion;
                ?>
                        </p>
                        
                        <div class="profile-social">
                <?php 
                $link = mysql_connect($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL);
                mysql_select_db($strDBMYSQL, $link);
                if (mysql_errno() > 0) {
    echo $users[1];
    ?>
" style="height:50px;width:50px">
                        <i></i>
                      </i>
                      </a>
                    </div>
                    <div class="media-body">
                   
                      <div class="pull-right" id="btn<?php 
    echo $users[8];
    ?>
">
                        <?php 
    // si el usuario ya esta agregado o no
    $usuconfir = usuconfir($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $users[8]);
    if ($usuconfir == 0) {
        ?>
                      <a class="agregar" id="<?php 
        echo $users[8];
        ?>
"><button type="button" class="btn btn-outline btn-default btn-sm">Agregar</button></a>
                      <?php 
    } else {
        ?>
                      <a href="user.php?order=1&nom=&pag=0"><button type="button" class="btn btn-success btn-default btn-sm">Revista</button></a>
                      <?php 
    }
    ?>
   
                      </div>
Example #3
0
                $usus = 2;
            } else {
                $usus = 1;
            }
            if ($row["tipoNotif"] == 5 || $row["tipoNotif"] == 6) {
                $userr = $row["iduserAct"];
                if ($row["tipoNotif"] == 6) {
                    $idalbum = vercoment($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $row["iduserMov"], $row["idcomentario"]);
                    $avatarusus = verfotocoment($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $idalbum[1]);
                }
            } else {
                $userr = $row["iduserMov"];
                $nombreuserse = "";
                $avatarusus = "";
            }
            $confirmarusuado = usuconfir($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $row["iduserMov"]);
            $fechaagregado = fechaagregado($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $row["iduserMov"]);
            if ($confirmarusuado == 0 && $row["iduserAct"] == $_SESSION["iduser"] && ($row["tipoNotif"] == 1 || $row["tipoNotif"] == 6) || $confirmarusuado == 1 && $fechaagregado <= $row["fechaHrNotif"] && $row["iduserAct"] == $_SESSION["iduser"]) {
                ?>
                               <a class="list-group-item" id="<?php 
                echo $userr . "," . $row["tipoNotif"] . "," . $usus . "," . $row["idnotif"] . "," . $idalbum[0];
                ?>
" role="menuitem">
                                    <div class="media">
                                      <div class="media-left padding-right-10">
                                        <span class="avatar avatar-sm avatar-online">
                                          <img src="<?php 
                echo $avatarusu;
                ?>
" style="height:50px;width:50px" />
                                        </span>
 $dato = explode(",", $notis[$i]);
 $avatarusu = avatar($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $dato[1]);
 $nombreusers = nombreusus($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $dato[1]);
 if ($dato[5] == $_SESSION["iduser"]) {
     $usus = 2;
 } else {
     $usus = 1;
 }
 if ($dato[3] == 6) {
     $userr = $dato[5];
 } else {
     $userr = $dato[1];
 }
 $idalbum = vercoment($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $dato[1], $dato[6]);
 $verfoto = verfotocoment($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $idalbum[1]);
 $confirmarusuado = usuconfir($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $dato[1]);
 $fechaagregado = fechaagregado($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $dato[1]);
 if ($confirmarusuado == 0 && $dato[5] == $_SESSION["iduser"] && ($dato[3] == 1 || $dato[3] == 6) || $confirmarusuado == 1 && $fechaagregado <= $dato[7] && $dato[5] == $_SESSION["iduser"]) {
     $h .= '<a class="list-group-item" id="' . $userr . ',' . $dato[3] . ',' . $usus . "," . $dato[4] . ',' . $idalbum[0] . '" role="menuitem">
                   <div class="media">
                     <div class="media-left padding-right-10">
                       <span class="avatar avatar-sm avatar-online" style="height:50px;width:50px">
                         <img src="' . $avatarusu . '" style="height:50px;width:50px" />
                       </span>
                     </div>
                     <div class="media-body">
                       <h6 class="media-heading">' . $nombreusers . '</h6>
                       <div class="media-meta">
                         <time datetime="2015-06-17T20:22:05+08:00">' . $dato[2] . '</time>
                       </div>
                       <div class="media-detail">' . $dato[0] . '</div>
                <?php 
echo $datosPerfil[4];
?>
              </div>
            </div>
            <div class="col-lg-12"><br>
              <label class="col-lg-4 control-label">Profesi&oacute;n:</label>
              <div class="col-lg-7" style="padding-right: 0px">
                <?php 
echo $datosPerfil[5];
?>
              </div> 
              		
            </div>
            <?php 
$confirmarusu = usuconfir($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $_GET["iduser"]);
if ($confirmarusu == 1) {
    ?>
             <div class="profile-social" id="result"></div>
              <div class="col-lg-12"><br>
               <label class="col-lg-4 control-label">Medios de Contacto:</label>
               <div class="col-lg-8" style="padding-right: 0px">
               <div class="profile-social" id="redesEP" style="margin-top:0px;text-align:left">
               <?php 
    $link = mysql_connect($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL);
    mysql_select_db($strDBMYSQL, $link);
    if (mysql_errno() > 0) {
        $strResultOp = "No fue posible validar el usuario.";
        $strInfoTec = "No fue posible localizar el host[" . mysql_errno() . "-" . mysql_error() . "]";
        $strModulo = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . basename($_SERVER['PHP_SELF']);
        $strParameters = "host:" . $strHostMYSQL . "~-user:"******"~PWD:" . $strPWDMYSQL . "bd:" . $strDBMYSQL;
Example #6
0
function notificaciones($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL)
{
    $link = mysql_connect($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL);
    mysql_select_db($strDBMYSQL, $link);
    if (mysql_errno() > 0) {
        $strResultOp = "No fue posible validar el usuario.";
        $strInfoTec = "No fue posible localizar el host[" . mysql_errno() . "-" . mysql_error() . "]";
        $strModulo = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . basename($_SERVER['PHP_SELF']);
        $strParameters = "host:" . $strHostMYSQL . "~-user:"******"~PWD:" . $strPWDMYSQL . "bd:" . $strDBMYSQL;
    } else {
        /*$str ="select count(idnotif) as total from notificaciones n, tiponotificacion t where n.tipoNotif=t.idtipoNotif
        			   and ((iduserMov!=".$_SESSION["iduser"]." and iduserAct=".$_SESSION["iduser"].") or (iduserMov!=".$_SESSION["iduser"]." and iduserAct!=".$_SESSION["iduser"].")) and estatusNotif=0 group by idnotif order by fechaHrNotif desc";
        		$Resu = mysql_query($str);*/
        $strS = "select tipoNotif, descripcion, iduserMov, iduserAct, fechaHrNotif, idnotif, idcomentario from notificaciones n, tiponotificacion t where n.tipoNotif=t.idtipoNotif\n\t\t\t\tand ((iduserMov!=" . $_SESSION["iduser"] . " and iduserAct=" . $_SESSION["iduser"] . ") or (iduserMov!=" . $_SESSION["iduser"] . " and iduserAct!=" . $_SESSION["iduser"] . ")) and estatusNotif=0 group by idnotif order by fechaHrNotif desc";
        $Res = mysql_query($strS);
        if (mysql_errno() > 0) {
            $strResultOp = "No fue posible validar el usuario.";
            $strInfoTec = "No fue posible ejecutar la consulta[" . mysql_errno() . "-" . mysql_error() . "]";
            $strModulo = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . basename($_SERVER['PHP_SELF']);
            $strParameters = $str;
            $notif = "";
        } else {
            $total = 0;
            while ($row = mysql_fetch_array($Res)) {
                $hoy = date("Y-m-d H:i:s");
                $datetime1 = new DateTime($row["fechaHrNotif"]);
                $datetime2 = new DateTime($hoy);
                $interval = date_diff($datetime1, $datetime2);
                $dia = $interval->format('%a');
                $horas = $interval->format('%H:%I');
                $hrs = explode(":", $horas);
                $hr = $hrs[0];
                $min = $hrs[1];
                if ($dia < 1) {
                    if ($hr > 1) {
                        $time = $hr . " Horas";
                    } else {
                        if ($hr == 1) {
                            $time = $hr . " Hora";
                        } else {
                            if ($min == "00") {
                                $time = "Ahora";
                            } else {
                                $time = $min . " min";
                            }
                        }
                    }
                } else {
                    if ($dia == 1) {
                        $time = $dia . " Dia";
                    } else {
                        $time = $dia . " Dias";
                    }
                }
                $desc .= $row["descripcion"] . "," . $row["iduserMov"] . "," . $time . "," . $row["tipoNotif"] . "," . $row["idnotif"] . "," . $row["iduserAct"] . "," . $row["idcomentario"] . "," . $row["fechaHrNotif"] . "&";
                $confirmarusuado = usuconfir($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $row["iduserMov"]);
                $fechaagregado = fechaagregado($strHostMYSQL, $strUserMYSQL, $strPWDMYSQL, $strDBMYSQL, $row["iduserMov"]);
                if ($confirmarusuado == 0 && ($row["tipoNotif"] == 1 || $row["tipoNotif"] == 6) || $confirmarusuado == 1 && $fechaagregado < $row["fechaHrNotif"]) {
                    $total++;
                }
            }
            $notif = $total . ";" . $desc;
        }
    }
    return $notif;
}