Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 09-17-2004 15:11:07

soulz
Member
Registered: 08-26-2004
Posts: 20

Help Outside Store Csv View

Alright my client from the begining wanted a cpanel on the backend of the site my company is working for him on. So he can easily change things around within the main site. Then he desided he want to launch an online store.

Well this is my companies first time working on a site containing a shop, and we found CCP which is by all means the best we have seen and demo-ed..  However now my client wants to pull some things such as the mailing list from the stores mailing list to the admin panel we have created for him. As well as he wants to be able to add to the mailing list via the admin panel and another section on the main site other then the store.

Problem is.. CCP is not of my own creation. So I have no clue where to begin and no clue where to end. So if anyone could help me with this that would be great.

Tasks at hand.

Pulling from the maillist.csv and displaying it accordingly on cpanel that we created.

Adding to maillist.csv from a form off of the store itself.

I rarely ever worked with csv.. I usually use sql and php for all my needs.. so again any and all help is great, thanks.

Offline

 

#2 09-17-2004 15:16:44

ghost1157
Member
Registered: 02-19-2003
Posts: 93

Re: Help Outside Store Csv View

Well ,if you guys are adept at creating a cpanel , you should setup CCP to run in MySql and then use php to grab the tables for manipulation . Just a thought .

You can select table by table which ones to convert to MySql 

Offline

 

#3 09-18-2004 09:48:59

soulz
Member
Registered: 08-26-2004
Posts: 20

Re: Help Outside Store Csv View

Converting it to SQL is an option yes.. but we havent been having the best of luck with CCP yet keep running into problem after problem now dont get me wrong the software is the best we have tryed, hence why we went with it.. However it is the first time we needed 3rd party software. and well to be honest I dont really feel like messing with the fungshway so to speak of the whole package. By converting all or a section of it to SQL.. rather then that I would rather hack into it a little with an outside script that calls the maillist.csv and displays it similar to that of the maillist in admin view of the store.

So far I have no problem with calling and displaying the CSV file except that I can only get it to display like it does in the file itself email,f_name,l_name..

And what I want is to make it display a table view of it.

[ email ][ f_name l_name ][ edit / remove ]

^^^ is how i would like to get a table to display it. I know I shouldnt have a problem getting the file to remove a line or more.. and i know i shouldnt have a problem getting the info to edit on any given line...

this is what I have thus far as far as code goes for the script im workin on maybe you or someone else can help point me in the right direction as to make what it is I want.

Code:

<?php 

// reads a csv file and returns a two-dimensional array of lines/fields 
function read_csv($file,$delimiter) 
{ 
  $data_array = file($file); 
  for ( $i = 0; $i < count($data_array); $i++ ) 
  { 
   $parts_array[$i] = explode($delimiter,$data_array[$i]); 
  } 
  return $parts_array; 
} 

// reads a csv file and returns an two-dimensional array of lines/fields 
function select_csv($file,$delimiter,$field,$query) 
{ 
  $data_array = file($file); 
  for ( $i = 0; $i < count($data_array); $i++ ) 
  { 
   $parts_array[$i] = explode($delimiter,$data_array[$i]); 
   if(trim(strtolower($parts_array[$i][$field])) == trim(strtolower($query))) 
   { 
    $result_array[] = $parts_array[$i]; 
   } 
  } 
  return $result_array; 
} 


// ------------------- demonstration below -------------------- 


// this willl display all records in the csv file 
$data = read_csv('ccp51/data/tables/maillist.csv','|'); 
for ( $i = 1; $i < count($data); $i++ ) 
{ 
  for ( $u = 0; $u < count($data[$i]); $u++ ) 
  { 
   echo $data[$i][$u].' '; 
   if($data[$i][$u] == end($data[$i])) 
   { 
    echo '<br>';   
   } 
  } 
} 


echo '<p>';   
?>

If all else fails I will go out and try to convert the email list over to SQL.. but Im going to need help with that also..
How would I have CCP call to SQL, what should I name the tables etc etc etc.. Thanks  wink 

Offline

 

#4 09-18-2004 09:51:31

soulz
Member
Registered: 08-26-2004
Posts: 20

Re: Help Outside Store Csv View

overall.. despite the babble i just sputered out.. thinking about it in hinesite while just after hitting the post button..

It would probally be alot and I mean alot more easier to work with if i could get it into SQL even if its just that section.. so yea.. if you or anyone could give me an idea on how to intergreat that into sql and still work with ccp i would be thankful

Offline

 

#5 09-18-2004 10:01:05

soulz
Member
Registered: 08-26-2004
Posts: 20

Re: Help Outside Store Csv View

alright nevermind.. comon sence.. i endlessly forget that Nick has done a great job with this software and has implimented almost everything as an option in the admin of CCP..

I guess im just a little too panicy right now.. the site plus the store are to be 100% working condition in less the 4 days and the client is up my ******** with constant changes and wanting to do un heard of things and complicated things.. things that should have been mentioned day one when he actually thought of them rather then coming up and saying heyi thought about this awhile back how bout do this.. and its usually not a question lol.. thanks for your patients (i know thats misspelled)..

if i have any questions from now on ill do more research before i post them. Thanks to those of you have helped me recently and in the past.

and thanks Nick for making such a great store package with support system on top of it all.  :-)

Although if someone can help me with the above CSV question I asked earlier please do.. I could use that someday soon cause I have researched that one for a few good hours to come up with examples to eventually get that out of it all...

Offline

 

#6 09-24-2004 15:39:53

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19871
Website

Re: Help Outside Store Csv View

The problem is with your examples in PHP.  They use | delimited files - not , delimited ones.  Instead of:

Code:


$data = read_csv('ccp51/data/tables/maillist.csv','|'); 

Do:

Code:


$data = read_csv('ccp51/data/tables/maillist.csv',','); 


Nick Hendler

Offline

 

Board footer