July_06newsletter.html0000644555041207172570000004572710456003674016715 0ustar cherrytownpg87134400000000000000 Cherrytown Kids!: Unique New and Quality Used Stuff for Kids

Cherrytown Kids! Cherrytown Kids!

Sign Up For Newsletter Newsletter Archives July Issue


Hope You Have a Happy July 4th, 5th, 6th...Hope You Have a Happy July!

Cherrytown Kids Closed for Independence Day Holiday Weekend

In order to give you, our loyal Cherrytown shoppers, and our team a little extra time to celebrate Independence Day, Cherrytown Kids will be closed on Saturday and Sunday July 1st and 2nd. Cherrytown Kids will be open on Wednesday July 5th as usual for your shopping convenience. We wish you and your family a safe, relaxing and memorable 4th of July weekend!

Here are some of the exciting summertime developments happening at Cherrytown Kids:


Starting Today - Super Shoe Sale - 40% Off Shoes, Shoes, and more Shoes!

If your little one has a hefty appetite for collecting (or losing!) shoes, we’ve got some great deals for you! We have just marked down tubs full of fabulous footwear, come on down to Cherrytown for a bumper crop of great deals.

‘Gear Sale Starts July 8th -- 40% Off Great Gear!

Mark your calendar for Saturday July 8th when we’ll be having a blowout 40% off sale on most strollers, back packs, bouncer chairs - lots of great gear at fabulously low prices - don’t miss out!

Fun Opportunity for Moms

If you’re looking for an opportunity to meet some of our great shoppers - and earn some valuable store credit just in time for holiday shopping! - we are looking for a few "Backup Moms" to cover shifts in our shop. Our next training session (in the evening, complete with snacks, of course!) will be held in October. If you’re interested, let us know next time you’re in the shop, send an email: amy@cherrytownkids.com or call: 510.569.1010.


New in The Shop

A fitting room! Now you can make sure your great Cherrytown bargains fit your children perfectly, thanks to our new fitting room, complete with full length mirror. Come on in and try it out for yourself!
Your new little bundle will love drifting off to dreamland in this beautiful bassinet. Loads of fun toys for birthdays girls and boys - great toys at even better prices
Adorable, affordable gifts for baby - and mom!
Fun magnet games - for hours of peaceful family roadtrip fun

Why Medical Professionals Recommend Robeez

Many medical professionals, from pediatricians and family doctors to orthopedic surgeons, attest to the medical benefits of Robeez shoes for developing feet. They not only recommend them to their patients, but put their own young children in them too. Here are some of the things they have to say about Cherrytown’s favorite footwear:

"I am a Pediatric Orthopedic Surgeon and get asked about infant shoes all the time. I have recommended your shoes to countless parents and friends; I can't say enough good things about your shoes."
Dr. Donna Pacicca

"We recommend Robeez to all of our patients. Not only because of the fun and colorful designs, but also for the comfort and protection they give to our little one’s feet. They allow little feet to develop and grow naturally. Best of all, moms love them because they stay on!"
Dr. Russell Shipman, Pediatrician from Kittery, Maine

"The flexible sole and excellent fit of Robeez allows the developing foot to learn balance and build strength, without sacrificing protection. The added benefits of quality materials, great colors and styles make it even easier to put our smallest clients into great footwear!"
Richard Bosch, HKin, CPedTech(C), CPed(C)

"You have truly cornered the market with your product. Aside from being absolutely adorable, your shoes are extremely complementary to a toddler's needs. My son wears them all the time...no hard soled shoes at our house...and I often notice how much more physically adept he is when he plays with kids in his age group. Even though he was considered to be a late walker, he is an early runner, jumper, skipper, and hopper. I recommend Robeez to any mom out there who is looking to give her child a strong foothold on balance and coordination!"
Dr. E. Audrey Toth, D.C. from Winnipeg, Manitoba




Consignment Corner

Due to an 18% increase in our rent, we are forced to adjust our consignment split to reflect the industry standard of 50% store credit or 40% in cash. As we mentioned in last month’s newsletter, this will go into effect in the next few days. We have discussed this reality with many of you and appreciate your continued support. If you have any questions or comments, please feel free to email us: ctk@CherrytownKids.com or give us a call in the shop: 569.1010.

Great Cherrytown Picks:

Breast Pumps
If you’ve priced breast pumps in the retail stores, you know that they are among the priciest items you will purchase for your baby. Don’t worry, Cherrytown Kids has an ample supply of high quality breast pumps at great prices.


Foster Closet

As you can imagine, children are often placed in the foster care system with only the clothes on their backs. We are proud you, of our loyal consignors, for donating your "no thank you" items to the Alameda County Foster Closet. If you’re not currently classified as a "donator" we encourage you to consider changing your status to help support this worthy cause. Give us a call (510) 569.1010 or email, ctk@CherrytownKids.com and we can easily change your return/donator status.


Tell Us What You Think?

In our constant effort to better serve you, we are considering expanding our inventory to include some exciting new items. Please let us know which of the following items you would rush down to Cherrytown to purchase - and which ones would fall into your "thanks, but no thanks!" category:
  1. New Stride Rite Shoes
  2. New McClaren Strollers
  3. New Nursing Bras
  4. Organic Baby Products (lotion, soap, shampoo, etc.)
  5. Eco-Friendly Diapers (New - of course!)
Email us your opinions: ctk@CherrytownKids.com give us a call: 510.569.1010 or let us know when you’re in the shop, as always, we really appreciate your feedback!


Cherrytown Calendar

Free Family Fun for Everyone

Friday July 7th, Free Fridays for Kids at the Alameda County Fair. GWhether you’re into 4H, farm equipment or funnel cakes, you won’t want to miss the rides, exhibits, animals and fun at the 10am-10pm, Alameda County Fairgrounds, 4501 Pleasanton Avenue in Pleasanton. Call: 925.426.7559, www.AlamedaCountyFair.com

Wednesday July 12, The Puppet Company Presents "Tall Tales!" Learn about Johnny Appleseed, Pecos Bill, John Henry, and more! San Leandro Main Library - 300 Estudillo Avenue at 7:30pm. Free. Call: (510) 577-3971.www.ci.san-leandro.ca.us

Saturday July 15, Enjoy a Good Family Flick at the San Leandro Library. Enjoy free family movies at the library - you can choose the morning or afternoon matinee! Pick up free tickets after July 1st and find out which of the newest movies they will be showing! San Leandro Main Library - 300 Estudillo Avenue at 10:30am and 1:00pm. Free. Call: (510) 577-3971. www.ci.san-leandro.ca.us

Wednesday July 19th, Sing-Along with Kathleen Rushing and Bingo Schmingo. Free entertainment for the whole family. Enjoy classics like "Little Bunny Foo Foo" and play an instrument! Refreshments served. San Leandro Main Library - 300 Estudillo Avenue at 11:00am. Free. Call: (510) 577-3971.www.ci.san-leandro.ca.us

Saturday and Sunday July 29th and 30th, Enjoy the Soars and Sights at the Berkeley Kite Festival. Cesar E. Chavez Park at the Berkeley Marina, University Avenue and Spinnaker. Call: 510.235.5483.

Come see us:

Cherrytown Kids

579 Bancroft Avenue @ Dutton

San Leandro, CA 94577

Call: (510) 569-1010

Visit: www.cherrytownkids.com

© 2005, Cherrytown Kids
Oct_06newsletter.html0000644555041207172570000005103110512020617016465 0ustar cherrytownpg87134400000000000000 Cherrytown Kids!: Unique New and Quality Used Stuff for Kids

