function add_option($name, $option_id, $type) { ob_start(); ?> <div id="option-<?php echo $option_id; ?> "> <h3><a href="#"><?php echo $type . ' > ' . $name; ?> </a></h3> <div style="text-align: left"> <?php echo lang('option_name'); ?> <span style="float:right"> <a onclick="remove_option(<?php echo $option_id; ?> )" class="ui-state-default ui-corner-all" style="float:right;"><span class="ui-icon ui-icon-circle-minus"></span></a></span> <input class="input gc_tf1" type="text" name="option[<?php echo $option_id; ?> ][name]" value="<?php echo $name; ?> "/> <input type="hidden" name="option[<?php echo $option_id; ?> ][type]" value="<?php echo $type; ?> " /> <input class="checkbox" type="checkbox" name="option[<?php echo $option_id; ?> ][required]" value="1"/> <?php echo lang('required'); ?> <button id="add_item_<?php echo $option_id; ?> " type="button" rel="<?php echo $type; ?> "onclick="add_item($(this).attr(\'rel\'), <?php echo $option_id; ?> );"><?php echo lang('add_item'); ?> </button> <div class="option_item_form" > <ul class="sortable" id="option_items_attr_<?php echo $option_id; ?> "> </ul> </div> </div> </div> <?php $stuff = ob_get_contents(); ob_end_clean(); echo replace_newline($stuff); }
function add_option_value($po, $count, $valcount, $value) { ob_start(); ?> <div class="option-values-form"> <div class="row-fluid"> <?php if ($po->type != 'textarea' && $po->type != 'textfield') { ?> <div class="span1"><a class="handle btn btn-mini" style="float:left;"><i class="icon-align-justify"></i></a></div><?php } ?> <div class="span3"><input type="text" class="span12" name="option[<?php echo $count; ?> ][values][<?php echo $valcount; ?> ][name]" value="<?php echo $value->name; ?> " /></div> <div class="span2"><input type="text" class="span12" name="option[<?php echo $count; ?> ][values][<?php echo $valcount; ?> ][value]" value="<?php echo $value->value; ?> " /></div> <div class="span2"><input type="text" class="span12" name="option[<?php echo $count; ?> ][values][<?php echo $valcount; ?> ][weight]" value="<?php echo $value->weight; ?> " /></div> <div class="span2"><input type="text" class="span12" name="option[<?php echo $count; ?> ][values][<?php echo $valcount; ?> ][price]" value="<?php echo $value->price; ?> " /></div> <div class="span2"> <?php if ($po->type == 'textfield') { ?> <input class="span12" type="text" name="option[<?php echo $count; ?> ][values][<?php echo $valcount; ?> ][limit]" value="<?php echo $value->limit; ?> " /> <?php } elseif ($po->type != 'textarea' && $po->type != 'textfield') { ?> <a class="delete-option-value btn btn-danger btn-mini pull-right"><i class="icon-trash icon-white"></i></a> <?php } ?> </div> </div> </div> <?php $stuff = ob_get_contents(); ob_end_clean(); echo replace_newline($stuff); }
{ return mysql_escape_string(mb_ucasefirst($str)); } function replace_newline($string) { return (string) str_replace(array("\r", "\r\n", "\n"), ' ', $string); } function mb_ucasefirst($str) { $str[0] = mb_strtoupper($str[0]); return $str; } $file_name = 'most_common_words'; $fhandle = fopen($file_name, "r"); $fcontents = fread($fhandle, filesize($file_name)); $fcontents = replace_newline($fcontents); $word_array = explode(" ", $fcontents); $word_count = count($word_array); for ($i = 0; $i < 100; $i++) { $ssn = rand(75, 92); $rand = rand(1, 12); if ($rand < 10) { $ssn .= "0" . $rand; } else { $ssn .= $rand; } $rand = rand(1, 28); if ($rand < 10) { $ssn .= "0" . $rand; } else { $ssn .= $rand;
function add_option_value($po, $count, $price) { ob_start(); ?> <tr id="giftcard_value_<?php echo $count; ?> "> <td> <div class="input-group"> <input type="text" name="option[giftcard_values][<?php echo $count; ?> ]" value="<?php echo $price; ?> " class="form-control"/> <div class="input-group-btn"> <button type="button" class="btn btn-danger" onclick="remove_giftcard_value(<?php echo $count; ?> );"><i class="icon-times"></i></button> </div> </div> </td> </tr> <?php $stuff = ob_get_contents(); ob_end_clean(); echo replace_newline($stuff); }