EmPower Earth | Changing Lives With Solar

Assign Date

nnn n n n admin/template/layout.css” rel=”stylesheet” type=”text/css” />n n n $v) {n if($v[''quantity'']==0) {n unset($_POST[''shipment_items''][$k]);n }n }n }n $shipment_items=serialize($_POST[''shipment_items'']);n $second=0;n $hour= (int) $hour;// Typecasting in PHP, oh joyn if($hour!=”” && $minute!=”” && $month!=”” && $day!=”” && $year!=”” && $second==0) {n /*convert the human-readable time into a unix timestamp.*/n $timestamp=mktime( $_POST[''hour''], $minute, $second, $month, $day, $year);n }n else {n $timestamp = 0;n }nn /*******************************************************************************************************************n * Restricting pickup timen * As of 2/2009 , the SHW warehouse is now only open 3 days / week. Therefore, most users will be restricted fromn * assigning pickup dates to those days. Previously there was also a check for the time to make sure that only 1n * pickup was assigned per 30 minute block, but this has subsequently been removed. n *******************************************************************************************************************/nn $days_closed=array(2,4);n $scheduler_override =array(“CoreyP”,”AdamF”,”RichardM”);n // Disabled – the warehouse if full time again.n /*n if( in_array(date(“N”,$timestamp),$days_closed) && (!in_array($_USER[''username''],$scheduler_override))){n die(“Warning! Scheduled date not available (warehouse closed). Please have warehouse personnel schedule the pickup if required, n or go back and choose a different time.“);n }n */nn /*******************************************************************************************************************n * The possible values used to indicate a shipment”s status are: *n * R (requested), C (confirmed), L (loaded) , S (shipped), andD (delivered) *n * A shipment”s status indicates whether a shipment has been requested by our company (awaiting confirmation by the *n * courier to accept the charges, time, etc) , confirmed by the courier or ourselves for internal delivery, *n * loaded into a trailer and awaiting pickup, shipped and in transit, or delivered. For shipments leaving via *n * third party courier, the initial status is ”R” for requested. Shipments leaving via internal couriers begin *n * their existence in ”confirmed” status. *n *******************************************************************************************************************/n if($method==”i”) {n $initial_status=”C”;n }else {n $initial_status=”R”;n }n if($mode==”pickup”) {n if($timestamp==0) {n $query=”update orders set pickup_date = NULL where orderid=”$orderid””;n $changelog_specs[]=array(“pickup_date”=>$timestamp);n echo “

Pick-up Cancelled