Cherrytown Kids! Cherrytown Kids!

Sign Up For Newsletter Newsletter Archives October Issue


Hooray for Fall!

It’s starting to feel like fall. Come down to Cherrytown Kids for great priced costumes, cuddly sweaters, comfy tights – and cute rain gear!

We’re Open, Open, Open…Tuesday through Saturday, from 10am to 5pm.

See Kai Run!

These shoes are red (and blue and green and brown…) HOT, HOT, HOT! Last week we got 40 new pairs of these adorable shoes for sizes 3 to 9 and are getting 50 more pairs next week, so surely we have the size you need. Come on in and get them while they last!

Award Winning Corolle Dolls & Accessories

Just in time for your holiday gifts, Cherrytown Kids just received a large shipment of Corolle dolls. These dolls are the product of a French company that has achieved global recognition for its dolls, winning more than 30 international awards for design and play excellence, including two Doll Of The Year awards, a DOLLS magazine Awards of Excellence nomination, as well as awards from the Oppenheim Toy Portfolio, National Parenting Publications, and Dr. Toy. Corolle dolls are also regularly featured in "Best Toys of the Year" stories in such nationally-circulated consumer publications as Child, Family Fun and Parenting.

Now that the dolls have arrived in San Leandro, they are at Cherrytown Kids just waiting for you to take them home.

Also New at Cherrytown Kids

eeBoo Games
Castle for all those Papo Knights and Princesses
Pirate Treasure Maps
Melissa & Doug Art supplies
Lions and Tigers and Zebras – Come Buy!
Boosty Yea!
These ultra cool booster hairs have been designed to add excitement to your little one's favorite meal, haircut, or story time. These functional, yet fashionable chairs are made by hand right here in California. The oil cloth fabric is easy to keep clean and looking new as it easily wipes clean. Your toddler will enjoy this chair for years.
News…

Grandparents’ Day Discounts, Every Week
As you probably know National Grandparents’ Day was last month – which we think is great but…why wait a whole year to celebrate grandmas, grandpas, nanas, papas, omas, opas – and all those great folks?!

Starting this Wednesday, Cherrytown Kids will celebrate Grandparents Day every week with a 10% Off All New Merchandise Discount for all grandparents, every Wednesday. All you have to do is show us a picture of your precious grandchild – and you can even tell us how adorable they are – and we’ll give you a well deserved discount. What a great deal!

Cherrytown Community Partnership Program: Cherrytown Kids has developed an innovative partnership program to help raise funds for schools and other local non-profit organizations. If you are involved with a worthy cause that would be interested in partnering with Cherrytown, please shoot us off an email and we’ll send you the details: ctk@cherrytownkids.com


Bean Bag Road Show: Is your school, sports organization or charitable group need a fun little game for children? Cherrytown Kids has a great little bean bag toss game that we lend to help support good causes and good fun. If you would like to arrange to have it at your group’s next event, email us for details: ctk@cherrytownkids.com


Come join the Cherrytown Kids Birthday Club!

Bring your child in on (or near!) his/her birthday and we’ll make him/her a celebrated member of the Cherrytown Kids Birthday Club – it’s fun and FREE -- hooray!

Your birthday girl or boy will receive the following fun benefits of membership:
  • A Free birthday gift
  • Their official CTK Birthday Club photo will be posted in the shop – and included in our fun monthly email newsletter
  • A limited edition CTK Birthday Club membership card
  • Warm wishes from the CTK shop assistants – and anyone else who happens to be around!

Join the Cherrytown Kids Team!

If you have an upbeat, enthusiastic personality, reliable childcare, and a few hours per week to spare, why not consider joining the Cherrytown Kids Team! We are looking for motivated moms (and dads!) or anyone else willing to trade time in the shop for store credit. It will be a fun way to pay for great holiday gifts that your kids will love. If you’re interested, give us a call at: 569.1010 or email: ctk@CherrytownKids.com


Bravo for Buy Outright!

Due to the overwhelmingly positive response to our trial of the Buy Outright model, you have convinced us to permanently adopt this approach. So, once again, here’s the deal:

You will be offered a cash rate on the spot (buying budget permitting) or a greater rate for store credit for your items as soon as they are processed, rather than having them consigned. The benefit to you, the consigner is that you get instant credit for your items rather than having to wait for them to sell. The trade off is that because there is no guarantee that items will sell, they may have to be placed on clearance or even donated rather than being sold, we take on all of the risk and therefore you may make less per item. As always, we’d be thrilled to be able to reuse and give your high quality clothing a new lease on life – and put it to work for you!


New Buying Hours

For your convenience, we will be available to purchase your quality children’s clothing in sizes 0-8 in person from 10am to 4pm on Tuesdays, Wednesdays and Thursdays. In a hurry? Our Drop & Run option allows you to leave your load of clothing anytime for us to go through and purchase for cash or instant credit.

Our Storage Room Runneth Over – Run on Over for Your Returns!

Do you ever wonder why it takes us a while to find your “returns”? Have you ever come to collect your items, only to be told that we can’t find them? Well, we'll admit it, when it comes to storage room chaos – we're guilty!

Help us out by coming to get your stuff – or calling and giving us permission to donate it to Alameda County Foster Closet, where the clothing items go to local children who, by no fault of there own, end up in foster care. Whatever you want, please help us clear out the clutter.


Look for your number and if you find it, either come on down and collect your stuff, or call (510) 569.1010 or email us: ctk@cherrytownkids.com and tell us to donate your items:


104 111 113 116 118
119120122 126133135
136140141 148151154
155162184 190191194
200204206 209210211
212220225 228233238
243246253 254257262
267271282 289290291
293298300 304305307
314318320 326332333
336346348 356359373
381383384 388393402
403403405 406407409
415419421 419421426
437442446 447453471
483493501 507510511
512515517 518529531
539540542 545547


Cherrytown Calendar

Free Family Fun for Everyone

Friday October 6th, Mooncake Festival. Celebrate the Autumn Harvest Festival when the moon is at its fullest. Make paper lanterns with recycled materials and mooncake cards with Chinese calligraphy in the Art Studio. FREE. 9:30-5:00, 2065 Kittredge, Berkeley. www.habitot.org

Sunday October 8th, Bancroft Ave Art & Wine Festival. Enjoy a fun, family friendly fall afternoon while you support the Davis Street Family Resource Center. You can admire the exceptional artwork on display while your little ones create some of their own at the art & craft area. The little ones will also enjoy giving the famous Cherrytown Kids Bean Bag toss a try. Adults $35, youth 12-21 $10, Children under 12 FREE, 12-4pm, 600 block of Bancroft Ave, near Zocalo Coffeehouse. www.DavisStreet.org

Sunday October 22nd, Celebrate the Days of the Dead with the Oakland Museum. Hands-on craft activities, demonstrations, music, dance, ceremonia, food and a mercado – something for everybody. The celebration activities are free. Museum gallery admission will be half off all day (children under 6 are FREE) 12-4pm, 10th & Oak Streets, Oakland. www.museumofcalifornia.org

Come see us:

Cherrytown Kids

579 Bancroft Avenue @ Dutton

San Leandro, CA 94577

Call: (510) 569-1010

Visit: www.cherrytownkids.com

© 2005, Cherrytown Kids
about.html0000644555041207172570000002622710510410415014436 0ustar cherrytownpg87134400000000000000 Robeez, See Kai Run and Childrens Clothes in the East Bay: Visit Cherrytown Kids!
Cherrytown Kids Home



