Ale o co chodzi? Wrzuciłem skrypt Technosystems; mam powiedzmy sobie sklep, w którym są 3 kategorie towaru - każda z nich korzysta z oddzielnego pliku csv. Tabelka z rekordami wygląda następująco:
$tableheight = "1200"; $globalconfig = "No"; $csvmanagerid = "1"; $csvFile = "./db/fajnadb.csv"; $firstlineislabels = "Yes"; $columnstoinclude = "1,3,4,5,6,7,8,9"; $columnlabels = ""; $def_sort_by = "3"; $def_sort_order = "Ascending"; $separator = "char(380)"; $step = "15"; $view_link = "No"; $view_url = ""; $edit_link = "No"; $edit_url = ""; $delete_link = "No"; $delete_url = ""; $parse_as_link = "9"; $parse_as_email = ""; $parse_as_img = "1"; $img_max_dim = ""; $image_path_prefix = "./../db/images/"; $image_tn = "./../db/images/tn"; ... } } } } } } } } { } } if($globalconfig == 'Yes'){ include 'csvmanager_includes/create_config.php'; } $display = '<div id="display_table" style="overflow:auto; width:100%; height:'.$tableheight.'px">'; $display .= '<table width="100%" cellpadding="3" cellspacing="1" class="csv_table" id="Table0"> <tr> <td align="center" valign="middle" class="csv_footer">'.$filenotfoundlabel.'</td> </tr> </table> </div> '; } if($firstlineislabels == "Yes"){ $labels_row++; for ($i = 0; $i<count($labels1); $i++){ } else{ $labels[array_search($i, $columns)] = trim($labels1[$i]); // Creates an array starting from 0 that contains only the usefull labels } } } } else{ // If no user input exists as far as column selection is concerned, labels = labels1 (all labels) $labels = $labels1; $columns[$i] = $i; } } } // -------------------------------------------------------- If no labels row exists, retrieve the number of columns in the file else{ // See how many columns the file has for($i = 0; $i < count($columnlabels1); $i++){ // IF user column selection exist, the previously seen array $keys is identical with $columns } } else{ // Else take into consideration ALL columns $columns[$k] = $k; $labels[$k] = $k; // In which case also $columns and $lables1 AND $labels are equal } } } die("Column number doesn't match Labels number. I can't set correctly the column headers. Please review your settings. The number of Columns to include and the number of column labels should be the same."); } // Read the entire file to get the records $k = 0; // Lets check if it has to be parsed as email, URL or image $values[$labels[array_search($i, $columns)]][] = '<a href="mailto:'.$data_array[$i].'" class="csv_link">'.$data_array[$i].'</a>'; $echo = '<a href="mailto:'.$data_array[$i].'" class="csv_link">'.$data_array[$i].'</a>'; } $values[$labels[array_search($i, $columns)]][] = '<a href="./torba.php" target="_parent"><img src="./images/add.png" title="Kliknij aby dodać do torby"></a>'; } $values[$labels[array_search($i, $columns)]][] = '<img src="./images/reserved.png" title="Rezerwacja!">'; } $values[$labels[array_search($i, $columns)]][] = '<a href= "'.$image_path_prefix.$data_array[$i].'"><img src="'.$image_tn.$data_array[$i].'" title="Zobacz większe zdjęcie"></a>'; } else{ } if ($echo) { //echo $echo."<br>"; } } }
konkretnie chodzi mi o wycinek:
$values[$labels[array_search($i, $columns)]][] = '<a href="./torba.php" target="_parent"><img src="./images/add.png" title="Kliknij aby dodać do torby"></a>'; }
Jak zrobić, żeby po kliknięciu w ikonkę (tutaj: "add.png") przechodziło się do "torba.php" ze wszystkimi danymi (rozbitymi na zdjęcie, kod produktu, nazwa, opis - no i w zaleznosci od bazy danych cena) z konkretnego wiersza dodatkowo żeby przeszła informacja z ktorej bazy danych rekord został pobrany?
tzn chce cos takiego:
zeby kierując na stronę 'torba' mogl sobie rozbic informację na składowe (tak jak one są w pliku) i powyciągać interesujące mnie dane do wyświetlenia stanu koszyka czyli:
1 z 3 baz danych| link do miniatury | kod produktu | nazwa | cena (1 z 3 - w zależności od bazy danych)
dodatkowo na koncu transakcji zeby sprawdził czy wartość na koncu wiersza dalej jest "1" i zmienił ją na "0" lub jeśli nagle jest "0" zeby dał komunikat ze dana rzecz zostala wlasnie zarezerwowana..?