“;n $subscribers = get_event_subscribers(8);n foreach($subscribers as $subscriber){n $notification_headers .= “From: apollo@siliconsolar.com\r\n”;n $user_info = user_info($subscriber);n mail($user_info[''email''],”Pickup Cancelled for Order ”.$orderid,”(No text)’n $headers,”-f apollo@siliconsolar.com”);n }n }n else {n /* if we are simply setting a pickup date, update the the appropriate field in the orders database*/n $query=”update orders set pickup_date= $timestamp where orderid=”$orderid””;n $subscribers = get_event_subscribers(8);n foreach($subscribers as $subscriber){n $notification_headers .= “From: apollo@siliconsolar.com\r\n”;n $user_info = user_info($subscriber);n mail($user_info[''email''],”Pickup Scheduled for Order ”.$orderid,”Scheduled date: ”.date(“m/d/Y”,$timestamp),n $headers,”-f apollo@siliconsolar.com”);n }n $changelog_specs[]=array(“pickup_date”=>$timestamp);n }n $changelog_specs=serialize($changelog_specs);n add_change_to_log(“Order”, $changelog_specs, $orderid);n }n if($mode==”shipment”) {n /* if we are updating a shipment, check to see if there is already a shipment for the order in question of the appropriate type*/n if($_GET[''shipmentid''] > 0 ){n $query=”UPDATE freight_shipmentsn SET weight=”$weight’slots=”$slots’length=”$length’width=”$width’height=”$height’n shipment_method=”$method” ,shipment_timestamp=”$timestamp” , shipment_courier_id = ”$courier”n WHERE shipmentid = ”$_GET[shipmentid]” “;n }n else {n /*************************************************************************************************************n * If there is not, then create a new shipment. *n * When a shipment is created, we will assume that all of the items currently in stock will be included in *n * the shipment. This data will be entered in the record for the shipment as a serialized array *n * indicating quantities and productids. Different actions are indicated depending on whether or not the *n * shipment is created as an RMA/Missing item shipment, or a standard shipment *n *************************************************************************************************************/nn /* if the shipment is to be a standard shipment….. */nn //if($type==”s” && $_USER[''username'']==”MattC”){n /* we will be assuming that an order has already been converted. */n // $items=get_items2($orderid);n // $i=0;n //$shipment_items=array();n //foreach($items as $k=>$v){n /*******************************************************************************************************n * We will populate the shipment with all of the item/quantity information for an order if *n * 1. We have enough of the product currently in stock to fill the quantity in the order *n * 2. The product in question has not already been picked *n * 3. The product is a ”real” product with physical presence, eg not a freight, insurance, *n * etc item *n * 4. The product is not an item shipped from a third party warehouse *n *******************************************************************************************************/n // if((product_instock($v[''productid'']) >= $v[''quantity'']) && ($v[''picked'']==”N”) &&n // (!in_array($v[''productid''], $fake_products_array)) && (!in_array($v[''productid''], $thirdproducts)) ){n // $shipment_items[][''productid'']=$v[''productid''];n // $shipment_items[$i][''quantity'']=$v[''quantity''];n // $shipment_items[$i][''itemid'']=$v[''itemid''];n // $i++;n // }n // }n //$shipment_items=serialize($shipment_items);n //}nn /* If the shipment is for damaged or missing items…. */nn if($type==”r” && $_USER[''username'']==”MattC”) {n /* retrieve a list of the itemids of all RMAs in ”Print Label” status */n $rma_items=get_rmas($orderid,”P”);n $i=0;n $shipment_items=array();n foreach($rma_items as $rma_item) {n /*******************************************************************************************************n * In general, the same requirements hold for RMA items as for standard items: we need to have enough *n * available, the product cannot be ”fake’the product should not be a third party item (this may *n * cause problems at some point) *n *******************************************************************************************************/n $item_information=get_item_information($rma_item);n if((product_instock($item_information[''productid'']) >= $item_information[''amount'']) && (!in_array($item_information[''productid''], $fake_products_array)) && (!in_array($item_information[''productid''], $thirdproducts)) ) {n $shipment_items[][''productid'']=$item_information[''productid''];n $shipment_items[$i][''quantity'']=$item_information[''amount''];n $shipment_items[$i][''itemid'']=$item_information[''itemid''];n }n $i++;n }n $shipment_items=serialize($shipment_items);n }n if(empty($courier)){n die(“Error!No courier Selected. Please go back and choose the appropriate courier for the shipment.”);n }nn $query=(“INSERT INTO freight_shipmentsn (shipmentid,orderid,weight,slots,length,width,height,shipment_method,shipment_timestamp,n type,status,shipment_items,origin_warehouse_id,delivery_location_type,total_charges,shipment_courier_id)n VALUES (””’$orderid”’$weight”’$slots”’$length”’$width”’$height”’$method’n ”$timestamp”’$type”’$initial_status”’$shipment_items”’$warehouseid”’$delivery_location_type”’0”’$courier”)”);n // if the shipment is via MegaSCS, email them to let them know they have a pending shipment to reviewnn // If the shipment is to be sent to an outside courier, notify them of the shipment requestn if($courier > 0){n $courier_data = get_courier_information($courier);n // Check to see if there is a warehouse user assigned.n if($courier_data[''warehouse_user_id''] > 0 && $_SESSION[''user_name'']!=”LaurenM”){n // If there is, retrieve their contact information.n $courier_warehouse_user_data = user_info($courier_data[''warehouse_user_id'']);n $notification_headers .= “From: apollo@siliconsolar.com\r\n”;n mail($courier_warehouse_user_data[''email''],”SunmaxxSolar Shipment Request’n “Dear “.$_SESSION[''firstname''].” “.$_SESSION[''lastname''].” \r\n\r\n”.n “The staff at SunmaxxSolar have created a new shipment request.\r\n”.n “Please log in to Apollo to review and assign charges or deny the request at your earliest convenience.\r\n”.n “$SITE[site_url]admin/review_shipment.php”,$notification_headers,”-f apollo@siliconsolar.com”);n }n }n // Otherwise, notify the warehouse contact if the warehouse is internaln if($warehouse_data[''email''] !=”” && ($warehouseid == 1 || $warehouseid == 2) ){n mail($warehouse_data[''email''],”New Freight Shipment Scheduled”’Please log in to Apollo and visit the shipment management page to view details.”);n //mail(”matt.c@siliconsolar.com”’new shipment!”’just testing, honestly ….”);n }n }n }n //echo $query;// here to be used for occaisional debugging purposesn mysql_query($query);n echo “

\n

Successfully updated order $orderid

\n”.n “

Manage Freight Shipments | SHW fulfillment

\n

\n”;n if(!is_order_instock($orderid)) {n echo “

We do not have sufficient inventory to ship this entire order.
Please review the order page for details.

“;n }n }n /* retrieving and assigning intial data when the form has not been submitted */n else {n $orderid=$_GET[''orderid''];n $nowday=date(“d”,$now);n $nowmonth=date(“m”,$now);n $nowyear=date(“Y”,$now);n //$unshippable_weight=get_unshippable_weight($orderid);n $override=$_GET[''override''];n echo “n

Assign $mode Date (MM/DD/YYYY HH:mm)

n

n n n
n
n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n “;n }n else {n echo “n n

n

n

n

n

n

n “;n }n if($mode==”shipment”) {n echo”n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

n

“;n if($type==”s” || $type==”t”) {n $items=get_order_inventory_component_itemids($orderid);n }n elseif($type==”r”) {n $items=get_rmas($orderid,”P”);n }n global $fake_products_array;n $thirdproducts=get_third_party_products();n foreach($items as $item) {n $item_info=get_item_information($item);n if(in_array($item_info[''productid''],$fake_products_array)) {n continue;n }n if(in_array($item_info[''productid''],$thirdproducts) && $type !=”t”) {n $item_info[''amount'']=0;n }n if( !in_array($item_info[''productid''],$thirdproducts) && $type==”t”) {n continue;n }n if($item_info[''picked_status'']==”Y” || $item_info[''quantity_picked''] >= $item_info[''amount'']) {n continue;n }n echon “n

n

n

n

“; n }n echo”n

n Order IDn n Monthn n Dayn n Yearn n Hourn n Minuten
n $orderidn “;n if($mode==”shipment”) {n //check for existing shipment datan $findshipmentquery=mysql_query(“select * from freight_shipments where orderid=”$orderid””);n if(mysql_num_rows($findshipmentquery)==1) {n while($data=mysql_fetch_assoc($findshipmentquery)) {n $dimprod=$data[''dimprod''];n $weight=$data[''weight''];n $length=$data[''length''];n $width=$data[''width''];n $height=$data[''height''];n $slots=$data[''slots''];n $delivery_type = $data[''delivery_location_type''];n }n }n $orderdata = get_all_order_info($orderid);n $delivery_type = $orderdata[''residential''];nn if(!$length) {n $length=91;n }n if(!$width) {n $width=45;n }n if(!$height) {n $height=62;n }n if(!$weight) {n $weight=0;n }n echo “n n n n n n n n n n
n n n n n n n n
Method
n n “.courier_select(”shipment_courier_id””’).”n
n Warehousen n “.warehouse_select(”warehouseid’”").”n Residential n “.boolean_select(”delivery_location_type’$delivery_type).”n
n Items contained in the shipmentn
n SKUn n Quantityn
n “.get_sku($item_info[''productid'']).”n n n

n n

n

n

n “;n }n else {n echo”n

n

n

n

n “;n }n }n ?>n nnnnn n n n admin/template/layout.css” rel=”stylesheet” type=”text/css” />n n n

Why Shop With Us

Why Shop With Silicon Solar

Silicon Solar is, and always will be, a family owned and operated solar company dedicated to providing the highest quality solar powered products which have completed our rigorous quality inspection. We also manufacture a full line of solar powered products right here in our production facility; enabling us offer faster delivery and priority technical support.

Search our online catalog for hundreds of solar lights, solar fountains and many other products, including solar cells and solar panels. We also manufacture custom solar kits upon request for professors and educational programs.

Call us today for your solar request, 1.800.786.0329