Sign up to receive e-mail newsletters from Cherrytown Kids.
Check out our products lines.


Consignors
Log in here
for sales status.
username:

password:

About Us

Our Store

The Store

Cherrytown Kids specializes in high quality, gently used children’s clothing in sizes 0 – 8. All items are clean, steamed with tea tree oil and in excellent condition.

Our Fall buying hours are Tuesday, Wednesday and Thursday, 10 a.m. to 4 p.m. No appointment is necessary.

Cherrytown Kids is not only a great place to outfit kids with great quality clothes at affordable prices. We also carry new clothes, one of the best selections of Robeez shoes and boots in the East Bay, See Kai Run shoes, Pediped baby shoes, Funkie Baby bibs and Go Mats, Bumkins bibs, Giggles dress-up outfits, Kidorable rain gear, Ravensburger puzzles, eeBoo toys, Melissa & Doug toys and other outstanding domestic and imported children's toys, including Corolle baby dolls from France. You can find baby care products such as Seventh Generation diapers and babies wipes.

We have a range of gifts that are perfect for baby showers, birthdays or special treats for your kids. Many of these products are from extremely talented local moms and artists. These are all one-of-a-kind items that you will not find anywhere else.

We have a fun, safe area for children to play in while the parent or caregiver shops. We also provide a nursing chair in the back of our store to support our nursing moms, along with a dressing room for kids of all ages. Our helpful staff is always available to help you find exactly what you are looking for!

Located in the North End of San Leandro close to Highway 580, Cherrytown Kids provides an unique shopping experience with exceptional quality and customer service. Many of our regular customers are from Alameda, Berkeley, Castro Valley, Hayward, Oakland and Pleasanton. Please come and visit us, and then relax at Zocalo Coffeehouse, which has a children's play area, ask us for recommendations for lunch at local restaurants, or explore the fantastic children's zoo at the nearby Oakland Zoo.

LOCATION
579 Bancroft Ave. (near Dutton Ave.)
San Leandro, CA 94577
See map

There is plenty of FREE PARKING right next to the store. We are a short drive from Highway 580 (use Dutton/Estudillo Exit from Berkeley/Oakland and Estudillo/Downtown Exit from Hayward/Castro Valley).

STORE HOURS
10:00 AM - 5:00 PM
Tuesday through Saturday

Closed Sunday & Monday

 

CONTACT US
Looking for something in particular? Call us at 510-569-1010 or by email at ctk@cherrytownkids.com If you wish to sign up for our monthly email newsletter announcing new items, holiday promotions and specials click here.


The Owners

Morgan Mack-Rose Amy Cassidy and Roseann Galvan are the owners of Cherrytown Kids. Both are mothers and customers of Cherrytown Kids prior to purchasing the store.

"As a loyal Cherrytown Kids customer and friend from the early days, I have had the privilege of watching it evolve from an idea born out of a need recognized by two very creative moms, Diana Quintal and Morgan Mack-Rose, to the much needed and appreciated community asset that it is today," stated Amy, in the photo with her daughters. "On behalf of my partner and the many other loyal Cherrytown patrons, I thank Diana and Morgan for having the vision and the courage that was necessary to turn their idea into a reality."

Amy and Roseann are committed providing an affordable, high quality shopping alternative for families in San Leandro and throughout the East Bay. "I personally understand the need for great bargains on children’s clothes, gifts and gear," commented Roseann. "I will be focusing my energies on spreading the word about Cherrytown and ferreting out more exciting new and quality pre-owned (sorry, couldn’t resist the car dealer lingo!) items for the children in your life."

Cherrytown Kids is resource center for families. Feel free to ask about opportunities to form partnerships to help raise funds for the great children’s programs, preschools and parent’s groups in the area. We welcome your ideas and suggestions on how we can make Cherrytown Kids an even better place for you to shop. Please email us at ctk@cherrytownkids.com.



HOMEABOUT USSHOPSITE MAP © 2004-06, Cherrytown Kids
about2.htm0000644555041207172570000000000010454114454014334 0ustar cherrytownpg87134400000000000000aprilnewsletter.html0000644555041207172570000003263310456002560016555 0ustar cherrytownpg87134400000000000000 Cherrytown Kids!: Unique New and Quality Used Stuff for Kids

Cherrytown Kids! Cherrytown Kids!

APRIL ISSUE

NEWS FLASH - Cherrytown Kids to Open on Sundays!

Due to an overwhelming number of requests from you, our loyal customers, we have decided to open on Sundays so you can easily fit your Cherrytown time in around your family’s work, school, soccer, ballet, baseball, piano, basketball, gymnastics, karate, dance, guitar and obo lessons. For your convenience, our new shop schedule, beginning May 1st, will be as follows:

Wednesday thru Sunday: Open 10am-5pm

Monday and Tuesday: Closed

Questions, suggestions, comments, random thoughts? Feel free to contact us about anything that’s on your mind! Call: (510) 569-1010, email: ctk@cherrytownkids.com


Meet Mr. Bunny at Cherrytown Kids

Look who’s on his way to Cherrytown Kids - hooray, it’s everybody’s favorite fuzzy friend, Mr. Bunny! Bring your kiddies and your camera and meet Mr. Bunny at Cherrytown Kids this Saturday, April 8th, from 2 to 5pm and next Saturday, April 15, from 10am to 1pm, phone: 510.569.1010. Free gift for good boys and girls, so mark your calendar for one (or both!) of those days and come on down! (Rain or SHINE - oh please, please let it shine, we all really want to see some the sun!)

Treasures in Your Garage (attic, basement, kitchen...)

Cherrytown Kids keeps a running "Wish List" of items that shoppers request so when our consignors come in with such items, we can play matchmaker and make everybody happy.

Here are some of the items that our shoppers are currently wishing for:
  • Highchairs (No less than 3 requests!)
  • Stroller that accommodates a car seat
  • Double strollers
  • Bed rail
  • Maclaren umbrella stroller
  • High quality pram (preferably navy and white)

New in The Shop

Some great new, high-quality wooden toys, games and craft sets from Melissa & Doug - as well as new supplies of your sold-out favorites.

Break away from the pastel pack! New Go Mats and Soak Proof Bibs by "Funky Baby" feature fabulous funky fabrics
Forget the hollow Peter Rabbit, these great goodies won’t require dental visits


Earth Day is On the Way!



We at Cherrytown Kids encourage you to make a special effort to educate your children on the importance of reducing consumption and waste, and preserving and improving the health of our environment -- on Earth Day and every day! Here is a fun way to celebrate while you educate on the importance of preserving our natural resources and caring for our planet:

Celebrate Earth Day, Saturday April 22nd, by lending a hand at the Eden Landing Restoration Clean-up. Hosted by Save The Bay and the California Department of Fish and Game. Volunteers will help clean-up debris and remove non-native plants in preparation for a levee breach this fall that will restore 600 acres of wetlands for fish, shorebirds, and wildlife. Eden Landing in Hayward, 9:00 am - 12:00 pm. Free. For more information or to sign-up to volunteer, call: Jocelyn Gretz at (510) 452-9261 ext. 109.



Coming in May...

Cherrytown celebrates Moms, Moms-to-be, Stepmoms, Fostermoms, Grandmothers, Godmothers, and all the other fabulous women in our lives. We’ll have special grownup girl items in stock for one special weekend, Saturday May 6th and Sunday May 7th. We thought we’d help you kick-start your Mother’s Day celebrations a week early, besides we’re sure you’ll be busy being pampered on Mother’s Day weekend - you deserve it! Stop in to treat yourself or someone you love.


