$cust_num is a variable which has not set before.
lets add a value, or use that:
inside that foreach...
if(empty($cust_num))
$cust_num=0;
if that value comes from the form, you might wrote a wrong variable name.
warning is a good way to troubleshoot, but if its a live website, you shoud turn that off.
i f i'm the visitor, lets pring all the errors and warning, another case hide the error messages.
if($_SESSION["userid"]==1)
{
//error_reporting(E_ERROR | E_PARSE);
error_reporting(E_ALL);
ini_set("display_errors", 1);
}
else
{
error_reporting(E_ERROR | E_PARSE);
ini_set("display_errors", 0);
}