Pereiti prie turinio

Zimex

Patvirtinti nariai
  • Pranešimai

    195
  • Užsiregistravo

  • Lankėsi

  • Atsiliepimai

    100%

Zimex Pranešimai

  1. Sveiki, gal kas galit pasiūlyt kokį PHP frameworką? Su frameworkais esu dirbęs labai minimaliai, o jų yra begalė, todėl nežinau koks būtu geriausias pasirinkimas. Jei siūlysit norėčiau kad argumentuotumėt kodėl jį siūlote.

  2. Priklauso ar naudoji kažkokį custom TVS ar žinomą (WordPress, Joomla, CMS Made Simple ir pan.)

    Žinomi TVS dažniausiai turi pluginus ar modulius kurie generuoja automatiškai sitemap'ą ir tiesiog pasikeitus paslapiams tereikia paspausti mygtuką "Atnaujinti"

    Naudoju ne TVS, HTML+CSS+JS puslapis. Mėginau su online converteriais daryt, bet jie nesugaudo tų puslapių kurių linkų nenaudoju pačioje svetainėje.

  3. Sveiki, labai reikia pagalbos darant redirecta. Paspaudus mygtuką duomenys nusiunčiami į php failą, bet nei php nei js faile neveikia redirectas. Kaip išspręsti šitą bėdą?

    JS kodas:

    $(document).ready(function() {
       $("#prisijungti").click(function() { 
           //Įvestų duomenų išsaugojimas į kintamuosius
    	var vartotojo_email        = $('input[name=email]').val();
    	var vartotojo_slaptazodis  = $('input[name=slaptazodis]').val(); 
    
           //Tikriname ar visi laukai buvo užpildyti 
    	//Jei neužpildyti pakeičiam jų rėmelio spalvą  
           var testi = true;
    	if(vartotojo_email==""){ 
               $('input[name=email]').css('border-color','red'); 
               testi = false;
           }
    	if(vartotojo_slaptazodis==""){ 
               $('input[name=slaptazodis]').css('border-color','red'); 
               testi = false;
           }
    
           if(testi) 
           {
               //Duomenys kurie bus siunčiami į failą
               post_data = {'vartotojoEmail':vartotojo_email, 'vartotojoSlaptazodis':vartotojo_slaptazodis};
    
               //Duomenų siuntimas į failą post metodu
               $.post('prisijungimas.php', post_data, function(response){  
    
                   //Užkrauna json įrašus iš failo    
    			if(response.type == 'error')
    			{
    				output = '<div class="error">'+response.text+'</div>';
    			}else{
    				window.location.href = 'index.php'
    			}
    
    			$("#result").hide().html(output).slideDown();
               }, 'json');
    
           }
       });

    PHP kodas:

    if(mysqli_num_rows($rez) > 0) {
    		$slaptazodis = crypt($vartotojo_Slaptazodis);
    		if($eil['slaptazodis'] == crypt($vartotojo_Slaptazodis,$eil['slaptazodis'])) {
    
    
    			$_SESSION['sess_user_id'] = $eil['id'];
    
    			header("Location: index.php");
    		} else {
    			$output = json_encode(array('type'=>'error', 'text' => 'Neteisingi prisijungimo duomenys.'));
    			die($output);
    		}
    	} else {
    		$output = json_encode(array('type'=>'error', 'text' => 'Neteisingi prisijungimo duomenys.'));
    		die($output);
    	}

  4. dar pasirodo yra toks metodas, kaip "focusout" taigi, gali su juo mėginti, dar net geriau. O man kažkaip pakako parašyti tai, ko tu nori į google angliškai ir iškart radau atsakymą. Jeigu ieškai LT kalba, tai siūlau pamiršti tai.

     

    http://stackoverflow.com/questions/20199265/how-to-submit-an-ajax-form-on-focusout

     

     

    try to google it :) čia ir vadinama "ajax" - taigi rašai į google "ajax tutorial"

     

    atsakymą eina rasti per pora sekundžių http://stackoverflow.com/questions/5004233/jquery-ajax-post-example-with-php

    Dėkui labai. Na aš kitaip formulavau paieškos užklausą, nes nežinojau kaip vadinasi šis dalykas.

  5. Iškilo dar viena problema. Niekaip nesigauna padaryt kad paryškintų dieną su švente, čia mano bandymas:

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style type="text/css">
    .withevent {
    background: gold;	
    }
    </style>
    </head>
    
    <body>
    
    <?php
    $month = isset($_GET['m']) ? $_GET['m'] : date('n');
    $year = isset($_GET['y']) ? $_GET['y'] : date('Y');
    
    $events = array(
    array("2014-5-05", 'Svente2', 'Aprasymas2'),
    array("2014-6-05", 'Svente', 'Aprasymas')
    );
    
    $month_name = array("Sausis", "Vasaris", "Kovas", 
    			"Balandis", "Geguze", "Birzelis", 
    			"Liepa", "Rugpjutis", "Rugsejis", 
    			"Spalis", "Lapkritis", "Gruodis");
    
    $first_day_timestamp = mktime(0,0,0,$month,1,$year); 
    $maxday = date("t",$first_day_timestamp); 
    $thismonth = getdate($first_day_timestamp); 
    $startday = $thismonth['wday']-1;
    if($startday < 0 ) $startday = 6; 
    
    $u_year = $year;
    $u_month = $month;
    if ($u_month >= 12) {
       $u_month = 1;
       $u_year++;
    if ($u_month<10) $current_day = '0'.$u_month;
    } else $u_month++;
    
    $n_year = $year;
    $n_month = $month;
    if ($n_month <= 1) {
       $n_month = 12;
       $n_year--;
    if ($n_month<10) $current_day = '0'.$n_month;
    } else $n_month--;
    
    $output_month_name = date("n",strtotime($year."-".$month."-01"));
    
    echo '<table width="100%" border="1">
     <tr>
         <td><a href="cal2.php?y='.$n_year.'&m='.$n_month.'"><<</a></td>
         <th colspan="5">'.$month_name[$output_month_name-1].', '.date("Y",strtotime($year."-".$month."-01")).'</th>
         <td><a href="cal2.php?y='.$u_year.'&m='.$u_month.'">>></a></td>
     </tr>
     <tr>
         <td class="wDays">Pirmadienis</td>
         <td class="wDays">Antradienis</td>
         <td class="wDays">Treciadienis</td>
         <td class="wDays">Ketvirtadienis</td>
         <td class="wDays">Penktadienis</td>
         <td class="wDays">Sestadienis</td>
         <td class="wDays">Sekmadienis</td>
     </tr>';
    for ($i=0; $i<($maxday+$startday); $i++) {
           if (($i % 7) == 0 ) echo "<tr>";
           if ($i < $startday) { echo "<td> </td>"; continue; };
           $current_day = $i - $startday + 1;
           if ($current_day<10) $current_day = '0'.$current_day;
    
    	for($a=0;$a<count($events);$a++) {
    		if($events[$a][0] == $year."-".$month."-".$current_day) {
    			$start = "class='withevent'";
    		} else {
    			$start = ""; 
    		}
    	}
    
           echo "<td ".$start."><a href='cal2.php?y=".$year."&m=".$month."&d=".$current_day."'>". $current_day . "</a></td>";
           if (($i % 7) == 6 ) echo "</tr>";
    }
    echo '</table>';
    
    if(isset($_GET['d'])) {
    for($i=0;$i<count($events);$i++) {
    	if($_GET['y']."-".$_GET['m']."-".$_GET['d'] == $events[$i][0]) {
    		echo $events[$i][1]."<br>".$events[$i][2];	
    	}
    }
    }
    
    ?>
    </body>
    </html>
    

  6. Kažkas tokio

    <?php
    $month = isset($_GET['m']) ? $_GET['m'] : date('m');
    $year = isset($_GET['y']) ? $_GET['y'] : date('Y');
    
    $first_day_timestamp = mktime(0,0,0,$month,1,$year); 
    $maxday = date("t",$first_day_timestamp); 
    $thismonth = getdate($first_day_timestamp); 
    $startday = $thismonth['wday']-1;
    if($startday < 0 ) $startday = 6; 
    
    echo '<table>';
    for ($i=0; $i<($maxday+$startday); $i++) {
           if (($i % 7) == 0 ) echo "<tr>";
           if ($i < $startday) { echo "<td> </td>"; continue; };
           $current_day = $i - $startday + 1;
           if ($current_day<10) $current_day = '0'.$current_day;
           echo "<td>". $current_day . "</td>";
           if (($i % 7) == 6 ) echo "</tr>";
    }
    echo '</table>';
    
    $n_year = $year;
    $n_month = $month;
    if ($n_month >= 12) {
       $n_month = 1;
       $n_year++;
    
    } else {
      $n_month++;
    }
    
    
    echo '<a href="/?y=' . $n_year . '&m=' . $n_month . '">Next month</a>';
    ?>

    Labai dėkingas.

  7. Sveiki, gal galit kas padėt arba užvest ant kelio. Kaip padaryt kad paspaudus linką rodytų kito mėnesio kalendorių? Mėginau su GET daryt, bet nelabai gavosi. Tikriausiai šiuo atveju tik PHP neužtenka?

     

    Čia neparašiau savo varianto nes labai kvailas kodas manyčiau.

    <?php
    $month = date('m');
    $year = date('Y');
    
    $first_day_timestamp = mktime(0,0,0,$month,1,$year); 
    $maxday = date("t",$first_day_timestamp); 
    $thismonth = getdate($first_day_timestamp); 
    $startday = $thismonth['wday']-1;
    if($startday < 0 ) $startday = 6; 
    
    echo '<table>';
    for ($i=0; $i<($maxday+$startday); $i++) {
           if (($i % 7) == 0 ) echo "<tr>";
           if ($i < $startday) { echo "<td> </td>"; continue; };
           $current_day = $i - $startday + 1;
           if ($current_day<10) $current_day = '0'.$current_day;
           echo "<td>". $current_day . "</td>";
           if (($i % 7) == 6 ) echo "</tr>";
    }
    echo '</table>';
    ?>

  8. O jei pas tave su minusu gaunasi? :rolleyes:

    $startday = $thismonth['wday']-1;

    Po apačia prirašyk

    if($startday < 0 ) $startday = 6;

     

    turi kodas but toks:

     

    <?php
    $month = 12;
    $year = 2013;
    
    $first_day_timestamp = mktime(0,0,0,$month,1,$year); 
    $maxday = date("t",$first_day_timestamp); 
    $thismonth = getdate($first_day_timestamp); 
    $startday = $thismonth['wday']-1;
    if($startday < 0 ) $startday = 6; 
    
    echo '<table>';
    for ($i=0; $i<($maxday+$startday); $i++) {
           if (($i % 7) == 0 ) echo "<tr>";
           if ($i < $startday) { echo "<td> </td>"; continue; };
           $current_day = $i - $startday + 1;
           if ($current_day<10) $current_day = '0'.$current_day;
           echo "<td>". $current_day . "</td>";
           if (($i % 7) == 6 ) echo "</tr>";
    }
    echo '</table>';
    ?>

    Nepagalvojau apie šitą. Dėkui labai.

  9. Sveiki, gal galit padėt? Kodėl man nerodo 01 kai jis būna sekmadienį? Pradeda nuo 02 tada, o kitais atvejais viskas kaip ir gerai.

    Ten įvesti skaičiai kai būna 01 sekmadienį.

    <?php
    $month = 12;
    $year = 2013 ;
    $first_day_timestamp = mktime(0,0,0,$month,1,$year); 
    $maxday = date("t",$first_day_timestamp); 
    $thismonth = getdate($first_day_timestamp); 
    $startday = $thismonth['wday']-1; 
    
    echo '<table width="100%">';
    
    for ($i=0; $i<($maxday+$startday); $i++) {
    
    if (($i % 7) == 0 ) echo "<tr>";
    
    if ($i < $startday) { echo "<td> </td>"; continue; };
    
    $current_day = $i - $startday + 1;
    if ($current_day<10) $current_day = '0'.$current_day;
    
    
    echo "<td>". $current_day . "</td>";
    
    if (($i % 7) == 6 ) echo "</tr>";
    }
    echo '</table>';
    ?>

  10. Sveiki, ateityje norėčiau užsiiminėti kažkuo kas susija su informatika (traukia programavimas). Kokius dalykus turėčiau pasirinkti? Kiek girdėjau reikalinga lietuvių klaba, matematika A lygiu, informatika A lygiu, anglų klaba ir fizika A. Dar ko nors reikia?

×
×
  • Pasirinkite naujai kuriamo turinio tipą...