Cherrytown Calendar

Free Family Fun for Everyone

Wednesday April 12, The whole family gets its groove on! Dynamic interactive concert with Lori & R.J, stars of the WB Channel 20 after school programming, performing kid's songs with a groove! Special appearance by the Easter Bunny and fun surprises for all the kids. San Leandro Main Library - 300 Estudillo Avenue at 7:30pm. Free. Call: (510) 577-3971. www.ci.san-leandro.ca.us/sllibrary.html

Saturday April 15, Family bird walk. Kids will learn how to create their personal bird watching field guides, and then head out onto the trails to find those birds. Learn about the salt marsh along the way. A limited number of binoculars are available to borrow. Recommended for children ages 5-10. Visitor Center, Don Edwards San Francisco Bay National Wildlife Refuge, #1 Marshlands Road, Fremont, 10:00am-12:00pm. Free. RESERVATIONS REQUIRED; call 510-792-0222 x43. www.fws.gov/desfbay

Sunday April 30, Self guided Bay-Friendly garden tour showcasing natural gardening practices. Self-guided tour features diverse and beautiful Bay-Friendly gardens: Mediterranean retreats, edible gardens with bees and chickens, wildlife habitats and gardens designed for children. 10am-5pm. Free, register online at www.BayFriendly.org

Ongoing, 24/7/365: Trying to keep your child occupied in a germ infested doctor’s office? Stuck in traffic without snacks? Don’t worry - grab your cell and call Dial-A-Story to have the children listen to the San Leandro Library’s own beloved Miss Penny tell an exciting story, 24 hours a day, FREE. Call: (510) 577-6067.

Cherrytown Kids

579 Bancroft Avenue @ Dutton

San Leandro, CA 94577

Call: (510) 569-1010


© 2005, Cherrytown Kids
barcode/0000755555041207172570000000000010567623256014051 5ustar cherrytownpg87134400000000000000barcode/barcode.php0000644555041207172570000000706010271617224016152 0ustar cherrytownpg87134400000000000000init(); // You must call this method to initialize the image $drawing->add_barcode($code_generated); $drawing->draw_all(); $im =& $drawing->get_im(); // Next line create the little picture, the barcode is being copied inside $im2 = imagecreate($code_generated->lastX,$code_generated->lastY); imagecopyresized($im2, $im, 0, 0, 0, 0, $code_generated->lastX, $code_generated->lastY, $code_generated->lastX, $code_generated->lastY); $drawing->set_im($im2); $drawing->orient(); // Draw (or save) the image into PNG format. $drawing->finish($fmt); ?>barcode/class/0000775555041207172570000000000010567623256015160 5ustar cherrytownpg87134400000000000000barcode/class/BarCode.php0000644555041207172570000001040110271617224017150 0ustar cherrytownpg87134400000000000000maxHeight = $maxHeight; $this->color1 = $color1; $this->color2 = $color2; $this->res = $res; $this->error = 0; $this->positionX = 4; $this->positionY = 13; //N.MEL.7 // $this->positionY = 0; } /** * Returns the index in $keys (useful for checksum) * * @param mixed $var * @return mixed */ protected function findIndex($var){ return array_search($var,$this->keys); } /** * Returns the code of the char (useful for drawing bars) * * @param mixed $var * @return string */ protected function findCode($var){ return $this->code[$this->findIndex($var)]; } /** * Draws a Bar of $color depending of the resolution * * @param ressource $img * @param FColor $color */ protected function DrawSingleBar($im,FColor $color){ $bar_color = (is_null($color))?NULL:$color->allocate($im); if(!is_null($bar_color)) for($i=0;$i<$this->res;$i++) imageline($im,$this->positionX+$i,$this->positionY,$this->positionX+$i,$this->positionY+$this->maxHeight,$bar_color); } /** * Writes the Error on the picture * * @param ressource $img * @param string $text */ protected function DrawError($im,$text){ $text_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); imagestring($im,5,0,$this->error*15,$text,$text_color); $this->error++; $this->lastX = (imagefontwidth(5)*strlen($text)>$this->lastX)?imagefontwidth(5)*strlen($text):$this->lastX; $this->lastY = $this->error*15; } /** * Moving the pointer right to write a bar */ protected function nextX(){ $this->positionX+=$this->res; } /** * Draws all chars thanks to $code. if $start==1, the line begins by a bar. * if $start==2, the line begins by a space. * * @param ressource $im * @param string $code * @param int $start */ protected function DrawChar($im,$code,$start=1){ $currentColor = ($start==1)?$this->color1:$this->color2; $colornumber = $start; for($i=0;$iDrawSingleBar($im,$currentColor); $this->nextX(); } if($colornumber==1){ $currentColor=$this->color2; $colornumber=2; } else{ $currentColor=$this->color1; $colornumber=1; } } } /** * Draws the information text above the barcode * * @param ressource $im */ protected function DrawInfoText($im) { if($this->textfont != 0 && strlen($this->info) != 0 ) { // $xPosition = ($this->positionX / 2) - (strlen($this->info)/2)*imagefontwidth($this->textfont); $xPosition = 4; $text_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); // imagestring($im,$this->textfont,$xPosition,0,$this->info,$text_color); // imagestring($im,1,$xPosition,0,$this->info,$text_color); imagestring($im,1,$xPosition,0,substr($this->info, 0, 18),$text_color); $this->lastY = $this->maxHeight + $this->positionY + imagefontheight($this->textfont); } } /** * Draws the label under the barcode * * @param ressource $im */ protected function DrawText($im) { if($this->textfont != 0) { // $xPosition = ($this->positionX / 2) - (strlen($this->text)/2)*imagefontwidth($this->textfont); $xPosition = 4; $text = $this->price." ".$this->text; $text_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); // imagestring($im,$this->textfont,$xPosition,$this->maxHeight+$this->positionY,$this->text,$text_color); imagestring($im,$this->textfont,$xPosition,$this->maxHeight+$this->positionY,$text,$text_color); $this->lastY = $this->maxHeight + $this->positionY + imagefontheight($this->textfont); } } }; ?>barcode/class/codabar.barcode.php0000644555041207172570000000577410271617226020665 0ustar cherrytownpg87134400000000000000keys = array('0','1','2','3','4','5','6','7','8','9','-','$',':','/','.','+','A','B','C','D'); $this->code = array( // 0 added to add an extra space '00000110', /* 0 */ '00001100', /* 1 */ '00010010', /* 2 */ '11000000', /* 3 */ '00100100', /* 4 */ '10000100', /* 5 */ '01000010', /* 6 */ '01001000', /* 7 */ '01100000', /* 8 */ '10010000', /* 9 */ '00011000', /* - */ '00110000', /* $ */ '10001010', /* : */ '10100010', /* / */ '10101000', /* . */ '00111110', /* + */ '00110100', /* A */ '00010110', /* B */ '01010010', /* C */ '00011100' /* D */ ); $this->setText($text); $this->textfont = $textfont; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = strtoupper($text); // Only Capital Letters are Allowed } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; // Checking if all chars are allowed for($i=0;$itext);$i++) { if(!is_int(array_search($this->text[$i],$this->keys))) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } } if($error_stop == false) { // Must Start By A, B, C or D if($this->text[0] != 'A' && $this->text[0] != 'B' && $this->text[0] != 'C' && $this->text[0] != 'D') { $this->DrawError($im,'You must start by char A, B, C or D.'); $error_stop = true; } // Must Over By A, B, C or D if($this->text[strlen($this->text)-1] != 'A' && $this->text[strlen($this->text)-1] != 'B' && $this->text[strlen($this->text)-1] != 'C' && $this->text[strlen($this->text)-1] != 'D') { $this->DrawError($im,'You must end by char A, B, C or D.'); $error_stop = true; } if($error_stop == false) { for($i=0;$itext);$i++) $this->DrawChar($im,$this->findCode($this->text[$i]),1); $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; $this->DrawText($im); } } } }; ?>barcode/class/code11.barcode.php0000644555041207172570000000663410271617226020342 0ustar cherrytownpg87134400000000000000starting = $this->ending = 47; $this->keys = array('0','1','2','3','4','5','6','7','8','9','-'); $this->code = array( // 0 added to add an extra space '000010', /* 0 */ '100010', /* 1 */ '010010', /* 2 */ '110000', /* 3 */ '001010', /* 4 */ '101000', /* 5 */ '011000', /* 6 */ '000110', /* 7 */ '100100', /* 8 */ '100000', /* 9 */ '001000' /* - */ ); $this->setText($text); $this->textfont = $textfont; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = $text; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; // Checking if all chars are allowed for($i=0;$itext);$i++) { if(!is_int(array_search($this->text[$i],$this->keys))) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } } if($error_stop == false) { // Starting Code $this->DrawChar($im,'001100',1); // Chars for($i=0;$itext);$i++) $this->DrawChar($im,$this->findCode($this->text[$i]),1); // Checksum // First CheckSUM "C" // The "C" checksum character is the modulo 11 remainder of the sum of the weighted // value of the data characters. The weighting value starts at "1" for the right-most // data character, 2 for the second to last, 3 for the third-to-last, and so on up to 20. // After 10, the sequence wraps around back to 1. // Second CheckSUM "K" // Same as CheckSUM "C" but we count the CheckSum "C" at the end // After 9, the sequence wraps around back to 1. $sequence_multiplier = array(10,9); $temp_text = $this->text; for($z=0;$z<2;$z++) { // We don't display the K CheckSum if the original text had a length less than 10 if(strlen($temp_text)<=10 && $z==1) break; $checksum = 0; for($i=strlen($temp_text),$j=0;$i>0;$i--,$j++) { $multiplier = $i % $sequence_multiplier[$z]; if($multiplier==0) $multiplier=$sequence_multiplier[$z]; $checksum += $this->findIndex($temp_text[$j]) * $multiplier; } $this->DrawChar($im,$this->findCode($checksum % 11),1); $temp_text .= $this->keys[$checksum % 11]; } // Ending Code $this->DrawChar($im,'00110',1); $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; $this->DrawText($im); } } }; ?>barcode/class/code128.barcode.php0000644555041207172570000002333610271617226020431 0ustar cherrytownpg87134400000000000000starting = 103; elseif($start=='B') $this->starting = 104; elseif($start=='C') $this->starting = 105; $this->ending = 106; $this->currentCode = $start; /* CODE 128 A */ $this->keysA = array(' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\',']','^','_','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',chr(128),chr(129)); /* CODE 128 B */ $this->keysB = array(' ','!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','[','\\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','{','|','}','~','','','','',chr(128),'',chr(130)); /* CODE 128 C */ $this->keysC = array(); for($i=0;$i<=99;$i++) $this->keysC[] = sprintf('%02d',$i); $this->keysC[] = chr(129); $this->keysC[] = chr(130); $this->code = array( '101111', /* 00 */ '111011', /* 01 */ '111110', /* 02 */ '010112', /* 03 */ '010211', /* 04 */ '020111', /* 05 */ '011102', /* 06 */ '011201', /* 07 */ '021101', /* 08 */ '110102', /* 09 */ '110201', /* 10 */ '120101', /* 11 */ '001121', /* 12 */ '011021', /* 13 */ '011120', /* 14 */ '002111', /* 15 */ '012011', /* 16 */ '012110', /* 17 */ '112100', /* 18 */ '110021', /* 19 */ '110120', /* 20 */ '102101', /* 21 */ '112001', /* 22 */ '201020', /* 23 */ '200111', /* 24 */ '210011', /* 25 */ '210110', /* 26 */ '201101', /* 27 */ '211001', /* 28 */ '211100', /* 29 */ '101012', /* 30 */ '101210', /* 31 */ '121010', /* 32 */ '000212', /* 33 */ '020012', /* 34 */ '020210', /* 35 */ '001202', /* 36 */ '021002', /* 37 */ '021200', /* 38 */ '100202', /* 39 */ '120002', /* 40 */ '120200', /* 41 */ '001022', /* 42 */ '001220', /* 43 */ '021020', /* 44 */ '002012', /* 45 */ '002210', /* 46 */ '022010', /* 47 */ '202010', /* 48 */ '100220', /* 49 */ '120020', /* 50 */ '102002', /* 51 */ '102200', /* 52 */ '102020', /* 53 */ '200012', /* 54 */ '200210', /* 55 */ '220010', /* 56 */ '201002', /* 57 */ '201200', /* 58 */ '221000', /* 59 */ '203000', /* 60 */ '110300', /* 61 */ '320000', /* 62 */ '000113', /* 63 */ '000311', /* 64 */ '010013', /* 65 */ '010310', /* 66 */ '030011', /* 67 */ '030110', /* 68 */ '001103', /* 69 */ '001301', /* 70 */ '011003', /* 71 */ '011300', /* 72 */ '031001', /* 73 */ '031100', /* 74 */ '130100', /* 75 */ '110003', /* 76 */ '302000', /* 77 */ '130001', /* 78 */ '023000', /* 79 */ '000131', /* 80 */ '010031', /* 81 */ '010130', /* 82 */ '003101', /* 83 */ '013001', /* 84 */ '013100', /* 85 */ '300101', /* 86 */ '310001', /* 87 */ '310100', /* 88 */ '101030', /* 89 */ '103010', /* 90 */ '301010', /* 91 */ '000032', /* 92 */ '000230', /* 93 */ '020030', /* 94 */ '003002', /* 95 */ '003200', /* 96 */ '300002', /* 97 */ '300200', /* 98 */ '002030', /* 99 */ '003020', /* 100*/ '200030', /* 101*/ '300020', /* 102*/ '100301', /* 103*/ '100103', /* 104*/ '100121', /* 105*/ '122000' /*STOP*/ ); $this->setText($text); $this->setInfo($info); $this->setPrice($price); $this->textfont = $textfont; $this->usingCode($start); $this->starting_text = $start; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = $text; } /** * Saves Info * * @param string $info */ public function setInfo($info) { $this->info = $info; } /** * Saves Price * * @param string $price */ public function setPrice($price) { $this->price = $price; } private function usingCode($code) { if($code=='A') $this->keys = $this->keysA; elseif($code=='B') $this->keys = $this->keysB; elseif($code=='C') $this->keys = $this->keysC; $this->currentCode = $code; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; $this->usingCode($this->starting_text); // Checking if all chars are allowed for($i=0;$itext);$i++) { if($this->currentCode=='C') { if(isset($this->text[$i+1]) && $this->check_int($this->text[$i+1])) { $value_test = array_search($this->text[$i].$this->text[$i+1],$this->keys); $i++; } else { $this->DrawError($im,'With Code C, you must provide always pair of two integers.'); $error_stop = true; } } else $value_test = array_search($this->text[$i],$this->keys); if(!is_int($value_test)) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } if($this->findIndex($this->text[$i]) == 99 && $this->currentCode != 'C') $this->usingCode('C'); elseif($this->findIndex($this->text[$i]) == 100 && $this->currentCode != 'B') $this->usingCode('B'); elseif($this->findIndex($this->text[$i]) == 101 && $this->currentCode != 'A') $this->usingCode('A'); } if($error_stop == false) { // The START-A, START-B, START-C, STOP are not allowed if(is_int(strpos($this->text,chr(135))) || is_int(strpos($this->text,chr(136))) || is_int(strpos($this->text,chr(137))) || is_int(strpos($this->text,chr(138)))) { $this->DrawError($im,'Chars START-A, START-B, START-C, STOP not allowed.'); $error_stop = true; } if($error_stop == false) { $this->usingCode($this->starting_text); // Starting Code $this->DrawChar($im,$this->code[$this->starting],1); // Chars for($i=0;$itext);$i++) { if($this->currentCode=='C') { $this->DrawChar($im,$this->findCode($this->text[$i].$this->text[$i+1]),1); $i++; } else $this->DrawChar($im,$this->findCode($this->text[$i]),1); if($this->findIndex($this->text[$i]) == 99 && $this->currentCode != 'C') $this->usingCode('C'); elseif($this->findIndex($this->text[$i]) == 100 && $this->currentCode != 'B') $this->usingCode('B'); elseif($this->findIndex($this->text[$i]) == 101 && $this->currentCode != 'A') $this->usingCode('A'); } // Checksum // First Char (START) // + Starting with the first data character following the start character, // take the value of the character (between 0 and 102, inclusive) multiply // it by its character position (1) and add that to the running checksum. // Modulated 103 if($this->starting == 103) $this->usingCode('A'); elseif($this->starting == 104) $this->usingCode('B'); elseif($this->starting == 105) $this->usingCode('C'); $checksum = 0; $checksum += $this->starting; for($position=1,$i=0;$itext);$position++,$i++) { if($this->currentCode=='C') { $checksum += intval($this->text[$i].$this->text[$i+1]) * $position; $i++; } else $checksum += $this->findIndex($this->text[$i]) * $position; if($this->findIndex($this->text[$i]) == 99 && $this->currentCode != 'C') $this->usingCode('C'); elseif($this->findIndex($this->text[$i]) == 100 && $this->currentCode != 'B') $this->usingCode('B'); elseif($this->findIndex($this->text[$i]) == 101 && $this->currentCode != 'A') $this->usingCode('A'); } $this->DrawChar($im,$this->code[$checksum % 103],1); // Ending Code $this->DrawChar($im,$this->code[$this->ending],1); // Draw a Final Bar $this->DrawChar($im,'1',1); $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; // Removing Special Code $this->text = ereg_replace(chr(128),'',$this->text); $this->text = ereg_replace(chr(129),'',$this->text); $this->text = ereg_replace(chr(130),'',$this->text); $this->DrawText($im); } } } private function check_int($var) { if(intval($var)>=0 || intval($var)<=9) return true; else return false; } }; ?>barcode/class/code39.barcode.php0000644555041207172570000001135710271617226020352 0ustar cherrytownpg87134400000000000000starting = $this->ending = 43; $this->keys = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.',' ','$','/','+','%','*'); $this->code = array( // 0 added to add an extra space '0001101000', /* 0 */ '1001000010', /* 1 */ '0011000010', /* 2 */ '1011000000', /* 3 */ '0001100010', /* 4 */ '1001100000', /* 5 */ '0011100000', /* 6 */ '0001001010', /* 7 */ '1001001000', /* 8 */ '0011001000', /* 9 */ '1000010010', /* A */ '0010010010', /* B */ '1010010000', /* C */ '0000110010', /* D */ '1000110000', /* E */ '0010110000', /* F */ '0000011010', /* G */ '1000011000', /* H */ '0010011000', /* I */ '0000111000', /* J */ '1000000110', /* K */ '0010000110', /* L */ '1010000100', /* M */ '0000100110', /* N */ '1000100100', /* O */ '0010100100', /* P */ '0000001110', /* Q */ '1000001100', /* R */ '0010001100', /* S */ '0000101100', /* T */ '1100000010', /* U */ '0110000010', /* V */ '1110000000', /* W */ '0100100010', /* X */ '1100100000', /* Y */ '0110100000', /* Z */ '0100001010', /* - */ '1100001000', /* . */ '0110001000', /* */ '0101010000', /* $ */ '0101000100', /* / */ '0100010100', /* + */ '0001010100', /* % */ '0100101000' /* * */ ); $this->setText($text); $this->setInfo($info); $this->setPrice($price); $this->textfont = $textfont; $this->checksum = $checksum; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = strtoupper($text); // Only Capital Letters are Allowed } /** * Saves Info * * @param string $info */ public function setInfo($info) { $this->info = $info; } /** * Saves Price * * @param string $price */ public function setPrice($price) { $this->price = $price; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; // Checking if all chars are allowed for($i=0;$itext);$i++) { if(!is_int(array_search($this->text[$i],$this->keys))) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } } if($error_stop == false) { // The * is not allowed if(is_int(strpos($this->text,'*'))) { $this->DrawError($im,'Char \'*\' not allowed.'); $error_stop = true; } if($error_stop == false) { // Starting * $this->DrawChar($im,$this->code[$this->starting],1); // Chars for($i=0;$itext);$i++) $this->DrawChar($im,$this->findCode($this->text[$i]),1); // Checksum (rarely used) if($this->checksum == true) { $checksum = 0; for($i=0;$itext);$i++) $checksum += $this->findIndex($this->text[$i]); $this->DrawChar($im,$this->code[$checksum % 43],1); } // Ending * $this->DrawChar($im,$this->code[$this->ending],1); $priceItemNumWidth = imagefontwidth($this->price) + strlen(" ") + imagefontwidth($this->text); $elementLengths = array (imagefontwidth($this->info), $priceItemNumWidth, $this->positionX); $maxX = 0; for ($l=0; $l= $maxX) { $maxX = $elements[$l]; } } $this->lastX = $maxX; // $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; $this->DrawInfoText($im); $this->DrawText($im); } } } }; ?>barcode/class/code93.barcode.php0000644555041207172570000001275410271617226020354 0ustar cherrytownpg87134400000000000000starting = $this->ending = 47; $this->keys = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','-','.',' ','$','/','+','%','($)','(%)','(/)','(+)','*'); $this->code = array( '020001', /* 0 */ '000102', /* 1 */ '000201', /* 2 */ '000300', /* 3 */ '010002', /* 4 */ '010101', /* 5 */ '010200', /* 6 */ '000003', /* 7 */ '020100', /* 8 */ '030000', /* 9 */ '100002', /* A */ '100101', /* B */ '100200', /* C */ '110001', /* D */ '110100', /* E */ '120000', /* F */ '001002', /* G */ '001101', /* H */ '001200', /* I */ '011001', /* J */ '021000', /* K */ '000012', /* L */ '000111', /* M */ '000210', /* N */ '010011', /* O */ '020010', /* P */ '101001', /* Q */ '101100', /* R */ '100011', /* S */ '100110', /* T */ '110010', /* U */ '111000', /* V */ '001011', /* W */ '001110', /* X */ '011010', /* Y */ '012000', /* Z */ '010020', /* - */ '200001', /* . */ '200100', /* */ '210000', /* $ */ '001020', /* / */ '002010', /* + */ '100020', /* % */ '010110', /*($)*/ '201000', /*(%)*/ '200010', /*(/)*/ '011100', /*(+)*/ '000030' /* * */ ); $this->setText($text); $this->setInfo($info); $this->setPrice($price); $this->textfont = $textfont; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = strtoupper($text); // Only Capital Letters are Allowed } /** * Saves Info * * @param string $info */ public function setInfo($info) { $this->info = $info; } /** * Saves Price * * @param string $price */ public function setPrice($price) { $this->price = $price; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; // Checking if all chars are allowed for($i=0;$itext);$i++) { if(!is_int(array_search($this->text[$i],$this->keys))) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } } if($error_stop == false) { // The * is not allowed if(is_int(strpos($this->text,'*'))) { $this->DrawError($im,'Char \'*\' not allowed.'); $error_stop = true; } if($error_stop == false) { // Starting * $this->DrawChar($im,$this->code[$this->starting],1); // Chars for($i=0;$itext);$i++) $this->DrawChar($im,$this->findCode($this->text[$i]),1); // Checksum // First CheckSUM "C" // The "C" checksum character is the modulo 47 remainder of the sum of the weighted // value of the data characters. The weighting value starts at "1" for the right-most // data character, 2 for the second to last, 3 for the third-to-last, and so on up to 20. // After 20, the sequence wraps around back to 1. // Second CheckSUM "K" // Same as CheckSUM "C" but we count the CheckSum "C" at the end // After 15, the sequence wraps around back to 1. $sequence_multiplier = array(20,15); $temp_text = $this->text; for($z=0;$z<2;$z++) { $checksum = 0; for($i=strlen($temp_text),$j=0;$i>0;$i--,$j++) { $multiplier = $i % $sequence_multiplier[$z]; if($multiplier==0) $multiplier = $sequence_multiplier[$z]; $checksum += $this->findIndex($temp_text[$j]) * $multiplier; } $this->DrawChar($im,$this->code[$checksum % 47],1); $temp_text .= $this->keys[$checksum % 47]; } // Ending * $this->DrawChar($im,$this->code[$this->ending],1); // Draw a Final Bar $this->DrawChar($im,'0',1); // MERL: calculate the max X width based on all of the printable elements $priceItemNumWidth = (int)(strlen($this->price)+ strlen(" ") + strlen($this->text))*imagefontwidth($this->textfont); $infoWidth = (int)strlen($this->info)*imagefontwidth($this->textfont); $elementLengths = array ($infoWidth, $priceItemNumWidth, $this->positionX); $maxX = 0; for ($l=0; $l= $maxX) { $maxX = $elementLengths[$l]; } } $this->lastX = $maxX; $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; $this->DrawInfoText($im); $this->DrawText($im); } } } }; ?>barcode/class/ean13.barcode.php0000644555041207172570000001477310271617226020200 0ustar cherrytownpg87134400000000000000keys = array('0','1','2','3','4','5','6','7','8','9'); // Left-Hand Odd Parity starting with a space // Left-Hand Even Parity is the inverse (0=0012) starting with a space // Right-Hand is the same of Left-Hand starting with a bar $this->code = array( '2100', /* 0 */ '1110', /* 1 */ '1011', /* 2 */ '0300', /* 3 */ '0021', /* 4 */ '0120', /* 5 */ '0003', /* 6 */ '0201', /* 7 */ '0102', /* 8 */ '2001' /* 9 */ ); // Parity, 0=Odd, 1=Even for manufacturer code. Depending on 1st System Digit $this->codeParity = array( array(0,0,0,0,0), /* 0 */ array(0,1,0,1,1), /* 1 */ array(0,1,1,0,1), /* 2 */ array(0,1,1,1,0), /* 3 */ array(1,0,0,1,1), /* 4 */ array(1,1,0,0,1), /* 5 */ array(1,1,1,0,0), /* 6 */ array(1,0,1,0,1), /* 7 */ array(1,0,1,1,0), /* 8 */ array(1,1,0,1,0) /* 9 */ ); $this->setText($text); $this->textfont = $textfont; $this->book = $book; } /** * Saves Text * * @param string $text */ public function setText($text){ $this->text = $text; } private function inverse($text,$inverse=1) { if($inverse == 1) $text = strrev($text); return $text; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; // Checking if all chars are allowed for($i=0;$itext);$i++) { if(!is_int(array_search($this->text[$i],$this->keys))) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } } if($error_stop == false) { if($this->book == true && strlen($this->text) != 10) { $this->DrawError($im,'Must contains 10 chars if ISBN is true.'); $error_stop = true; } // If it's a book, we change the code to the right one if($this->book==true && strlen($this->text)==10) $this->text = '978'.substr($this->text,0,strlen($this->text)-1); // Must contains 12 chars if(strlen($this->text) != 12) { $this->DrawError($im,'Must contains 12 chars, the 13th digit is automatically added.'); $error_stop = true; } if($error_stop == false) { // Calculating Checksum // Consider the right-most digit of the message to be in an "odd" position, // and assign odd/even to each character moving from right to left // Odd Position = 3, Even Position = 1 // Multiply it by the number // Add all of that and do 10-(?mod10) $odd = true; $checksum=0; for($i=strlen($this->text);$i>0;$i--) { if($odd==true) { $multiplier=3; $odd=false; } else { $multiplier=1; $odd=true; } $checksum += $this->keys[$this->text[$i - 1]] * $multiplier; } $checksum = 10 - $checksum % 10; $checksum = ($checksum == 10)?0:$checksum; $this->text .= $this->keys[$checksum]; // If we have to write text, we move the barcode to the right to have space to put system digit $this->positionX = ($this->textfont == 0)?0:10; // Starting Code $this->DrawChar($im,'000',1); // Draw Second Code $this->DrawChar($im,$this->findCode($this->text[1]),2); // Draw Manufacturer Code for($i=0;$i<5;$i++) $this->DrawChar($im,$this->inverse($this->findCode($this->text[$i + 2]),$this->codeParity[$this->text[0]][$i]),2); // Draw Center Guard Bar $this->DrawChar($im,'00000',2); // Draw Product Code for($i=7;$i<13;$i++){ $this->DrawChar($im,$this->findCode($this->text[$i]),1); } // Draw Right Guard Bar $this->DrawChar($im,'000',1); $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; $this->DrawText($im); } } } /** * Overloaded method for drawing special label * * @param ressource $im */ protected function DrawText($im) { if($this->textfont != 0) { $bar_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); if(!is_null($bar_color)) { $rememberX = $this->positionX; $rememberH = $this->maxHeight; // We increase the bars $this->maxHeight = $this->maxHeight + 9; $this->positionX = 10; $this->DrawSingleBar($im,$this->color1); $this->positionX += $this->res*2; $this->DrawSingleBar($im,$this->color1); // Center Guard Bar $this->positionX += $this->res*44; $this->DrawSingleBar($im,$this->color1); $this->positionX += $this->res*2; $this->DrawSingleBar($im,$this->color1); // Last Bars $this->positionX += $this->res*44; $this->DrawSingleBar($im,$this->color1); $this->positionX += $this->res*2; $this->DrawSingleBar($im,$this->color1); $this->positionX = $rememberX; $this->maxHeight = $rememberH; imagechar($im,$this->textfont,1,$this->maxHeight-(imagefontheight($this->textfont)/2),$this->text[0],$bar_color); imagestring($im,$this->textfont,10+(3*$this->res+48*$this->res)/2-imagefontwidth($this->textfont)*(6/2),$this->maxHeight+1,substr($this->text,1,6),$bar_color); imagestring($im,$this->textfont,10+46*$this->res+(3*$this->res+46*$this->res)/2-imagefontwidth($this->textfont)*(6/2),$this->maxHeight+1,substr($this->text,7,6),$bar_color); } $this->lastY = $this->maxHeight + imagefontheight($this->textfont); } } }; ?>barcode/class/ean8.barcode.php0000644555041207172570000001157210271617226020116 0ustar cherrytownpg87134400000000000000keys = array('0','1','2','3','4','5','6','7','8','9'); // Left-Hand Odd Parity starting with a space // Right-Hand is the same of Left-Hand starting with a bar $this->code = array( '2100', /* 0 */ '1110', /* 1 */ '1011', /* 2 */ '0300', /* 3 */ '0021', /* 4 */ '0120', /* 5 */ '0003', /* 6 */ '0201', /* 7 */ '0102', /* 8 */ '2001' /* 9 */ ); $this->setText($text); $this->textfont = $textfont; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = $text; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; // Checking if all chars are allowed for($i=0;$itext);$i++) { if(!is_int(array_search($this->text[$i],$this->keys))) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } } if($error_stop == false) { // Must contains 7 chars if(strlen($this->text) != 7) { $this->DrawError($im,'Must contains 7 chars, the 8th digit is automatically added.'); $error_stop = true; } if($error_stop == false) { // Calculating Checksum // Consider the right-most digit of the message to be in an "odd" position, // and assign odd/even to each character moving from right to left // Odd Position = 3, Even Position = 1 // Multiply it by the number // Add all of that and do 10-(?mod10) $odd = true; $checksum=0; for($i=strlen($this->text);$i>0;$i--) { if($odd==true) { $multiplier=3; $odd=false; } else { $multiplier=1; $odd=true; } $checksum += $this->keys[$this->text[$i - 1]] * $multiplier; } $checksum = 10 - $checksum % 10; $checksum = ($checksum == 10)?0:$checksum; $this->text .= $this->keys[$checksum]; // Starting Code $this->DrawChar($im,'000',1); // Draw First 4 Chars (Left-Hand) for($i=0;$i<4;$i++) $this->DrawChar($im,$this->findCode($this->text[$i]),2); // Draw Center Guard Bar $this->DrawChar($im,'00000',2); // Draw Last 4 Chars (Right-Hand) for($i=4;$i<8;$i++) $this->DrawChar($im,$this->findCode($this->text[$i]),1); // Draw Right Guard Bar $this->DrawChar($im,'000',1); $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; $this->DrawText($im); } } } /** * Overloaded method for drawing special label * * @param ressource $im */ protected function DrawText($im) { if($this->textfont != 0) { $bar_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); if(!is_null($bar_color)) { $rememberX = $this->positionX; $rememberH = $this->maxHeight; // We increase the bars $this->maxHeight = $this->maxHeight + 9; $this->positionX = 0; $this->DrawSingleBar($im,$this->color1); $this->positionX += $this->res*2; $this->DrawSingleBar($im,$this->color1); // Center Guard Bar $this->positionX += $this->res*30; $this->DrawSingleBar($im,$this->color1); $this->positionX += $this->res*2; $this->DrawSingleBar($im,$this->color1); // Last Bars $this->positionX += $this->res*30; $this->DrawSingleBar($im,$this->color1); $this->positionX += $this->res*2; $this->DrawSingleBar($im,$this->color1); $this->positionX = $rememberX; $this->maxHeight = $rememberH; imagestring($im,$this->textfont,(3*$this->res+34*$this->res)/2-imagefontwidth($this->textfont)*(4/2),$this->maxHeight+1,substr($this->text,0,4),$bar_color); imagestring($im,$this->textfont,32*$this->res+(3*$this->res+32*$this->res)/2-imagefontwidth($this->textfont)*(4/2),$this->maxHeight+1,substr($this->text,4,4),$bar_color); } $this->lastY = $this->maxHeight + imagefontheight($this->textfont); } } }; ?>barcode/class/FColor.php0000644555041207172570000000164110271617224017043 0ustar cherrytownpg87134400000000000000r = $r; $this->g = $g; $this->b = $b; } /** * Returns Red Color * * @return int */ public function r(){ return $this->r; } /** * Returns Green Color * * @return int */ public function g(){ return $this->g; } /** * Returns Blue Color * * @return int */ public function b(){ return $this->b; } /** * Returns the int value for PHP color * * @param ressource $im * @return int */ public function allocate($im) { return imagecolorallocate($im,$this->r,$this->g,$this->b); } }; ?>barcode/class/FDrawing.php0000644555041207172570000000506210271617224017361 0ustar cherrytownpg87134400000000000000w = $w; $this->h = $h; $this->filename = $filename; $this->color = $color; $this->orient = $orient; } /** * Destructor */ public function __destruct() { $this->destroy(); } /** * Init Image and color background */ public function init(){ $this->im = imagecreatetruecolor($this->w, $this->h) or die('Can\'t Initialize the GD Libraty'); imagefill($this->im,0,0,$this->color->allocate($this->im)); } /** * @return ressource */ public function get_im() { return $this->im; } /** * @param ressource $im */ public function set_im($im) { $this->im = $im; } /** * Add barcode into the drawing array (for future drawing) * * @param BarCode $barcode */ public function add_barcode(BarCode $barcode) { $this->barcode[] = $barcode; } /** * Draw first all forms and after all texts on $im */ public function draw_all() { for($i=0;$ibarcode);$i++) $this->barcode[$i]->draw($this->im); } /** * Sets to horizontal or vertical orientation * */ public function orient() { if ($this->orient == 'vert') { $this->im = imagerotate($this->im, -90, 0); } } /** * Save $im into the file (many format available) * * @param int $image_style * @param int $quality */ public function finish($image_style=IMG_FORMAT_PNG,$quality=100) { if($image_style==constant('IMG_FORMAT_PNG')){ if(empty($this->filename)) imagepng($this->im); else imagepng($this->im,$this->filename); } elseif($image_style==constant('IMG_FORMAT_JPEG')) // MERL // if(empty($this->filename)) // imagejpeg($this->im); // else imagejpeg($this->im,$this->filename,$quality); } /** * Free the memory of PHP (called also by destructor) */ public function destroy() { imagedestroy($this->im); } }; ?>barcode/class/i25.barcode.php0000644555041207172570000000643310271617226017662 0ustar cherrytownpg87134400000000000000keys = array('0','1','2','3','4','5','6','7','8','9'); $this->code = array( '00110', /* 0 */ '10001', /* 1 */ '01001', /* 2 */ '11000', /* 3 */ '00101', /* 4 */ '10100', /* 5 */ '01100', /* 6 */ '00011', /* 7 */ '10010', /* 8 */ '01010' /* 9 */ ); $this->setText($text); $this->textfont = $textfont; $this->checksum = $checksum; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = $text; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $error_stop = false; // Checking if all chars are allowed for($i=0;$itext);$i++) { if(!is_int(array_search($this->text[$i],$this->keys))) { $this->DrawError($im,'Char \''.$this->text[$i].'\' not allowed.'); $error_stop = true; } } if($error_stop == false) { // Must be even if(strlen($this->text) % 2 != 0 && $this->checksum == false) { $this->DrawError($im,'i25 must be even if checksum is false.'); $error_stop = true; } elseif(strlen($this->text) % 2 == 0 && $this->checksum == true) { $this->DrawError($im,'i25 must be odd if checksum is true.'); $error_stop = true; } if($error_stop == false) { // We calculate checksum first // Odd Number has a weight of 1, even number has a weight of 3 // Multiply to position // Sum all of that and mod 10 if($this->checksum == true) { $chec